I have an GMSOverlay in a GMSMapView, so I listen to taps into it with the method:
func mapView(_ mapView: GMSMapView, didTap overlay: GMSOverlay) {
// Overlay was tapped
}
Then I want a GMSMarker to be painted over the GMSOverlay, and I listen to taps into it with the method:
func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool {
// Marker was tapped
return false
}
Every time the listener of the marker is called, its info window hides (if it's shown) or shows (if it's hidden).
The problem is that the listener of the marker is not called every time I tap it.
Step by step:
Tap in the marker:
- The info window shows because the listener of the marker is called.
- The listener of the overlay is not called.
Tap in the marker:
- The info window doesn't hides (it should) because the listener of the marker is not called.
- The listener of the overlay is called (it shouldn't).
Tap in the marker:
- The info window hides because the listener of the marker is called.
- The listener of the overlay is not called.
Tap in the marker:
- The info window doesn't show (it should) because the listener of the marker is not called.
- The listener of the overlay is called (it shouldn't).
Tap in the marker: step 1.
Tap in the marker: step 2.
Tap in the marker: step 3.
Tap in the marker: step 4.
... and so on ...
In brief: