Note that there are some explanatory texts on larger screens.

plurals
  1. POCustom InfoWindowAdapter is not calling from onMarkerClick()
    primarykey
    data
    text
    <p>I set <code>CustomInfoWindow</code> to call when user click on maker. I do not call it when create <code>Map</code> but call only when user clicks on a <code>Marker</code>.</p> <p>I have different overlays and those has different infoWindows implementation Overlay class build the <code>infoWindow</code> like below.</p> <pre><code>public void onTap(AndroidMapOverlayItem item) { String overlayType = ""; googleMap.setInfoWindowAdapter(new InfoWindowAdapter() { /* * some code to find overlayType */ @Override public View getInfoWindow(Marker marker) { return null; } @Override public View getInfoContents(Marker marker) { if ("mylocation".equalsIgnoreCase(overlayType)) { // set title ((TextView)infoWindow.findViewById(R.id.title)).setText("Title"); // set distance ((TextView)infoWindow.findViewById(R.id.text)).setText(display); } return infoWindow; } }); } </code></pre> <p>Below is my activity class that pick the user clicks and find the which marker. Based on the marker I call its relevant overlay class. That overlay class has what information to show in infowindow. Activity class.</p> <pre><code>googleMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap(); googleMap.setOnMarkerClickListener(this); @Override public boolean onMarkerClick(final Marker marker) { Log.d(TAG,"Inside onMakerClick "+marker); /* * find the relevant overlay class and try to fire it's onTap event. * onTap event has what needs to be done with specific marker. * Different marker has different information to show. * */ overlay.onTap(overlayItem); return true; } </code></pre> <p>This I wanted because when I set CustomInfowindow at first instance all the markers shows the same infomation.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload