简体   繁体   中英

iPhone:Mapview move pin issue

I have Mapview and I successfully plot all pins on map and when I select a pin also add one button which is rightCalloutAccessoryView and when I click on button at that time I want to move all pins and selected pin display in center of mapview so please give me idea to develop this functionality..

Sorry for bad English.

Thanks in advance.

When the button is pushed, calculate the latitude/longitude range of all your pins, make an MKCoordinateRegion based on that, then use the MKMapView

- (void)setRegion:(MKCoordinateRegion)region animated:(BOOL)animated

To zoom to that region.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM