bookmarks plugin
- fix auto draw to pass the right options (line/polygon) - otherwise geodesic lines can show a fill due to the curve - add note about API needed in draw tools plugin for this to use
This commit is contained in:
parent
792acc33ed
commit
9a654ae8fa
@ -616,12 +616,13 @@
|
||||
});
|
||||
|
||||
if(latlngs.length >= 2 && latlngs.length <= 3) {
|
||||
// TODO: add an API to draw-tools rather than assuming things about it's internals
|
||||
var newItem;
|
||||
// var options = {color:"#a24ac3",weight:4,opacity:.5}
|
||||
var options = window.plugin.drawTools.polygonOptions;
|
||||
|
||||
if(latlngs.length == 3) { newItem = L.geodesicPolygon(latlngs, options); }
|
||||
else if(latlngs.length == 2) { newItem = L.geodesicPolyline(latlngs, options); }
|
||||
if(latlngs.length == 2) {
|
||||
newItem = L.geodesicPolyline(latlngs, window.plugin.drawTools.lineOptions);
|
||||
} else {
|
||||
newItem = L.geodesicPolygon(latlngs, window.plugin.drawTools.polygonOptions);
|
||||
}
|
||||
|
||||
$('#bkmrksAutoDrawer a.bkmrk.selected').removeClass('selected');
|
||||
newItem.addTo(window.plugin.drawTools.drawnItems);
|
||||
|
Loading…
x
Reference in New Issue
Block a user