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:
Jon Atkins 2013-11-18 07:33:35 +00:00
parent 792acc33ed
commit 9a654ae8fa

View File

@ -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);