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
If you create an identity function that points at a string feature property, and the values of that property match the enum values declared in the style spec, the value should be used. Instead, the value gets ignored because of the perceived type difference.
Nicki and I ran into this when she tried to use an identity function to test a text-anchor DDS property. She says that we are intending to use identity functions on enums in core styles.
I haven't worked through enough of this code to see what exactly needs to change, but hopefully it's a straightforward fix.
The text was updated successfully, but these errors were encountered:
ChrisLoer
changed the title
evaluateIdentityFunction ignores valid string input if the propertySpec type is enum
'evaluateIdentityFunction' ignores valid string input if the propertySpec type is 'enum'
Jul 20, 2017
Hm, yeah @ChrisLoer -- looks like we aren't appropriately handling enum values in style functions. Strings that match one of an enum's values should be returned (not happening due to https://github.com/mapbox/mapbox-gl-js/blob/master/src/style-spec/function/index.js#L215, as you said). Also, I think if a categorical or interval function evaluates to a string not matching the enum, we should return undefined.
If you create an identity function that points at a string feature property, and the values of that property match the enum values declared in the style spec, the value should be used. Instead, the value gets ignored because of the perceived type difference.
Nicki and I ran into this when she tried to use an identity function to test a
text-anchor
DDS property. She says that we are intending to use identity functions on enums in core styles.I haven't worked through enough of this code to see what exactly needs to change, but hopefully it's a straightforward fix.
/cc @nickidlugash @anandthakker
The text was updated successfully, but these errors were encountered: