Is there a way to disable the pushpins?

  • Ivan Filgueiras

    Ivan Filgueiras - 2011-08-23

    Hello there,

    I want OpenGTS to display only the red path that it shows beneath the pushpins, and not them. Better yet: it would be perfect if I could achieve to make it display a pushpin only in the beginning and end of a given path.

    Is it possible without hacking the source code?

  • Ben Greenberg

    Ben Greenberg - 2011-08-23

    I don't have a definitive answer for you, but I think I can point you in the right direction.

    The private.xml file controls what pushpins are displayed on your map.

    My guess is that the easiest way to "disable" the pushpins is to create one or more pushpins that are all transparent, and set private.xml to show those pushpins for every event. You can use to edit one of the existing pushpins and save as a transparent png.

    It looks like there is a way to display a pushpin at the end of the path. In the comments in private.xml, it says there is a "last" key that will define the pushpin for the last point on the map. However, there isn't an equivalent "first" key.

    Remember, that whenever you make a change to private.xml you will need to re-compile and re-deploy track.war.

  • Ivan Filgueiras

    Ivan Filgueiras - 2011-08-23

    That's exactly the way that I will do it if it comes to this, but I was wondering if there is a cleaner way. In this method, the resources would still be there, although transparent.

    I want to remove the pushpins to lower the resource consumption of my page. My application has something like a point per second in the map. :(

  • Ronny H

    Ronny H - 2011-08-27

    I have the same problem like filgueirasivan. If the GPS device send data very often, there are to many pushpins on the map. But more points makes the position and route  precisely. For the future i think the better way is to display the drivers way in the first step. In the second step it must show the stop points with pushpins (who displays the stop duration). The last step is to display pushpins, but in dependency of the zoom level it doesnt need to display all track points with pushpins.

  • loki

    loki - 2013-07-01

    I am also facing the same problem like Ronny and filgueirasivan. Have anyone figured out how to show only starting and ending pushpins on the map.

  • Eric Budiman Gosno

    Hi loki
    if you want to just show only starting and ending pushpins on the map
    you can just simply filter pushpins on your jsmap.js or your_map.js(for me it's GoogleMapV3.js)

    In example, I will filter the pushpins in my GoogleMapV3.js's JSDrawPushpins function
    / draw pushpins now /
    var pushpinErr = null;
    for (var i = 0; i < drawPushpins.length; i++) {
    if(i > 0 && i < drawPushpins.length-1)continue; //My Add here just ignore another pushpins except first and last pushpins
    var pp = drawPushpins[i]; // JSMapPushpin
    try {
    this._addPushpin(pp); // JSMapPushpin
    } catch (e) {
    if (pushpinErr == null) { pushpinErr = e; }

    P.S. : I know in the programmer's point of view this is not a clean solution, I still working to find a cleaner solution
    so if anyone can give a cleaner solution, I'll really appreciate :)

    Last edit: Eric Budiman Gosno 2013-08-05

Log in to post a comment.