I'm looking for a way to detect when a marker on Google map is deselected. I have a Sliding drawer, where the handle is invisible until the user clicks on the marker, and I want to make it invisible again once the marker is "deselected". I've tried with marker.isInfoWindowShown()
but I couldn't get it to work.
Click the marker to reveal the editing options. Click the "Delete" link in the lower-left corner of the dialog box.
Green – Vegetation, darker shades mean more dense. Tan – Sand & scrub, lighter shades mean less vegetation. White – Void of any vegetation, sand dunes, mountain peaks. Light Gray – Population areas, cities, suburbs. Medium Gray – Military areas.
Google Maps Blue Pins Are For Locations You Searched Near; For Example...
getId() function to retrieve marker id.
There is no event for info window disappearance, but you may work it around using
map.setOnMapClickListener(new OnMapClickListener() { ... });
and a couple of other "events" that make info window disappear. If you use marker.remove()
or marker.setVisible(false)
, they also make info window disappear when called on a marker that shows info window.
You will have to save markerShowingInfoWindow
reference (probably from OnMarkerClickListener
or InfoWindowAdapter
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With