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

Custom groups #117

Closed
LMarcinkowski opened this issue Feb 1, 2019 · 2 comments
Closed

Custom groups #117

LMarcinkowski opened this issue Feb 1, 2019 · 2 comments

Comments

@LMarcinkowski
Copy link

Is it possible to make custom groups ?
I.E.
I have 3 types of markers on map: A, B, C and i want to make cluster groups.
Clusters for A markers.
Clusters for B markers.
Clusters for C markers.

@mourner
Copy link
Member

mourner commented Feb 1, 2019

No, you'll have to create separate Supercluster indexes for each group.

@MaevskiyE
Copy link

HI @mourner , I believe that I'm doing something wrong. I looked in documentation and everywhere I could. But only this topic looks similar to my goal. I have different kind of markers that I want to clusterize not all together, but by type. So only definite type should be inside cluster

I created two separate indexes and putting them one by one. But unfortunately I see only last one on map. Maybe you can suggest something?

` index = new Supercluster().load(features);
index2 = new Supercluster().load(features2);

self.onmessage = function (e) {
if (e.data.markers) {
loadPoints(e.data.markers);
} else if (e.data.getClusterExpansionZoom) {
postMessage({
expansionZoom: index.getClusterExpansionZoom(e.data.getClusterExpansionZoom),
center: e.data.center,
});
} else if (e.data.bbox && e.data.zoom) {
postMessage(index.getClusters(e.data.bbox, e.data.zoom));
postMessage(index2.getClusters(e.data.bbox, e.data.zoom));
}
};`

Thank you in advance

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

No branches or pull requests

3 participants