Rolando
Rolando

Reputation: 62634

iOS using GPS show the blue dot on an image?

How do I make a image, make it georeferenced and make it such that using the GPS, a blue dot appears where I am standing (assuming the image is there) in my iOS application. How do I approach this to georeference my image and accomplish this?

Upvotes: 0

Views: 273

Answers (2)

Nick Esposito
Nick Esposito

Reputation: 395

The steps I would take are as follows :

  1. Get the user's location using a location manager
  2. Capture the image
  3. Instead of saving it to the disk, copy the image to a new file named something like "imageprefix_(user location's latitude value)_(user location's longitude value).png"
  4. Put an MKMapView in your UIViewController and set [viewController.mapView showsUserLocation:YES]
  5. Show the image below, or above. In the future, if you're not at that location, use the latitude and longitude values from the title of the image to drop an annotation on your mapView

Good luck!

Upvotes: 0

Bill Burgess
Bill Burgess

Reputation: 14154

The only way to do this would be to use MKMapView. There is a property you can set, -showsUserLocation, that will show the blue dot you need.

If you need to show this over the top of a specific image... you will have to get creative with it. Maybe loading a custom image for an annotation. It can be done, just depends on how big of a map you plan to show and what your use case is. Hope this helps.

Upvotes: 1

Related Questions