Skip to content

Commit b53b424

Browse files
committed
Define default leaflet max zoom as constant
1 parent 78c6053 commit b53b424

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/lib/cyleaflet_clientside.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ if (!window.dash_clientside) {
1010
// Reference: https://epsg.io/3857
1111

1212
// Conversion factor based on EPSG:3857 bounds
13-
var conversion_factor = 20037508.34;
13+
const conversion_factor = 20037508.34;
1414

15-
var double_lon = 360;
16-
var max_lon = 180;
17-
var max_lat = 90;
15+
const double_lon = 360;
16+
const max_lon = 180;
17+
const max_lat = 90;
1818

19-
var leafletZoomMultiplier = 0.418;
20-
var leafletZoomReference = 16;
19+
const leafletZoomMultiplier = 0.418;
20+
const leafletZoomReference = 16;
21+
const defaultLeafletMaxZoom = 18;
2122

2223
// Convert EPSG:4326 to EPSG:3857
2324
// We also flip the sign of the y-value to match Cytoscape's coordinate system
@@ -126,7 +127,7 @@ window.dash_clientside.cyleaflet = {
126127
})[0];
127128
}
128129

129-
var leafletMaxZoom = 18;
130+
var leafletMaxZoom = defaultLeafletMaxZoom;
130131
if (Object.prototype.hasOwnProperty.call(tileLayer.props, 'maxZoom')) {
131132
leafletMaxZoom = tileLayer.props.maxZoom;
132133
}

0 commit comments

Comments
 (0)