X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/33aa0a6e454fb2d43b8ccc07395abf0864d47b66..f1a4669c957d29c012466768581c4a801e5029be:/app/assets/javascripts/leaflet.layers.js?ds=sidebyside diff --git a/app/assets/javascripts/leaflet.layers.js b/app/assets/javascripts/leaflet.layers.js index 6c83f0c2f..09cf1cf60 100644 --- a/app/assets/javascripts/leaflet.layers.js +++ b/app/assets/javascripts/leaflet.layers.js @@ -1,25 +1,132 @@ -//= require templates/map/layers - L.OSM.Layers = L.Control.extend({ onAdd: function (map) { - this._initLayout(map); - return this._container; + this._map = map; + this._initLayout(); + return this.$container[0]; }, - _initLayout: function (map) { - var className = 'leaflet-control-map-ui', - container = this._container = L.DomUtil.create('div', className); + _initLayout: function () { + var map = this._map, + layers = this.options.layers; + + this.$container = $('