Mapbox-gl-js: Incorrect cross-fading at non-integer zoom levels

Created on 24 Mar 2018  路  3Comments  路  Source: mapbox/mapbox-gl-js

http://jsbin.com/gatejucoti/edit?html,output

crossfade

This is because the crossfade interpolation factor t is designed to cross-fade the property across integer zoom levels, so when you have a non-integer zoom level, the from and to values of the CrossFadedProperty will be incorrect at integer zooms after a non-integer stop.

I think we should disallow non-integer stops for these properties, because they're non-interpolatable so they won't work anyways with data-driven expressions, so I think it may cause confusion if they're supported for camera expressions.

@nickidlugash @natslaughter do you have strong feelings about this?

cc @ansis @anandthakker

bug

All 3 comments

I do think it makes sense to say that for zoom expressions on _any_ non-interpolatable style property -- which are already required to be step expressions -- the expression must use only integer-valued stops.

But, if I'm understanding this right, then we also can (and, I think, should) address this by making sure that in CrossFadedProperty#possiblyEvaluate, we only evaluate the expression at integer zoom levels.

@mollymerp I don't recall ever trying to switch a line pattern between integer z-levels, where this cross-fade issue appeared, and can't think of a use case when switching patterns between z-levels would be necessary.
I don't have any strong opinions on disallowing this.

cc @nickidlugash

I agree, integer-only stops make sense here.

Was this page helpful?
0 / 5 - 0 ratings