Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

'super cluster' implementation #330

Open
NicoledeGreef opened this issue Jun 17, 2020 · 0 comments
Open

'super cluster' implementation #330

NicoledeGreef opened this issue Jun 17, 2020 · 0 comments

Comments

@NicoledeGreef
Copy link
Collaborator

NicoledeGreef commented Jun 17, 2020

To date, we've not found SMK to suffer performance-wise when clustering data, local or streamed.

We recently heard that a product under development at the BC Dev Exchange Lab found L.markerCluster to be slow and not enough to meet their needs. As such, they decided to implement clustering in their leaflet map using the super cluster product:

https://github.com/mapbox/supercluster

"yeah, the above is using the default Leaflet clusterer "L.ClusterMarkerGroup" that we found to be super slow on our data set. Mainly because it calculates the clusters for every zoom level of the map. Say if the map has 20 zoom levels and you are on level 14 it calculates clusters for 0 - 20. The reason they do that is that they assume you would supply ALL the map points in one go and they are optimizing the map for zoom in and out so as not to recalculate the clusters every time. However, for PIMS the frontend map will pass the current map extent to the API and the API will return only those points (parcels/buildings) that are within that extent. So for every pan or zoom you get a distinct dataset, which then the leaflet default clusterer goes and calculates the same thing 20 times"

This is currently not a high priority for SMK core as we've yet to come across a case of a 'simple map" that our current implementation didn't serve well enough but this is something to keep in our back pocket if needed.

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

No branches or pull requests

1 participant