Skip to content

Commit 0f8b4e8

Browse files
committed
min level set
1 parent 880e852 commit 0f8b4e8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

js/jquery.mapael.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@
601601
* Zoom on the map at a specific level focused on specific coordinates
602602
* If no coordinates are specified, the zoom will be focused on the center of the map
603603
* options :
604-
* "level" : level of the zoom between 0 and maxLevel
604+
* "level" : level of the zoom between minLevel and maxLevel
605605
* "x" or "latitude" : x coordinate or latitude of the point to focus on
606606
* "y" or "longitude" : y coordinate or longitude of the point to focus on
607607
* "fixedCenter" : set to true in order to preserve the position of x,y in the canvas when zoomed
@@ -641,7 +641,7 @@
641641
}
642642
}
643643
// Make sure we stay in the boundaries
644-
newLevel = Math.min(Math.max(newLevel, 0), self.options.map.zoom.maxLevel);
644+
newLevel = Math.min(Math.max(newLevel, self.options.map.zoom.minLevel), self.options.map.zoom.maxLevel);
645645
}
646646

647647
zoomLevel = (1 + newLevel * self.options.map.zoom.step);
@@ -2045,6 +2045,7 @@
20452045
},
20462046
zoom: {
20472047
enabled: false,
2048+
minLevel: 0,
20482049
maxLevel: 10,
20492050
step: 0.25,
20502051
mousewheel: true,

0 commit comments

Comments
 (0)