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

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

Closed
francesco-clementi-92 opened this issue Oct 6, 2021 · 17 comments · Fixed by #29885
Labels
area: google-maps feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@francesco-clementi-92
Copy link

Feature Description

I'd like to use the package https://www.npmjs.com/package/@googlemaps/markerclusterer instead of the old one https://www.npmjs.com/package/@googlemaps/markerclustererplus.

Use Case

It will be possible to use different algorithms, improve performance and more.

@francesco-clementi-92 francesco-clementi-92 added feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team labels Oct 6, 2021
@A2Ple98
Copy link

A2Ple98 commented Oct 7, 2021

I just asked for that yesterday, they can't change the @types/googlemaps to @types/google.maps for that to work, it's one of the future changes in v13 though. You can use skipLibCheck in your tsconfig file to skip the type check

@jelbourn
Copy link
Member

jelbourn commented Oct 7, 2021

I believe #23350 should resolve this. Since the type change constitutes a breaking change, this will be in the next major version (v13).

@jelbourn jelbourn closed this as completed Oct 7, 2021
@crisbeto
Copy link
Member

crisbeto commented Oct 8, 2021

@jelbourn this won't be fixed by #23350 because it only updates the main Google Maps typings, not the clusterer ones which are in a separate package. Reopening.

@crisbeto crisbeto reopened this Oct 8, 2021
@crisbeto crisbeto added area: google-maps P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels Oct 8, 2021
@angular-robot
Copy link
Contributor

angular-robot bot commented Mar 13, 2022

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

@angular-robot
Copy link
Contributor

angular-robot bot commented Apr 1, 2022

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

@crisbeto crisbeto self-assigned this Apr 29, 2022
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 29, 2022
The marker clusterer component is currently based on the `@googlemaps/markerclustererplus` package which is deprecated. These changes rewrite the component to use `@googlemaps/markerclusterer` instead.

BREAKING CHANGES:
The new clustering package doesn't offer the same set of public APIs. As a result, the following inputs to the `MapMarkerClusterer` component have been removed:
* `ariaLabelFn`
* `averageCenter`
* `batchSizeIE`
* `calculator`
* `clusterClass`
* `enableRetinaIcons`
* `gridSize`
* `ignoreHidden`
* `imageExtension`
* `imagePath`
* `imageSizes`
* `maxZoom`
* `minimumClusterSize`
* `styles`
* `title`
* `zIndex`
* `zoomOnClick`
* `options`
The new recommended way of customizing the cluster is to use the `renderer` and `algorithm` inputs.

Fixes angular#23695.
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 29, 2022
The marker clusterer component is currently based on the `@googlemaps/markerclustererplus` package which is deprecated. These changes rewrite the component to use `@googlemaps/markerclusterer` instead.

BREAKING CHANGES:
The new `@googlemaps/markerclusterer` API should be imported instead of the old one. Read more at: https://github.com/googlemaps/js-markerclusterer

Furthermore, the new clustering package doesn't offer the same set of public APIs. As a result, the following inputs to the `MapMarkerClusterer` component have been removed:
* `ariaLabelFn`
* `averageCenter`
* `batchSizeIE`
* `calculator`
* `clusterClass`
* `enableRetinaIcons`
* `gridSize`
* `ignoreHidden`
* `imageExtension`
* `imagePath`
* `imageSizes`
* `maxZoom`
* `minimumClusterSize`
* `styles`
* `title`
* `zIndex`
* `zoomOnClick`
* `options`

It is now recommended to customize the cluster using the `renderer` and `algorithm` inputs.

Fixes angular#23695.
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 29, 2022
The marker clusterer component is currently based on the `@googlemaps/markerclustererplus` package which is deprecated. These changes rewrite the component to use `@googlemaps/markerclusterer` instead.

BREAKING CHANGE:
The new `@googlemaps/markerclusterer` API should be imported instead of the old one. Read more at: https://github.com/googlemaps/js-markerclusterer

Furthermore, the new clustering package doesn't offer the same set of public APIs. As a result, the following inputs to the `MapMarkerClusterer` component have been removed:
* `ariaLabelFn`
* `averageCenter`
* `batchSizeIE`
* `calculator`
* `clusterClass`
* `enableRetinaIcons`
* `gridSize`
* `ignoreHidden`
* `imageExtension`
* `imagePath`
* `imageSizes`
* `maxZoom`
* `minimumClusterSize`
* `styles`
* `title`
* `zIndex`
* `zoomOnClick`
* `options`

It is now recommended to customize the cluster using the `renderer` and `algorithm` inputs.

Fixes angular#23695.
crisbeto added a commit to crisbeto/material2 that referenced this issue May 9, 2022
The marker clusterer component is currently based on the `@googlemaps/markerclustererplus` package which is deprecated. These changes rewrite the component to use `@googlemaps/markerclusterer` instead.

BREAKING CHANGE:
The new `@googlemaps/markerclusterer` API should be imported instead of the old one. Read more at: https://github.com/googlemaps/js-markerclusterer

Furthermore, the new clustering package doesn't offer the same set of public APIs. As a result, the following inputs to the `MapMarkerClusterer` component have been removed:
* `ariaLabelFn`
* `averageCenter`
* `batchSizeIE`
* `calculator`
* `clusterClass`
* `enableRetinaIcons`
* `gridSize`
* `ignoreHidden`
* `imageExtension`
* `imagePath`
* `imageSizes`
* `maxZoom`
* `minimumClusterSize`
* `styles`
* `title`
* `zIndex`
* `zoomOnClick`
* `options`

It is now recommended to customize the cluster using the `renderer` and `algorithm` inputs.

Fixes angular#23695.
@ghost
Copy link

ghost commented Oct 10, 2022

Does this issue still not consider for new updates? Is it possible to vote again?

@royvanderwesten
Copy link

royvanderwesten commented Nov 30, 2022

We really need to reconsider this issue. It took me too long to realize that I have to use the new Markerclusterer package, but add the script tag of the old markerclustererplus package to the head. Otherwise I get the markerclusterer class not found error. I'm not even sure it's a feature, seems more like a bug to me.

@zellkon
Copy link

zellkon commented Dec 7, 2022

I have same issue, Can we fix this issue ?

@itayperry
Copy link

Will this make the <map-marker-clusterer> component work?

@mmalerba mmalerba removed the has pr label Dec 8, 2022
@andreyjkee
Copy link

Any work in progress for this issue?

@volo4dev
Copy link

It works ? I am facing the problem in Angular v14

image

@PhSlowSense
Copy link

I have the same problem, using the map-marker-clusterer component throw the error "class not found" that recommend to install the deprecated MarkerClustererPlus library...

@rbalet
Copy link

rbalet commented Jun 15, 2023

@PhSlowSense and @volo4dev

For me, the only version that is working is the following.

"dependencies": {
    "@googlemaps/markerclusterer": "^2.1.4",
},
"devDependencies": {
    "@types/google.maps": "^3.53.2",
}

@PhSlowSense
Copy link

PhSlowSense commented Jun 15, 2023

Thanks @rbalet I will try !
Even with your version it is not working :(

image image

It work with @googlemaps/markerclusterer when creating clusters with the class MarkerClusterer itself but it won't work with the selector map-marker-clusterer

@runette
Copy link

runette commented Feb 14, 2024

For information - in my app I created a component based on the code in the draft PR #24853 updated for the latest version of the component and for Dynamic API loading.

This seems to work well for me - but I make no guarantees.

I have added an Input to tell the clusterer when the API is loaded - which I linked to the google map "loaded" output event. I am very sure that there are better ways of doing this but I don't have the time to find out.

If I find the time - I might create a new PR based on this and someone can improve that.

The component is in this gist:

https://gist.github.com/runette/3cc43124bad49df69e28ae177cfdc8b9

the calling html is :

<google-map height="100%"
            width="100%"
            [options]="options"
            (mapInitialized)="loaded($event)"
>
    <new-map-marker-clusterer
        [options]="clusterOptions"
        [apiInitialized]="apiLoaded"
    >
        @for (marker of markerPositions; track marker) {
            <map-marker 
                [position]="marker.position" 
                [icon]="marker.icon" 
                [clickable]="true"
                (mapClick)="markerClick($event)"
            />
        }
    </new-map-marker-clusterer>
</google-map>

and

  loaded($event) {
    this.apiLoaded.next();
}

@jmeinlschmidt
Copy link

jmeinlschmidt commented Jul 30, 2024

Support for Advanced Markers with Marker Clusterer is currently missing. This is related to #29187 and #23695.

As of February 21st, 2024 (v3.56), google.maps.Marker is deprecated. We encourage you to transition to the new google.maps.marker.AdvancedMarkerElement class. Advanced markers provide substantial improvements over the legacy google.maps.Marker class. The minimum version of the Maps JavaScript API with google.maps.marker.AdvancedMarkerElement is 3.53.2. At this time, google.maps.Marker is not scheduled to be discontinued.

crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 17, 2024
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.
crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 17, 2024
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.
crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 17, 2024
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.
crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 17, 2024
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.
crisbeto added a commit that referenced this issue Oct 17, 2024
Adds a new `MapMarkerClusterer` component that is based on the most up-to-date clustering library, and supports both regular and advanced markers.

Fixes #23695.
@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
area: google-maps feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet