Skip to content
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

Implement new map marker clusterer #29885

Merged
merged 3 commits into from
Oct 17, 2024
Merged

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Oct 17, 2024

The history of clustering in Google Maps is complicated, but the result is that our current map-marker-clusterer component is based on top of an unmaintained API. We haven't been able to switch to the new one without breaking changes, because it doesn't offer the same set of features as the old one. Furthermore, the current clusterer only supports the Marker class which is deprecated, but not the AdvancedMarker which is the recommended class to use for markers, whereas the new API supports both kinds of markers. These changes attempt to cover both existing users and users who want to use the new API by:

  1. Renaming the map-marker-clusterer to deprecated-map-marker-clusterer.
  2. Introducing a new map-marker-clusterer based on top of the new API.
  3. Adding an ng update schematic to rename existing usages.

Fixes #23695.

@crisbeto crisbeto added target: major This PR is targeted for the next major release merge: preserve commits When the PR is merged, a rebase and merge should be performed labels Oct 17, 2024
@angular-robot angular-robot bot added detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit labels Oct 17, 2024
@crisbeto crisbeto force-pushed the replace-clusterer branch 2 times, most recently from 0619bc3 to db740bd Compare October 17, 2024 11:31
@crisbeto crisbeto marked this pull request as ready for review October 17, 2024 11:32
@crisbeto crisbeto requested a review from a team as a code owner October 17, 2024 11:32
@crisbeto crisbeto requested review from amysorto, wagnermaciel and andrewseguin and removed request for a team October 17, 2024 11:32
@amysorto amysorto added the dev-app preview When applied, previews of the dev-app are deployed to Firebase label Oct 17, 2024
Copy link

github-actions bot commented Oct 17, 2024

Deployed dev-app for a0742c9 to: https://ng-dev-previews-comp--pr-angular-components-29885-dev-ufuii8oi.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

Deprecates the existing `MapMarkerClusterer`, because it's based on a deprecated library that doesn't support advanced markers.
A new clusterer component will be introduced that supports both regular markers and advanced ones, and is based on the current marker library.

BREAKING CHANGE:
* The new @googlemaps/markerclusterer API should be imported instead of the old one. Read more at: https://github.com/googlemaps/js-markerclusterer
* The `MapMarkerClusterer` class has been renamed to `DeprecatedMapMarkerClusterer`.
* The `map-marker-clusterer` selector has been changed to `deprecated-map-marker-clusterer`.
@Component({
selector: 'google-map-demo',
templateUrl: 'google-map-demo.html',
standalone: true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this will be the default when released, we can remove this line from the example

Adds a new `MapMarkerClusterer` component that is based on the most up-to-date clustering library, and supports both regular and advanced markers.

Fixes angular#23695.
Since the clusterer's class and tag were renamed, we need to migrated existing users to the new name.
@crisbeto crisbeto removed the request for review from wagnermaciel October 17, 2024 14:49
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Oct 17, 2024
@crisbeto crisbeto merged commit b9deeee into angular:main Oct 17, 2024
24 checks passed
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker detected: breaking change PR contains a commit with a breaking change detected: feature PR contains a feature commit dev-app preview When applied, previews of the dev-app are deployed to Firebase merge: preserve commits When the PR is merged, a rebase and merge should be performed target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(ANGULAR GOOGLE MAPS): Is it possible to use the new package @googlemaps/markerclusterer?
3 participants