-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[google_maps_flutter] Issue165999 - add onActiveLevelChanged
callback to GoogleMap
#8923
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
base: main
Are you sure you want to change the base?
Conversation
I still need to update CHANGELOG, update versions, write new and run existing tests, but wanted to get some eyes on this. Will probably try to do some of the outstanding tasks over this weekend. I am also curious whether adding this to |
96babe0
to
7f32eeb
Compare
Thanks for the contribution! I did an initial skim of the app-facing and platform interface package changes, and the structure all looks good.
No, this would be fine to land without web support, and that be left as a follow-up issue for someone else to implement. It's clear that web wouldn't change the core design of this API (which is the main potential concern, per our policy), and having the callback not fire on web wouldn't be fundamentally confusing in the same way that, say, a significant new API throwing |
git: | ||
url: git@github.com:ChopinDavid/flutter_packages.git | ||
ref: Issue165999 | ||
path: packages/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.
Please use our tooling for multi-package changes, as our CI will recognize it and adjust some checks accordingly.
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.
Yes, this was one of the changes I was going to make this weekend. Due to the structure of the packages, and the way they all depend on eachother, we had to sort of use these git references for some dependencies to get things building.
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.
Due to the structure of the packages, and the way they all depend on eachother, we had to sort of use these git references for some dependencies to get things building.
That's exactly what make-deps-path-based
is designed for, but without using git references.
@stuartmorgan I also noticed that there were a lot of changes in I basically ran
|
Our CI enforces (with a few rare exceptions) autoformatting; what is checked in is by definition correct, since otherwise the PR wouldn't have passed CI.
You should run the repo tooling |
02def77
to
4eeb99f
Compare
@stuartmorgan-g I think this PR is in a pretty good place now, but please let me know. I noticed in the contributing README that "changes that span multiple packages will need to be done in multiple PRs", so should this PR be closed and should individual PRs be made for each of the 4 changed packages? |
The PR needs to follow the step by step process that is described in the paragraph right after the sentence you quoted. Step 1 hasn't been completed yet, which is why this is failing all the CI checks. |
c778e30
to
d4dbf52
Compare
77c8523
to
fe385e3
Compare
…_maps_flutter_ios - DC
… be path-based - DC
It sounds like this PR isn't responsible for ensuring the |
Yes, that's correct. |
@stuartmorgan-g cool, in that case I believe this story is ready for review once the tree status is addressed. Please let me know if that is incorrect. |
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.
I don't see any testing of the actual implementations, only the Dart passthroughs. The native code should have native unit tests, and if possible (it looks like both the Android and iOS SDKs have a way of programmatically setting building levels), end-to-end integration testing.
On the API itself, after looking at the implementations here and the native SDKs: levels are a component of buildings, and yet this is only reflecting levels; what's the reason for that? It seems like the API would make a lot more sense if it included buildings and the building-change notifications as well.
@@ -17,13 +17,14 @@ flutter: | |||
default_package: google_maps_flutter_ios | |||
web: | |||
default_package: google_maps_flutter_web | |||
publish_to: none |
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.
This needs to be removed, as it is disabling some CI checks.
...flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java
Outdated
Show resolved
Hide resolved
...flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java
Outdated
Show resolved
Hide resolved
@@ -54,7 +54,8 @@ Tile getTile() { | |||
new Messages.PlatformPoint.Builder().setX((long) x).setY((long) y).build(); | |||
handler.post(() -> flutterApi.getTileOverlayTile(tileOverlayId, location, (long) zoom, this)); | |||
try { | |||
// `flutterApi.getTileOverlayTile` is async, so use a `countDownLatch` to make it synchronized. | |||
// `flutterApi.getTileOverlayTile` is async, so use a `countDownLatch` to make it |
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 are there formatting changes in a bunch of unrelated files?
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.
I can resolve these. Not sure, could've ran the wrong formatter maybe? But I figured a CI check would fail if I had.
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.
Code formatters generally don't remove line breaks in comments, so adding extra line breaks won't fail CI.
|
||
/// Describes a single level in a building. | ||
/// | ||
/// Multiple buildings can share a level - in this case the level instances will compare as equal, |
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.
What code in the class below makes this comment true?
@@ -167,6 +167,12 @@ class MethodChannelGoogleMapsFlutter extends GoogleMapsFlutterPlatform { | |||
return _events(mapId).whereType<MapLongPressEvent>(); | |||
} | |||
|
|||
@override | |||
Stream<MapActiveLevelChangedEvent> onActiveLevelChanged( |
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.
The changes to this file should be reverted; the method channel code is only for compatibility with any legacy third-party implementations, and by definition legacy implementations won't have support for new features.
' from pubspec - DC
…to be more simple - DC
@ChopinDavid are you still waiting on something or can this just be rebased and reviewed? |
@ash2moon Sorry, been meaning to get around to @stuartmorgan-g's other comments but have been having a hard time finding free time to do so. I believed this PR was ready to review, but it sounds like Stuart had some concerns so I'd hold off from merging until I address those, but I'd say feel free to review. As much feedback as possible is appreciated. |
@stuartmorgan-g The idea originally was that, at least on the iOS side, the only native methods we are tying into are reflecting changes in the indoor level and not the indoor building. I thought we were doing the same on Android, but now see we are for some reason tying into both building and floor listeners. I will try to make it so that we do not need to override I would think this PR makes sense to merge if we can get it to a point where we are only tying into native methods reflecting changes in indoor levels and not buildings as well. If I can make it so we no longer tie into If it is the case that we do, in fact, need to continue to tie into I'm curious what others think re: whether we move this forward if we can make it so that we are no longer tying into native methods reflecting indoor building changes. If we don't think this is the right path forward, I'm afraid this PR will more than likely sit in an open state for a long time without contributions from others. As you can see, its taken me 3 weeks to find the time to even take another look at these requested changes and I'm still trying to work through them. |
It seems weird to me to only partially implement the From the iOS side, other than it being confusing on why we don't implement the entire As mentioned before, though, this would need more tests. |
Could you elaborate (either here or in the issue) on what your use case is? I'm trying to understand under what circumstances it's useful to know what floor of a building is being displayed without knowing what the building is. |
@ChopinDavid Are you still working on this? |
This PR would introduce a listener on
GoogleMap
that notifies anytime the active floor changes on a building when theGoogleMap
isindoorViewEnabled
. This includes handling a null level when a building is unfocused.Sample code:
This would fix #165999
Pre-Review Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2 ↩3