Question

i have a application which has 3 things in UIViewController

  1. MapView
  2. Search-control - (Ability to Search any Location in Map view)
  3. Slider - (minimum value 0km - Maximum value 50Km)

Now i have Searched one city Lets Say Barcelona . it will search using Geocode method and i got the latitude and Longitude of the Barcelona and i have added one annotation of red Pin which show title and sub locality in annotation click..

i want to calculate distance of Zoom in zoom out with in the Radius of that annotation in Kilometers. what are the best possible way to achieve this ? For e.g. i want to zoom around 30 km within that Radius

Any help will be greatly appreciated

No correct solution

OTHER TIPS

Calculate a MKCoordinateRegion with the searched point as the center and 30km(or whatever distance) as the radius, see this to do it. Set the map region to the calculated value using this method

setVisibleMapRect:animated:
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top