I have many markers in GMSMapView
. I want to know which marker is tapped.
I know that there is - (BOOL)mapView:(GMSMapView *)mapView didTapMarker:(GMSMarker *)marker
delegate. But my problem is when i tap any marker, i will show different information for every marker in infoWindow
. So, i must know which marker is tapped.How can i do this?
When you create the marker, set its userData
property to an instance of your own class which stores data about the marker.
Then in didTapMarker
, you can get out the userData
property, cast it to your own type, and then extract the details you need.