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
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
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 for interval given the options, so I propose adding another linear 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 default MGLStyleFunctionOptionInterpolationBase value of 1.
@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:
// 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?
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.
@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 curve operator accepts a linear interpolation type equivalent to exponential with a base of 1. Therefore, the suggestion above will be implemented in the course of implementing #8074.
Activity
boundsj commentedon May 17, 2017
@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:
as an alias for:
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?
cc @friedbunny @jmkiley
ericrwolfe commentedon May 18, 2017
@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.
1ec5 commentedon Jun 22, 2017
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.
1ec5 commentedon Sep 10, 2017
As part of the expressions implementation in mapbox/mapbox-gl-js#4777, the
curveoperator accepts alinearinterpolation type equivalent toexponentialwith a base of 1. Therefore, the suggestion above will be implemented in the course of implementing #8074./cc @anandthakker
1ec5 commentedon Mar 27, 2018
Implemented in #8074 for iOS SDK v4.0.0 and macOS SDK v0.7.0.