-
Notifications
You must be signed in to change notification settings - Fork 821
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
agm-marker-cluster click events are passed to agm-map #1564
Comments
Same issue here. Have you found a solution? |
I have the same issue too. |
Bump, same issue |
Is there even any workaround for this? |
@ruisilva450 you found the solution? |
No. Not really a solution for the use case of this issue, sorry . |
are you sure that it does to the map? Maybe it's just the zoomOnClick property? |
I've tried cluster click event as i've done in the stackblitz([https://stackblitz.com/edit/angular-tst926]), for some reason the click works but the $event parameter is undefined. Atleast in stackblitz the click event gets triggered but in my real application it didn't. |
@doom777, Why the clusterClick event is behaving weird in the sample created in the stackblitz link: clusterClick |
@doom777, do you want to raise a new issue as clusterClick event is being logged as "undefined", the same can be verified from the stackblitz: clusterClick |
correct, clusterClick does not have an event object. https://angular-maps.com/api-docs/js-marker-clusterer/directives/agmmarkercluster#clusterClick |
Then how to get the details of the markers available in a specific cluster using clusterClick? is this feature yet to be implemented? |
well, you place the markers in the cluster based on data, so you can just use the same data <agm-marker-cluster (clusterClick)="clusterClicked(allInstes)">
<agm-marker *ngFor="inst of allInstes" [latitude]="inst.lat" [longitude]="inst.long"></agm-marker>
</agm-marker-cluster> |
You pass allInstes to clusterClicked() function, but how to get markers in specific cluster? In you case you get all markers. |
How to retrieve the values on cluster click event, which fall under the same position ? |
any update on the cluster click event, when click event is fired, i should be able to get all the data present in cluster. |
along with that, please suggest how to update the value of minimumClusterSize dynamically? |
I have debugged the libraries from node_modules from where cluster click is incorporated, below is my findings and suggestions.
If you do the changes and publish in next version.. that would be greatful. |
Any update ? |
Nobody tries the @surendravanga 's changes ? or just a workaround ? |
So, i applied the @surendravanga changes and it works. for those who want to have the content of the cluster, you can do this : In component.html
In component.ts
In node_modules/markerclusterer/ivy_ngcc/fesm2015/agm-markerclusterer.js at line 278: that's a workaround because you have to redone the markerclusterer.js update everytime you delete the node_module folder. @doom777 or @SebastianM, can you add this to the next @agm/clusterer version ? that would be great ! :) |
sounds interesting, I'll look into it. You want to do a PR? |
@Foreverdie Thanks for joining me with the work around. @doom777 . I will do a PR and send you the request. |
Hi @doom777 , @SebastianM I have created the pull request #1877 for cluster click issue. Appreciate if you can approve soon and release in the next version. As node_modules are getting deleted every time when we deploy, we cannot change manually, request you to release soon. Regards, |
Any update ? |
Hello there, I cant get the marker clutterer working with the following setup I am getting this errorERROR in node_modules/@agm/markerclusterer/lib/directives/marker-cluster.d.ts:33:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class. This likely means that the library (@agm/markerclusterer) which declares AgmMarkerCluster has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy. 33 export declare class AgmMarkerCluster implements OnDestroy, OnChanges, OnInit, MarkerClustererOptions {If there is a working sample hosted somewhere, can anyone pls point that to me ? thanks |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
any news on this issue ? It would be a nice update to have the data on clusterClick (returns undefined at the moment) |
I'm also waiting for news into this issue. Is there any update? |
Same issue for me ! Any update please ? |
same here |
Hi.
Great library by the way.
I have a small issue that I believe should be marked as a bug with regards to click event handling in the agm-marker-cluster.
For agm-marker(s) the click events are NOT passed through to the agm-map but for the marker that represents the cluster the click events are passed on to the agm-map.
This causes me issues as I have click handlers on the map that I do NOT want executed when clicking on a marker and this should include the cluster marker.
Is there anyway I can tell the cluster maker not to pass the event on up the chain to the agm-map ???
I realise that click events on cluster markers have default behaviours, which is what I do want i.e. center map based on cluster and zoom to best fir the makers in the clicked cluster.
My main problem is that I have a click event on the map that performs other functionality and I definitely do NOT want this executed when clicking on ANY markers, including cluster markers.
Regards
Steve
The text was updated successfully, but these errors were encountered: