Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MarkerCluster not optimized? #305

Open
chefranov opened this issue Jan 10, 2025 · 2 comments
Open

MarkerCluster not optimized? #305

chefranov opened this issue Jan 10, 2025 · 2 comments

Comments

@chefranov
Copy link

I have ~15000 markers and when I try show it with MarkerCluster my browser freeze and page doesn't response.

Use like this:

    <!-- Marker Cluster -->
    <MarkerCluster>
        <AdvancedMarker v-for="poi in visiblePois" :key="poi.id" :options="{
            position: { lat: parseFloat(poi.latitude), lng: parseFloat(poi.longitude) },
            content: createMarkerContent(poi.category_icon),
        }" @click="handleMarkerClick(poi)" />
    </MarkerCluster>

Am I doing something wrong or is this not optimized?

@tony-nz
Copy link

tony-nz commented Jan 11, 2025

Also running into this issue, and as for a test, without using Clusters, replacing AdvancedMarkers to Markers (albeit depreciated) seems to be a notable difference in performance.

@tony-nz
Copy link

tony-nz commented Jan 16, 2025

Okay so I believe the performance difference between the deprecated Marker and AdvancedMarkerView (Custom Markers) boils down to rendering methods:

Deprecated Marker: Renders via canvas/static images and is highly optimized for large quantities (1000+ markers), with minimal DOM overhead.
AdvancedMarkerView: Uses individual DOM elements for each marker, which does offer more customization but can cause performance issues with large numbers due to DOM manipulation, reflow, and repaint costs.

Unfortunately, I will have to use the deprecated Marker in my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants