0

We are working on MKOverlayView, below is the expected functionality:

An image has to be overlaid on the map and has to be tilted by a certain angle (bearing).

Issue: When the map is zoomed to the maximum level, one of the corners of the overlaid image is getting truncated. But, Complete image is coming back when zoom out a little bit. Please find the attached screenshot for reference.

enter image description here

chandvoid
  • 133
  • 1
  • 12

1 Answers1

0

I'm also getting overlaying text being clipped at any zoom level. What I noticed is that it clips at some vertical invisible lines. Those invisible lines, they look like as if they were the actual map tiles. What it still works is other overlays I have on the map, they don't get chopped.

This started to happen with iOS 10.

In the image, the building outlines –colored- are overlays that don't get clipped, but the text overlays (drawn using drawInRect) they do get chopped. Texts are Very Long text1 to see if it truncates, changing text1 for text2 and so forth.

enter image description here

carlos_ms
  • 838
  • 9
  • 15
  • It might be that now iOS10 calls the overlay renderer only for those overlays that intersect with ``MKPolygon``'s ``boundingMapRect`` and because my texts are represented with ``MKPolygons`` that have only one coordinate, my ``boundingMapRect`` has a zero size, so my custom overlay rendered is not being called for those overlays that don't intersect with that rectangle. This wasn't the case on iOS9. Could this be a bug on iOS10?. The **change** is not specified in the API documentation though. – carlos_ms Sep 28 '16 at 14:45
  • The workaround was to create a polygon with multiple points; starting with the original point, I created a rectangle that would contain my text, then used the vertices of that rectangle as the polygon points. The **con** with this workaround is that the rectangles don't shrink when zooming in/out the map but the outcome is the expected: texts are drawn without clipping and performance is not degraded. – carlos_ms Sep 29 '16 at 12:59