setPerspective method

void setPerspective(
  1. MapViewPerspective perspective, {
  2. GemAnimation? animation,
})

Switch between 2D and 3D map perspectives during follow position mode

Toggles between a flat, top-down view (MapViewPerspective.twoDimensional) and a perspective view with tilt (MapViewPerspective.threeDimensional). Optionally animates the transition.

Parameters

Also see:

  • perspective - Current map perspective
  • viewAngle - Camera pitch angle relevant in 3D perspective

Implementation

void setPerspective(
  final MapViewPerspective perspective, {
  final GemAnimation? animation,
}) {
  objectMethod(
    pointerId,
    'FollowPositionPreferences',
    'setPerspective',
    args: <String, Object>{
      'perspective': perspective.id,
      if (animation != null) 'animation': animation,
    },
    dependencyId: _mapPointerId,
  );
}