Menu

#24 Display only last location pushpin (with solution)

open
nobody
None
5
2011-12-08
2011-12-08
Anonymous
No

As explained in one issue (http://sourceforge.net/tracker/?func=detail&aid=3432148&group_id=169519&atid=850686), I have a quite simple and elegant solution for the problem of having too many pushpins on the screen. This looks quite ugly already when the device is moving but especially when its stopped. Then you'll have a bunch of pushpins ovelapping.

I solved this by a few changes in the JS script OpenLayers.js. The idea is to assign a value "visible" to each pushpin. The last puspin is always visible, the is not.

If a pushpin is not visible its opacity is set to zero which makes it disappear but keeps it responsive for hover events (if you set display: none, it will not receive events). When hovering over the route, the pushpin will be displayed and hidden again, on "mouseout",

I have the source file attached as well as the diff to the previous version in SVN. But this diff might not work because I might have changed something else before. Never the less, it should help to see which source lines I have changed.

Discussion

  • Nobody/Anonymous

    The modified version including the solution.

     
  • YanXu

    YanXu - 2011-12-08

    Duplicate of Issue 3454358.