From c2e9fe0aac69bf64000214f72e5f44ffadcfe2ff Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 8 May 2023 21:05:06 -0500 Subject: [PATCH] feat(web): improve map styling and interaction (#2399) * improve map styling and interaction * Update style --- .../leaflet/asset-marker-cluster.svelte | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) 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 @@