I'm attempting to create a method where I can pass a LatLng parameter so I can add circles over top of multiple areas on a map. Below is a test method of what I'm going for. I have reviewed the Xamarin and Google documentation for the Shapes overlays, but I am unable to get this code to actually display the Circle shape on the map. Currently I do not have a parameter passing into the method while I'm testing with it. Same story goes for the radius. I'm certainly going to scale it down once it is working...
private void AddCircleToMap()
{
CircleOptions circleOptions = new CircleOptions ();
circleOptions.InvokeCenter(new LatLng (0, 0));
circleOptions.InvokeRadius(5000);
circleOptions.InvokeFillColor(Android.Graphics.Color.Blue);
Circle newCircle = _map.AddCircle(circleOptions);
newCircle.Visible = true;
}
I'm calling the method after the other test markers have been created within the SetupMapIfNeeded() method. The end result currently is that the other markers from the example code will display as they always have, but my new method to insert a test Circle will not.
//INITIAL DECLARATIONS
private GoogleMap _map;
private MapFragment _mapFragment;
private void SetupMapIfNeeded()
{
if (_map == null)
{
_map = _mapFragment.Map;
if (_map != null)
{
AddMonkeyMarkersToMap();
AddInitialPolarBarToMap();
AddCircleToMap();
}
}
}
Suggestions? Comments? I'd certainly appreciate any direction on it.