Skip to content

[google_maps_flutter] Add marker clustering support - web implementation - #6187

Merged
jokerttu merged 5 commits into
flutter:mainfrom
CodemateLtd:feature/google_maps_flutter_web_marker_clustering
Apr 30, 2024
Merged

[google_maps_flutter] Add marker clustering support - web implementation#6187
jokerttu merged 5 commits into
flutter:mainfrom
CodemateLtd:feature/google_maps_flutter_web_marker_clustering

Conversation

@jokerttu

Copy link
Copy Markdown
Contributor

This PR introduces support for marker clustering for Web platform

This is prequel PR for: #4319
and sequel PR for: #6158

Containing only changes to google_maps_flutter_web package.

Follow up PR will hold the app-facing plugin implementation.

Linked issue: flutter/flutter#26863

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@jokerttujokerttu changed the title [google_maps_flutter_web] Add marker clustering support[google_maps_flutter] Add marker clustering support - web implementationFeb 29, 2024
@jokerttu
jokerttuforce-pushed the feature/google_maps_flutter_web_marker_clustering branch 3 times, most recently from 4953014 to f1b3296CompareMarch 1, 2024 10:51
@jokerttu
jokerttu marked this pull request as ready for review March 1, 2024 11:11
@jokerttu
jokerttu requested a review from ditman as a code ownerMarch 1, 2024 11:11
@jokerttu

jokerttu commented Mar 1, 2024

Copy link
Copy Markdown
ContributorAuthor

@ditman
Web does not have example app to verify the clustering functionality.

Instead use app-facing package from this PR to test the clustering support on web platform: #4319
And use dependency overriding to force platform implementations from PR:s

To clone and start run the app-facing example app with web clustering from this PR, follow these steps:

  1. Clone and open git@github.com:flutter/packages.git
  2. Fetch pull request ref: git fetch origin pull/4319/head
  3. Create local branch from fetch head: git checkout -b clustering-pr-4319 FETCH_HEAD
  4. Add following dependency overrides:
dependency_overrides:
google_maps_flutter_android:
git:
url: git@github.com:flutter/packages.git
path: packages/google_maps_flutter/google_maps_flutter_android
ref: refs/pull/6185/head
google_maps_flutter_ios:
git:
url: git@github.com:flutter/packages.git
path: packages/google_maps_flutter/google_maps_flutter_ios
ref: refs/pull/6186/head
google_maps_flutter_web:
git:
url: git@github.com:flutter/packages.git
path: packages/google_maps_flutter/google_maps_flutter_web
ref: refs/pull/6187/head
  1. Start example on using web platform at /packages/google_maps_flutter/google_maps_flutter/example

@jokerttu
jokerttuforce-pushed the feature/google_maps_flutter_web_marker_clustering branch from f1b3296 to 1ae83afCompareMarch 7, 2024 08:36
@jokerttu

jokerttu commented Apr 11, 2024

Copy link
Copy Markdown
ContributorAuthor

@ditman is it possible to get review for this PR as iOS implementation is already reviewed and Android has only minor test related tasks to do.

@jokerttu
jokerttuforce-pushed the feature/google_maps_flutter_web_marker_clustering branch from 5bbb35d to f0dcd50CompareApril 15, 2024 06:24
@ditman

Copy link
Copy Markdown
Member

Seems to work on my machine!

Screenshot 2024-04-15 at 5 13 25 PM

@ditmanditman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The marker clustering is super intrusive with the markers themselves, but I guess that's the way it was done in the SDK.

Most of my comments are nitpicking, but there's one blocking observation: we can't add package:js to the dependencies. I hope the links I left help migrating the js-interop layer of markerclusterer to something that is wasm-friendly.

Thanks for the PR and the patience!

Comment threadpackages/google_maps_flutter/google_maps_flutter_web/README.md Outdated
Comment threadpackages/google_maps_flutter/google_maps_flutter_web/pubspec.yaml Outdated
@jokerttu
jokerttuforce-pushed the feature/google_maps_flutter_web_marker_clustering branch from f0dcd50 to ce387c9CompareApril 25, 2024 12:42
@ditman

This comment was marked as resolved.

@jokerttu
jokerttuforce-pushed the feature/google_maps_flutter_web_marker_clustering branch from 7f0d10c to 800a08eCompareApril 29, 2024 07:56
Comment on lines 5 to 9

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ditman@srujzs
Should I remove these lines and update the SDK constraints to 3.3.1 within this PR, or should this be updated separately?
See: CodemateLtd#6 (comment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can clean them up all together later.

@jokerttu
jokerttu requested a review from ditmanApril 29, 2024 08:24
@ditman

Copy link
Copy Markdown
Member

Giving this a final test, want to see if the plugin still works without adding the clustering JS dependency (obviously NOT on the clustering screens, but elsewhere :))

@ditmanditman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still believe marker_clustering_js_interop.dart should be a separate package, and that it should inject the JS as needed, but for now this is good.

I tested without the JS in the page, and everything works until you attempt to "Add cluster manager", and then it fails with a fairly explicit Uncaught TypeError: Cannot read properties of undefined (reading 'MarkerClusterer'), which is fine.

Let's ship this one!

@jokerttu
jokerttuforce-pushed the feature/google_maps_flutter_web_marker_clustering branch from 0080a2c to 9aaaf7dCompareApril 30, 2024 08:26
@jokerttu
jokerttu merged commit cc47b06 into flutter:mainApr 30, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 30, 2024
auto-submitBot pushed a commit to flutter/flutter that referenced this pull request Apr 30, 2024
flutter/packages@87a7c51...cc47b06
2024-04-30 joonas.kerttula@codemate.com [google_maps_flutter_web] Add marker clustering support (flutter/packages#6187)
2024-04-30 joonas.kerttula@codemate.com [google_maps_flutter_android] Add marker clustering support (flutter/packages#6185)
2024-04-29 32538273+ValentinVignal@users.noreply.github.com [go_router] Don't log if `hierarchicalLoggingEnabled` is `true` (flutter/packages#6019)
2024-04-29 43054281+camsim99@users.noreply.github.com [file_selector_android] Update `LICENSE` file to include newly added licensed code (flutter/packages#6626)
2024-04-29 43054281+camsim99@users.noreply.github.com [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 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://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
TecHaxter pushed a commit to TecHaxter/flutter_packages that referenced this pull request May 22, 2024
This PR introduces support for marker clustering for Web platform
This is prequel PR for: flutter#4319
and sequel PR for: flutter#6158
Containing only changes to `google_maps_flutter_web` package.
Follow up PR will hold the app-facing plugin implementation.
Linked issue: flutter/flutter#26863
---------
Co-authored-by: David Iglesias Teixeira <ditman@gmail.com>
@jokerttu
jokerttu deleted the feature/google_maps_flutter_web_marker_clustering branch September 9, 2024 10:44
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
This PR introduces support for marker clustering for Web platform
This is prequel PR for: flutter#4319
and sequel PR for: flutter#6158
Containing only changes to `google_maps_flutter_web` package.
Follow up PR will hold the app-facing plugin implementation.
Linked issue: flutter/flutter#26863
---------
Co-authored-by: David Iglesias Teixeira <ditman@gmail.com>
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
This PR introduces support for marker clustering for Web platform
This is prequel PR for: flutter#4319
and sequel PR for: flutter#6158
Containing only changes to `google_maps_flutter_web` package.
Follow up PR will hold the app-facing plugin implementation.
Linked issue: flutter/flutter#26863
---------
Co-authored-by: David Iglesias Teixeira <ditman@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@jokerttu@ditman