-
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
Conversation
@Franreno these web-only options are a little bit unexpected. We're deciding on how to best land this. We might have to create a new |
(Discussed on chat with @stuartmorgan and we decided to go with the PRs as they are, and then maybe do a more thorough refactor of per-platform settings, for example "liteMode" doesn't make sense in the web or iOS either) |
@Franreno there's some automated "checks" failing, please work on the branch until all automated checks pass, otherwise we can't merge it. Currently, there's the following warnings/errors being reported:
You can find more on the "View more" link of each check (search for the stdout of the failing step). In this case, the analyzer is complaining about missing types because this PR isn't setup with the correct dependencies. Read instructions on how this PR needs to be configured here: |
(Moving this to draft until it's more ready to review!) |
Hello @ditman, I really appreciate your suggestions and thank you for helping me!
As your comment states, this PR would be valid if the tests are passing? If so, only the web google maps would receive these new parameters? I'm currently working to get the tests fixed! |
@ditman I think the |
Packages that don't actually need dependency overrides should just have the dependency overrides reverted. |
I have reverted the other packages that didn't needed the dependancies overrides. The only checks failing are the |
It's unrelated to the PR; see https://github.com/flutter/flutter/wiki/Understanding-Packages-tests#specific-tests |
Oh okay! Thanks! |
Would this PR be valid for review now? If there is anything else that I need to do let me know. |
Yes, this is ready for review now @Franreno, thanks for keeping the CI happy! |
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.
Android +1
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
These should all end with Enabled
, like the existing comparable properties.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the changes to google_maps_flutter_android
and google_maps_flutter_ios
.
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?
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Three unrelated things should not be tested in the same test.
@@ -1,3 +1,7 @@ | |||
## 2.4.1 |
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.
New functionality is a minor update, not a bugfix update.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Same here; this should be 0.5.3
.
@Franreno is this still something you are planning to work on? |
Thank you for your contribution. I'm going to close this PR for now since there are outstanding comments, just to get this off our PR review queue. Please don't hesitate to submit a new PR if you have the time to address the review comments. Thanks! |
As the linked issue states, there are some
MapOptions
parameters that can't be modified on theMapConfiguration
when usinggoogle_maps_flutter_web
package.The parameters are:
mapTypeControl
: Enables the user to change mapTypes.fullscreenControl
: Enables the user make the map fullscreen.streetViewControl
: Enables the user to use the streetview functionality.There parameters where previously set to false by default at the
MapConfiguration
class. With this Pull Request, these parameters could be setted to true or false.As the previous version handles these options as false by default, I opted to keep them as false if the user has not setted them to
true
.Using this approach and creating a simple example app that uses this new implementation, we can see that these new controllers can be used on the
google_maps_flutter_web
package.new_options_parameters.mp4
Fixes #104111
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.