Skip to content

Basic implementation of using MarkerClusterer#123

Closed
AbeCole wants to merge 9 commits intoMicheleBertoli:masterfrom
AbeCole:master
Closed

Basic implementation of using MarkerClusterer#123
AbeCole wants to merge 9 commits intoMicheleBertoli:masterfrom
AbeCole:master

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.

2 participants