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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -