camera property

MapCamera get camera

Retrieves the current map camera for advanced positioning and orientation control.

Returns a MapCamera object that provides fine-grained control over the camera's 3D position (x, y, z coordinates) and orientation (quaternion). The camera determines the viewing perspective of the map, including the observer's location in 3D space and the direction they are looking.

Use the returned MapCamera to:

  • Get or set the camera's absolute position and orientation
  • Store and restore specific camera states
  • Generate positions relative to geographic targets
  • Perform complex camera movements not available through standard centering methods

For simple operations like centering on coordinates or adjusting zoom level, consider using the dedicated centering methods instead.

See also:

Implementation

MapCamera get camera {
  final OperationResult resultString = objectMethod(
    _pointerId,
    'MapView',
    'getCamera',
  );

  return MapCamera.init(resultString['result'], _mapId);
}
set camera (MapCamera camera)

Sets the map camera to a specific position and orientation.

Replaces the current camera with the provided MapCamera object, immediately updating the map view's position and orientation. This allows for precise 3D camera control that may not be achievable through standard centering and zoom methods.

Parameters

  • camera: The MapCamera object containing the desired position and orientation

See also:

  • MapCamera - Camera position and orientation controls
  • camera - Getter to retrieve the current camera

Implementation

set camera(MapCamera camera) {
  objectMethod(_pointerId, 'MapView', 'setCamera', args: camera.pointerId);
}