¡@

Home 

2014/10/15 ¤U¤È 10:14:01

iphone Programming Glossary: setvisiblemaprect

MKMapView setRegion “snaps” to predefined zoom levels?

http://stackoverflow.com/questions/3612007/mkmapview-setregion-snaps-to-predefined-zoom-levels

fits the map's frame but it returns the region that corresponds to the next higher predefined zoom level instead. setVisibleMapRect behaves similarly. Any further insight or information would be appreciated. I found these related posts but neither included..

Restrict MKMapView scrolling

http://stackoverflow.com/questions/4119117/restrict-mkmapview-scrolling

regionDidChangeAnimated BOOL animated if manuallyChangingMapRect prevents possible infinite recursion when we call setVisibleMapRect below return theOverlay below is a reference to your MKOverlay object. It could be an ivar or obtained from mapView.overlays.. if widthRatio 0.6 heightRatio 0.6 adjust ratios as needed manuallyChangingMapRect YES mapView setVisibleMapRect theOverlay.boundingMapRect animated YES manuallyChangingMapRect NO else if theOverlay intersectsMapRect mapView.visibleMapRect.. mapView.visibleMapRect Overlay is no longer visible in the map view. Reset to last good map rect... mapView setVisibleMapRect lastGoodMapRect animated YES I tried this with the built in MKCircle overlay and seems to work well. EDIT It does work..

MKMapRect zooms too much

http://stackoverflow.com/questions/8465149/mkmaprect-zooms-too-much

0 1000 if MKMapRectIsNull zoomRect zoomRect pointRect else zoomRect MKMapRectUnion zoomRect pointRect mapView setVisibleMapRect zoomRect animated YES But my problem is that when the annotations are close to each other it zooms too much as the rectangle.. minMapWidth y minMapHeight 2 h minMapHeight 2 needChange YES if needChange zoomRect MKMapRectMake x y w h mapView setVisibleMapRect zoomRect animated YES EDITED double minMapHeight 250 choose some value that fit your needs double minMapWidth 250 the same..