Note that there are some explanatory texts on larger screens.

plurals
  1. POSecond tap/click on marker doesn't call OnMarkerClickListener
    primarykey
    data
    text
    <p>I've added an OnMarkerClickListener to my map. When I tap on a marker, the OnMarkerClickListener gets invoked and displays an AlertDialog. But, if I cancel out of the AlertDialog and tap on the same marker a second time, the OnMarkerClickListener isn't called. Here's my OnMarkerClickListener:</p> <pre><code>googleMap.setOnMarkerClickListener(new OnMarkerClickListener() { @Override public boolean onMarkerClick(final Marker marker) { AlertDialog.Builder builder = new AlertDialog.Builder( DirectionsActivity.this); builder.setMessage(marker.getSnippet()); builder.setTitle(marker.getTitle()); builder.setPositiveButton("Open in Google Maps", new OnClickListener() { // ... } }); builder.setNegativeButton("Cancel", null); AlertDialog dialog = builder.create(); dialog.show(); return false; } }); </code></pre> <p>Simply moving or zooming the map allows me to make an additional click on the same marker. Because of this, if my OnMarkerClickListener.onMarkerClick returns <code>true</code> then the default handling, which includes centering the map on the clicked marker, is executed and I can make a second click on the same marker, but a third and subsequent clicks don't do anything. So the problem seems to be that a click on the same marker isn't being recognized until the map zoom or center changes.</p> <p>I'm not doing anything special with my markers except that I do have custom icons derived from bitmaps.</p> <p>Is anyone else having this problem? Anything I should check that I might be doing wrong? Or is this a known issue?</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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