Skip to content

feat(clustering): Allow clustering on geojson config#89

Open
david-bretaud-dev wants to merge 2 commits into
mainfrom
david-bretaud-dev/feat-add-cluster-display
Open

feat(clustering): Allow clustering on geojson config#89
david-bretaud-dev wants to merge 2 commits into
mainfrom
david-bretaud-dev/feat-add-cluster-display

Conversation

@david-bretaud-dev

Copy link
Copy Markdown
Collaborator

Ticket dataforgoodfr/14_Data4Trees#153

Idea: clustering is enabled directly in the backend config, per layer. There is nothing to do backend side. Then coordo-ts handles the backend config and the frontend interaction for the clusters.

The cluster config in coordo-ts seems complex, but it's their API: https://maplibre.org/maplibre-gl-js/docs/examples/create-and-style-clusters/

For instance, we have to have 3 different levels of cluster

demo-clustering.mp4

// (Later this can be driven by layer metadata from coordo-py.)
const CLUSTER_COLORS = ["#51bbd6", "#f1f075", "#f28cb1"];
const CLUSTER_RADII = [20, 30, 40];
const CLUSTER_STEPS = [100, 750]; // point_count thresholds between the 3 buckets

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Here is an example when I change the cluster step ([10,750])
STEP 1 < 100 <= STEP 2 < 750 <= STEP 3

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.

1 participant