From 9286ac33e73d516ae3af83f5f8d7b18f04680f53 Mon Sep 17 00:00:00 2001 From: RyanBirtch-aot Date: Tue, 22 Oct 2024 18:07:04 +0000 Subject: [PATCH 1/2] Added fix for popup bug --- components/src/components/Map/services/MapService.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/src/components/Map/services/MapService.ts b/components/src/components/Map/services/MapService.ts index 2e0f72121..478e56178 100644 --- a/components/src/components/Map/services/MapService.ts +++ b/components/src/components/Map/services/MapService.ts @@ -54,10 +54,14 @@ class MapService { map.on('draw:created', (e) => { const layer = e.layer; if (drawnItems.getLayers().length === options.numPoints) { + console.log('too many markers'); + map.closePopup(); L.popup() - .setLatLng(layer.getLatLng()) - .setContent('

Only one marker for submission

') - .openOn(map); + .setLatLng(map.getCenter()) + .setContent( + `

Only ${options.numPoints} features per submission

` + ) + .addTo(map); } else { drawnItems.addLayer(layer); } From abf00267c3f74c4cfbc1895e3e94e53172e91eba Mon Sep 17 00:00:00 2001 From: RyanBirtch-aot Date: Tue, 22 Oct 2024 23:50:13 +0000 Subject: [PATCH 2/2] Removed console --- components/src/components/Map/services/MapService.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/components/src/components/Map/services/MapService.ts b/components/src/components/Map/services/MapService.ts index 478e56178..3698d1e0e 100644 --- a/components/src/components/Map/services/MapService.ts +++ b/components/src/components/Map/services/MapService.ts @@ -54,7 +54,6 @@ class MapService { map.on('draw:created', (e) => { const layer = e.layer; if (drawnItems.getLayers().length === options.numPoints) { - console.log('too many markers'); map.closePopup(); L.popup() .setLatLng(map.getCenter())