MKOverlay View is blurred

前端 未结 3 774
醉梦人生
醉梦人生 2021-01-15 02:52

I\'m trying to add a png image as a custom map using MKOverlayView. I\'m almost there - I am able to get the image lined up in the right place, and I know that the -drawMapR

相关标签:
3条回答
  • 2021-01-15 03:35

    Thanks Rob, you made my day. My blur overlay image got sharpen when I replaced

    CGContextScaleCTM(context, 1.0, -1.0);
    

    with

    CGAffineTransform flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, theRect.size.height);
    CGContextConcatCTM(context, flipVertical);  
    
    0 讨论(0)
  • 2021-01-15 03:41

    Get rid of CGContextScaleCTM(context, 1.0, -1.0); and do a vertical flip on your image in preview instead. the mapkit seems to use the context information to determine which part of the image to render more clearly. Know it's been a while, but hope it helps!

    0 讨论(0)
  • 2021-01-15 03:43

    I've had a similar problem. The problem was that my boundingMapRect was defined incorrectly. The full image is rendered scaled down when the scale is small on a tile. Then the map is zoomed and not all the image tiles are in the boundingMapRect tiles so they are not redrawn in the correct scale and the scaled down version is zoomed. At least that's what I think happens.

    Hope this helps.

    0 讨论(0)
提交回复
热议问题