-
Notifications
You must be signed in to change notification settings - Fork 6
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
support for zoom + data driven functions #16
Conversation
|
||
} else { | ||
var property = parameters.property === undefined ? '$zoom' : parameters.property; | ||
var zoomAndDataDependent = typeof parameters.stops[0][0] === 'object'; | ||
var dataDependent = zoomAndDataDependent || parameters.property !== undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we've been referring to as "data-driven functions" I think we should rebrand as "property functions" or "feature functions" or "feature property functions" before shipping. "Data-driven" is a more ambiguous name that potentially encompasses a larger suite of features including "feature property functions"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Will this also apply to how we talk about these things externally? Which do you prefer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with talking about data-driven styling in general. This specific feature, however, I have been and will continue to refer to as "property functions."
We support "property functions", "zoom functions", and "property-and-zoom functions" all of which can be referred to as "functions."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not necessarily preferring "property functions" over "feature functions", that's just the terminology I've been test-driving lately.
I've realized more recently that the isPaintValueFeatureConstant
and isPaintValueZoomConstant
would segue more nicely into the "feature functions" naming scheme.
@@ -258,7 +256,7 @@ test('isConstant', function(t) { | |||
property: 'mapbox' | |||
}); | |||
|
|||
t.notOk(f.isGlobalConstant); | |||
t.ok(f.isZoomConstant); | |||
t.notOk(f.isFeatureConstant); | |||
|
|||
t.end(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to add unit tests for "zoom and feature" functions?
Looks good! 🚢 |
👀 @lucaswoj