I'm working on configuring a MKPolyLineView overlay for an MKMapView. It seems to be fairly straightforward. Create a Polyline object from an array of CoreLocation Coordinates, initalize the MKPolyLineView with the Polyline object, and then add the overlay object (which I believe you can get as a property from the MKPolyLineView object, due to it subclassing MKOverlayView) to the MKMapView.
What I'm hung up on is the MKMapView "setVisibleMapRect" method. I'd like to have the map center on the route overlay after it loads. I've looked at the MKOverlay protocol reference and there's a method there that would get exactly what I need: "boundingMapRect". Should I be able to call that on an overlay object itself (obtained from the MKPolyLineView)? Or is that more for if I was going to create a custom type of overlay?
MKOverlayPathView
MKOverlay Protocol Reference
EDIT:
Nevermind, I figured it out.
For those interested:
MKPolyline conforms to the MKOverlay protocol, so an MKPolyline object responds to boundingMapRect.
What I'm hung up on is the MKMapView "setVisibleMapRect" method. I'd like to have the map center on the route overlay after it loads. I've looked at the MKOverlay protocol reference and there's a method there that would get exactly what I need: "boundingMapRect". Should I be able to call that on an overlay object itself (obtained from the MKPolyLineView)? Or is that more for if I was going to create a custom type of overlay?
MKOverlayPathView
MKOverlay Protocol Reference
EDIT:
Nevermind, I figured it out.
For those interested:
MKPolyline conforms to the MKOverlay protocol, so an MKPolyline object responds to boundingMapRect.
Last edited by a moderator: