]> git.openstreetmap.org Git - rails.git/commitdiff
Rename 'keyid' layer option to 'layerId'
authorAnton Khorev <tony29@yandex.ru>
Mon, 9 Dec 2024 22:23:41 +0000 (01:23 +0300)
committerAnton Khorev <tony29@yandex.ru>
Mon, 9 Dec 2024 22:23:41 +0000 (01:23 +0300)
app/assets/javascripts/index.js
app/assets/javascripts/leaflet.map.js
config/layers.yml

index 9df0f0ad5a432b34be12258c6ead602362fa05d0..56495b31a31c87fd18ca8b864ac492b84f1f0240 100644 (file)
@@ -207,7 +207,7 @@ $(document).ready(function () {
   if (OSM.MATOMO) {
     map.on("layeradd", function (e) {
       if (e.layer.options) {
-        var goal = OSM.MATOMO.goals[e.layer.options.keyid];
+        var goal = OSM.MATOMO.goals[e.layer.options.layerId];
 
         if (goal) {
           $("body").trigger("matomogoal", goal);
index f478f4351b58a644ab0b5b35015021b28abaf48c..02ed318acffc89eded8d0dccad99a682c8e2d05f 100644 (file)
@@ -26,8 +26,6 @@ L.OSM.Map = L.Map.extend({
       for (const [property, value] of Object.entries(layerDefinition)) {
         if (property === "credit") {
           layerOptions.attribution = makeAttribution(value);
-        } else if (property === "keyId") {
-          layerOptions.keyid = value;
         } else if (property === "nameId") {
           layerOptions.name = I18n.t(`javascripts.map.base.${value}`);
         } else if (property === "apiKeyId") {
@@ -134,7 +132,7 @@ L.OSM.Map = L.Map.extend({
   getMapBaseLayerId: function () {
     var baseLayerId;
     this.eachLayer(function (layer) {
-      if (layer.options && layer.options.keyid) baseLayerId = layer.options.keyid;
+      if (layer.options && layer.options.layerId) baseLayerId = layer.options.layerId;
     });
     return baseLayerId;
   },
index 3b5bc944fe14a2c321cd86cf36e8d491edbbda07..4f883cc9403eea879eaad8128882e27e2d04b31f 100644 (file)
@@ -1,6 +1,6 @@
 - leafletOsmId: "Mapnik"
   code: "M"
-  keyId: "mapnik"
+  layerId: "mapnik"
   nameId: "standard"
   credit:
     id: "make_a_donation"
@@ -9,7 +9,7 @@
 
 - leafletOsmId: "CyclOSM"
   code: "Y"
-  keyId: "cyclosm"
+  layerId: "cyclosm"
   nameId: "cyclosm"
   credit:
     id: "cyclosm_credit"
@@ -23,7 +23,7 @@
 
 - leafletOsmId: "CycleMap"
   code: "C"
-  keyId: "cyclemap"
+  layerId: "cyclemap"
   nameId: "cycle_map"
   apiKeyId: "THUNDERFOREST_KEY"
   credit:
@@ -35,7 +35,7 @@
 
 - leafletOsmId: "TransportMap"
   code: "T"
-  keyId: "transportmap"
+  layerId: "transportmap"
   nameId: "transport_map"
   apiKeyId: "THUNDERFOREST_KEY"
   credit:
@@ -47,7 +47,7 @@
 
 - leafletOsmId: "TracestrackTopo"
   code: "P"
-  keyId: "tracestracktopo"
+  layerId: "tracestracktopo"
   nameId: "tracestracktop_topo"
   apiKeyId: "TRACESTRACK_KEY"
   credit:
@@ -59,7 +59,7 @@
 
 - leafletOsmId: "HOT"
   code: "H"
-  keyId: "hot"
+  layerId: "hot"
   nameId: "hot"
   credit:
     id: "hotosm_credit"