vue-mapbox-gl icon indicating copy to clipboard operation
vue-mapbox-gl copied to clipboard

MapboxCluster: `id`s of layer and source

Open tmlmt opened this issue 2 years ago • 2 comments

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)?

https://github.com/studiometa/vue-mapbox-gl/blob/24bfc5552d9e319a7c4084732481e18ab887e31b/packages/vue-mapbox-gl/components/MapboxCluster.vue#L136-L139

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.

tmlmt avatar Apr 20 '23 02:04 tmlmt

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 :)

titouanmathis avatar Apr 20 '23 07:04 titouanmathis

👍 Will get to it soon 😊

tmlmt avatar Apr 20 '23 15:04 tmlmt