packages icon indicating copy to clipboard operation
packages copied to clipboard

[google_maps_flutter] Add marker clustering support - web implementation

Open jokerttu opened this issue 1 year ago • 1 comments
trafficstars

This PR introduces support for marker clustering for Web platform

This is prequel PR for: https://github.com/flutter/packages/pull/4319 and sequel PR for: https://github.com/flutter/packages/pull/6158

Containing only changes to google_maps_flutter_web package.

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

Linked issue: https://github.com/flutter/flutter/issues/26863

Pre-launch Checklist

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

jokerttu avatar Feb 23 '24 14:02 jokerttu

@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: https://github.com/flutter/packages/pull/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 [email protected]: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: [email protected]:flutter/packages.git
      path: packages/google_maps_flutter/google_maps_flutter_android
      ref: refs/pull/6185/head
  google_maps_flutter_ios:
    git:
      url: [email protected]:flutter/packages.git
      path: packages/google_maps_flutter/google_maps_flutter_ios
      ref: refs/pull/6186/head
  google_maps_flutter_web:
    git:
      url: [email protected]: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 avatar Mar 01 '24 12:03 jokerttu

@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 avatar Apr 11 '24 13:04 jokerttu

Seems to work on my machine!

Screenshot 2024-04-15 at 5 13 25 PM

ditman avatar Apr 16 '24 00:04 ditman

@jokerttu I've created a fix for the JS-interop layer and left it on your repo:

  • https://github.com/CodemateLtd/packages/pull/6

ditman avatar Apr 27 '24 00:04 ditman

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 :))

ditman avatar Apr 29 '24 23:04 ditman