문제

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

올바른 솔루션이 없습니다

다른 팁

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:
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top