views:

1010

answers:

6

Is there any way for a web application to access the location data of an iPhone without the installation of an additional iPhone client app?

If not, the next best thing would be if any can recommend an existing native app, preferably free to the end user and as lightweight as possible, that does expose this information to Mobile Safari.

+1  A: 

I don't think this is possible. MobileSafari does not expose this information.

rpetrich
A: 

There is not. At the very least you will have to implement your own UIWebView based application, read the location from CLLocationManager and inject it into the WebView.

A good starting point is the iPhone-google-maps-component. it...

... uses a UIWebView in the background to load the HTML/Javascript version of Google Maps, and offers a set of Objective-C methods that mimic a subset of the original Javascript methods for controlling the map. It currently supports setting the center location, and zooming & panning using the touch interface

Roger Nolan
A: 

For jailbroken phones Locatable is exactly what you describe, it is available on cydia and very simple to integrate server-side.

Martin
A: 

PhoneGap takes an interesting approach, providing a native wrapper that allows Javascript access to hardware features. It's not exactly the answer to my question, but it is interesting in its own right, and it may end up getting the job done.

Abie
+2  A: 

Yes, in iPhone OS 3.0.

Abie