X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ef73cc1f574124b10cda75188aa542d9f4d802bb..e443ec7587e78564deadd34f0aebde02c83437cc:/app/assets/javascripts/leaflet.layers.js diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js index 15f114a5c..038205ca4 100644 --- a/app/assets/javascripts/leaflet.layers.js +++ b/app/assets/javascripts/leaflet.layers.js @@ -1,92 +1,196 @@ -//= require templates/map/layers +L.OSM.layers = function (options) { + var control = L.control(options); + + control.onAdd = function (map) { + var layers = options.layers; + + var $container = $("
") + .attr("class", "control-layers"); + + var button = $("") + .attr("class", "control-button") + .attr("href", "#") + .attr("title", I18n.t("javascripts.map.layers.title")) + .html("") + .on("click", toggle) + .appendTo($container); + + var $ui = $("
") + .attr("class", "layers-ui"); + + $("
") + .attr("class", "sidebar_heading") + .appendTo($ui) + .append( + $("