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) {
|
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 newItem;
|
||||||
// var options = {color:"#a24ac3",weight:4,opacity:.5}
|
if(latlngs.length == 2) {
|
||||||
var options = window.plugin.drawTools.polygonOptions;
|
newItem = L.geodesicPolyline(latlngs, window.plugin.drawTools.lineOptions);
|
||||||
|
} else {
|
||||||
if(latlngs.length == 3) { newItem = L.geodesicPolygon(latlngs, options); }
|
newItem = L.geodesicPolygon(latlngs, window.plugin.drawTools.polygonOptions);
|
||||||
else if(latlngs.length == 2) { newItem = L.geodesicPolyline(latlngs, options); }
|
}
|
||||||
|
|
||||||
$('#bkmrksAutoDrawer a.bkmrk.selected').removeClass('selected');
|
$('#bkmrksAutoDrawer a.bkmrk.selected').removeClass('selected');
|
||||||
newItem.addTo(window.plugin.drawTools.drawnItems);
|
newItem.addTo(window.plugin.drawTools.drawnItems);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user