-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[google_maps_flutter_web] Adds missing MapOptions parameters. #4553
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
Changes from all commits
9410577
2ebad26
69c8b91
2198581
a723032
c79f485
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,8 @@ flutter: | |
uses-material-design: true | ||
assets: | ||
- assets/ | ||
|
||
# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert the changes to |
||
# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins | ||
dependency_overrides: | ||
{google_maps_flutter_platform_interface: {path: ../../../google_maps_flutter/google_maps_flutter_platform_interface}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 2.4.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New functionality is a minor update, not a bugfix update. |
||
|
||
* Adds `mapType`, `fullscreen` and `streetview` controls to google maps configuration. | ||
|
||
## 2.4.0 | ||
|
||
* Adds options for gesture handling and tilt controls on web. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,9 @@ class MapConfiguration { | |
this.indoorViewEnabled, | ||
this.trafficEnabled, | ||
this.buildingsEnabled, | ||
this.mapTypeControl, | ||
this.fullscreenControl, | ||
this.streetViewControl, | ||
this.cloudMapId, | ||
}); | ||
|
||
|
@@ -107,6 +110,16 @@ class MapConfiguration { | |
/// True if 3D building display should be enabled. | ||
final bool? buildingsEnabled; | ||
|
||
/// True if the control to toggle between map types should be displayed. | ||
final bool? mapTypeControl; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should all end with |
||
|
||
/// True if the control to open the map on full screen should be displayed. | ||
final bool? fullscreenControl; | ||
|
||
/// True if the Pegman control, that lets the user to activate the street | ||
/// view panorama, should be displayed. | ||
final bool? streetViewControl; | ||
|
||
/// Identifier that's associated with a specific cloud-based map style. | ||
/// | ||
/// See https://developers.google.com/maps/documentation/get-map-id | ||
|
@@ -173,6 +186,14 @@ class MapConfiguration { | |
trafficEnabled != other.trafficEnabled ? trafficEnabled : null, | ||
buildingsEnabled: | ||
buildingsEnabled != other.buildingsEnabled ? buildingsEnabled : null, | ||
mapTypeControl: | ||
mapTypeControl != other.mapTypeControl ? mapTypeControl : null, | ||
fullscreenControl: fullscreenControl != other.fullscreenControl | ||
? fullscreenControl | ||
: null, | ||
streetViewControl: streetViewControl != other.streetViewControl | ||
? streetViewControl | ||
: null, | ||
cloudMapId: cloudMapId != other.cloudMapId ? cloudMapId : null, | ||
); | ||
} | ||
|
@@ -205,6 +226,9 @@ class MapConfiguration { | |
indoorViewEnabled: diff.indoorViewEnabled ?? indoorViewEnabled, | ||
trafficEnabled: diff.trafficEnabled ?? trafficEnabled, | ||
buildingsEnabled: diff.buildingsEnabled ?? buildingsEnabled, | ||
mapTypeControl: diff.mapTypeControl ?? mapTypeControl, | ||
fullscreenControl: diff.fullscreenControl ?? fullscreenControl, | ||
streetViewControl: diff.streetViewControl ?? streetViewControl, | ||
cloudMapId: diff.cloudMapId ?? cloudMapId, | ||
); | ||
} | ||
|
@@ -231,6 +255,9 @@ class MapConfiguration { | |
indoorViewEnabled == null && | ||
trafficEnabled == null && | ||
buildingsEnabled == null && | ||
mapTypeControl == null && | ||
fullscreenControl == null && | ||
streetViewControl == null && | ||
cloudMapId == null; | ||
|
||
@override | ||
|
@@ -262,6 +289,9 @@ class MapConfiguration { | |
indoorViewEnabled == other.indoorViewEnabled && | ||
trafficEnabled == other.trafficEnabled && | ||
buildingsEnabled == other.buildingsEnabled && | ||
mapTypeControl == other.mapTypeControl && | ||
fullscreenControl == other.fullscreenControl && | ||
streetViewControl == other.streetViewControl && | ||
cloudMapId == other.cloudMapId; | ||
} | ||
|
||
|
@@ -287,6 +317,9 @@ class MapConfiguration { | |
indoorViewEnabled, | ||
trafficEnabled, | ||
buildingsEnabled, | ||
mapTypeControl, | ||
fullscreenControl, | ||
streetViewControl, | ||
cloudMapId, | ||
]); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -403,6 +403,30 @@ void main() { | |
expect(capturedOptions!.tilt, 0); | ||
}); | ||
|
||
testWidgets( | ||
'translates mapTypeControl, fullscreenControl, streetViewControl configurations', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Three unrelated things should not be tested in the same test. |
||
(WidgetTester tester) async { | ||
controller = createController( | ||
mapConfiguration: const MapConfiguration( | ||
mapTypeControl: true, | ||
fullscreenControl: true, | ||
streetViewControl: true, | ||
)); | ||
|
||
controller.debugSetOverrides( | ||
createMap: (_, gmaps.MapOptions options) { | ||
capturedOptions = options; | ||
return map; | ||
}); | ||
|
||
controller.init(); | ||
|
||
expect(capturedOptions, isNotNull); | ||
expect(capturedOptions!.mapTypeControl, true); | ||
expect(capturedOptions!.fullscreenControl, true); | ||
expect(capturedOptions!.streetViewControl, true); | ||
}); | ||
|
||
testWidgets('translates fortyFiveDegreeImageryEnabled option', | ||
(WidgetTester tester) async { | ||
controller = createController( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name: google_maps_flutter_web | |
description: Web platform implementation of google_maps_flutter | ||
repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_web | ||
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 | ||
version: 0.5.2 | ||
version: 0.5.2+1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here; this should be |
||
|
||
environment: | ||
sdk: ">=2.18.0 <4.0.0" | ||
|
@@ -33,3 +33,8 @@ dev_dependencies: | |
# The example deliberately includes limited-use secrets. | ||
false_secrets: | ||
- /example/web/index.html | ||
|
||
# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. | ||
# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins | ||
dependency_overrides: | ||
{google_maps_flutter_platform_interface: {path: ../../google_maps_flutter/google_maps_flutter_platform_interface}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why aren't there any actual changes in this package? Isn't the intent of the PR to allow clients of
google_maps_flutter
to configure these options?