From 83f436cd5604c30b139e76aa339b8a14849b2086 Mon Sep 17 00:00:00 2001 From: Anton Khorev Date: Tue, 10 Dec 2024 00:39:42 +0300 Subject: [PATCH] Rename 'keyid' layer option to 'keyId' --- app/assets/javascripts/index.js | 2 +- app/assets/javascripts/leaflet.map.js | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/index.js b/app/assets/javascripts/index.js index 9df0f0ad5a..f46a29969f 100644 --- a/app/assets/javascripts/index.js +++ b/app/assets/javascripts/index.js @@ -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.keyId]; if (goal) { $("body").trigger("matomogoal", goal); diff --git a/app/assets/javascripts/leaflet.map.js b/app/assets/javascripts/leaflet.map.js index a97a72dcb3..ff5c7eaffe 100644 --- a/app/assets/javascripts/leaflet.map.js +++ b/app/assets/javascripts/leaflet.map.js @@ -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") { @@ -133,7 +131,7 @@ L.OSM.Map = L.Map.extend({ getMapBaseLayerId: function () { const layer = this.getMapBaseLayer(); - if (layer) return layer.options.keyid; + if (layer) return layer.options.keyId; }, getMapBaseLayer: function () {