2
votes

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?

1

1 Answers

3
votes

I'd suggest using MapKit framework (introduced in SDK 3.0) that uses google maps services. MKMapView and other classes will provide all functionality you want without the need to mess with java-script:

  1. Displaying google maps
  2. Showing and tracking user location
  3. Easy converting between view coordinates and geo coordinates (see convertPoint:toCoordinateFromView: and convertCoordinate:toPointToView: functions)
  4. Creating and showing custom map markers
  5. Reverse geocoding
  6. etc. :)