-
Notifications
You must be signed in to change notification settings - Fork 104
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
Comments
player-tracker code is not great. E.g. this part currently seems do nothing:
Similar code is hereingress-intel-total-conversion/plugins/player-activity-tracker.user.js Lines 404 to 407 in 256f9c5
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).
Also we could use tooltips with portal markers, to display To avoid tooltip overlapping: https://github.com/ZijingPeng/leaflet-tooltip-layout |
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? |
My player tracker add-on plugin already adds permanent player names as labels to the markers. |
@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 👍 |
@xscreach thanks! I'll check it. |
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:
player-tracker
The text was updated successfully, but these errors were encountered: