Search code examples
objective-cuibezierpathmkpolygon

Convert MKPolygon to UIBezierPath


Is there a way to convert an MKPolygon to a UIBezierPath? I have an MKPolygon that is using latitude and longitude coordinates to make up its points. How would those latitude/longitude coordinates translate to coordinates on a UIView?


Solution

  • MKPolygon *myPolygon;
    
    MKPolygonView *polygonView = [[MKPolygonView alloc] initWithPolygon:myPolygon];
    
    UIBezierPath *myBezierPath = [UIBezierPath bezierPathWithCGPath:polygonView.path];