Skip to content

Commit

Permalink
[fix] Reduce max zoom level to prevent unintended behavior due to exc…
Browse files Browse the repository at this point in the history
…essive zooming openwisp#188

Related to openwisp#188
  • Loading branch information
d1vyanshu-kumar committed Apr 5, 2024
1 parent 9079971 commit 8863446
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/js/echarts-leaflet/LeafletModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default function extendLeafletModel(echarts) {
},

setCenterAndZoom(center, zoom) {

this.option.center = center;
this.option.zoom = zoom;
},
Expand All @@ -33,7 +34,10 @@ export default function extendLeafletModel(echarts) {
},

defaultOption: {
mapOptions: {},
mapOptions: {
zoomDelta: 0.25, // Set zoom sensitivity
zoomSnap: 0.19 // Disable zoom snapping
},
tiles: [
{
urlTemplate: "http://{s}.tile.osm.org/{z}/{x}/{y}.png",
Expand All @@ -44,6 +48,7 @@ export default function extendLeafletModel(echarts) {
},
],
layerControl: {},

},
});
}
2 changes: 1 addition & 1 deletion src/js/netjsongraph.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ const NetJSONGraphDefaultConfig = {
"http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
options: {
minZoom: 3,
maxZoom: 32,
maxZoom: 15,
attribution: `&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors,
tiles offered by <a href="https://www.mapbox.com">Mapbox</a>`,
},
Expand Down

0 comments on commit 8863446

Please sign in to comment.