views:

377

answers:

1

Hi folks,

By the time you finish reading this question, it will become obvious to you that I'm pretty new to this development. But I've got a quick question here. I think I (unfortunately, sorta) know the answer, but I figured I'd ask, anyway:

I'm working on an app in which I'd like to display traffic data from Google Maps into a map. Easy enough, it seems. I can easily put the a MKMapView and center it on the desired location. I can also create a custom Google Maps API that I can look at on my browser, and it would display the traffic data with the GTrafficOverlay object.

Now...

Can I use the API traffic data (in Javascript) and parse it into the MKMapView implementation? I don't think so... right?

So, my only other option is to do a UIWebView instead, right? I just link to that page, and I'm good to go.

Also... Is there a major drawback to doing that? I know I lose a bit of the built-in interface, but beyond that, it doesn't seem to be that huge a difference, right?

And, also, if I want to use that Google Code API, how do I implement it in place? Do I have to have that HTML file somewhere in a server, or can I have it as part of my resources, or what?

Sorry about all the questions, but thanks in advance for any suggestions y'all might have!

A: 

You can't parse the javascript into the MKMapView implementation directly.

Yes you can use a UIWebView. I've only had a brief look at that, and it was pretty nasty with default behaviour, because both the web view and the map view try to respond to drag events etc. There is probably a way of tuning that out - you would want to look for SDK2.x examples as there was no other maps solution then.

This post may also provide a lot of help.

Andiih