-
Notifications
You must be signed in to change notification settings - Fork 38
functions without interpolation #237
Comments
For fade transitions between |
Yes, a parameter could be exposed in the style. It might make sense to move away zoom-based overlap to only time-based overlap so that patterns are only crossfaded during timed transitions, not permanently. Separate issue for that: #236 I'm imagining something like this:
|
We can work to accommodate the new functions. If we're going down this road, I think we should apply these new function types to transition-able array properties as well:
|
Is this for UI consistency? It will mean that the users unnecessarily loses the ability to set separate bases for each value in the array, but maybe that's not a big deal. For |
For both UI and spec consistency. I think it would be strange is some array values are transitioned individually ( |
What about if make this change for all transitionable array values, but split |
👍 |
Just to be clear, we're just talking about making |
Right. |
Following up from last comments here and mapbox/mapbox-gl-js#976 (comment). It seems like the consensus is to switch to the |
for properties like *-translate, *-offset mapbox/mapbox-gl-style-spec#237
🚢 |
The functions in the new dash implementation (mapbox/mapbox-gl-js#938) work a bit differently than existing functions. The would need to be treated differently from a ui perspective. It also raises a bunch of other questions. A bit of background on why they work the way they do:
Current functions are always interpolated. For any specific zoom, it finds the nearest step above, the nearest step below, and then interpolates both to get an exact value. This works great for line widths, etc.
But some other value types can't be interpolated like this. Functions for these properties would not be continuous. They would jump sharply when switching between steps.
fill patterns
If fill patterns had functions they might look something like this:
You can't interpolate the string "waves-small" with "waves-medium". I think you want it to choose just "waves-small" for zooms 0-7.99, "waves-medium" for 8-11.99, etc. Transitions between stops could be faded.
Line patterns would work the same way.
dashed lines
Dashes are a specific kind of line pattern. Just like line patterns, dash patterns need to stretch and reset so that the dashes don't look like they are sliding along the line. In the new dashed line implementation mapbox/mapbox-gl-js#938, dash functions work the same way the pattern functions above work:
The two dash sizes, 5 and 3, are never interpolated to get a mixed value. It just chooses the pattern with the closest z <= the current z. So, for zooms 0-7.99 it uses [5, 1] and for zooms 8+ it uses [3, 2].
In the old dash implementation you could provide two separate functions for the dash and gap parts of the pattern. This isn't possible with the new approach.
Since the dash sizes are scaled by the line width you shouldn't need functions in most cases. You should only need functions when you want the proportions to look different at different zooms.
ui
A ui for styling would have to treat these functions differently from number functions. There probably wouldn't be a graph. The first thing that comes to mind is something similar to a table with [z, pattern] pairs, but there could be a better way.
questions
Do the proposed pattern functions work the way you would expect them to and the way they should?
Does it make sense to treat dashes the same way as patterns?
Would this new type of function cause ui problems?
@nickidlugash @edenh @jfirebaugh @peterqliu @lbud
The text was updated successfully, but these errors were encountered: