Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove is user gesture #389

Merged
merged 5 commits into from
Aug 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions lib/flutter_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ abstract class MapController {

typedef void TapCallback(LatLng point);
typedef void LongPressCallback(LatLng point);
typedef void PositionCallback(
MapPosition position, bool hasGesture, bool isUserGesture);
typedef void PositionCallback(MapPosition position, bool hasGesture);

class MapOptions {
final Crs crs;
Expand Down
3 changes: 1 addition & 2 deletions lib/src/gestures/gestures.dart
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ abstract class MapGestureMixin extends State<FlutterMap>
_doubleTapCenterAnimation.value,
_doubleTapZoomAnimation.value,
hasGesture: true,
isUserGesture: true,
);
});
}
Expand All @@ -181,7 +180,7 @@ abstract class MapGestureMixin extends State<FlutterMap>
var newCenterPoint = map.project(_mapCenterStart) +
CustomPoint(_flingOffset.dx, _flingOffset.dy);
var newCenter = map.unproject(newCenterPoint);
map.move(newCenter, map.zoom, hasGesture: true, isUserGesture: true);
map.move(newCenter, map.zoom, hasGesture: true);
}

CustomPoint _offsetToPoint(Offset offset) {
Expand Down
9 changes: 4 additions & 5 deletions lib/src/map/map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class MapControllerImpl implements MapController {

@override
void move(LatLng center, double zoom,
{bool hasGesture = false, isUserGesture = false}) {
{bool hasGesture = false}) {
_state.move(center, zoom,
hasGesture: hasGesture, isUserGesture: isUserGesture);
hasGesture: hasGesture);
}

@override
Expand Down Expand Up @@ -111,7 +111,7 @@ class MapState {
}

void move(LatLng center, double zoom,
{hasGesture = false, isUserGesture = false}) {
{hasGesture = false}) {
zoom = _fitZoomToBounds(zoom);
final mapMoved = center != _lastCenter || zoom != _zoom;

Expand All @@ -134,8 +134,7 @@ class MapState {
bounds: bounds,
zoom: zoom,
),
hasGesture,
isUserGesture);
hasGesture);
}
}

Expand Down