Skip to content

ScriptGoogleMapsMarker cannot be used with mapOptions.styles #716

Description

@yukiyohure

🐛 The bug

Since v1 consolidates ScriptGoogleMapsMarker to wrap google.maps.marker.AdvancedMarkerElement
(removing the legacy google.maps.Marker), a mapId is now always required for markers to
function. However, the Map Styling guide
states:

JSON styles and mapId are mutually exclusive. When you provide both, the component ignores
mapId and applies styles.

This creates an irreconcilable conflict:

  • ScriptGoogleMapsMarker (v1) requiresmapId via AdvancedMarkerElement
  • Providing mapOptions.stylessilently dropsmapId
  • As a result, AdvancedMarkerElement fails to initialize, and the map surface shows
    "This Page Can’t Load Google Maps Correctly."

There is currently no supported way to apply JSON map styles when any ScriptGoogleMapsMarker
is present as a child of ScriptGoogleMaps in v1.

🛠️ To reproduce

https://stackblitz.com/edit/nuxt-starter-uyvxje18?file=pages%2Findex.vue

🌈 Expected behavior

Either:

  • (a) mapOptions.styles is applied and ScriptGoogleMapsMarker renders correctly — both should be usable together, as they were in v0 (where ScriptGoogleMapsMarker used the legacy google.maps.Marker , which did not require mapId).
  • (b) The documentation is updated to clearly state that JSON styles cannot be used alongside ScriptGoogleMapsMarker in v1, and an alternative migration path is provided.

ℹ️ Additional context

  • In v0, ScriptGoogleMapsMarker wrapped google.maps.Marker, which does not require mapId. JSON styles worked without issue alongside markers.
  • In v1, the migration guide states that ScriptGoogleMapsMarker now wraps google.maps.marker.AdvancedMarkerElement, which requires a Map ID.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions