diff --git a/plugins/bookmarks-by-zaso.user.js b/plugins/bookmarks-by-zaso.user.js index 5a6ab61c..54164f42 100644 --- a/plugins/bookmarks-by-zaso.user.js +++ b/plugins/bookmarks-by-zaso.user.js @@ -675,6 +675,35 @@ } } + window.plugin.bookmarks.autoDrawCalcDistance = function() { + var latlngs = []; + var uuu = $('#bkmrksAutoDrawer a.bkmrk.selected').each(function(i) { + var tt = $(this).data('latlng'); + latlngs[i] = tt; + }); + + var distance = null; + if(latlngs.length == 2) { + distance = L.latLng(latlngs[0]).distanceTo(latlngs[1]); + } + + $('#bkmrksAutoDrawerDistance').remove(); + if(distance !== null) { + distance = Math.round(distance); + + var text = 'Distance between portals: '; + if(distance > 1000) + text += digits(distance / 1000) + 'km'; + else + text += digits(distance) + 'm'; + + $('
You must select 2 or 3 portals.
' + + '