var map = L.map(divName).fitBounds(<%= @bbox.to_json %>);
// Create a layer switcher
- var layers = L.control.layers();
+ var layers = L.control.layers(null, null, {collapsed:false});
// Add OpenStreetMap layer
layers.addBaseLayer(L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
// Add <%= layer[:name] %> to layer switcher
<% if layer[:overlay] -%>
- layers.addBaseLayer(<%= layer[:name] %>, <%= layer[:title].to_json %>);
- <% else %>
layers.addOverlay(<%= layer[:name] %>, <%= layer[:title].to_json %>);
+ <% else %>
+ layers.addBaseLayer(<%= layer[:name] %>, <%= layer[:title].to_json %>);
<% end -%>
<% if layer[:default] -%>
// Add the layer switch to the mao
layers.addTo(map);
-
+ map.addControl(new L.Control.Permalink());
return map;
}