Limit zoom to 19 if geocode bounding box too small

This commit is contained in:
Dr Ian
2013-02-01 23:05:47 +01:00
parent 839844de27
commit f4975447f8
2 changed files with 1 additions and 4 deletions

View File

@@ -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);
}
};

View File

@@ -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);
});
}