http://jsbin.com/gatejucoti/edit?html,output
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
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.