]> git.openstreetmap.org Git - rails.git/blobdiff - app/assets/javascripts/leaflet.share.js
Merge pull request #5388 from AntonKhorev/map-layer-can-embed
[rails.git] / app / assets / javascripts / leaflet.share.js
index f0d2781098224d31bab521e66eb1a931373d09f2..7b0b5ef028001b14b842e139af76750e68c706a0 100644 (file)
@@ -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")