Edit Buttons

This commit is contained in:
portree_kid
2020-01-07 14:53:48 +01:00
parent cd501175f5
commit d520d982b5
8 changed files with 1348 additions and 17 deletions
+37
View File
@@ -0,0 +1,37 @@
/* eslint-disable */
L.EditControl = L.Control.extend({
options: {
position: 'topleft',
callback: null,
kind: '',
html: '<i class="fas fa-draw-polygon"></i>',
tooltip: 'tooltip'
},
onAdd: function (map) {
var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar'),
link = L.DomUtil.create('a', '', container);
link.href = '#';
link.title = this.options.tooltip;
link.innerHTML = this.options.html;
L.DomEvent.on(link, 'click', L.DomEvent.stop)
.on(link, 'click', function () {
window.LAYER = this.options.callback.call(map.editTools);
}, this);
return container;
}
});
L.NewMarkerControl = L.EditControl.extend({
options: {
position: 'topright',
callback: null,
kind: 'marker',
html: '🖈'
}
});