• Main Page
  • Related Pages
  • Classes
  • Files
  • File List
  • File Members

BMMapView.h

00001 //
00002 //  BMMapView.h
00003 //  BingMaps
00004 //
00005 //  Copyright (c) 2011 Microsoft Corporation. All rights reserved.
00006 //
00007 
00008 #import <UIKit/UIKit.h>
00009 
00010 #import "BingMaps/BMGeometry.h"
00011 #import "BingMaps/BMTypes.h"
00012 #import "BingMaps/BMMarker.h"
00013 #import "BingMaps/BMMarkerView.h"
00014 
00015 @protocol BMMapViewDelegate;
00016 @class BMUserLocation;
00017 @class BMMapViewInternal;
00018 
00019 @interface BMMapView : UIView {
00020 @private
00021     BMMapViewInternal *_internal;
00022 }
00023 
00024 #pragma mark -
00025 #pragma mark Manipulation
00026 
00027 @property(nonatomic, assign) id <BMMapViewDelegate> delegate;
00028 @property(nonatomic) BMMapMode mapMode;
00029 @property(nonatomic) BMCoordinateRegion region;
00030 @property(nonatomic) BOOL zoomEnabled;
00031 @property(nonatomic) BOOL scrollEnabled;
00032 - (void)setRegion:(BMCoordinateRegion)region animated:(BOOL)animated;
00033 
00034 // centerCoordinate allows the coordinate of the region to be changed without changing the zoom level.
00035 @property(nonatomic) CLLocationCoordinate2D centerCoordinate;
00036 - (void)setCenterCoordinate:(CLLocationCoordinate2D)coordinate animated:(BOOL)animated;
00037 
00038 #pragma mark -
00039 #pragma mark Math
00040 
00041 // Returns a region of the aspect ratio of the map view that contains the given region, with the same center point.
00042 - (BMCoordinateRegion)regionThatFits:(BMCoordinateRegion)region;
00043 - (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(UIView *)view;
00044 - (CLLocationCoordinate2D)convertPoint:(CGPoint)point toCoordinateFromView:(UIView *)view;
00045 - (CGRect)convertRegion:(BMCoordinateRegion)region toRectToView:(UIView *)view;
00046 - (BMCoordinateRegion)convertRect:(CGRect)rect toRegionFromView:(UIView *)view;
00047 
00048 #pragma mark -
00049 #pragma mark User Location
00050 
00051 @property(nonatomic) BOOL showsUserLocation;
00052 
00053 // The marker representing the user's location
00054 @property(nonatomic, readonly) BMUserLocation *userLocation;
00060 @property(nonatomic, readonly, getter=isUserLocationVisible) BOOL userLocationVisible;
00061 
00062 #pragma mark -
00063 #pragma mark markers
00064 
00065 // markers are models used to add markers on the map. 
00066 // Implement mapView:viewFormarker: on BMMapViewDelegate to return the marker view for each marker.
00067 - (void)addMarker:(id <BMMarker>)marker;
00068 - (void)addMarkers:(NSArray *)markers;
00069 
00070 - (void)removeMarker:(id <BMMarker>)marker;
00071 - (void)removeMarkers:(NSArray *)markers;
00072 
00073 @property(nonatomic, readonly) NSArray *markers;
00074 
00075 // Currently displayed view for an marker; returns nil if the view for the marker hasn't been created yet.
00076 - (BMMarkerView *)viewForMarker:(id <BMMarker>)marker;
00077 
00078 // Used by the delegate to acquire an already allocated marker view, in lieu of allocating a new one.
00079 - (BMMarkerView *)dequeueReusableMarkerViewWithIdentifier:(NSString *)identifier;
00080 
00081 // Select or deselect a given marker.  Asks the delegate for the corresponding marker view if necessary.
00082 - (void)selectMarker:(id <BMMarker>)marker animated:(BOOL)animated;
00083 - (void)deselectMarker:(id <BMMarker>)marker animated:(BOOL)animated;
00084 
00085 
00086 @property(nonatomic, copy) NSArray *selectedMarkers;
00087 
00088 @property (nonatomic, readonly) CGRect markerVisibleRect;
00089 
00090 @end
00091 
00098 @protocol BMMapViewDelegate <NSObject>
00099 @optional
00100 
00107 - (void)mapView:(BMMapView *)mapView regionWillChangeAnimated:(BOOL)animated;
00114 - (void)mapView:(BMMapView *)mapView regionDidChangeAnimated:(BOOL)animated;
00120 - (void)mapViewWillStartLoadingMap:(BMMapView *)mapView;
00127 - (void)mapViewDidFinishLoadingMap:(BMMapView *)mapView;
00135 - (void)mapViewDidFailLoadingMap:(BMMapView *)mapView withError:(NSError *)error;
00142 - (BMMarkerView *)mapView:(BMMapView *)mapView viewForMarker:(id <BMMarker>)marker;
00150 - (void)mapView:(BMMapView *)mapView didAddMarkerViews:(NSArray *)views;
00157 - (void)mapView:(BMMapView *)mapView markerView:(BMMarkerView *)view calloutAccessoryControlTapped:(UIControl *)control;
00158 
00159 @end

Generated on Tue May 3 2011 11:57:16 for Bing Maps iOS Control by  doxygen 1.7.2