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 18, 2024
1 parent 2c84465 commit 8a8c251
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/assets/javascripts/leaflet.share.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ L.OSM.share = function (options) {
}

function update() {
var canEmbed = map.getMapBaseLayerId() !== "tracestracktopo";
const layer = map.getMapBaseLayer();
var canEmbed = layer && layer.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"
layerId: "mapnik"
nameId: "standard"
canEmbed: true
credit:
id: "make_a_donation"
href: "https://supporting.openstreetmap.org"
Expand All @@ -11,6 +12,7 @@
code: "Y"
layerId: "cyclosm"
nameId: "cyclosm"
canEmbed: true
credit:
id: "cyclosm_credit"
children:
Expand All @@ -26,6 +28,7 @@
layerId: "cyclemap"
nameId: "cycle_map"
apiKeyId: "THUNDERFOREST_KEY"
canEmbed: true
credit:
id: "thunderforest_credit"
children:
Expand All @@ -38,6 +41,7 @@
layerId: "transportmap"
nameId: "transport_map"
apiKeyId: "THUNDERFOREST_KEY"
canEmbed: true
credit:
id: "thunderforest_credit"
children:
Expand All @@ -61,6 +65,7 @@
code: "H"
layerId: "hot"
nameId: "hot"
canEmbed: true
credit:
id: "hotosm_credit"
children:
Expand Down

0 comments on commit 8a8c251

Please sign in to comment.