mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-06 11:21:33 +00:00
Limit zoom to 19 if geocode bounding box too small
This commit is contained in:
@@ -346,10 +346,6 @@ iD.Map = function(context) {
|
||||
vZoomDiff = Math.log(Math.abs(vFactor)) / Math.LN2,
|
||||
newZoom = map.zoom() - Math.max(hZoomDiff, vZoomDiff);
|
||||
|
||||
if(newZoom > 19){
|
||||
newZoom = 19;
|
||||
}
|
||||
|
||||
map.centerZoom(extent.center(), newZoom);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,6 +19,7 @@ iD.ui.geocoder = function() {
|
||||
}
|
||||
var bounds = resp[0].boundingbox;
|
||||
map.extent(iD.geo.Extent([parseFloat(bounds[3]), parseFloat(bounds[0])], [parseFloat(bounds[2]), parseFloat(bounds[1])]));
|
||||
if (map.zoom() > 19) map.zoom(19);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user