1 //= require templates/map/layers
3 OSM.MapUI = L.Control.extend({
6 return this._container;
9 _initLayout: function(map) {
10 var className = 'leaflet-control-map-ui',
11 container = this._container = L.DomUtil.create('div', className);
13 var link = this._layersLink = L.DomUtil.create('a', 'leaflet-map-ui-layers', container);
15 link.title = 'Layers';
17 this._uiPane = L.DomUtil.create('div', 'leaflet-map-ui', map._container);
19 $(link).on('click', $.proxy(this.toggleLayers, this));
22 toggleLayers: function(e) {
26 var controlContainer = $('.leaflet-control-container .leaflet-top.leaflet-right');
28 if ($(this._uiPane).is(':visible')) {
29 $(this._uiPane).hide();
30 controlContainer.css({paddingRight: '0'})
34 .html(JST["templates/map/layers"]());
35 controlContainer.css({paddingRight: '200px'})
40 OSM.mapUI = function() {
41 return new OSM.MapUI();