map: keep rotation when changing layer
This commit is contained in:
parent
51c92fe6ed
commit
10e9caaffe
2 changed files with 3 additions and 1 deletions
|
@ -171,13 +171,14 @@ class _EntryGoogleMapState extends State<EntryGoogleMap> with WidgetsBindingObse
|
|||
builder: (context, dotEntry, child) {
|
||||
return GoogleMap(
|
||||
initialCameraPosition: CameraPosition(
|
||||
bearing: -bounds.rotation,
|
||||
target: _toGoogleLatLng(bounds.center),
|
||||
zoom: bounds.zoom,
|
||||
),
|
||||
onMapCreated: (controller) async {
|
||||
_googleMapController = controller;
|
||||
final zoom = await controller.getZoomLevel();
|
||||
await _updateVisibleRegion(zoom: zoom, rotation: 0);
|
||||
await _updateVisibleRegion(zoom: zoom, rotation: bounds.rotation);
|
||||
setState(() {});
|
||||
},
|
||||
// compass disabled to use provider agnostic controls
|
||||
|
|
|
@ -151,6 +151,7 @@ class _EntryLeafletMapState extends State<EntryLeafletMap> with TickerProviderSt
|
|||
options: MapOptions(
|
||||
center: bounds.center,
|
||||
zoom: bounds.zoom,
|
||||
rotation: bounds.rotation,
|
||||
minZoom: widget.minZoom,
|
||||
maxZoom: widget.maxZoom,
|
||||
// TODO TLAD [map] as of flutter_map v0.14.0, `doubleTapZoom` does not move when zoom is already maximal
|
||||
|
|
Loading…
Reference in a new issue