views:

241

answers:

1

I've seen the answers for opening the Maps app in a native iPhone app, but is there any way to do this in a web app? I've tried changing window.location to http://maps.google.com/maps?q=cupertino for example, to no avail. I've tried using a simple anchor tag linked to http://maps.google.com/maps?q=cupertino, also to no avail. Has anyone gotten this to work before? I'm working on a map-heavy application, and I'd like to provide users with directions at the end. I figured it would be easiest to simply open it up in the Map application.

Note: I'm currently testing with just the simulator, could that lead to problems? My iPhone is down for the count at the moment.

A: 

You can do this by implementing the delegate methods of the UIWebView to intercept URLs loaded for links that are being clicked on. You can then handle those URLs yourself by for example opening a MKMapView or opening the Maps application.

This blog article has some examples on how to do that:

http://webbuilders.wordpress.com/2009/04/10/opening-google-map-from-uiwebview/

St3fan
I'm working with a _web_ app, so I do not have access to UIWebView
munchybunch