You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a large dataset, we can dynamically use setFeatureState to change some aspects of how a feature is displayed without having to update the entire geojson source. However, this only works with the 'Paint' property.
setFeatureState doesn't change, it's already setting data agnostic to how it will be used
Allowing layout and filters to use 'feature-state' standardises which option work between paint, filter, and layout
Implementation
The text was updated successfully, but these errors were encountered:
Motivation
With a large dataset, we can dynamically use
setFeatureState
to change some aspects of how a feature is displayed without having to update the entire geojson source. However, this only works with the 'Paint' property.paint: { 'icon-opacity': ['case', ['boolean', ['feature-state', 'filtered'], false], 1,.5], },
This works well, but we can't use it for things like
text-size
, orvisibility
that are handled in the 'paint' property.Mock-Up
{ layout: { 'visibility': ['case', ['boolean', ['feature-state', 'filtered'], false], 'visible', 'none'], }
Concepts
setFeatureState
doesn't change, it's already setting data agnostic to how it will be usedAllowing layout and filters to use 'feature-state' standardises which option work between paint, filter, and layout
Implementation
The text was updated successfully, but these errors were encountered: