Search code examples
androiddictionaryz-axis

Android - Maps v2 - How to arrange z-axis of last marker drawn


Ive put together a tool in an app Im building that uses the v2 version of the maps on android and when markers are very close to one another they will draw ontop of one another which isnt a problem but what Id like to have happen at the least is for the last marker drawn to appear on the top.

Is there a way to make sure that the last marker drawn is shown on top of the rest or am I at the mercy of the systems decision making when it comes to showing markers that are to closely grouped together.


Solution

  • For now I just ended up using

    marker.showInfoWindow();
    

    It gives me the exact behavior I want which is keeping the last drawn marker to appear on the very top of the other markers on screen.

    On a side note it does open the info window but if I really wanted to I could just set a custom layout and make it null for the info window under a certain condition but for my needs it actually works out good that the window opens.