diff --git a/plugins/done-links.user.js b/plugins/done-links.user.js new file mode 100644 index 00000000..264c74fb --- /dev/null +++ b/plugins/done-links.user.js @@ -0,0 +1,194 @@ +// ==UserScript== +// @id iitc-plugin-done-links@jonatkins +// @name IITC plugin: done links +// @category Layer +// @version 0.0.1.@@DATETIMEVERSION@@ +// @namespace https://github.com/jonatkins/ingress-intel-total-conversion +// @updateURL @@UPDATEURL@@ +// @downloadURL @@DOWNLOADURL@@ +// @description [@@BUILDNAME@@-@@BUILDDATE@@] A companion to the Cross Links plugin. Highlights any links that match existing draw-tools line/polygon edges +// @include https://www.ingress.com/intel* +// @include http://www.ingress.com/intel* +// @match https://www.ingress.com/intel* +// @match http://www.ingress.com/intel* +// @grant none +// ==/UserScript== + +@@PLUGINSTART@@ + +// PLUGIN START //////////////////////////////////////////////////////// + + +window.plugin.doneLinks = function() {}; + +window.plugin.doneLinks.sameLink = function(a0, a1, b0, b1) { + if (a0.equals(b0) && a1.equals(b1)) return true; + if (a0.equals(b1) && a1.equals(b0)) return true; + return false; +} + + +window.plugin.doneLinks.testPolyLine = function (polyline, link,closed) { + + var a = link.getLatLngs(); + var b = polyline.getLatLngs(); + + for (var i=0;i