Skip to content

Commit 1d5e0f0

Browse files
authored
fix(googleMaps): configurable google map options (#424)
1 parent 3f79fb5 commit 1d5e0f0

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

docs/content/scripts/tracking/google-tag-manager.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,4 @@ function sendConversion() {
174174

175175
`useScriptGoogleTagManager` initialize Google Tag Manager by itself. This means it pushes the `js`, `config` and the `gtm.start` events for you.
176176

177-
If you need to configure GTM before it starts. For example, (setting the consent mode)[https://developers.google.com/tag-platform/security/guides/consent?hl=fr&consentmode=basic]. You can use the `onBeforeGtmStart` hook which is run right before we push the `gtm.start` event into the dataLayer.
177+
If you need to configure GTM before it starts. For example, [setting the consent mode](https://developers.google.com/tag-platform/security/guides/consent?consentmode=basic). You can use the `onBeforeGtmStart` hook which is run right before we push the `gtm.start` event into the dataLayer.

src/runtime/components/ScriptGoogleMaps.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ const { load, status, onLoaded } = useScriptGoogleMaps({
121121
scriptOptions: {
122122
trigger,
123123
},
124+
...props.mapOptions
124125
})
125126
126127
const options = computed(() => {

src/runtime/registry/google-maps.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const GoogleMapsOptions = object({
2020
libraries: optional(array(string())),
2121
language: optional(string()),
2222
region: optional(string()),
23-
v: optional(union([literal('weekly'), literal('beta'), literal('alpha')])),
23+
v: optional(union([literal('weekly'), literal('quarterly'), literal('beta'), literal('alpha'), string()])),
2424
})
2525

2626
export type GoogleMapsInput = RegistryScriptInput<typeof GoogleMapsOptions>
@@ -46,6 +46,7 @@ export function useScriptGoogleMaps<T extends GoogleMapsApi>(_options?: GoogleMa
4646
const libraries = options?.libraries || ['places']
4747
const language = options?.language ? { language: options.language } : undefined
4848
const region = options?.region ? { region: options.region } : undefined
49+
const version = options?.v ? { v: options.v } : undefined
4950
return {
5051
scriptInput: {
5152
src: withQuery(`https://maps.googleapis.com/maps/api/js`, {
@@ -55,6 +56,7 @@ export function useScriptGoogleMaps<T extends GoogleMapsApi>(_options?: GoogleMa
5556
callback: 'google.maps.__ib__',
5657
...language,
5758
...region,
59+
...version
5860
}),
5961
},
6062
clientInit: import.meta.server

0 commit comments

Comments
 (0)