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

MapboxCluster: ids of layer and source #104

Open
tmlmt opened this issue Apr 20, 2023 · 2 comments · May be fixed by #105
Open

MapboxCluster: ids of layer and source #104

tmlmt opened this issue Apr 20, 2023 · 2 comments · May be fixed by #105

Comments

@tmlmt
Copy link
Contributor

tmlmt commented Apr 20, 2023

Hey @titouanmathis, is there any reason why you don't allow for a custom id and auto generate ones with add an incremental index, for the 4 components included in a cluster (source, clusters layer, cluster-point layer unclustered layer)?

const id = ref(`mb-cluster-${index}`);
index += 1;
const getId = (suffix) => `${unref(id)}-${suffix}`;

I've noticed some issues when sometimes (haven't figured out when), the index ends up different from 0. Would it be possible to add a prop so that one can set a specific prefix? I can help with a PR if that can help.

@titouanmathis
Copy link
Collaborator

Hi @tmlmt, this was done to be able to skip defining IDs each time we use the component. A prop allowing to override this behavior is a good idea and a PR is more than welcome :)

@tmlmt
Copy link
Contributor Author

tmlmt commented Apr 20, 2023

👍 Will get to it soon 😊

@tmlmt tmlmt linked a pull request Apr 23, 2023 that will close this issue
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 a pull request may close this issue.

2 participants