Skip to content

Google Maps MarkerClusterer stuck loading with emitted event warnings #652

@Donitron

Description

@Donitron

🐛 The bug

When using the it takes ~10 seconds to load ~2k markers. In the console I noticed warnings about emitted events and the map only loaded after it was done outputting all the warnings. It also seemed like I got the same warnings with other events and components.

Image
  <ScriptGoogleMaps
    :center="center"
    :mapOptions="{ zoom }"
    :centerMarker="false"
    :class="['h-full w-full', { 'overflow-hidden rounded-2xl': isSingle }]"
    aboveTheFold
    trigger="immediate"
    width="100%"
    height="100%"
  >
    <ScriptGoogleMapsMarkerClusterer>
      <ScriptGoogleMapsAdvancedMarkerElement
        v-for="location in locations"
        :key="location.id"
        :options="{
          position: {
            lat: location.latitude,
            lng: location.longitude,
          },
        }"
      />
    </ScriptGoogleMapsMarkerClusterer>
  </ScriptGoogleMaps>

🛠️ To reproduce

See above, using the code as shown with lots of markers.

🌈 Expected behavior

The map loading is not blocked by the clusterer. The more locations I try to load in the longer it took. Ideally the warnings wouldn't be there either.

ℹ️ Additional context

Using Nuxt v4.3.1 and Nuxt Scripts v1.0.0-beta.26

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