]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/export/start.rjs
Limit Osmarender zoom to 17 levels.
[rails.git] / app / views / export / start.rjs
index 47cf9ce6bf21feddbcec4cc630233677fd30205c..83db38002444d179027a582a7012f0dc12fc8176 100644 (file)
@@ -327,7 +327,7 @@ page << <<EOJ
     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.floor(Math.min(xzoom, yzoom));
+    return Math.min(Math.floor(Math.min(xzoom, yzoom)), 17);
   }
 
   function roundScale(scale) {