disable map scroll wheel zoom

pull/11/head
Dan Gowans 2025-04-28 13:11:39 -04:00
parent afa0286a2a
commit 78cae2f964
4 changed files with 16 additions and 8 deletions

View File

@ -10,8 +10,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
const mapLatitude = Number.parseFloat(mapContainerElement.dataset.latitude ?? ''); const mapLatitude = Number.parseFloat(mapContainerElement.dataset.latitude ?? '');
const mapLongitude = Number.parseFloat(mapContainerElement.dataset.longitude ?? ''); const mapLongitude = Number.parseFloat(mapContainerElement.dataset.longitude ?? '');
const mapCoordinates = [mapLatitude, mapLongitude]; const mapCoordinates = [mapLatitude, mapLongitude];
// eslint-disable-next-line unicorn/no-array-callback-reference // eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument
const map = L.map(mapContainerElement); const map = L.map(mapContainerElement, {
scrollWheelZoom: false
});
map.setView(mapCoordinates, sunrise.leafletConstants.defaultZoom); map.setView(mapCoordinates, sunrise.leafletConstants.defaultZoom);
L.tileLayer(sunrise.leafletConstants.tileLayerURL, { L.tileLayer(sunrise.leafletConstants.tileLayerURL, {
attribution: sunrise.leafletConstants.attribution, attribution: sunrise.leafletConstants.attribution,

View File

@ -27,8 +27,10 @@ declare const exports: {
const mapCoordinates: Leaflet.LatLngTuple = [mapLatitude, mapLongitude] const mapCoordinates: Leaflet.LatLngTuple = [mapLatitude, mapLongitude]
// eslint-disable-next-line unicorn/no-array-callback-reference // eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument
const map: Leaflet.Map = L.map(mapContainerElement) const map: Leaflet.Map = L.map(mapContainerElement, {
scrollWheelZoom: false
})
map.setView(mapCoordinates, sunrise.leafletConstants.defaultZoom) map.setView(mapCoordinates, sunrise.leafletConstants.defaultZoom)
L.tileLayer(sunrise.leafletConstants.tileLayerURL, { L.tileLayer(sunrise.leafletConstants.tileLayerURL, {

View File

@ -7,8 +7,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
const mapLatitude = Number.parseFloat(mapContainerElement.dataset.latitude ?? ''); const mapLatitude = Number.parseFloat(mapContainerElement.dataset.latitude ?? '');
const mapLongitude = Number.parseFloat(mapContainerElement.dataset.longitude ?? ''); const mapLongitude = Number.parseFloat(mapContainerElement.dataset.longitude ?? '');
const mapCoordinates = [mapLatitude, mapLongitude]; const mapCoordinates = [mapLatitude, mapLongitude];
// eslint-disable-next-line unicorn/no-array-callback-reference // eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument
const map = L.map(mapContainerElement); const map = L.map(mapContainerElement, {
scrollWheelZoom: false
});
map.setView(mapCoordinates, sunrise.leafletConstants.defaultZoom); map.setView(mapCoordinates, sunrise.leafletConstants.defaultZoom);
L.tileLayer(sunrise.leafletConstants.tileLayerURL, { L.tileLayer(sunrise.leafletConstants.tileLayerURL, {
attribution: sunrise.leafletConstants.attribution, attribution: sunrise.leafletConstants.attribution,

View File

@ -22,8 +22,10 @@ declare const exports: {
const mapCoordinates: Leaflet.LatLngTuple = [mapLatitude, mapLongitude] const mapCoordinates: Leaflet.LatLngTuple = [mapLatitude, mapLongitude]
// eslint-disable-next-line unicorn/no-array-callback-reference // eslint-disable-next-line unicorn/no-array-callback-reference, unicorn/no-array-method-this-argument
const map: Leaflet.Map = L.map(mapContainerElement) const map: Leaflet.Map = L.map(mapContainerElement, {
scrollWheelZoom: false
})
map.setView(mapCoordinates, sunrise.leafletConstants.defaultZoom) map.setView(mapCoordinates, sunrise.leafletConstants.defaultZoom)
L.tileLayer(sunrise.leafletConstants.tileLayerURL, { L.tileLayer(sunrise.leafletConstants.tileLayerURL, {