I have Implement customization in map. In which I have created cluster of pin and when click on pin a custom Info Window need to be open. After spending couple of hours I found that the issue is that need to set InfoWindowAdapter in clustermanager. But the clustermanager doesn't contain "MarkerCollection" which is available in Xamarin but not in maui.
clustermanager.MarkerCollection.SetOnInfoWindowAdapter(infoWindow);
In below code
public voidpublic void OnMapReady(GoogleMap googleMap)
{
clustermanager = new ClusterManager(Platform.CurrentActivity, googleMap);
googleMap.SetOnCameraIdleListener(clustermanager);
googleMap.SetOnMarkerClickListener(clustermanager);
var cuslterrenderer = new ClusterRenderer(Platform.CurrentActivity, googleMap, clustermanager)
{
MinClusterSize = 4,
};
clustermanager.Renderer = cuslterrenderer;
// clustermanager.MarkerCollection.SetOnInfoWindowAdapter(infoWindow);
googleMap.SetInfoWindowAdapter(clustermanager.MarkerManager);
googleMap.SetOnInfoWindowClickListener(clustermanager);
_handler._clusterManager.SetOnClusterItemInfoWindowClickListener(infoWindowClickListener);
if (pins.Count > 0)
{
clustermanager.AddItems(pins);
}
}
Maui handler should contain all the native methods which was available in Xamarin.
Is any alternative to fix this? I refer this url but didn't found any help https://github.com/googlemaps/android-maps-utils/issues/738
ClusterManager is coming from <PackageReference Include="GoogleMapsUtils.Android.Maui" Version="1.0.2">
MAUI version is 8.0.100
Android Platform API level is 34