且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iPhone MapKit:带有图像的自定义MKPolygonView上下颠倒

更新时间:2023-02-01 18:30:27

已修复!这是完成工作的代码:

Fixed! This is the code that gets the job done:

-(void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context
{
    UIImage *image = [UIImage imageNamed:@"snowmap.png"];
    MKMapRect theMapRect = [self.overlay boundingMapRect];
    CGRect theRect = [self rectForMapRect:theMapRect];

    UIGraphicsPushContext(context);
    [image drawInRect:theRect blendMode:kCGBlendModeNormal alpha:1.0];
    UIGraphicsPopContext();
}