I am new in xamarin forms I want to add a json layer in a button click in my map.How can I do this.I am tried with a dependency for adding json layer.I using using Xamarin.Forms.GoogleMaps for creating map.
Please help me...
Here is my code
private void Close_Tapped(object sender, EventArgs e)
{
try
{
var _IIGeoJsonLayer = DependencyService.Get<IGeoJsonLayer>();
_IIGeoJsonLayer.AddLayerJson();
}
catch (Exception ex)
{
}
}
Here is my Dependency Service
public void AddLayerJson()
{
GoogleMap gmap =null;
GeoJsonLayer layer = new GeoJsonLayer(gmap, Resource.Raw.jsonFile, Android.App.Application.Context);
layer.AddLayerToMap();
}