With a cluster manager, not all markers are instantiated at the same time and so the markers cannot be passed to the InfoWindow. However, the InfoWindow only uses the marker's position, so we can generalise the InfoWindow implementation and use the position directly.
It's great that you noticed this. We appreciate your work. Please update the javadoc with your changes and create a pull request to the develop branch.
Thank you :)
This changes the InfoWindow to use
LatLng
instead ofMarker
in order to make it interactive InfoWindows possible for markers that are managed by a ClusterManager (https://developers.google.com/maps/documentation/android-api/utility/marker-clustering).With a cluster manager, not all markers are instantiated at the same time and so the markers cannot be passed to the InfoWindow. However, the InfoWindow only uses the marker's position, so we can generalise the InfoWindow implementation and use the position directly.