X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/10c9ca81c788c5aa3cd7a66d9cdbaedc14def1bc..b8da7922ec4194e61a1eebb43be787f8b55d1647:/app/assets/javascripts/leaflet.layers.js diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js index ce0fcd9f3..020876c47 100644 --- a/app/assets/javascripts/leaflet.layers.js +++ b/app/assets/javascripts/leaflet.layers.js @@ -1,68 +1,163 @@ -//= 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 = $("