-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[google_maps_flutter] Add marker clustering support - android implementation #6185
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] Add marker clustering support - android implementation #6185
Conversation
1410d4e to
8608e82
Compare
9444aa9 to
cb542bf
Compare
|
Did not mean to close. |
cb542bf to
78f9a40
Compare
reidbaker
left a comment
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.
Partial review. Sorry you waited so long this slipped though my radar. Will continue the review tomorrow.
...r_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java
Outdated
Show resolved
Hide resolved
...r_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java
Outdated
Show resolved
Hide resolved
...r_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java
Outdated
Show resolved
Hide resolved
...r_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java
Outdated
Show resolved
Hide resolved
...flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java
Outdated
Show resolved
Hide resolved
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.
Looks great! Just left some comments about nits, tests, and naming :) Would not merge until @reidbaker gives a second review though
...r_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java
Outdated
Show resolved
Hide resolved
...r_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java
Outdated
Show resolved
Hide resolved
...r_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java
Outdated
Show resolved
Hide resolved
...r_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java
Outdated
Show resolved
Hide resolved
...r_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java
Outdated
Show resolved
Hide resolved
...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
...s_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java
Outdated
Show resolved
Hide resolved
...s_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java
Outdated
Show resolved
Hide resolved
...utter_android/android/src/test/java/io/flutter/plugins/googlemaps/MarkersControllerTest.java
Outdated
Show resolved
Hide resolved
b67ab37 to
1e71fb3
Compare
...r_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java
Outdated
Show resolved
Hide resolved
...r_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java
Outdated
Show resolved
Hide resolved
...google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java
Outdated
Show resolved
Hide resolved
...flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java
Outdated
Show resolved
Hide resolved
..._maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkerBuilder.java
Outdated
Show resolved
Hide resolved
...s_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java
Outdated
Show resolved
Hide resolved
...le_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/ConvertTest.java
Outdated
Show resolved
Hide resolved
...s_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java
Outdated
Show resolved
Hide resolved
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.
Document/test the behavior here if onClusterTap is called with an invalid mapId
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 check how this _events method is used elsewhere in the file.
_events function just creates event matcher that matches the mapId, and creating stream with invalid mapId will just create stream that does not match any events ever.
The stream is created for the current mapId and I don't see case where the mapId could be invalid.
Testing this method would test mostly the dart Stream functionality. Not sure how this should be tested.
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.
Ok so what you are saying is that an invalid map id is a user error and is safe to call?
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 it is. The app facing plugin implementation is also hiding the map id from the developer interface.
If anyone uses these plarform interface implementations directly, it is user error to listen wron mapId.
Note that this whole multiplexing behaviour will be removed when this plugin is transformed to use pigeon messaging.
...ges/google_maps_flutter/google_maps_flutter_android/lib/src/utils/cluster_manager_utils.dart
Outdated
Show resolved
Hide resolved
...r_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java
Outdated
Show resolved
Hide resolved
...google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java
Outdated
Show resolved
Hide resolved
..._maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkerBuilder.java
Outdated
Show resolved
Hide resolved
..._maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkerBuilder.java
Outdated
Show resolved
Hide resolved
...ps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkerController.java
Outdated
Show resolved
Hide resolved
...s_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java
Outdated
Show resolved
Hide resolved
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
...s_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/MarkersController.java
Outdated
Show resolved
Hide resolved
4c3ecb0 to
ff0ce89
Compare
camsim99
left a comment
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.
Left some nits but all of my comments have been addressed! Looks good :)
...r_android/android/src/main/java/io/flutter/plugins/googlemaps/ClusterManagersController.java
Outdated
Show resolved
Hide resolved
...ges/google_maps_flutter/google_maps_flutter_android/lib/src/utils/cluster_manager_utils.dart
Outdated
Show resolved
Hide resolved
e2df683 to
51d1517
Compare
camsim99
left a comment
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.
Thanks for fixing my nits! @reidbaker for second review
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.
Ok so what you are saying is that an invalid map id is a user error and is safe to call?
…y test the right constructor
51d1517 to
8bec3de
Compare
flutter/packages@87a7c51...cc47b06 2024-04-30 [email protected] [google_maps_flutter_web] Add marker clustering support (flutter/packages#6187) 2024-04-30 [email protected] [google_maps_flutter_android] Add marker clustering support (flutter/packages#6185) 2024-04-29 [email protected] [go_router] Don't log if `hierarchicalLoggingEnabled` is `true` (flutter/packages#6019) 2024-04-29 [email protected] [file_selector_android] Update `LICENSE` file to include newly added licensed code (flutter/packages#6626) 2024-04-29 [email protected] [file_selector_android] Modifies `getDirectoryPath`, `openFile`, `openFiles` to return file/directory paths instead of URIs (flutter/packages#6438) 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 [email protected],[email protected] 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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…6185) This PR introduces support for marker clustering for Android platform An example usage is available in the example application at `./packages/google_maps_flutter/google_maps_flutter_android/example` on the page `Manage clustering` This is prequel PR for: flutter#4319 and sequel PR for: flutter#6158 Containing only changes to `google_maps_flutter_android` package. Follow up PR will hold the app-facing plugin implementation. Linked issue: flutter/flutter#26863
This PR introduces support for marker clustering for Android platform
An example usage is available in the example application at
./packages/google_maps_flutter/google_maps_flutter_android/exampleon the pageManage clusteringThis is prequel PR for: #4319
and sequel PR for: #6158
Containing only changes to
google_maps_flutter_androidpackage.Follow up PR will hold the app-facing plugin implementation.
Linked issue: flutter/flutter#26863
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto 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.