Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using Leaflet.Tooltip #28

Open
3 tasks
johnd0e opened this issue Dec 16, 2018 · 7 comments
Open
3 tasks

Consider using Leaflet.Tooltip #28

johnd0e opened this issue Dec 16, 2018 · 7 comments
Labels
development general development issue enhancement New feature or request

Comments

@johnd0e
Copy link
Contributor

johnd0e commented Dec 16, 2018

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 Portal tooltip #195
  • Portal permanent label (as replacement for portal-names plugin)
  • Players' nicks for player-tracker
@johnd0e johnd0e added the development general development issue label Jan 23, 2019
@johnd0e
Copy link
Contributor Author

johnd0e commented Mar 27, 2019

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:

if(obj.layer === plugin.playerTracker.drawnTracesEnl || obj.layer === plugin.playerTracker.drawnTracesRes) {
obj.layer.eachLayer(function(marker) {
if(marker._icon) window.setupTooltips($(marker._icon));
});
}
});

Similar code is here

// jQueryUI doesn’t automatically notice the new markers
if (!isTouchDev) {
window.setupTooltips($(m._icon));
}

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

// force close all open tooltips before markers are cleared
window.plugin.playerTracker.closeIconTooltips = function() {
plugin.playerTracker.drawnTracesRes.eachLayer(function(layer) {
if ($(layer._icon)) { $(layer._icon).tooltip('close');}
});
plugin.playerTracker.drawnTracesEnl.eachLayer(function(layer) {
if ($(layer._icon)) { $(layer._icon).tooltip('close');}
});
}

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:

var m = L.marker(gllfe(last), {icon: icon, referenceToPortal: closestPortal, opacity: absOpacity, desc: popup[0], title: tooltip});

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
Copy link
Contributor Author

johnd0e commented Mar 27, 2019

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 johnd0e added the enhancement New feature or request label Mar 27, 2019
@Gollam
Copy link

Gollam commented Jun 18, 2023

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
Copy link

DanielOndiordna commented Jun 18, 2023

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
Copy link

Gollam commented Jun 18, 2023

@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
Copy link
Contributor

@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
Copy link

Gollam commented Jun 18, 2023

@xscreach thanks! I'll check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development general development issue enhancement New feature or request
Projects
Development

No branches or pull requests

4 participants