Skip to content

[google_maps_flutter_web] Options to disable tilt controls and configure gesture handling #3258

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

Merged
merged 41 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1df0ccc
Transfer changes from flutter/plugins
Rexios80 Feb 22, 2023
6b10886
Merge remote-tracking branch 'upstream/main' into google-maps-more-we…
Rexios80 Mar 3, 2023
302fb6e
Merge remote-tracking branch 'upstream/main' into google-maps-more-we…
Rexios80 Mar 7, 2023
aeeb30c
Regenerated overrides with tooling
Rexios80 Mar 7, 2023
5a02d16
Revert android example config changes
Rexios80 Mar 7, 2023
38a2060
Alphabetical ordering
Rexios80 Mar 7, 2023
6e04109
Revert changes in unrelated platforms
Rexios80 Mar 7, 2023
dd16d53
Merge branch 'main' into google-maps-more-web-config-options
Rexios80 Apr 24, 2023
69d678f
Merge remote-tracking branch 'upstream/main' into google-maps-more-we…
Rexios80 Apr 24, 2023
64342e7
Merge remote-tracking branch 'upstream/main' into google-maps-more-we…
Rexios80 Jun 28, 2023
275ec3f
Fix analysis issue
Rexios80 Jun 28, 2023
e09c618
Update packages/google_maps_flutter/google_maps_flutter_web/lib/src/c…
Rexios80 Jul 14, 2023
b759f98
Merge remote-tracking branch 'upstream/main' into google-maps-more-we…
Rexios80 Jul 14, 2023
b31f3dd
Merge remote-tracking branch 'origin/google-maps-more-web-config-opti…
Rexios80 Jul 14, 2023
03903ef
Remove duplicated changelog line
Rexios80 Jul 14, 2023
cc80903
Platform interface changes for #3258
Rexios80 Jul 15, 2023
f59558c
Merge branch 'main' into google-maps-more-web-config-options-platform…
Rexios80 Jul 15, 2023
44640ae
Adds tests
Rexios80 Jul 15, 2023
2ccf1fa
Fixes
Rexios80 Jul 15, 2023
c144efe
Adding more tests
Rexios80 Jul 15, 2023
493210d
Merge remote-tracking branch 'upstream/main' into google-maps-more-we…
Rexios80 Jul 17, 2023
43f8b84
Merge remote-tracking branch 'upstream/main' into google-maps-more-we…
Rexios80 Jul 17, 2023
9c9cc16
Update versions
Rexios80 Jul 17, 2023
a2c2566
Merge branch 'google-maps-more-web-config-options-platform-interface'…
Rexios80 Jul 18, 2023
0a381c9
Merge remote-tracking branch 'upstream/main' into google-maps-more-we…
Rexios80 Jul 18, 2023
6be90e8
Merge remote-tracking branch 'origin/google-maps-more-web-config-opti…
Rexios80 Jul 18, 2023
ff28a18
Remove dependency overrides for platform interface
Rexios80 Jul 18, 2023
ced5c25
Fixing changelogs
Rexios80 Jul 18, 2023
5ec7bd2
Fixing issues
Rexios80 Jul 18, 2023
da96ec1
Merge branch 'main' into google-maps-more-web-config-options
Rexios80 Jul 18, 2023
222b80d
Update google_maps_platform_interface constraint
Rexios80 Jul 18, 2023
e2e5623
Merge remote-tracking branch 'origin/google-maps-more-web-config-opti…
Rexios80 Jul 18, 2023
bed7229
Revert "Update google_maps_platform_interface constraint"
Rexios80 Jul 18, 2023
50ee59d
Merge remote-tracking branch 'upstream/main' into google-maps-more-we…
Rexios80 Jul 18, 2023
133810f
Let's try this again
Rexios80 Jul 18, 2023
b2da449
Merge remote-tracking branch 'upstream/main' into google-maps-more-we…
Rexios80 Jul 19, 2023
582a1fd
Merge remote-tracking branch 'upstream/main' into google-maps-more-we…
Rexios80 Jul 21, 2023
e64a239
Update google_maps_flutter_web
Rexios80 Jul 21, 2023
a7aeb65
Fixes
Rexios80 Jul 21, 2023
caa5e49
Merge branch 'main' into google-maps-more-web-config-options
Rexios80 Jul 21, 2023
ab9ff93
Merge branch 'main' into google-maps-more-web-config-options
Rexios80 Jul 24, 2023
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.4.0

