Title: Label Marker
Last modified: July 20, 2020

---

# Label Marker

 *  Resolved [chris7711](https://wordpress.org/support/users/chris7711/)
 * (@chris7711)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/label-marker/)
 * Is there at least a possibility to add a label to a marker? The ID or name…
    
   The plugin is really nice, but when having 5 different users on one map, it is
   impossible to know who is who.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [tinuzz](https://wordpress.org/support/users/tinuzz/)
 * (@tinuzz)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/label-marker/#post-13206923)
 * Hi,
 * Can you clarify what exactly you have in mind for a ‘label’?
 * Best regards,
    Martijn.
 *  Thread Starter [chris7711](https://wordpress.org/support/users/chris7711/)
 * (@chris7711)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/label-marker/#post-13213618)
 * 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](https://wordpress.org/support/users/tinuzz/)
 * (@tinuzz)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/label-marker/#post-13216147)
 * 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.
 *  Thread Starter [chris7711](https://wordpress.org/support/users/chris7711/)
 * (@chris7711)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/label-marker/#post-13217890)
 * 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.
 *  Thread Starter [chris7711](https://wordpress.org/support/users/chris7711/)
 * (@chris7711)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/label-marker/#post-13233913)
 * Can be closed, it is working now 🙂
 *  Plugin Author [tinuzz](https://wordpress.org/support/users/tinuzz/)
 * (@tinuzz)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/label-marker/#post-13234406)
 * 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](https://github.com/tinuzz/wp-plugin-trackserver/issues)
 * Cheers,
    Martijn.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Label Marker’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/trackserver.svg)
 * [Trackserver](https://wordpress.org/plugins/trackserver/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/trackserver/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/trackserver/)
 * [Active Topics](https://wordpress.org/support/plugin/trackserver/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/trackserver/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/trackserver/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [tinuzz](https://wordpress.org/support/users/tinuzz/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/label-marker/#post-13234406)
 * Status: resolved