diff --git a/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMaps.vue b/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMaps.vue index 5ae811fb5..12f86b807 100644 --- a/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +++ b/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMaps.vue @@ -1,129 +1,165 @@ - + + diff --git a/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue b/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue index ff96595b9..5b87a7beb 100644 --- a/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +++ b/packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue @@ -1,62 +1,89 @@ diff --git a/playground/pages/index.vue b/playground/pages/index.vue index 416dd71d0..dcfa1b1f8 100644 --- a/playground/pages/index.vue +++ b/playground/pages/index.vue @@ -187,12 +187,6 @@ const content = registryScripts logo: registryScripts.find(s => s.label === 'Google Maps')?.logo, registryScript: null, }, - { - name: 'Google Maps (Styled)', - path: '/third-parties/google-maps/styled', - logo: registryScripts.find(s => s.label === 'Google Maps')?.logo, - registryScript: null, - }, { name: 'Google Maps (SFCs)', path: '/third-parties/google-maps/sfcs', diff --git a/playground/pages/third-parties/google-maps/center.vue b/playground/pages/third-parties/google-maps/center.vue index 9ab6131b9..93b0491d1 100644 --- a/playground/pages/third-parties/google-maps/center.vue +++ b/playground/pages/third-parties/google-maps/center.vue @@ -4,6 +4,7 @@ import { ref } from 'vue' const mapOptions = ref({ center: { lat: -34.397, lng: 150.644 }, }) + function changeQuery() { mapOptions.value = { center: { @@ -19,8 +20,6 @@ function changeQuery() {
-import { whenever } from '@vueuse/core' -import { ref, useTemplateRef } from 'vue' +import { ref } from 'vue' const eventLog = ref([]) @@ -59,12 +58,11 @@ const circleOptions = {

diff --git a/playground/pages/third-parties/google-maps/geojson-test.vue b/playground/pages/third-parties/google-maps/geojson-test.vue index da73b8f1a..476ada55c 100644 --- a/playground/pages/third-parties/google-maps/geojson-test.vue +++ b/playground/pages/third-parties/google-maps/geojson-test.vue @@ -92,11 +92,9 @@ const secondGeoJson = {

diff --git a/playground/pages/third-parties/google-maps/nuxt-scripts.vue b/playground/pages/third-parties/google-maps/nuxt-scripts.vue index 1ebd7436c..bf70bdc29 100644 --- a/playground/pages/third-parties/google-maps/nuxt-scripts.vue +++ b/playground/pages/third-parties/google-maps/nuxt-scripts.vue @@ -6,10 +6,12 @@ const mapOptions = ref({ center: { lat: -34.397, lng: 150.644 }, }) -const googleMapsRef = ref() +const googleMapsRef = useTemplateRef('googleMapsRef') -function changeQuery() { - query.value = 'Brooklyn+Bride,New+York+NY' +async function changeQuery() { + const res = await googleMapsRef.value.resolveQueryToLatLng('Brooklyn+Bridge,New+York+NY') + + mapOptions.value.center = res } diff --git a/playground/pages/third-parties/google-maps/overlay-animated.vue b/playground/pages/third-parties/google-maps/overlay-animated.vue index b9f1db219..c931cf9f7 100644 --- a/playground/pages/third-parties/google-maps/overlay-animated.vue +++ b/playground/pages/third-parties/google-maps/overlay-animated.vue @@ -32,11 +32,9 @@ function close(id: number) { Click a marker to open/close. Uses data-state attribute for CSS enter/leave animations.

-
-
-

- {{ place.name }} -

- -
-
- ★ {{ place.rating }} - ({{ place.reviews }} reviews) -
-

- {{ place.desc }} -

+
+

+ {{ place.name }} +

+
+
+ ★ {{ place.rating }} + ({{ place.reviews }} reviews) +
+

+ {{ place.desc }} +

- diff --git a/playground/pages/third-parties/google-maps/overlay-popup.vue b/playground/pages/third-parties/google-maps/overlay-popup.vue index 950548543..fad901bd0 100644 --- a/playground/pages/third-parties/google-maps/overlay-popup.vue +++ b/playground/pages/third-parties/google-maps/overlay-popup.vue @@ -19,11 +19,9 @@ const places = [ Click a marker to show a fully custom popup. Click again or press × to close. Uses v-if for multiple markers.

-

{{ place.name }} @@ -60,9 +58,22 @@ const places = [ -

+ + diff --git a/playground/pages/third-parties/google-maps/query.vue b/playground/pages/third-parties/google-maps/query.vue index 9a6448700..d3ebf2aa7 100644 --- a/playground/pages/third-parties/google-maps/query.vue +++ b/playground/pages/third-parties/google-maps/query.vue @@ -1,15 +1,29 @@ @@ -17,10 +31,12 @@ function changeQuery() {
diff --git a/playground/pages/third-parties/google-maps/sfcs.vue b/playground/pages/third-parties/google-maps/sfcs.vue index c3617dac8..6c924e153 100644 --- a/playground/pages/third-parties/google-maps/sfcs.vue +++ b/playground/pages/third-parties/google-maps/sfcs.vue @@ -65,22 +65,22 @@ const zoom = ref(8) const googleMapsRef = useTemplateRef('googleMapsRef') -whenever(() => googleMapsRef.value?.googleMaps, (googleMaps) => { +whenever(() => googleMapsRef.value?.mapsApi, (mapsApi) => { heatmapLayerData.value.push(...[ - new googleMaps.LatLng(-33.8688, 151.2093), - new googleMaps.LatLng(-33.8690, 151.2100), - new googleMaps.LatLng(-33.8700, 151.2150), - new googleMaps.LatLng(-33.8710, 151.2200), - new googleMaps.LatLng(-33.8720, 151.2250), - new googleMaps.LatLng(-33.8730, 151.2300), - new googleMaps.LatLng(-33.8740, 151.2350), - new googleMaps.LatLng(-33.8750, 151.2400), - new googleMaps.LatLng(-33.8760, 151.2450), - new googleMaps.LatLng(-33.8770, 151.2500), - new googleMaps.LatLng(-33.8780, 151.2550), - new googleMaps.LatLng(-33.8790, 151.2600), - new googleMaps.LatLng(-33.8800, 151.2650), - new googleMaps.LatLng(-33.8810, 151.2700), + new mapsApi.LatLng(-33.8688, 151.2093), + new mapsApi.LatLng(-33.8690, 151.2100), + new mapsApi.LatLng(-33.8700, 151.2150), + new mapsApi.LatLng(-33.8710, 151.2200), + new mapsApi.LatLng(-33.8720, 151.2250), + new mapsApi.LatLng(-33.8730, 151.2300), + new mapsApi.LatLng(-33.8740, 151.2350), + new mapsApi.LatLng(-33.8750, 151.2400), + new mapsApi.LatLng(-33.8760, 151.2450), + new mapsApi.LatLng(-33.8770, 151.2500), + new mapsApi.LatLng(-33.8780, 151.2550), + new mapsApi.LatLng(-33.8790, 151.2600), + new mapsApi.LatLng(-33.8800, 151.2650), + new mapsApi.LatLng(-33.8810, 151.2700), ]) }) @@ -89,13 +89,12 @@ whenever(() => googleMapsRef.value?.googleMaps, (googleMaps) => {
-const mapOptions = { - center: { lat: -34.397, lng: 150.644 }, - styles: [{ elementType: 'labels', stylers: [{ visibility: 'off' }, { color: '#f49f53' }] }, { featureType: 'landscape', stylers: [{ color: '#f9ddc5' }, { lightness: -7 }] }, { featureType: 'road', stylers: [{ color: '#813033' }, { lightness: 43 }] }, { featureType: 'poi.business', stylers: [{ color: '#645c20' }, { lightness: 38 }] }, { featureType: 'water', stylers: [{ color: '#1994bf' }, { saturation: -69 }, { gamma: 0.99 }, { lightness: 43 }] }, { featureType: 'road.local', elementType: 'geometry.fill', stylers: [{ color: '#f19f53' }, { weight: 1.3 }, { visibility: 'on' }, { lightness: 16 }] }, { featureType: 'poi.business' }, { featureType: 'poi.park', stylers: [{ color: '#645c20' }, { lightness: 39 }] }, { featureType: 'poi.school', stylers: [{ color: '#a95521' }, { lightness: 35 }] }, {}, { featureType: 'poi.medical', elementType: 'geometry.fill', stylers: [{ color: '#813033' }, { lightness: 38 }, { visibility: 'off' }] }, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, { elementType: 'labels' }, { featureType: 'poi.sports_complex', stylers: [{ color: '#9e5916' }, { lightness: 32 }] }, {}, { featureType: 'poi.government', stylers: [{ color: '#9e5916' }, { lightness: 46 }] }, { featureType: 'transit.station', stylers: [{ visibility: 'off' }] }, { featureType: 'transit.line', stylers: [{ color: '#813033' }, { lightness: 22 }] }, { featureType: 'transit', stylers: [{ lightness: 38 }] }, { featureType: 'road.local', elementType: 'geometry.stroke', stylers: [{ color: '#f19f53' }, { lightness: -10 }] }, {}, {}, {}], -} satisfies google.maps.MapOptions - - - diff --git a/test/e2e-dev/first-party.test.ts b/test/e2e-dev/first-party.test.ts index 7397d106a..b69e24c2f 100644 --- a/test/e2e-dev/first-party.test.ts +++ b/test/e2e-dev/first-party.test.ts @@ -1,9 +1,9 @@ import { existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs' import { join } from 'node:path' import { createResolver } from '@nuxt/kit' +import { getProxyDef, registry } from '@nuxt/scripts/registry' import { $fetch, getBrowser, setup, url } from '@nuxt/test-utils/e2e' import { afterAll, beforeAll, describe, expect, it } from 'vitest' -import { getProxyDef, registry } from '@nuxt/scripts/registry' const { resolve } = createResolver(import.meta.url) const fixtureDir = resolve('../fixtures/first-party') @@ -96,7 +96,6 @@ const ANONYMIZED_FINGERPRINT_PARAMS = [ 'client_user_agent', ] - /** Check that a capture has a fully-resolved privacy object with all six boolean flags. */ function hasResolvedPrivacy(c: Record): boolean { const p = c.privacy