Skip to content

Commit

Permalink
162-animate-camera-on-web-fix (maplibre#254)
Browse files Browse the repository at this point in the history
Co-authored-by: Julian Bissekkou <julian.bissekkou@tapped.dev>
  • Loading branch information
2 people authored and JanikoNaber committed Aug 23, 2023
1 parent a66c18e commit b34d38c
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 b34d38c

Please sign in to comment.