Pass zoom to map.setCenter as an integer (Closes #1547)
This commit is contained in:
parent
4c2564e1af
commit
4ee1ce2881
1 changed files with 1 additions and 0 deletions
|
@ -132,6 +132,7 @@ function getMapCenter(center, zoom) {
|
|||
}
|
||||
|
||||
function setMapCenter(center, zoom) {
|
||||
zoom = parseInt(zoom);
|
||||
var numzoom = map.getNumZoomLevels();
|
||||
if (zoom >= numzoom) zoom = numzoom - 1;
|
||||
map.setCenter(center.clone().transform(epsg4326, map.getProjectionObject()), zoom);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue