Polyline options
VladimirKalachikhin opened this issue · 0 comments
VladimirKalachikhin commented
Is it possible to add some options to polyline, created by control?
For example, window.LAYER = this.options.callback.call(map.editTools,{weight: 5});
in code
L.EditControl = L.Control.extend({
options: {
position: 'bottomright',
callback: null,
kind: '',
html: ''
},
onAdd: function (map) {
var container = L.DomUtil.create('div', 'leaflet-control leaflet-bar'),
link = L.DomUtil.create('a', '', container);
link.href = '#';
link.title = 'Create a new ' + this.options.kind;
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,{weight: 5});
}, this);
return container;
}
});
L.NewLineControl = L.EditControl.extend({
options: {
position: 'topleft',
callback: map.editTools.startPolyline,
kind: 'line',
html: '\\/\\',
}
});
produce error.