]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.share.js
Add map.getMapBaseLayer()
[rails.git] / app / assets / javascripts / leaflet.share.js
index 40ba020e6c36ac0ac82cd6367a934cf9cf24897d..f0d2781098224d31bab521e66eb1a931373d09f2 100644 (file)
@@ -410,15 +410,15 @@ L.OSM.share = function (options) {
       $("#mapnik_image_width").text(mapWidth);
       $("#mapnik_image_height").text(mapHeight);
 
-      const layer = map.getMapBaseLayerId();
+      const layerId = map.getMapBaseLayerId();
       const layerKeys = new Map([
         ["mapnik", "standard"],
         ["cyclemap", "cycle_map"],
         ["transportmap", "transport_map"]
       ]);
 
-      $("#mapnik_image_layer").text(layerKeys.has(layer) ? I18n.t(`javascripts.map.base.${layerKeys.get(layer)}`) : "");
-      $("#map_format").val(layer);
+      $("#mapnik_image_layer").text(layerKeys.has(layerId) ? I18n.t(`javascripts.map.base.${layerKeys.get(layerId)}`) : "");
+      $("#map_format").val(layerId);
 
       $("#map_zoom").val(map.getZoom());
       $("#mapnik_lon").val(map.getCenter().lng);