Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7c4cd57
Added options to GoogleMap
Rexios80 Feb 24, 2022
d40968f
Use the options in google_maps_flutter_web
Rexios80 Feb 24, 2022
81bdeb2
Tests
Rexios80 Feb 24, 2022
92c8327
Cherry-picked google_maps_flutter_platform_interface changes from fea…
Rexios80 Feb 24, 2022
afbab1a
Merge branch 'feature/more-web-config-options-platform-interface' int…
Rexios80 Feb 24, 2022
2d99561
Updated changelogs
Rexios80 Mar 15, 2022
0c7dc71
Merge branch 'master' into feature/more-web-config-options
Rexios80 Mar 15, 2022
66130ca
More clear doc comment for tiltControlsEnabled
Rexios80 Mar 17, 2022
56de8e1
Merge branch 'main' into feature/more-web-config-options
Rexios80 Mar 22, 2022
b33411e
Merge branch 'main' into feature/more-web-config-options
Rexios80 Apr 5, 2022
4931805
Update CHANGELOG.md
Rexios80 Apr 5, 2022
d6c475c
Merge branch 'master' into feature/more-web-config-options
Rexios80 Apr 19, 2022
539dc12
Merge branch 'main' into feature/more-web-config-options
Rexios80 Apr 28, 2022
2f59c50
Merge branch 'main' into feature/more-web-config-options
Rexios80 May 8, 2022
2d78fa0
Merge branch 'master' into feature/more-web-config-options
Rexios80 May 23, 2022
f53fdca
Fixed analysis issues
Rexios80 May 23, 2022
3ed3277
Refactored GestureHandling to WebGestureHandling
Rexios80 May 23, 2022
7c6934d
Added license text to web_gesture_handling.dart and organized imports
Rexios80 May 23, 2022
48c85bf
Merge branch 'master' into feature/more-web-config-options
Rexios80 May 23, 2022
e47ba62
Refactored 45 degree imagery option
Rexios80 May 24, 2022
c19c7a8
Merge branch 'master' into feature/more-web-config-options
Rexios80 Jun 15, 2022
c16e89f
Merge branch 'main' into feature/more-web-config-options
Rexios80 Jul 11, 2022
70121cd
Removed extra if condition and updated documentation
Rexios80 Jul 11, 2022
c458b88
Merge branch 'main' into feature/more-web-config-options
Rexios80 Jul 14, 2022
8b9c69f
Formatting
Rexios80 Jul 14, 2022
3577e26
Removed now irrelevant tests
Rexios80 Jul 15, 2022
4936999
Merge remote-tracking branch 'origin/master' into feature/more-web-co…
Rexios80 Oct 17, 2022
a047e50
Fixes
Rexios80 Oct 17, 2022
46536fd
Cleaning some things up
Rexios80 Oct 17, 2022
c1b5467
Fixed android build issue
Rexios80 Oct 17, 2022
4c73eea
Fixed web test
Rexios80 Oct 17, 2022
63126cb
Merge remote-tracking branch 'origin/master' into feature/more-web-co…
Rexios80 Oct 24, 2022
17bb023
Merge branch 'master' into feature/more-web-config-options
Rexios80 Dec 20, 2022
2b93eaa
Merge remote-tracking branch 'origin/master' into feature/more-web-co…
Rexios80 Feb 22, 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
Prev Previous commit
Next Next commit
Refactored 45 degree imagery option
  • Loading branch information
Rexios80 committed May 24, 2022
commit e47ba6213d76b832c70df80b5c2c110b14315d65
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class GoogleMap extends StatefulWidget {
this.zoomGesturesEnabled = true,
this.liteModeEnabled = false,
this.tiltGesturesEnabled = true,
this.tiltControlsEnabled = true,
this.fortyFiveDegreeImageryEnabled = false,
this.myLocationEnabled = false,
this.myLocationButtonEnabled = true,
this.layoutDirection,
Expand Down Expand Up @@ -178,11 +178,8 @@ class GoogleMap extends StatefulWidget {
/// True if the map view should respond to tilt gestures.
final bool tiltGesturesEnabled;

/// True if the map should show tilt controls. Web only.
///
/// Disabling this will cause map dragging to be interrupted if the
/// [GoogleMap] is rebuilt while dragging.
final bool tiltControlsEnabled;
/// 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 @@ -549,7 +546,7 @@ class _GoogleMapOptions {
rotateGesturesEnabled = map.rotateGesturesEnabled,
scrollGesturesEnabled = map.scrollGesturesEnabled,
tiltGesturesEnabled = map.tiltGesturesEnabled,
tiltControlsEnabled = map.tiltControlsEnabled,
fortyFiveDegreeImageryEnabled = map.fortyFiveDegreeImageryEnabled,
trackCameraPosition = map.onCameraMove != null,
zoomControlsEnabled = map.zoomControlsEnabled,
zoomGesturesEnabled = map.zoomGesturesEnabled,
Expand Down Expand Up @@ -580,7 +577,7 @@ class _GoogleMapOptions {

final bool tiltGesturesEnabled;

final bool tiltControlsEnabled;
final bool fortyFiveDegreeImageryEnabled;

final bool trackCameraPosition;

Expand Down Expand Up @@ -613,7 +610,7 @@ class _GoogleMapOptions {
'rotateGesturesEnabled': rotateGesturesEnabled,
'scrollGesturesEnabled': scrollGesturesEnabled,
'tiltGesturesEnabled': tiltGesturesEnabled,
'tiltControlsEnabled': tiltControlsEnabled,
'fortyFiveDegreeImageryEnabled': fortyFiveDegreeImageryEnabled,
'zoomControlsEnabled': zoomControlsEnabled,
'zoomGesturesEnabled': zoomGesturesEnabled,
'liteModeEnabled': liteModeEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ void main() {
controller = _createController(options: <String, dynamic>{
'mapType': 2,
'zoomControlsEnabled': true,
'tiltControlsEnabled': false,
'fortyFiveDegreeImageryEnabled': false,
});
controller.debugSetOverrides(
createMap: (_, gmaps.MapOptions options) {
Expand Down Expand Up @@ -427,9 +427,27 @@ void main() {
'disabling scroll gestures disables all gesture handling');
});

testWidgets('translates fortyFiveDegreeImageryEnabled option',
(WidgetTester tester) async {
controller = _createController(options: <String, dynamic>{
'fortyFiveDegreeImageryEnabled': true,
});
controller.debugSetOverrides(
createMap: (_, gmaps.MapOptions options) {
capturedOptions = options;
return map;
});

controller.init();

expect(capturedOptions, isNotNull);
expect(capturedOptions!.rotateControl, true);
expect(capturedOptions!.tilt, isNull);
});

testWidgets('translates webGestureHandling option',
(WidgetTester tester) async {
controller = _createController(options: <String, String>{
controller = _createController(options: <String, dynamic>{
'webGestureHandling': WebGestureHandling.greedy.name,
});
controller.debugSetOverrides(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ gmaps.MapOptions _rawOptionsToGmapsOptions(Map<String, Object?> rawOptions) {
options.gestureHandling = WebGestureHandling.auto.name;
}

if (rawOptions['tiltControlsEnabled'] == false) {
options.rotateControl = false;
options.tilt = 0;
if (rawOptions['fortyFiveDegreeImageryEnabled'] != null) {
options.rotateControl =
rawOptions['fortyFiveDegreeImageryEnabled'] as bool?;
}

// These don't have any rawOptions entry, but they seem to be off in the native maps.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ class GoogleMapController {
// Initial position can only to be set here!
options = _applyInitialPosition(_initialCameraPosition, options);

// Fully disable 45 degree imagery if desired
if (options.rotateControl == false) {
options.tilt = 0;
}

// Create the map...
final gmaps.GMap map = _createMap(_div, options);
_googleMap = map;
Expand Down