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
It is often useful to define an identity property-function. For example, when styling a 3d building, users might have a feature property called height which maps directly to the pixel height of the building. Presently a user might define such a function like:
{property: 'height',steps: [[0,0],[1000,1000]]}
We could make this use case more ergonomic and safe by adding an identity function type
{property: 'height',type: 'identity'}
The identity function may also allow using colors in property functions, which was previously impossible
👍 . This also takes the work out of having to figure out or guess at the max value to include in the highest stop (currently if the stops are [[0, 0], [1000, 1000]] and there are buildings higher than 1000, that highest stop will chop them all off at 1000).
I'm hesitant to even make the following suggestion, because it may be a bit of a slippery slope, but we may also consider something like a multiplier property, which would turn
Activity
lbud commentedon Aug 19, 2016
👍 . This also takes the work out of having to figure out or guess at the max value to include in the highest stop (currently if the stops are
[[0, 0], [1000, 1000]]and there are buildings higher than 1000, that highest stop will chop them all off at 1000).lbud commentedon Aug 19, 2016
I'm hesitant to even make the following suggestion, because it may be a bit of a slippery slope, but we may also consider something like a
multiplierproperty, which would turn{ "property": "height", "type": "exponential", "steps": [[0, 0], [1000, 3000]] }into
{ "property": "height", "type": "identity", "multiplier": 3 }scothis commentedon Aug 19, 2016
lucaswoj and I have been batting around the idea of derived values, they would address your use case and a lot more @lbud.
The exact syntax is tbd, but you could do something like:
{ "property": ["*", { "$ref": "height" }, 3], "type": "identity" }... or convert celsius to fahrenheit.
{ "property": ["+", ["*", { "$ref": "temperature" }, ["/", 9, 5], 32]], "type": "identity" }As more functions are introduced, the power of the concept grows. To select the the red channel of a color
{ "property": ["rgba", ["red", { "$ref": "color" }], 0, 0, 0.5], "type": "identity" }Slippery slope archived.
lbud commentedon Aug 19, 2016
👀