IITC-CE / ingress-intel-total-conversion

intel.ingress.com total conversion user script with some new features. Should allow easier extension of the intel map.
https://iitc.app
ISC License
290 stars 109 forks source link

Consider using Leaflet.Tooltip #28

Open johnd0e opened 5 years ago

johnd0e commented 5 years ago

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:

johnd0e commented 5 years ago

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 commented 5 years ago

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

Gollam commented 1 year ago

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?

DanielOndiordna commented 1 year ago

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

Gollam commented 1 year ago

@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.

xscreach commented 1 year ago

@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 😉

Gollam commented 1 year ago

@xscreach thanks! I'll check it.