Add Layers control as tab to sidebar
This commit is contained in:
parent
443ca9c03e
commit
23e7eb073e
4 changed files with 27 additions and 1 deletions
|
|
@ -111,7 +111,7 @@ BR.Map = {
|
|||
map.addLayer(firstLayer);
|
||||
}
|
||||
|
||||
layersControl = L.control.layers(baseLayers, overlays).addTo(map);
|
||||
layersControl = BR.layersTab(baseLayers, overlays).addTo(map);
|
||||
|
||||
L.control.locate({
|
||||
icon: 'fa fa-location-arrow',
|
||||
|
|
|
|||
12
js/control/LayersTab.js
Normal file
12
js/control/LayersTab.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
BR.LayersTab = L.Control.Layers.extend({
|
||||
addTo: function (map) {
|
||||
this._map = map;
|
||||
this.onAdd(map);
|
||||
L.DomUtil.get('layers-control-wrapper').appendChild(this._form);
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
BR.layersTab = function (baseLayers, overlays, options) {
|
||||
return new BR.LayersTab(baseLayers, overlays, options);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue