iPhone: Set Map zoom level on the base of distance
I want to set the zoom level of google map on the base of variable value so it show only part of map on start-up. Basically i want to show only surrounding area from user location.
For exam开发者_StackOverflow中文版ple if variable value is 30 mile, then map show only 30 mile surrounding area from current location and zoom in/out accordingly.
Create a MKCoordinateRegion
using the MKCoordinateRegionMakeWithDistance
function and pass it to the map view's setRegion:animated:
method.
Note that MKCoordinateRegionMakeWithDistance
requires meters so you'll need to convert the miles to meters first.
精彩评论