-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[google_maps_flutter_web] Allow marker position updates #3697
Conversation
Unconditionally convert the current marker position in `convert.dart:_markerOptionsFromMarker`, to allow for position updates. Also adds position changes to `marker_test.dart/MarkerController/update` and `markers_test.dart/MarkersController/changeMarkers`. The `MarkersController` case is fixed by this patch.
Hey @AsturaPhoenix I did a small tweak to the position update to make it optional so programmers don't always have to pass the |
@ditman It shouldn't affect my use case, so I'm inclined to defer to your judgment. I'm curious about the rationale though. I did get the distinct impression that Google Maps JS, and for that matter Google Maps Android, really want to push the MVC paradigm and that the current Flutter interface is taking some not insignificant performance hits as a result, so from that angle I understand the desire to have the ability to skip updates. However, my personal opinion is I'm not a fan of treating Null Island as a sentinel value, nor of Google Maps Flutter behaving differently here from Android and iOS, unless I'm mistaken. If we're going for performance optimization, I'd suggest taking a hammer to the interface instead, or at least the |
@AsturaPhoenix to me, this is a stop-gap measure so we can land this update, that seems useful, without forcing everybody to re-set the Location of a Marker every time they want to update any other property. Currently, you should be able to set Do you need to pass the position of every marker on every update on Android? (I bet you that was the original intent of the code, defaulting to the "currently set position", except I did the default backwards! 🤦) I agree that using Null Island as a sentinel value is not great, but to remove that, I must fix the interface and make the position of the Marker nullable, which is probably a Major version change, and would take much longer to land than this. (Once the default position is |
Yes if you're using To be precise, as you discovered, the If the true null case is what you want to support, we could ignore analyzer warnings and add conditionals for null positions anyway, but that doesn't seem like a great direction.
It doesn't, as far as I can tell. Although the Android and iOS platform impls skip setters for anything that's null on the method channel, the only way that happens is if the code using It may also be worth calling out that since |
I guess I don't need to worry about the web resetting the position then! |
I think the position resetting to 0,0 is a bug, and we shouldn't force people to specify a new position on the marker if they don't want to, but let's land this to improve consistency with the mobile implementations! |
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.
LGTM!
auto label is removed for flutter/packages, pr: 3697, due to This PR has not met approval requirements for merging. You have project association NONE and need 1 more review(s) in order to merge this PR.
|
auto label is removed for flutter/packages, pr: 3697, due to Validations Fail. |
My beloved @auto-submit, please try again! |
flutter/packages@88591be...746750e 2023-04-20 stuartmorgan@google.com [pigeon] Add an initial example app (flutter/packages#3761) 2023-04-20 imagipioneer@gmail.com [google_maps_flutter_web] Allow marker position updates (flutter/packages#3697) 2023-04-19 tarrinneal@gmail.com [Tool] [Code Excerpt] allow excerpts in example readme (flutter/packages#3758) 2023-04-19 47866232+chunhtai@users.noreply.github.com [go_router] migrates test for route information.location deprecation (flutter/packages#3763) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
* main: (144 commits) Update test golden images for the latest Skia roll (flutter#3787) [various] Adds Android namespace (flutter#3791) [shared_preferences] Update gradle/agp in example apps (flutter#3809) [go_router] Adds name to TypedGoRoute (flutter#3702) [webview_flutter] Adds support to receive permission requests (flutter#3543) [google_sign_in] Fix Android Java warnings (flutter#3762) [local_auth] Fix enum return on Android (flutter#3780) [pigeon] Warn when trying to use enums in collections (flutter#3782) [webview_flutter_android] [webview_flutter_wkwebview] Platform implementations for supporting permission requests (flutter#3792) [pigeon] Update for compatibility with a future change to the analyzer. (flutter#3789) [camera_android] Fix Android lint warnings (flutter#3716) [webview_flutter_platform_interface] Adds method to receive permission requests (flutter#3767) [image_picker_ios] In unit test write and read kCGImagePropertyExifUserComment property (flutter#3783) [go_router_builder] Fixed the return value of the generated push method (flutter#3650) [image_picker] Mention `launchMode: singleInstance` in README (flutter#3759) Revert "[pigeon] Add an initial example app" (flutter#3785) [google_maps_flutter] Add examples for different iOS versions (flutter#3757) [pigeon] Add an initial example app (flutter#3761) [google_maps_flutter_web] Allow marker position updates (flutter#3697) [Tool] [Code Excerpt] allow excerpts in example readme (flutter#3758) ... # Conflicts: # packages/camera/camera/pubspec.yaml
Unconditionally convert the current marker position in `convert.dart:_markerOptionsFromMarker`, to allow for position updates. Also adds position changes to `marker_test.dart/MarkerController/update` and `markers_test.dart/MarkersController/changeMarkers`. The `MarkersController` case is fixed by this patch. * Grafted from: flutter/plugins#6753 * Fixes: flutter/flutter#83467
Unconditionally convert the current marker position in
convert.dart:_markerOptionsFromMarker
, to allow for position updates.Also adds position changes to
marker_test.dart/MarkerController/update
andmarkers_test.dart/MarkersController/changeMarkers
. TheMarkersController
case is fixed by this patch.Issues
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.