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

Basic implementation of using MarkerClusterer #123

Closed
wants to merge 9 commits into from

Conversation

AbeCole
Copy link

@AbeCole AbeCole commented Apr 15, 2019

Made a few changes to allow a basic implementation of MarkerClusterer. In order to do this the following has been done:

  • Added an onCreate callback to child components to callback to the GMaps component
  • In the callback we check if the child is a "Marker" and then add it to the static "markers" array
  • In the "createMap" method we call MarkerClusterer with our Map entity and Markers array

There are still improvements that can be made, this are the mains ones I could think of at this time:

  1. Currently no events are implemented on the MarkerClusterer - most importantly onClick would be handy
  2. Adding/removing a marker after the map has been created will not update the MarkerClusterer instance
  3. Implementing something to allow 'de-clustering' would be very helpful - for example if you have 5 markers with the exact same location you would have a 'cluster' with the number 5 on it, when events are implement the onClick event would be for the whole cluster, it would be ideal to have the cluster 'split' on first click so you can then click the correct one of 5 markers

@AbeCole AbeCole mentioned this pull request Apr 15, 2019
@MicheleBertoli
Copy link
Owner

Thanks for your contribution, @AbeCole

@AnatoleLucet proposed a full modern rewrite in #130
I'm closing this, but let's follow up if we believe that the feature is still relevant in v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants