nuxt / scripts

Third-Party Scripts Meets Nuxt Developer Experience.
https://scripts.nuxt.com
MIT License
270 stars 29 forks source link

Google Maps: Cant add styles to options #202

Closed MickL closed 2 weeks ago

MickL commented 1 month ago

🐛 The bug

When adding styles to prop options of <ScriptGoogleMaps :options="{}" /> they dont get applied. Instead a warning is shown in the console:

Google Maps JavaScript API: A Map's styles property cannot be set when a mapId is present. When a mapId is present, Map styles are controlled via the cloud console.

I did not set any mapId.

harlan-zw commented 2 weeks ago

Thanks for the issue, this should be fixed in the latest version. Providing mapOptions.styles will style the static map and the interactive map.

The only issue is that it seems to break the map marker api (on google maps side).

image

image