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);
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") {
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;
},
- leafletOsmId: "Mapnik"
code: "M"
- keyId: "mapnik"
+ layerId: "mapnik"
nameId: "standard"
credit:
id: "make_a_donation"
- leafletOsmId: "CyclOSM"
code: "Y"
- keyId: "cyclosm"
+ layerId: "cyclosm"
nameId: "cyclosm"
credit:
id: "cyclosm_credit"
- leafletOsmId: "CycleMap"
code: "C"
- keyId: "cyclemap"
+ layerId: "cyclemap"
nameId: "cycle_map"
apiKeyId: "THUNDERFOREST_KEY"
credit:
- leafletOsmId: "TransportMap"
code: "T"
- keyId: "transportmap"
+ layerId: "transportmap"
nameId: "transport_map"
apiKeyId: "THUNDERFOREST_KEY"
credit:
- leafletOsmId: "TracestrackTopo"
code: "P"
- keyId: "tracestracktopo"
+ layerId: "tracestracktopo"
nameId: "tracestracktop_topo"
apiKeyId: "TRACESTRACK_KEY"
credit:
- leafletOsmId: "HOT"
code: "H"
- keyId: "hot"
+ layerId: "hot"
nameId: "hot"
credit:
id: "hotosm_credit"