Rename 'keyid' layer option to 'layerId'
This commit is contained in:
parent
7b05c1c060
commit
bfc8c5f6de
3 changed files with 8 additions and 10 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
},
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue