Im using Google Map on Xamarin Android and iOS
Im trying to create a close polygon from random tap coordinates.
Android like:
var options = new PolygonOptions();
options.InvokeFillColor(int.Parse("80000000", System.Globalization.NumberStyles.HexNumber));
options.InvokeStrokeColor(int.Parse("000000", System.Globalization.NumberStyles.HexNumber));
options.InvokeStrokeWidth(2);
options.AddAll(listOfPosition); //list of tapped coordinates
googleMap.AddPolygon(options);
iOS like:
var polygon = new Polygon();
polygon.Path = path; // this is my list of tapped coordinates
polygon.StrokeWidth = 2;
polygon.StrokeColor = UIColor.Black;
polygon.FillColor = UIColor.FromRGBA(0, 0, 0, 0.3f);
polygon.Map = mapView;
Let say I have tapped coordinates randomly like this :
Debug|LOCATION:: 37.9115841998119 : -122.566957734525
Debug|LOCATION:: 37.9117754470967 : -122.561504803598
Debug|LOCATION:: 37.9085008969633 : -122.566276118159
Debug|LOCATION:: 37.9086561762004 : -122.562640719116
Debug|LOCATION:: 37.9102216477146 : -122.561550065875
Debug|LOCATION:: 37.9098513127501 : -122.567805983126
Debug|LOCATION:: 37.9123967989511 : -122.564518935978
How can I make it close polygon without intersecting lines inside even may tap coordinates reached 100 position data.? Any Idea or Computation? Thanks advance..