Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polyline fields in AutoDraw #969

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions plugins/bookmarks-by-zaso.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,9 @@
// TODO: add an API to draw-tools rather than assuming things about its internals

var layer, layerType;
if(latlngs.length == 2) {
if(latlngs.length == 2 || $('#bkmrkDrawAsPolylines').prop('checked')) {
if (latlngs.length > 2)
latlngs.push(latlngs[0]);
layer = L.geodesicPolyline(latlngs, window.plugin.drawTools.lineOptions);
layerType = 'polyline';
} else {
Expand Down Expand Up @@ -938,9 +940,12 @@

// Append all folders and bookmarks
r = '<div id="bkmrksAutoDrawer">'
+ '<label style="margin-bottom: 9px; display: block;">'
+ '<label style="display: block;">'
+ '<input style="vertical-align: middle;" type="checkbox" id="bkmrkClearSelection" checked>'
+ ' Clear selection after drawing</label>'
+ '<label style="margin-bottom: 9px; display: block;">'
+ '<input style="vertical-align: middle;" type="checkbox" id="bkmrkDrawAsPolylines">'
+ ' Draw field as polylines</label>'
+ '<p style="margin-bottom:9px;color:red">You must select 2 or 3 portals!</p>'
+ '<div onclick="window.plugin.bookmarks.autoDrawOnSelect();return false;">'
+ element
Expand Down