setMapRotationMode method
- FollowPositionMapRotationMode mode, {
- double mapAngle = 0,
- bool objectFollowMap = true,
Configure how the map rotates during follow position mode
Controls whether the map rotates based on device heading, compass sensor, or a fixed angle. The position tracker icon's rotation can optionally follow the map rotation.
When objectFollowMap is true, all views using the same tracking object will see the rotation update.
Parameters
mode: The rotation mode. Use FollowPositionMapRotationMode.positionHeading to rotate by device heading, FollowPositionMapRotationMode.compass to rotate by compass sensor, or FollowPositionMapRotationMode.fixed to use a fixed angle.mapAngle: The fixed map rotation angle in degrees (0-360) used whenmodeis FollowPositionMapRotationMode.fixed. 0 degrees represents north-up. Ignored for other modes. Default: 0objectFollowMap: If true, the position tracker icon rotates with the map view rotation. If false, the tracker maintains independent orientation. Default: true
See also:
- isTrackObjectFollowingMapRotation - Whether the tracker icon follows map rotation
- mapRotationMode - Current map rotation mode and fixed angle
Implementation
void setMapRotationMode(
final FollowPositionMapRotationMode mode, {
final double mapAngle = 0,
final bool objectFollowMap = true,
}) {
objectMethod(
pointerId,
'FollowPositionPreferences',
'setMapRotationMode',
args: <String, Object>{
'mode': mode.id,
'angle': mapAngle,
'objectFollowMap': objectFollowMap,
},
dependencyId: _mapPointerId,
);
}