Forum Cross Platform with Xamarin

Xamarin.Forms.GoogleMaps MapRenderer is not triggering

I have the below renderer:

[assembly: ExportRenderer(typeof(Map), typeof(MarkerClusterRenderer))]
namespace SamplingApp.Droid.CustomRenderers
{
public class MarkerClusterRenderer : MapRenderer
{
ClusterManager _clusterManager;

    protected override void OnMarkerCreated(Pin outerItem, Marker innerItem)
    {
        base.OnMarkerCreated(outerItem, innerItem);
        AddToMarkerCluster();
    }
    protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
    {
        base.OnElementPropertyChanged(sender, e);
    }
    protected override void OnElementChanged(ElementChangedEventArgs<Map> e)
    {
        base.OnElementChanged(e);
    }

    public void AddToMarkerCluster()
    {
        _clusterManager = new ClusterManager(Android.App.Application.Context, NativeMap);
        //[do other things here]
    }

}

}

of the overrides get triggered Whille map load. Am i doing anything wrong? (I want to make custom renderer for native map Not a CustomMap that inherit Map Class.)
Or their is any alternative method to use Map MarkerClustering From PCL project? ( I dont want to create a CustomMap coz it will lead me to rewrite lot of codes, since they are already written.

Since i am new at Xamarin, a little Help is appriciated.
Thank you

Sign In or Register to comment.