iitc-project / ingress-intel-total-conversion

ingress.com/intel total conversion user script with some new features. Should allow easier extension of the intel map.
http://iitc.jonatkins.com/
ISC License
991 stars 552 forks source link

Fly links plugin #736

Open RobyB opened 10 years ago

RobyB commented 10 years ago

Just a question to the developer of this plugin. It would be really nice being able to select a certain region on the map on which calculating links/fields... Probably simplest thing would be delimiting the area by a polyline with draw tools, rather than clicking on all interested portals... Then maybe with CTRL click you could remove any unwanted portal from the selected region... Example of portals you would like to skip are:

jonatkins commented 10 years ago

A more general 'portal multi select' solution might be better, so it can also be used by other plugins. (e.g. portals list/counts, the other 'links' plugin, scoreboard (if it ever returns), etc)

Start by selecting all portals in view, or a defined rectangle, then allow portals to be added/removed from the selection. Being able to save a more complex polygon for the region could also be an option.

The whole user interface is probably the hardest part - something that works well for both desktop and mobile (touch only) would be preferred.

asnapper commented 10 years ago

when i stumbled upon fly-links i was at first impressed how it calculated all the fields, but it becomes quickly useless when you realize that it always uses all the portals that are within the bounds of the current map view.

so i made my own small plugin which has a list of disabled portals. portals can be disabled with a link in the portal details window.

https://github.com/asnapper/ingress-intel-total-conversion/commit/9aa54406399072d3cd51111da9a19a7eb9586363

and for fly-links to be able to use it, it needs a single-line addition:

diff --git a/plugins/fly-links.user.js b/plugins/fly-links.user.js
old mode 100644
new mode 100755
index 584a3ab..d749265
--- a/plugins/fly-links.user.js
+++ b/plugins/fly-links.user.js
@@ -51,7 +51,8 @@ window.plugin.flyLinks.updateLayer = function() {
     var ll = portal.getLatLng();
     if (bounds.contains(ll)) {
       var p = map.project(portal.getLatLng(), window.plugin.flyLinks.PROJECT_ZOOM);
-      locations.push(p);
+     if (!window.plugin.disablePortal || !(guid in window.plugin.disablePortal.disabledGUID))
+       locations.push(p);
     }
   });
Yossi commented 10 years ago

asnapper, I tried to use your portal disabler, but no link shows up in the portal details window.

Is this supposed to work as-is on firefox with greasemonkey?

asnapper commented 10 years ago

@Yossi Yes, it's supposed to work with ff/greasemonkey and chrome/tampermonkey. A few suggestions:

Hackswell commented 9 years ago

I like Asnapper's implementation. Works well! It'd be easier with a polygon disable/enable, but still much better than before! Great Job!

Any way to get his patch to fly-links put in upstream? And his plugin listed on the page?

asnapper commented 9 years ago

I don't think that "dirty hack" is worth for upstream ;)

On Thu, Apr 2, 2015 at 5:46 PM Sir Woody Hackswell notifications@github.com wrote:

I like Asnapper's implementation. Works well! It'd be easier with a polygon disable/enable, but still much better than before! Great Job!

Any way to get his patch to fly-links put in upstream? And his plugin listed on the page?

— Reply to this email directly or view it on GitHub https://github.com/jonatkins/ingress-intel-total-conversion/issues/736#issuecomment-88952485 .

Hackswell commented 9 years ago

I've seen nothing better added in over a year. ;) Once it's in, it'll get the proper attention it needs. Just my US$0.03.

asnapper commented 9 years ago

Thanks. Forgive me that i'm not up to date when it comes to iitc (I basically stopped playing ingress), but isn't there any other plugin which allows you to create a an editable list of portals? Because i think this is a feature that many other plugins use/could use, so it would probably be better to make it a bit more generic.

On Thu, Apr 2, 2015 at 6:25 PM Sir Woody Hackswell notifications@github.com wrote:

I've seen nothing better added in over a year. ;) Once it's in, it'll get the proper attention it needs. Just my US$0.03.

— Reply to this email directly or view it on GitHub https://github.com/jonatkins/ingress-intel-total-conversion/issues/736#issuecomment-88965932 .

Hackswell commented 9 years ago

I agree. Probably be better to make an addition to draw tools to "select" all portals within a closed polygon or touching a multi-line or falling within a circle. Then any plugin could set a menu item for actions on the "selection".

Yannisiman commented 8 years ago

chrislennon made the polygon selection fly links plugin.

https://github.com/chrislennon/IITCPlugins

Seraphli commented 6 years ago

I manage to update chrislennon's tweak and implement ray cast algorithm. Here is an example. https://github.com/Seraphli/IITCPlugins