diff --git a/web/src/lib/components/shared-components/leaflet/asset-marker-cluster.svelte b/web/src/lib/components/shared-components/leaflet/asset-marker-cluster.svelte index 15475733e2..7784694651 100644 --- a/web/src/lib/components/shared-components/leaflet/asset-marker-cluster.svelte +++ b/web/src/lib/components/shared-components/leaflet/asset-marker-cluster.svelte @@ -28,7 +28,8 @@ iconAnchor: [12, 41], popupAnchor: [1, -34], tooltipAnchor: [16, -28], - shadowSize: [41, 41] + shadowSize: [41, 41], + className: 'asset-marker-icon' }) }); @@ -67,6 +68,16 @@ dispatch('view', { assets: ids }); }); + cluster.on('clustermouseover', (event: LeafletEvent) => { + if (event.sourceTarget.getChildCount() <= 10) { + event.sourceTarget.spiderfy(); + } + }); + + cluster.on('clustermouseout', (event: LeafletEvent) => { + event.sourceTarget.unspiderfy(); + }); + for (let marker of markers) { const leafletMarker = new AssetMarker(marker); @@ -91,7 +102,7 @@