Skip to content

Source component does not support cluster properties #354

@ajbraudev

Description

@ajbraudev

Describe the bug
setting cluster={true} on a Source component does not pass through. When inspecting the source after it's added, the cluster property does not show, but if I manually add a layer using map.addSource('map-data', {cluster: true}) and inspect, I see the properties. This is causing ['has', 'point_count'] not to work when attempting to cluster using mapbox layers.

To Reproduce
add cluster={true} to a source component, add a Layer component. Try to filter layer by ['has', 'point_count'] and call map.getStyle().sources and you'll see the cluster property missing.

Expected behavior
cluster properties should be passed to the mapbox source, using the filter ['has', 'point_count'] should work on layer component and filter component

Screenshots
When using the component like so: Screen Shot 2021-12-13 at 6 46 04 AM
The source properties are not reflected as show here: Screen Shot 2021-12-13 at 6 43 38 AM
but when I manually add a source like so:
Screen Shot 2021-12-13 at 6 45 07 AM
Properties are show: Screen Shot 2021-12-13 at 6 44 56 AM

Desktop (please complete the following information):

  • OS: macOs
  • Browser Chrome
  • Version [e.g. 22] 1.14.4

Additional context
We need to filter out non-clustered features, and there is no way to do that currently. If there is, please let us know!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions