Skip to content

Commit

Permalink
Add 'canEmbed' layer option
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Dec 9, 2024
1 parent b342908 commit 00c6c74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/assets/javascripts/leaflet.share.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ L.OSM.share = function (options) {
}

function update() {
var canEmbed = map.getMapBaseLayerId() !== "tracestracktopo";
var canEmbed = map.getMapBaseLayer()?.options?.canEmbed;
var bounds = map.getBounds();

$("#link_marker")
Expand Down
5 changes: 5 additions & 0 deletions config/layers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
code: "M"
keyId: "mapnik"
nameId: "standard"
canEmbed: true
credit:
id: "make_a_donation"
href: "https://supporting.openstreetmap.org"
Expand All @@ -11,6 +12,7 @@
code: "Y"
keyId: "cyclosm"
nameId: "cyclosm"
canEmbed: true
credit:
id: "cyclosm_credit"
children:
Expand All @@ -26,6 +28,7 @@
keyId: "cyclemap"
nameId: "cycle_map"
apiKeyId: "THUNDERFOREST_KEY"
canEmbed: true
credit:
id: "thunderforest_credit"
children:
Expand All @@ -38,6 +41,7 @@
keyId: "transportmap"
nameId: "transport_map"
apiKeyId: "THUNDERFOREST_KEY"
canEmbed: true
credit:
id: "thunderforest_credit"
children:
Expand All @@ -61,6 +65,7 @@
code: "H"
keyId: "hot"
nameId: "hot"
canEmbed: true
credit:
id: "hotosm_credit"
children:
Expand Down

0 comments on commit 00c6c74

Please sign in to comment.