Skip to content

Commit bec5752

Browse files
committed
Correct usage of options to set zoom with the center to avoid recentering to 0,0 when loading panel.
1 parent 2a4fd4c commit bec5752

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/worldmap.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ export default class WorldMap {
1919

2020
createMap() {
2121
const mapCenter = window.L.latLng(parseFloat(this.ctrl.panel.mapCenterLatitude), parseFloat(this.ctrl.panel.mapCenterLongitude));
22-
this.map = window.L.map(this.mapContainer, {worldCopyJump: true, center: mapCenter})
23-
.fitWorld()
24-
.zoomIn(parseInt(this.ctrl.panel.initialZoom, 10));
25-
this.map.panTo(mapCenter);
22+
this.map = window.L.map(this.mapContainer, { worldCopyJump: true, center: mapCenter, zoom: (this.panel.initialZoom || 1) });
2623
this.setMouseWheelZoom();
2724

2825
const selectedTileServer = tileServers[this.ctrl.tileServer];

0 commit comments

Comments
 (0)