1 //= require templates/map/share
3 L.Control.Share = L.Control.extend({
9 onAdd: function (map) {
10 var className = 'leaflet-control-locate',
11 classNames = className + ' leaflet-control-zoom leaflet-bar leaflet-control',
12 container = L.DomUtil.create('div', classNames);
15 this._layer = new L.LayerGroup();
16 this._layer.addTo(map);
17 this._event = undefined;
19 var link = L.DomUtil.create('a', 'leaflet-bar-part leaflet-bar-part-single', container);
21 link.title = this.options.title;
23 this._uiPane = L.DomUtil.create('div', 'leaflet-map-ui', map._container);
26 .on(link, 'click', L.DomEvent.stopPropagation)
27 .on(link, 'click', L.DomEvent.preventDefault)
28 .on(link, 'click', this.toggle, this)
29 .on(link, 'dblclick', L.DomEvent.stopPropagation);
35 var controlContainer = $('.leaflet-control-container .leaflet-top.leaflet-right');
37 if ($(this._uiPane).is(':visible')) {
38 $(this._uiPane).hide();
39 controlContainer.css({paddingRight: '0'});
43 .html(JST["templates/map/share"]());
44 controlContainer.css({paddingRight: '200px'});
49 L.control.share = function(options) {
50 return new L.Control.Share(options);