- <% @overlays.sort_by { |layer| layer[:name] }.each do |layer| -%>
- // Add <%= layer[:name] %> to layer switcher
- layers.addOverlay(L.tileLayer(<%= layer[:url].to_json %>, {
- attribution: <%= layer[:attribution].to_json %>,
- maxZoom: <%= layer[:maxZoom].to_json %>
- }), <%= layer[:title].to_json %>);
-
- <% end -%>
- // Add the layer switch to the mao
- layers.addTo(map);