I am working on a project (iOS 7 platform) in which I need a current location with stores of about 5 km, therefore, how to calculate the span / region value to display all stores with the current location on the map.
MKMapRect zoomRect = MKMapRectNull; double inset; for (id <MKAnnotation> annotation in mapVW.annotations) { MKMapPoint annotationPoint = MKMapPointForCoordinate(annotation.coordinate); MKMapRect pointRect = MKMapRectMake(annotationPoint.x, annotationPoint.y, 0.1, 0.1); zoomRect = MKMapRectUnion(zoomRect, pointRect); inset = -zoomRect.size.width * 20; } [mapVW setVisibleMapRect:MKMapRectInset(zoomRect, inset, inset) animated:YES];
that's what i am trying
thanks
objective-c
Vidhi raichura
source share