feat: Leaflet marker clustering (markercluster plugin) #61

Closed
opened 2026-06-28 15:36:37 +00:00 by jmiller · 2 comments
Owner

Summary

When many locations are displayed on the map, markers overlap and become unusable. Implement Leaflet.markercluster to group nearby markers at lower zoom levels.

Requirements

  • Include leaflet.markercluster.js and CSS assets
  • Cluster markers by proximity at each zoom level
  • Show cluster count badge
  • Expand cluster on click to reveal individual markers
  • Optional: color-code clusters by category

Reference

Priority

P3 — enhancement for maps with 50+ locations.

## Summary When many locations are displayed on the map, markers overlap and become unusable. Implement Leaflet.markercluster to group nearby markers at lower zoom levels. ## Requirements - Include `leaflet.markercluster.js` and CSS assets - Cluster markers by proximity at each zoom level - Show cluster count badge - Expand cluster on click to reveal individual markers - Optional: color-code clusters by category ## Reference - Leaflet.markercluster: https://github.com/Leaflet/Leaflet.markercluster - Competitive analysis (#54): all competitors support clustering ## Priority P3 — enhancement for maps with 50+ locations.
Author
Owner

Branch created: feature/61-feat-leaflet-marker-clustering-markerclu

git fetch origin
git checkout feature/61-feat-leaflet-marker-clustering-markerclu
Branch created: [`feature/61-feat-leaflet-marker-clustering-markerclu`](https://git.mokoconsulting.tech/MokoConsulting/MokoSuiteStoreLocator/src/branch/feature/61-feat-leaflet-marker-clustering-markerclu) ```bash git fetch origin git checkout feature/61-feat-leaflet-marker-clustering-markerclu ```
Author
Owner

Implemented:

  • Leaflet.markercluster 1.5.3 loaded from CDN (CSS + JS) via WebAssetManager
  • Markers added to L.markerClusterGroup() instead of directly to map
  • Graceful fallback: if markercluster JS fails to load, markers render individually via L.layerGroup()
  • New module parameter enable_clustering (default: Yes) to toggle clustering
  • Language string MOD_MOKOJOOMSTORELOCATOR_MAP_CLUSTERING added
Implemented: - Leaflet.markercluster 1.5.3 loaded from CDN (CSS + JS) via WebAssetManager - Markers added to `L.markerClusterGroup()` instead of directly to map - Graceful fallback: if markercluster JS fails to load, markers render individually via `L.layerGroup()` - New module parameter `enable_clustering` (default: Yes) to toggle clustering - Language string `MOD_MOKOJOOMSTORELOCATOR_MAP_CLUSTERING` added
Sign in to join this conversation.