Search code examples
androidoverlayinfowindowosmdroid

osmdroid bonuspack show infowindow


I tried to relate osmdroid bonuspack's infowindow to a polygon in a mapview. The purpose is that when a polygon is touched, I need to show some info about that polygon. I had a look at some examples but all of them were used with ExtendedItemizedOverlay.

is it possible to relate infowindow with my custom overlay class which includes a list of polygones.

thanks in advance.


Solution

  • Inside the Tutorial_1 you can see how to add InfoWindows:

    https://code.google.com/p/osmbonuspack/wiki/Tutorial_1

    Also, i've done a little tutorial to make them clickable quickly.

    http://mobiledevstories.wordpress.com/2014/03/01/osmdroid-bonus-pack-markers-with-clickable-infowindows/

    What i would do to suit your needs is to modify the layout inside bonuspack_bubble.xml and include the TextViews with the additional info you need. If you need a reference to a Polygon or another object in the map, just modify the MyInfoWindow constructor to receive the desired objects.

    hope it helps!!