Ashutosh
Ashutosh

Reputation: 5742

Display location around current location?

In my map i need to display the locations which i am getting from a xml which are currently in a 200 mile radius from my current location. I have never done this thing before can you please suggest a way.

Thanks,

Upvotes: 1

Views: 451

Answers (2)

albertamg
albertamg

Reputation: 28572

Look into CoreLocation. Particularly, the method distanceFromLocation: of the CLLocation class will prove useful to find nearby locations. Use CLLocationManager to find out the current location.

Since you will most likely retrieve latitudes and longitudes from your XML, CLLocations initWithLatitude:longitude: will be handy to initialize CLLocation objects that you can later pass to distanceFromLocation:.

Upvotes: 2

Armand
Armand

Reputation: 10264

This will be the best site you ever visit http://www.raywenderlich.com/2847/introduction-to-mapkit-on-ios-tutorial

Upvotes: 1

Related Questions