Search code examples
iphonedrawingmapkitcllocation

Drawing route for two points on mapkit


I'm doing an iphone app concerning geolocation. Its working fine with mapkit and cllocation, now I want to draw a path for two points on the map, I dont need to be aware of streets or stuff like this, i only want to connect graphically an array of points that i already have.. How can i do this?


Solution

  • to extend onto user's comment, you can have overlays and annotations. check out this for an example of polyline overlay.

    basically you would leave your viewForAnnotations method alone and let it draw your placemarks. then you would have a viewForOverlay and let it draw any shapes like polylines onto your map. this is much cleaner and quicker than drawing a route in a custom annotation like we had to do prior to apples adding of MKOverlayViews