Plugin Author
tinuzz
(@tinuzz)
Hi,
Can you clarify what exactly you have in mind for a ‘label’?
Best regards,
Martijn.
With label I meant the same thing as with the popups. So that the name is visible all the time and over each dot a name (a label) is seen
Plugin Author
tinuzz
(@tinuzz)
Isn’t this actually the same question as in the other topic?
While this isn’t in Trackserver right now, it’s really easy to accomplish.
In trackserver.js, find the infobar code, which looks something like this in summarized form:
if (mymapdata.is_live) {
if (track_id == follow_id) {
if (mymapdata.infobar) {
if (alltracks && alltracks[track_id]) {
metadata = alltracks[track_id].metadata;
}
else {
metadata = _this.get_mydata(div_id, track_id, 'metadata');
}
...
mymapdata.infobar_div.innerHTML = infobar_text;
}
}
}
If you pull the metadata assigment two levels up, you can very easily add a tooltip to the end_marker:
if (mymapdata.is_live) {
if (alltracks && alltracks[track_id]) {
metadata = alltracks[track_id].metadata;
}
else {
metadata = _this.get_mydata(div_id, track_id, 'metadata');
}
if (track_id == follow_id) {
if (mymapdata.infobar) {
...
mymapdata.infobar_div.innerHTML = infobar_text;
}
}
}
end_marker.bindTooltip(metadata.userlogin).openTooltip();
That last line adds a tooltip with the user’s login name. You can als use the display name:
end_marker.bindTooltip(metadata.displayname).openTooltip();
or any other information that is available in the metadata.
Does that help?
Best regards,
Martijn.
Thank you for the reply.
I guess that’s very easy if you are good with javascript ;), I am not…
I tried to change that how I understand it from above, now the map isn’t showing anymore. However, I think it is my fault and I changed trackserver.js how I understood it from above, but it seems I haven’t understood it :)).
I changed the file again to the original and the map is back.
Can be closed, it is working now 🙂
Plugin Author
tinuzz
(@tinuzz)
Glad you got it working! If you still want me to add this to Trackserver, please create e feature request issue on Github.
https://github.com/tinuzz/wp-plugin-trackserver/issues
Cheers,
Martijn.