Road with traffic on MKMapView

I have a question about the MKMapView component. I saw that on the native "Map" iOS app, we can draw the roads between different points and we can display the traffic for those roads. Well, that's exactly what I want to do for my app :)

So, I have two questions :

1) Firstly, how can I draw roads on a map. I read a lot of things about MKOverlay, about some samples which do that with JavaScript in UIWebView but what's the best way to do this ?

2) How can I know the traffic on a particularly road ? In order to draw the road in green, orange or red.

Thanks a lot !

Regards, Sébastien ;)

Upvotes: 2

Views: 1424

Answers (1)

voromax
voromax

Reputation: 3389

Unfortunately by now CLGeocoder class from iOS 5 is just supporting to process address to geolocation transformation and reverse. It means to find address around the geocode you have or to find geocode of the address you provide. There are no possibilities access road graph to create routes (to select and draw roads precisely) and moreover to control traffic on the exact place. The only things you can do with standard tools is to draw overlays on the MKMapView with your own data.

To achieve the results you want I would offer to use the third party resources, Google Maps API for example, and use UIWebView to present a customized map. Google Maps JavaScript API v3 TrafficLayer

Upvotes: 1

Related Questions