1 L.Control.Note = L.Control.extend({
7 onAdd: function (map) {
8 var className = 'leaflet-control-locate',
9 classNames = className + ' leaflet-control-zoom leaflet-bar leaflet-control',
10 container = L.DomUtil.create('div', classNames);
12 var link = L.DomUtil.create('a', 'leaflet-bar-part leaflet-bar-part-single', container);
14 link.title = this.options.title;
17 .on(link, 'click', L.DomEvent.stopPropagation)
18 .on(link, 'click', L.DomEvent.preventDefault)
19 .on(link, 'click', this._toggle, this)
20 .on(link, 'dblclick', L.DomEvent.stopPropagation);
27 // TODO: this relies on notesLayer on the map
29 if (this.map.hasLayer(this.map.noteLayer)) {
30 this.map.removeLayer(this.map.noteLayer);
32 this.map.addLayer(this.map.noteLayer);
37 L.control.note = function(options) {
38 return new L.Control.Note(options);