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) {
|
if (OSM.MATOMO) {
|
||||||
map.on("layeradd", function (e) {
|
map.on("layeradd", function (e) {
|
||||||
if (e.layer.options) {
|
if (e.layer.options) {
|
||||||
var goal = OSM.MATOMO.goals[e.layer.options.keyid];
|
var goal = OSM.MATOMO.goals[e.layer.options.layerId];
|
||||||
|
|
||||||
if (goal) {
|
if (goal) {
|
||||||
$("body").trigger("matomogoal", goal);
|
$("body").trigger("matomogoal", goal);
|
||||||
|
|
|
@ -26,8 +26,6 @@ L.OSM.Map = L.Map.extend({
|
||||||
for (const [property, value] of Object.entries(layerDefinition)) {
|
for (const [property, value] of Object.entries(layerDefinition)) {
|
||||||
if (property === "credit") {
|
if (property === "credit") {
|
||||||
layerOptions.attribution = makeAttribution(value);
|
layerOptions.attribution = makeAttribution(value);
|
||||||
} else if (property === "keyId") {
|
|
||||||
layerOptions.keyid = value;
|
|
||||||
} else if (property === "nameId") {
|
} else if (property === "nameId") {
|
||||||
layerOptions.name = I18n.t(`javascripts.map.base.${value}`);
|
layerOptions.name = I18n.t(`javascripts.map.base.${value}`);
|
||||||
} else if (property === "apiKeyId") {
|
} else if (property === "apiKeyId") {
|
||||||
|
@ -134,7 +132,7 @@ L.OSM.Map = L.Map.extend({
|
||||||
getMapBaseLayerId: function () {
|
getMapBaseLayerId: function () {
|
||||||
var baseLayerId;
|
var baseLayerId;
|
||||||
this.eachLayer(function (layer) {
|
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;
|
return baseLayerId;
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
- leafletOsmId: "Mapnik"
|
- leafletOsmId: "Mapnik"
|
||||||
code: "M"
|
code: "M"
|
||||||
keyId: "mapnik"
|
layerId: "mapnik"
|
||||||
nameId: "standard"
|
nameId: "standard"
|
||||||
credit:
|
credit:
|
||||||
id: "make_a_donation"
|
id: "make_a_donation"
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
- leafletOsmId: "CyclOSM"
|
- leafletOsmId: "CyclOSM"
|
||||||
code: "Y"
|
code: "Y"
|
||||||
keyId: "cyclosm"
|
layerId: "cyclosm"
|
||||||
nameId: "cyclosm"
|
nameId: "cyclosm"
|
||||||
credit:
|
credit:
|
||||||
id: "cyclosm_credit"
|
id: "cyclosm_credit"
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
|
|
||||||
- leafletOsmId: "CycleMap"
|
- leafletOsmId: "CycleMap"
|
||||||
code: "C"
|
code: "C"
|
||||||
keyId: "cyclemap"
|
layerId: "cyclemap"
|
||||||
nameId: "cycle_map"
|
nameId: "cycle_map"
|
||||||
apiKeyId: "THUNDERFOREST_KEY"
|
apiKeyId: "THUNDERFOREST_KEY"
|
||||||
credit:
|
credit:
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
- leafletOsmId: "TransportMap"
|
- leafletOsmId: "TransportMap"
|
||||||
code: "T"
|
code: "T"
|
||||||
keyId: "transportmap"
|
layerId: "transportmap"
|
||||||
nameId: "transport_map"
|
nameId: "transport_map"
|
||||||
apiKeyId: "THUNDERFOREST_KEY"
|
apiKeyId: "THUNDERFOREST_KEY"
|
||||||
credit:
|
credit:
|
||||||
|
@ -47,7 +47,7 @@
|
||||||
|
|
||||||
- leafletOsmId: "TracestrackTopo"
|
- leafletOsmId: "TracestrackTopo"
|
||||||
code: "P"
|
code: "P"
|
||||||
keyId: "tracestracktopo"
|
layerId: "tracestracktopo"
|
||||||
nameId: "tracestracktop_topo"
|
nameId: "tracestracktop_topo"
|
||||||
apiKeyId: "TRACESTRACK_KEY"
|
apiKeyId: "TRACESTRACK_KEY"
|
||||||
credit:
|
credit:
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
|
|
||||||
- leafletOsmId: "HOT"
|
- leafletOsmId: "HOT"
|
||||||
code: "H"
|
code: "H"
|
||||||
keyId: "hot"
|
layerId: "hot"
|
||||||
nameId: "hot"
|
nameId: "hot"
|
||||||
credit:
|
credit:
|
||||||
id: "hotosm_credit"
|
id: "hotosm_credit"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue