]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/index/export.js
Merge remote-tracking branch 'osmlab/hash'
[rails.git] / app / assets / javascripts / index / export.js
index 2baab4d4b10f82a5025104ee49992f6f6c67cd68..47830f8beea33111284db05b264eebdaeb694650 100644 (file)
@@ -38,7 +38,7 @@ function initializeExport(map) {
 
     openSidebar();
 
 
     openSidebar();
 
-    if (getMapBaseLayerId(map) == "mapnik") {
+    if (map.getMapBaseLayerId() == "mapnik") {
       $("#format_mapnik").prop("checked", true);
     }
 
       $("#format_mapnik").prop("checked", true);
     }
 
@@ -150,12 +150,12 @@ function initializeExport(map) {
     }
 
     function setBounds(bounds) {
     }
 
     function setBounds(bounds) {
-      var toPrecision = zoomPrecision(map.getZoom());
+      var precision = zoomPrecision(map.getZoom());
 
 
-      $("#minlon").val(toPrecision(bounds.getWest()));
-      $("#minlat").val(toPrecision(bounds.getSouth()));
-      $("#maxlon").val(toPrecision(bounds.getEast()));
-      $("#maxlat").val(toPrecision(bounds.getNorth()));
+      $("#minlon").val(bounds.getWest().toFixed(precision));
+      $("#minlat").val(bounds.getSouth().toFixed(precision));
+      $("#maxlon").val(bounds.getEast().toFixed(precision));
+      $("#maxlat").val(bounds.getNorth().toFixed(precision));
 
       mapnikSizeChanged();
       htmlUrlChanged();
 
       mapnikSizeChanged();
       htmlUrlChanged();
@@ -186,7 +186,7 @@ function initializeExport(map) {
 
     function htmlUrlChanged() {
       var bounds = getBounds();
 
     function htmlUrlChanged() {
       var bounds = getBounds();
-      var layerName = getMapBaseLayerId(map);
+      var layerName = map.getMapBaseLayerId();
 
       var url = "http://" + OSM.SERVER_URL + "/export/embed.html?bbox=" + bounds.toBBoxString() + "&layer=" + layerName;
       var markerUrl = "";
 
       var url = "http://" + OSM.SERVER_URL + "/export/embed.html?bbox=" + bounds.toBBoxString() + "&layer=" + layerName;
       var markerUrl = "";
@@ -203,7 +203,7 @@ function initializeExport(map) {
 
       var zoom = map.getBoundsZoom(bounds);
 
 
       var zoom = map.getBoundsZoom(bounds);
 
-      var layers = getMapLayers(map);
+      var layers = map.getLayersCode();
 
       var text = I18n.t('export.start_rjs.view_larger_map');
       var escaped = [];
 
       var text = I18n.t('export.start_rjs.view_larger_map');
       var escaped = [];