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
However, after a mouseover and mouseleave, it will however revert to using the default fallback line color instead of the one retrieved with ["get", "0", ["get", "colors"]].
Additionally, this warning will be logged to the console: Expected value to be of type object, but found string instead.
Great find and thanks for the thorough writeup @iokill. You're correct that this is related to #2434. Although I think we should keep this issue open for tracking purposes, the underlying cause is the same:
GeoJSON features are transferred from a Web Worker that does most of the expression evaluation to the main thread.
Expression evaluation for expressions that use feature-state is an exception: it's done on the main thread.
Hi!
mapbox-gl-js version: v0.48
browser: Chrome 68.0.3440.106
Steps to Trigger Behavior
Playing around with the hover-styles example (https://www.mapbox.com/mapbox-gl-js/example/hover-styles/), I encountered an issue that nested objects in a features object will not work after setFeatureState is called.
More specifically, doing this will work fine on initial rendering.
However, after a
mouseover
andmouseleave
, it will however revert to using the default fallback line color instead of the one retrieved with["get", "0", ["get", "colors"]]
.Additionally, this warning will be logged to the console:
Expected value to be of type object, but found string instead.
Link to Demonstration
https://jsfiddle.net/43bq7mfg/
Expected Behavior
Using
get
on nested objects in feature properties to work after usingsetFeatureState()
Actual Behavior
Using
get
on nested objects in feature properties logs a warning and will revert to the fallback/default value.I'm not sure, but could this be related to #2434?
The text was updated successfully, but these errors were encountered: