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.onMapCreatedcallback to store a reference to theGoogleMapControllerparameter it has.Then, use it to set the camera position: