In an iPhone application I’m developing I need to get GPS coordinates to perform some actions based on the values received. Users should have two possibilities of giving the location:
- automatically from iPhone build-in GPS
- by finding a specific point on a map (Google Maps)
I know how to user CLLocationManager to get current position coordinates and I know how to add Google Maps using JS API. What I would like to know if how can I get coordinates for a specific point on a map that user clicks. Is that possible with UIWebView or is there any other way of getting the values I need?
I’d suggest using MapKit framework (introduced in SDK 3.0) that uses google maps services.
MKMapViewand other classes will provide all functionality you want without the need to mess with java-script:convertPoint:toCoordinateFromView:andconvertCoordinate:toPointToView:functions)