Include selected layer in short links
authorTom Hughes <tom@compton.nu>
Sat, 15 Feb 2014 12:05:30 +0000 (12:05 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 15 Feb 2014 12:05:30 +0000 (12:05 +0000)
Fixes #703

app/assets/javascripts/leaflet.map.js.erb

index 1171390..7ae330d 100644 (file)
@@ -148,6 +148,11 @@ L.OSM.Map = L.Map.extend({
     }
 
     var params = {};
+    var layers = this.getLayersCode().replace('M', '');
+
+    if (layers) {
+      params.layers = layers;
+    }
 
     if (marker && this.hasLayer(marker)) {
       params.m = '';