Android - Get Click Map Overlay Event

I have a MapView with Overlays, like this:

public class MyMapActivity extends MapActivity { private MapItemizedOverlay itemizedOverlay; @Override public void onCreate(Bundle savedInstanceState) { for(a loop to put all 10 datas into overlay) { OverlayItem overlayitem=new OverlayItem(some params); overlayitem.setMarker(some bitmap); itemizedOverlay.addOverlay(overlayitem); } mapView.getOverlays().add(itemizedOverlay); } } public class MapItemizedOverlay extends ItemizedOverlay<OverlayItem> { //some code @Override protected boolean onTap(int index) { //Here I know what marker been clicked... } } 

I know that I get which marker was clicked in the MapItemizedOverlay class. But how can I use this in my MapView? What I want, I show a balloon tip when OverlayItem is clicked, as here Show a popup above the map marker in MapView .

I beg you, I do not know what to do at all ...

Many thanks.

+6
source share
1 answer

Got it. Used this great project. works like a charm:

https://github.com/jgilfelt/android-mapviewballoons

Just check both the project and the example.

+5
source

Source: https://habr.com/ru/post/887359/


All Articles