`['distance-from-center']` is barely usable when terrain is enabled
The return value of Transform#calculateDistanceTileData() seems to be dependent on terrain state (probably via Transform#cameraWorldSize?)
This makes it near-impossible to choose a static threshold value for distance-based symbol filtering (e.g. ["<=", ["distance-from-center"], n]) that yields a visually acceptable result regardless of terrain.
Also, it's pretty easy to choose a threshold value where symbols in tiles close to the camera get culled even though intuitively they should show up – this might or might not be another bug (possibly related: https://github.com/mapbox/mapbox-gl-js/issues/11455).
Please note that this is also happening when the projection is mercator (see https://github.com/mapbox/mapbox-gl-js/issues/11243 for a similar issue w/ other projections).
mapbox-gl-js version: 2.11.0 browser: Google Chrome 107.0.5304.110
Steps to Trigger Behavior
- Enable distance-based filtering for some symbol layers using
['distance-from-center'] - Enable terrain w/ exaggeration set to some value
> 0 - Pitch the map to
~70 degso the issue is visible - Observe that filter state is dependent on the terrain's exaggeration
Expected Behavior
Optimally I should be able to empirically choose a value which yields an acceptable visual result that does not depend on the terrain.
Actual Behavior
Cannot determine such a value, the acceptable range changes wildly depending on the terrain's height in the viewport.