]> git.openstreetmap.org Git - rails.git/blob - app/assets/javascripts/leaflet.note.js
14a33640ace6c89f35b6a5f8aa1307673d171836
[rails.git] / app / assets / javascripts / leaflet.note.js
1 L.Control.Note = L.Control.extend({
2     options: {
3         position: 'topright',
4         title: 'Notes',
5     },
6
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);
11
12         var link = L.DomUtil.create('a', 'leaflet-bar-part leaflet-bar-part-single', container);
13         link.href = '#';
14         link.title = this.options.title;
15
16         L.DomEvent
17             .on(link, 'click', L.DomEvent.stopPropagation)
18             .on(link, 'click', L.DomEvent.preventDefault)
19             .on(link, 'dblclick', L.DomEvent.stopPropagation);
20
21         return container;
22     }
23 });
24
25 L.control.note = function(options) {
26     return new L.Control.Note(options);
27 };