@googlemaps/markerclusterer
Creates and manages per-zoom-level clusters for large amounts of markers.
This package has a good security score with no known vulnerabilities.
Community Reviews
Solid clustering with good performance, but needs careful lifecycle management
The API is straightforward: pass your map and markers array, configure clustering behavior via renderer and algorithm options. Custom renderers give you full control over cluster appearance and click behavior. Error handling is minimal - invalid markers fail silently rather than throwing, which can make debugging tricky. No built-in retry logic or connection management since it's purely client-side DOM manipulation.
Configuration is flexible with sensible defaults (gridSize, maxZoom thresholds work well out of the box). Breaking changes between 1.x and 2.x required API rewrites, but 2.x has been stable. No timeout concerns since operations are synchronous. Under heavy load with 10k+ markers, initial render can block the main thread briefly - consider batching marker additions if you're dynamically loading data.
Best for: Applications displaying hundreds to thousands of map markers that need automatic clustering with custom visual styling
Avoid if: You need real-time streaming updates with tens of thousands of rapidly changing markers or require server-side clustering
Solid clustering solution with clear API, though docs could be deeper
The main frustration is documentation depth. While basic examples exist, figuring out custom renderers or advanced clustering algorithms requires digging through TypeScript definitions and GitHub issues. Error messages are typically clear when you pass wrong types, but runtime issues with marker lifecycle management can be cryptic. The community is reasonably responsive on GitHub, though Stack Overflow coverage is thin.
Debugging is manageable thanks to the library's modular architecture. You can swap algorithms (GridAlgorithm, SuperClusterAlgorithm) and renderers independently, which helps isolate issues. Performance with thousands of markers is solid, though you'll want to test with your specific data patterns.
Best for: Projects needing straightforward marker clustering on Google Maps with thousands of points and TypeScript support.
Avoid if: You need extensive hand-holding documentation or are using a maps library other than Google Maps (this is Google Maps-specific).
Solid clustering with good TypeScript support but quirky lifecycle management
The rendering pipeline is flexible, allowing custom renderers through the `Renderer` interface. The `SuperClusterAlgorithm` option provides better performance than the default for large datasets. However, the lifecycle management can be tricky—you need to explicitly call `clearMarkers()` before updating your marker set, or you'll end up with duplicates. The library doesn't automatically diff marker arrays, which feels unintuitive coming from modern reactive frameworks.
Error messages are generally helpful, though silent failures can occur if you pass markers that haven't been properly initialized with the map. Documentation covers the basics well with clear examples, but advanced customization scenarios (like dynamic renderer switching) require digging through TypeScript definitions.
Best for: Projects needing performant marker clustering with custom visual styling and full TypeScript support.
Avoid if: You need automatic reactive updates or are working in a framework where manual lifecycle management feels awkward.
Sign in to write a review
Sign In