ingress-intel-total-conversion icon indicating copy to clipboard operation
ingress-intel-total-conversion copied to clipboard

Consider using Leaflet.Tooltip

Open johnd0e opened this issue 6 years ago • 7 comments

Since Leaflet 1.0 there is buildin L.Tooltip functionality, which can be more powerful than IITC's own custom tooltips.

For example, it could be used in player-tracker in order to provide (optionally) permanent labels for players' nicks.

I saw some plugins capable of that, but their implementations are far from perfect (main issue: overlapping labels).

Some ideas where we may use tooltips:

  • [ ] Portal info tooltip #195
  • [ ] Portal permanent label (as replacement for portal-names plugin)
  • [ ] Players' nicks for player-tracker

johnd0e avatar Dec 16 '18 14:12 johnd0e

For example, it could be used in player-tracker in order to provide (optionally) permanent labels for players' nicks.

player-tracker code is not great. E.g. this part currently seems do nothing:

https://github.com/IITC-CE/ingress-intel-total-conversion/blob/256f9c53a866a254b40e40b1f766e58b4d2a89f4/plugins/player-activity-tracker.user.js#L50-L55

Similar code is here

https://github.com/IITC-CE/ingress-intel-total-conversion/blob/256f9c53a866a254b40e40b1f766e58b4d2a89f4/plugins/player-activity-tracker.user.js#L404-L407

And here and there I see workaround if form of force calling closeIconTooltips

https://github.com/IITC-CE/ingress-intel-total-conversion/blob/256f9c53a866a254b40e40b1f766e58b4d2a89f4/plugins/player-activity-tracker.user.js#L81-L89

I suppose that using leaflet native tooltips instead of jQueryUI would be much easier and do not require any special handling, we just need bindTooltip here: https://github.com/IITC-CE/ingress-intel-total-conversion/blob/256f9c53a866a254b40e40b1f766e58b4d2a89f4/plugins/player-activity-tracker.user.js#L389

But as for initial intention (bindTooltip with permanent: true option on every marker) then we should consider to apply special tooltips styling (default is not good for dense areas).

johnd0e avatar Mar 27 '19 10:03 johnd0e

Also we could use tooltips with portal markers, to display title if available (or some other info in concise form).

To avoid tooltip overlapping: https://github.com/ZijingPeng/leaflet-tooltip-layout

johnd0e avatar Mar 27 '19 10:03 johnd0e

Hi @modos189, I just had the idea of showing agent names in player tracker, and I found this open issue. Do you think I should try to write some code for it?

Gollam avatar Jun 18 '23 06:06 Gollam

My player tracker add-on plugin already adds permanent player names as labels to the markers. https://softspot.nl/ingress/plugindetails/iitc-plugin-player-tracker-addon This plugin adds Leaflet.iconlabel: https://github.com/jacobtoye/Leaflet.iconlabel

DanielOndiordna avatar Jun 18 '23 09:06 DanielOndiordna

@DanielOndiordna thanks! I still think this would be a useful optional feature to contribute into the official plugin :) also I think it would be useful to display the machina movement (e.g. with white icon), also optionally.

Gollam avatar Jun 18 '23 11:06 Gollam

@DanielOndiordna thanks! I still think this would be a useful optional feature to contribute into the official plugin :) also I think it would be useful to display the machina movement (e.g. with white icon), also optionally.

Imho a good idea 👍 Just note that Machina movement is handled by machina-tracker plugin 😉

xscreach avatar Jun 18 '23 11:06 xscreach

@xscreach thanks! I'll check it.

Gollam avatar Jun 18 '23 11:06 Gollam