Show popup above map marker in MapView

The way I did is:

Put the markers at required GeoPoints by subclassing ItemizedOverlay, as described in

Create a popup View by inflating from the layout:

View popUp = getLayoutInflater().inflate(R.layout.map_popup, map, false);

Use MapView.LayoutParams to position the popup with respect to GeoPoint in the ItemizedOverlay< OverlayItem >::onTap method. Popup will scroll automatically (without any additional code) when user scrolls the map. Basically popup gets tied to a GeoPoint, if user zooms, popup’s position gets adjusted automatically.

MapView map = (MapView) findViewById(;   
MapView.LayoutParams mapParams = new MapView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, 
                        <x offset if required>,
                        <y offset like pinHeight>,
map.addView(popUp, mapParams);

Leave a Comment