Meiji Meiji - 1 year ago 102
iOS Question

How do I convert an array of MKMapPoint values to a MKPolygon overlay

I have a list of

values and I'd like to be able to convert these to a
overlay. Is this possible?

List<MKMapPoint> pointsList = new List<MKMapPoint>();

I've tried the following, but it doesn't seem to work:

MKPolygon polygon = MKPolygon.FromPoints(pointsList);

I get the error:

Error: Argument 1: cannot convert from

Answer Source

Convert the list to an array by using .ToArray():

MKPolygon polygon = MKPolygon.FromPoints(pointsList.ToArray());

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download