Skip to content

Commit

Permalink
Disable moving the map when locked on current position.
Browse files Browse the repository at this point in the history
  • Loading branch information
CaramelDunes committed Aug 26, 2021
1 parent 5322d40 commit aa98a89
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/map/flight_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ class _FlightMapState extends State<FlightMap> {

@override
Widget build(BuildContext context) {
final int interactiveFlags = (_centerOnPosition
? InteractiveFlag.none
: InteractiveFlag.drag | InteractiveFlag.pinchMove) |
InteractiveFlag.pinchZoom;

return Stack(
fit: StackFit.expand,
children: [
Expand All @@ -57,9 +62,7 @@ class _FlightMapState extends State<FlightMap> {
swPanBoundary: LatLng(41.327326, -5.734863),
nePanBoundary: LatLng(51.138001, 9.382324),
onLongPress: widget.onLongPress,
interactiveFlags: InteractiveFlag.drag |
InteractiveFlag.pinchZoom |
InteractiveFlag.pinchMove),
interactiveFlags: interactiveFlags),
layers: [
TileLayerOptions(
urlTemplate:
Expand Down

0 comments on commit aa98a89

Please sign in to comment.