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
I'm using code similar to the following, but in attempting to build a hoverState composable -- which relies on map.setFeatureState({id: X, ...}) and map.removeFeatureState({id: X, ...}), have found that the feature id attribute for the features is not available in GeoJSON source/layers. I have not found this issue with Vector Tile sources.
Errors look like this:
Error: The feature id parameter must be provided. setFeatureState style.ts:1251 setFeatureState map.ts:2878 useMapHover mapHover.js:30 callWithErrorHandling runtime-core.esm-bundler.js:199 callWithAsyncErrorHandling runtime-core.esm-bundler.js:206Error: A feature id is required to remove its specific state property. removeFeatureState style.ts:1276 removeFeatureState map.ts:2929 useMapHover mapHover.js:16 callWithErrorHandling runtime-core.esm-bundler.js:199 callWithAsyncErrorHandling runtime-core.esm-bundler.js:206 call runtime-core.esm-bundler.js:6193
As a workaround, I'm able to use :generate-id="true" on the mgl-geo-json-source, like below, but this obviously not ideal (since features can't be referenced later by their actual id).
Similar experiments with :promote-id="'id'" have likewise failed.
General code context/snippets:
(feature.source is currently manually assigned and existing, and feature.sourceLayer is intentionally null, required for xFeatureState() calls on GeoJSON sources)
I'm using code similar to the following, but in attempting to build a hoverState composable -- which relies on
map.setFeatureState({id: X, ...})
andmap.removeFeatureState({id: X, ...})
, have found that the featureid
attribute for the features is not available in GeoJSON source/layers. I have not found this issue with Vector Tile sources.Errors look like this:
As a workaround, I'm able to use
:generate-id="true"
on themgl-geo-json-source
, like below, but this obviously not ideal (since features can't be referenced later by their actualid
).Similar experiments with
:promote-id="'id'"
have likewise failed.General code context/snippets:
(
feature.source
is currently manually assigned and existing, andfeature.sourceLayer
is intentionallynull
, required forxFeatureState()
calls on GeoJSON sources)The text was updated successfully, but these errors were encountered: