Skip to content

Commit

Permalink
feat:#477 enable mouse wheel zoom detail map (#482)
Browse files Browse the repository at this point in the history
* Add scrollWheelZoom enable on click for public detail map

* Add scrollWheelZoom enable for admin detail map
  • Loading branch information
ianliuwk1019 authored Oct 26, 2023
1 parent 95f85a7 commit 8d05382
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions admin/src/app/foms/details-map/details-map.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8d05382

Please sign in to comment.