From 8126ef1099d0693afeddfeaf17c9715232f01d79 Mon Sep 17 00:00:00 2001 From: Ian Liu Date: Wed, 25 Oct 2023 13:58:10 -0700 Subject: [PATCH 1/2] Add scrollWheelZoom enable on click for public detail map --- .../details-panel/details-map/details-map.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/public/src/app/applications/details-panel/details-map/details-map.component.ts b/public/src/app/applications/details-panel/details-map/details-map.component.ts index 394b949f3..1349ff0bb 100644 --- a/public/src/app/applications/details-panel/details-map/details-map.component.ts +++ b/public/src/app/applications/details-panel/details-map/details-map.component.ts @@ -124,6 +124,9 @@ export class DetailsMapComponent implements OnInit, OnChanges, OnDestroy { this.mapLayersService.notifyLayersChange({overlay: {action: OverlayAction.Remove, layerName: e.name}}); }); + this.map.on('click', () => { this.map.scrollWheelZoom.enable(); }); + this.map.on('blur', () => { this.map.scrollWheelZoom.disable(); }); + // Initialize current app-map layers state (for the first time when this component map is shown) this.mapLayersService.applyCurrentMapLayers(this.map, this.mapLayers); } From 0d1485d14dc9c5481b35126a828dd72836577e70 Mon Sep 17 00:00:00 2001 From: Ian Liu Date: Wed, 25 Oct 2023 14:20:39 -0700 Subject: [PATCH 2/2] Add scrollWheelZoom enable for admin detail map --- admin/src/app/foms/details-map/details-map.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/src/app/foms/details-map/details-map.component.ts b/admin/src/app/foms/details-map/details-map.component.ts index d399cc071..ec8bbfa1b 100644 --- a/admin/src/app/foms/details-map/details-map.component.ts +++ b/admin/src/app/foms/details-map/details-map.component.ts @@ -108,6 +108,9 @@ export class DetailsMapComponent implements OnInit, OnChanges, OnDestroy { maxBounds: L.latLngBounds(L.latLng(-90, -180), L.latLng(90, 180)) // restrict view to "the world" }); + this.map.on('click', () => { this.map.scrollWheelZoom.enable(); }); + this.map.on('blur', () => { this.map.scrollWheelZoom.disable(); }); + mapLayers.addLayerControl(this.map); this.map.on('baselayerchange', (e: L.LayersControlEvent) => { mapLayers.setActiveBaseLayerName(e.name);