-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add "Linear" MGLInterpolationMode #8457
Comments
@ericrwolfe I wanted to check in again here to see how much of a pain point this still is now that the API has existed for awhile and documentation and examples have improved. I think what is proposed here would lead to an API that allows for something like: circleStyleLayer.circleColor = MGLStyleValue<MGLColor>(
interpolationMode: .linear,
cameraStops: stops
) as an alias for: // using an interpolation mode of exponential and passing no options results in linear interpolation
circleStyleLayer.circleColor = MGLStyleValue<MGLColor>(
interpolationMode: .exponential,
cameraStops: stops
) Implementing this API would be trivial. Updating the tests, manual docs, and generated docs would not take that much longer. However, this API would be in addition to the style spec and exist only on one platform. So, I think it is worth checking in again to see if this is really required just on iOS and macOS. Would it be possible to solve this problem by adding something to the relevant existing docs or add some new documentation? |
@boundsj I'd be okay with revisiting this in a future API redesign if cross-platform inconsistency is a concern. I'm not sure I'm aware of any written issues with developers getting tripped up on this (cc @jmkiley), though I'd be interested in user testing some of the more complex APIs with developers at some point. |
Taking off the v3.6.0 milestone since this isn’t going to get fixed in time. Additionally, the entire style function API will be redesigned as part of the expressions feature: #8074. |
As part of the expressions implementation in mapbox/mapbox-gl-js#4777, the /cc @anandthakker |
Implemented in #8074 for iOS SDK v4.0.0 and macOS SDK v0.7.0. |
MGLInterpolationMode
is rather confusing, particularly since only one of the options actually deals with interpolation:exponential
(values interpolated)interval
(not interpolated)categorical
(not interpolated)identity
(not interpolated)90% of developers are going to be using
+[MGLStyleValue valueWithInterpolationMode:cameraStops:options:]
and will be looking for linear interpolation as the default. Right now, I naturally reach forinterval
given the options, so I propose adding anotherlinear
option for clarity:linear
(values interpolated; alias for exponential)exponential
(values interpolated)interval
(not interpolated)categorical
(not interpolated)identity
(not interpolated)This could be a simple alias for
exponential
, with the defaultMGLStyleFunctionOptionInterpolationBase
value of 1./cc @boundsj @jmkiley @friedbunny
The text was updated successfully, but these errors were encountered: