-function maxOsmarenderZoom() {
- var bounds = new OpenLayers.Bounds($("#minlon").val(), $("#minlat").val(), $("#maxlon").val(), $("#maxlat").val());
- var xzoom = Math.LOG2E * Math.log(2000 * 1.40625 / bounds.getWidth());
- var ymin = bounds.bottom * Math.PI / 180;
- var ymax = bounds.top * Math.PI / 180;
- var yzoom = Math.LOG2E * (Math.log(2000 * 2 * Math.PI) - Math.log(Math.log((Math.tan(ymax) + 1 / Math.cos(ymax)) / (Math.tan(ymin) + 1 / Math.cos(ymin)))))
-
- return Math.min(Math.floor(Math.min(xzoom, yzoom)), 17);
-}
-