* Adds options for gesture handling and tilt controls on web.

## 2.3.1

* Fixes a regression from 2.2.8 that could cause incorrect handling of a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ export 'package:google_maps_flutter_platform_interface/google_maps_flutter_platf
Tile,
TileOverlayId,
TileOverlay,
TileProvider;
TileProvider,
WebGestureHandling;

part 'src/controller.dart';
part 'src/google_map.dart';
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class GoogleMap extends StatefulWidget {
required this.initialCameraPosition,
this.onMapCreated,
this.gestureRecognizers = const <Factory<OneSequenceGestureRecognizer>>{},
this.webGestureHandling,
this.compassEnabled = true,
this.mapToolbarEnabled = true,
this.cameraTargetBounds = CameraTargetBounds.unbounded,
Expand All @@ -104,6 +105,7 @@ class GoogleMap extends StatefulWidget {
this.zoomGesturesEnabled = true,
this.liteModeEnabled = false,
this.tiltGesturesEnabled = true,
this.fortyFiveDegreeImageryEnabled = false,
this.myLocationEnabled = false,
this.myLocationButtonEnabled = true,
this.layoutDirection,
Expand Down Expand Up @@ -179,6 +181,9 @@ class GoogleMap extends StatefulWidget {
/// True if the map view should respond to tilt gestures.
final bool tiltGesturesEnabled;

/// True if 45 degree imagery should be enabled. Web only.
final bool fortyFiveDegreeImageryEnabled;

/// Padding to be set on map. See https://developers.google.com/maps/documentation/android-sdk/map#map_padding for more details.
final EdgeInsets padding;

Expand Down Expand Up @@ -282,6 +287,11 @@ class GoogleMap extends StatefulWidget {
/// were not claimed by any other gesture recognizer.
final Set<Factory<OneSequenceGestureRecognizer>> gestureRecognizers;

/// This setting controls how the API handles gestures on the map. Web only.
///
/// See [WebGestureHandling] for more details.
final WebGestureHandling? webGestureHandling;

/// Creates a [State] for this [GoogleMap].
@override
State createState() => _GoogleMapState();
Expand Down Expand Up @@ -518,6 +528,7 @@ class _GoogleMapState extends State<GoogleMap> {
MapConfiguration _configurationFromMapWidget(GoogleMap map) {
assert(!map.liteModeEnabled || Platform.isAndroid);
return MapConfiguration(
webGestureHandling: map.webGestureHandling,
compassEnabled: map.compassEnabled,
mapToolbarEnabled: map.mapToolbarEnabled,
cameraTargetBounds: map.cameraTargetBounds,
Expand All @@ -526,6 +537,7 @@ MapConfiguration _configurationFromMapWidget(GoogleMap map) {
rotateGesturesEnabled: map.rotateGesturesEnabled,
scrollGesturesEnabled: map.scrollGesturesEnabled,
tiltGesturesEnabled: map.tiltGesturesEnabled,
fortyFiveDegreeImageryEnabled: map.fortyFiveDegreeImageryEnabled,
trackCameraPosition: map.onCameraMove != null,
zoomControlsEnabled: map.zoomControlsEnabled,
zoomGesturesEnabled: map.zoomGesturesEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: google_maps_flutter
description: A Flutter plugin for integrating Google Maps in iOS and Android applications.
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22
version: 2.3.1
version: 2.4.0

environment:
sdk: ">=3.0.0 <4.0.0"
Expand All @@ -23,8 +23,8 @@ dependencies:
sdk: flutter
google_maps_flutter_android: ^2.1.10
google_maps_flutter_ios: ^2.1.10
google_maps_flutter_platform_interface: ^2.2.1
google_maps_flutter_web: ^0.5.0
google_maps_flutter_platform_interface: ^2.4.0
google_maps_flutter_web: ^0.5.2

dev_dependencies:
flutter_test:
Expand Down