When I create the GoogleMap widget I can set:
initialCameraPosition: CameraPosition(
target: _initialCameraPosition,
zoom: 12.0,
bearing: 0.0
),
but after the user changes the rotation, how can I set the bearing to 0.0 again?
Use the GoogleMap.onMapCreated
callback to store a reference to the GoogleMapController
parameter it has.
GoogleMap(
onMapCreated: (controller) => /* store the controller in state */,
...
);
Then, use it to set the camera position:
controller.animateCamera(
CameraUpdate.newCameraPosition(
CameraPosition(
bearing: /* set your desired bearing */,
...
),
),
);