Skip to content

Commit

Permalink
162-animate-camera-on-web-fix (#254)
Browse files Browse the repository at this point in the history
Co-authored-by: Julian Bissekkou <[email protected]>
  • Loading branch information
JulianBissekkou and JulianBissekkou committed Jun 28, 2023
1 parent 3a36217 commit 1b63264
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions maplibre_gl_web/lib/src/mapbox_web_gl_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class MaplibreMapController extends MapLibreGlPlatform
@override
Future<bool?> animateCamera(CameraUpdate cameraUpdate,
{Duration? duration}) async {
final cameraOptions = Convert.toCameraOptions(cameraUpdate, _map);
final cameraOptions = Convert.toCameraOptions(cameraUpdate, _map).jsObject;

final around = getProperty(cameraOptions, 'around');
final bearing = getProperty(cameraOptions, 'bearing');
Expand All @@ -203,9 +203,9 @@ class MaplibreMapController extends MapLibreGlPlatform
final zoom = getProperty(cameraOptions, 'zoom');

_map.flyTo({
if (around.jsObject != null) 'around': around,
if (around != null) 'around': around,
if (bearing != null) 'bearing': bearing,
if (center.jsObject != null) 'center': center,
if (center != null) 'center': center,
if (pitch != null) 'pitch': pitch,
if (zoom != null) 'zoom': zoom,
if (duration != null) 'duration': duration.inMilliseconds,
Expand Down

0 comments on commit 1b63264

Please sign in to comment.