Skip to content

Commit

Permalink
web: camera changed
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed Sep 20, 2024
1 parent b1ccac0 commit 5c33789
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/src/web/interop/events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ abstract class MapEventType {
/// Fired when the style has been loaded.
static const load = 'load';

/// Fired repeatedly during an animated transition from one camera position
/// to another caused either by flyTo() or user interaction.
static const move = 'move';

/// Fired once the map stops moving.
static const moveEnd = 'moveend';
}
2 changes: 1 addition & 1 deletion lib/src/web/widget_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ final class MapLibreMapStateWeb extends State<MapLibreMap>
}.toJS,
);
_map.on(
interop.MapEventType.moveEnd,
interop.MapEventType.move,
(interop.MapLibreEvent event) {
final camera = MapCamera(
center: _map.getCenter().toPosition(),
Expand Down

0 comments on commit 5c33789

Please sign in to comment.