Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace property spec "function" property with "interpolatable" property #4194

Closed
jfirebaugh opened this issue Feb 3, 2017 · 0 comments · Fixed by #6505 or #6521
Closed

Replace property spec "function" property with "interpolatable" property #4194

jfirebaugh opened this issue Feb 3, 2017 · 0 comments · Fixed by #6505 or #6521
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)

Comments

@jfirebaugh
Copy link
Contributor

The "function" property in the style specification JSON for a style property currently takes on the enumerated values "interpolated" and "piecewise-constant". These terms are a historical accident, not used elsewhere in our function vocabulary.

The "function" property is used:

  • To select a default function type if the function itself does not have a "type" property. (If "function": "interpolated", then "type": "exponential", else "type": "interval".)
  • In function validation, to prohibit the use of exponential functions when the property is not interpolatable.
  • To check if interpolation is possible for purposes of style transitions.
  • In function validation, to mandate the use of integer stops when the property is not interpolatable (though this is proposed for removal).

In essence, what's really being checked in all these cases is "is it possible to interpolate between two values of this property?" This would be more clearly served by a boolean property in the style specification: "interpolatable": true/false.

Whether or not a property is interpolatable can almost be deduced from the property type, with number and color being interpolatable; enum, string, and boolean not; and array reducing to the interpolatability of the element type. But line-dasharray is the exception -- it's not interpolatable, even though it's an array of numbers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)
Projects
None yet
2 participants