Pregunta

I have a working MKTileOverlay and MKPolyline on my MKMapView but need to update the polyline every second or so. I do this currently by removing the old line and adding a new one with the next point added. At the moment this does work but causes the tiles of the MKTileOverlay to be reloaded. Is it possible to have a mutable polyline or replace it without reloading all of the tiles?

¿Fue útil?

Solución

Similar to [UIView drawRect:], the new MKTileOverlayRenderer descends from MKOverlayRenderer and has rect-based screen updates. So you could figure out the start point of your mutable segment addition, the end point, and use those as opposite corners on an MKMapRect which should be refreshed. That is, you'd just refresh the overlay tile(s) involved with the new segment, not the whole path.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top