js-markerclusterer icon indicating copy to clipboard operation
js-markerclusterer copied to clipboard

Migration Feedback

Open aavmurphy opened this issue 2 years ago • 3 comments

[Sorry for multiple points in the same issue] Migrating from (depreciated) https://github.com/mahnunchik/markerclustererplus to v2.0.4

  1. More documentation in README please, with examples of calling each cluster algorithm & each render algorithm,
  • explain differences between them
  • give calling options for them.
  1. Slower... seemed to be lots of re-rendering. (12,000 markers). Maybe load markers into memory, do the clustering once at each zoom level, then just render on the map as you pan close.
  2. After showing/hiding markers with [marker].setVisible(), I called .render() to redraw - it just didn't work, cluster-total's were wrong, saw a cluster-total of 1 one time. Thinking about it, I needed to re-cluster, then re-render. Maybe add an example of this to the documentation as a migration point.
  3. Use cdnjs (or a google version of it) Hope this helps.

aavmurphy avatar Apr 24 '22 17:04 aavmurphy

@aavmurphy Thank you for opening this issue. 🙏 Please check out these other resources that might be applicable:

This is an automated message, feel free to ignore.

jpoehnelt avatar Apr 24 '22 17:04 jpoehnelt

Thanks for capturing these. There are definitely some tradeoffs that were made and I think this library was an early attempt to provide the flexibility that was lacking in previous versions.

One of the questions going forward will be additional forms of rendering. The previous marker clustering implementation used google.maps.OverlayView and had significant challenges around a11y that were blockers for many customers. The rendering of the clusters had also fallen into the trap of a leaky abstraction. Should we provide renderers that use WebGLOverlayView for instance, or OverlayView where the renderer returns a HTMLElement?

Another question is the input data. It's difficult to support all of the edge cases around visibility, setMap, etc as captured in #267. Should we allow something like geojson?

As to speed, markers are definitely the bottleneck on both ends however there is ongoing work that may improve this on the rendering side.

Already available at unpkg.

<script src="https://unpkg.com/@googlemaps/markerclusterer/dist/index.min.js"></script>

Anyone can submit a pr to have support in CDNJS. https://github.com/cdnjs/packages

jpoehnelt avatar Apr 25 '22 22:04 jpoehnelt

An update, checking if I can upgrade to the current (2.5.3) version from legacy clusterer https://github.com/mahnunchik/markerclustererplus

The points I made above are still valid

  • still much slower - its takes a while to first render the page - but once it does, performance is fine.
  • documentation still needed, for example, several examples of algorithm options would be very nice - I had to hunt thru auto-generated doco to find a link to them elsewhere.
  • played around (the page load time was noticeable each time) but didn't find a combination minPoints and radius that quite worked

(Note : I was using Advanced Markers when testing, the legacy clusterer doesn't support them)

aavmurphy avatar Mar 12 '24 16:03 aavmurphy