Compartir a través de


MapCamera Class

Note

Bing Maps SDK for Android and iOS retirement

Bing Maps SDK for Android and iOS is deprecated and will be retired. Free (Basic) account customers can continue to use Bing Maps SDK for Android and iOS until June 30th, 2025. Enterprise account customers can continue to use Bing Maps SDK for Android and iOS until June 30th, 2028. To avoid service disruptions, all implementations using Bing Maps SDK for Android and iOS will need to be updated to use Azure Maps Web SDK by the retirement date that applies to your Bing Maps for Enterprise account type.

Azure Maps is Microsoft's next-generation maps and geospatial services for developers. Azure Maps has many of the same features as Bing Maps for Enterprise, and more. To get started with Azure Maps, create a free Azure subscription and an Azure Maps account. For more information about azure Maps, see Azure Maps Documentation. For migration guidance, see Bing Maps Migration Overview.

Describes a camera in a MapView.

Android

public class MapCamera

iOS

@interface MSMapCamera : NSObject

Constructors

If not specified, Geopoint defaults to (latitude: 0, longitude: 0), Heading to 0, Pitch to -90, and VerticalFieldOfView defaults to not set (null).

Android

MapCamera()
MapCamera(Geopoint cameraLocation) 
MapCamera(Geopoint cameraLocation, double heading, double pitch)
MapCamera(Geopoint cameraLocation, double heading, double pitch, double verticalFieldOfView)

iOS

+ (instancetype)cameraWithLocation:(MSGeopoint *)location
+ (instancetype)cameraWithLocation:(MSGeopoint *)location heading:(CLLocationDirection)heading pitch:(double)pitch
+ (instancetype)cameraWithLocation:(MSGeopoint *)location heading:(CLLocationDirection)heading pitch:(double)pitch verticalFieldOfView:(double)fov

Properties

Heading

The heading in degrees. 0 corresponds to north, 90 to east, 180 to south, and 270 to west. Values less than 0 or greater than 360 are wrapped.

Android

double getHeading()
void setHeading(double heading)

iOS

@property (nonatomic) CLLocationDirection heading

Location

The location of the MapCamera.
See also: MSGeopoint

Android

Geopoint getLocation()
void setLocation(Geopoint location)

iOS

@property (nonatomic) MSGeopoint *location

Pitch

The pitch of the map in degrees, where 0 is looking straight down (minimum) and 90 is looking towards the horizon (maximum). Values outside of this range will throw an exception. Note that pitch may be limited in some views.

Android

double getPitch()
void setPitch(double pitch)

iOS

@property (nonatomic) double pitch

VerticalFieldOfView

The vertical field of view in degrees. It may be null for MapCameras created without a vertical field of view.

Android

Double getVerticalFieldOfView()
void setVerticalFieldOfView(double verticalFieldOfView)

iOS

@property (nonatomic, nullable) NSNumber *verticalFieldOfView