首页 > 代码库 > MKMapView

MKMapView

Accessing Map Properties

@property(nonatomic) MKMapType mapType@property(nonatomic, getter=isZoomEnabled) BOOL zoomEnabled@property(nonatomic, getter=isScrollEnabled) BOOL scrollEnabled@property(nonatomic, getter=isPitchEnabled) BOOL pitchEnabled@property(nonatomic, getter=isRotateEnabled) BOOL rotateEnabled

 

Accessing the Delegate

@property(nonatomic, weak) id< MKMapViewDelegate > delegate

 

Manipulating the Visible Portion of the Map

@property(nonatomic) MKCoordinateRegion region@property(nonatomic) CLLocationCoordinate2D centerCoordinate@property(nonatomic) MKMapRect visibleMapRect- (void)setRegion:(MKCoordinateRegion)region animated:(BOOL)animated- (void)setCenterCoordinate:(CLLocationCoordinate2D)coordinate animated:(BOOL)animated- (void)showAnnotations:(NSArray *)annotations animated:(BOOL)animated- (void)setVisibleMapRect:(MKMapRect)mapRect animated:(BOOL)animate- (void)setVisibleMapRect:(MKMapRect)mapRect edgePadding:(UIEdgeInsets)insets animated:(BOOL)animate

 

Configuring the Map’s Appearance

@property(nonatomic, copy) MKMapCamera *camera@property(nonatomic) BOOL showsPointsOfInterest@property(nonatomic) BOOL showsBuildings- (void)setCamera:(MKMapCamera *)camera animated:(BOOL)animated

 

Displaying the User’s Location

@property(nonatomic) BOOL showsUserLocation@property(nonatomic, readonly, getter=isUserLocationVisible) BOOL userLocationVisible@property(nonatomic, readonly) MKUserLocation *userLocation@property(nonatomic) MKUserTrackingMode userTrackingMode- (void)setUserTrackingMode:(MKUserTrackingMode)mode animated:(BOOL)animated

 

Annotating the Map

@property(nonatomic, readonly) NSArray *annotations@property(nonatomic, readonly) CGRect annotationVisibleRect- (void)addAnnotation:(id<MKAnnotation>)annotation- (void)addAnnotations:(NSArray *)annotations- (void)removeAnnotation:(id<MKAnnotation>)annotation- (void)removeAnnotations:(NSArray *)annotations- (MKAnnotationView *)viewForAnnotation:(id<MKAnnotation>)annotation- (NSSet *)annotationsInMapRect:(MKMapRect)mapRect- (MKAnnotationView *)dequeueReusableAnnotationViewWithIdentifier:(NSString *)identifier

 

Managing Annotation Selections

@property(nonatomic, copy) NSArray *selectedAnnotations- (void)selectAnnotation:(id<MKAnnotation>)annotation animated:(BOOL)animated- (void)deselectAnnotation:(id<MKAnnotation>)annotation animated:(BOOL)animated

 

Accessing Overlays

@property(nonatomic, readonly) NSArray *overlays- (NSArray *)overlaysInLevel:(MKOverlayLevel)level- (MKOverlayRenderer *)rendererForOverlay:(id<MKOverlay>)overlay- (MKOverlayView *)viewForOverlay:(id<MKOverlay>)overlay

 

Adding and Inserting Overlays

- (void)addOverlay:(id<MKOverlay>)overlay level:(MKOverlayLevel)level- (void)addOverlays:(NSArray *)overlays level:(MKOverlayLevel)level- (void)addOverlay:(id<MKOverlay>)overlay- (void)addOverlays:(NSArray *)overlays- (void)insertOverlay:(id<MKOverlay>)overlay atIndex:(NSUInteger)index level:(MKOverlayLevel)level- (void)insertOverlay:(id<MKOverlay>)overlay atIndex:(NSUInteger)index- (void)insertOverlay:(id<MKOverlay>)overlay aboveOverlay:(id<MKOverlay>)sibling- (void)insertOverlay:(id<MKOverlay>)overlay belowOverlay:(id<MKOverlay>)sibling- (void)exchangeOverlay:(id<MKOverlay>)overlay1 withOverlay:(id<MKOverlay>)overlay2- (void)exchangeOverlayAtIndex:(NSUInteger)index1 withOverlayAtIndex:(NSUInteger)index2

 

Removing Overlays

- (void)removeOverlay:(id<MKOverlay>)overlay- (void)removeOverlays:(NSArray *)overlays

 

Converting Map Coordinates

- (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(UIView *)view- (CLLocationCoordinate2D)convertPoint:(CGPoint)point toCoordinateFromView:(UIView *)view- (CGRect)convertRegion:(MKCoordinateRegion)region toRectToView:(UIView *)view- (MKCoordinateRegion)convertRect:(CGRect)rect toRegionFromView:(UIView *)view

 

Adjusting Map Regions and Rectangles

- (MKCoordinateRegion)regionThatFits:(MKCoordinateRegion)region- (MKMapRect)mapRectThatFits:(MKMapRect)mapRect- (MKMapRect)mapRectThatFits:(MKMapRect)mapRect edgePadding:(UIEdgeInsets)insets

 

MKMapView