iphone - Enlage MKCoordinateRegionForMapRect For some margin -
i have annotations presented on map (somepoints) map zooms in or out fit points - see working code below.
mkpolygon *poly = [mkpolygon polygonwithpoints:somepoints count:i]; [self.mapview setregion:mkcoordinateregionformaprect([poly boundingmaprect]) animated:no]; q: expand poly have margins, how can enlarge region?
you can increase span of region in order add margin:
mkcoordinateregion region = mkcoordinateregionformaprect([poly boundingmaprect]); region.span.latitudedelta *= 1.2; // increase span 20% add margin region.span.longitudedelta *= 1.2; [self.mapview setregion:region animated:yes];
Comments
Post a Comment