X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/10c9ca81c788c5aa3cd7a66d9cdbaedc14def1bc..0eed6708a8f28938c085c76eaf9c35619535c7d3:/app/assets/javascripts/leaflet.layers.js diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js index ce0fcd9f3..27311f7c1 100644 --- a/app/assets/javascripts/leaflet.layers.js +++ b/app/assets/javascripts/leaflet.layers.js @@ -1,68 +1,164 @@ -//= require templates/map/layers +L.OSM.layers = function (options) { + var control = L.OSM.sidebarPane(options, "layers", "javascripts.map.layers.title", "javascripts.map.layers.header"); -L.OSM.Layers = L.Control.extend({ - onAdd: function (map) { - this._map = map; - this._initLayout(map); - return this._container; - }, + control.onAddPane = function (map, button, $ui, toggle) { + var layers = options.layers; - _initLayout: function (map) { - var className = 'leaflet-control-map-ui', - container = this._container = L.DomUtil.create('div', className); + var baseSection = $("
") + .attr("class", "section base-layers") + .appendTo($ui); - var link = this._layersLink = L.DomUtil.create('a', 'leaflet-map-ui-layers', container); - link.href = '#'; - link.title = 'Layers'; + var baseLayers = $("