mapbox-gl-js
mapbox-gl-js copied to clipboard
globe projection zoom out from `GLOBE_ZOOM_THRESHOLD_MAX` to 5.9 repaint symbol disappeared about 200 ms
mapbox-gl-js version: latest 2.9.2
browser: Chroium Edge 102 CPU: AMD Ryzen 5 4500U with Radeon Graphics 2.38 GHz
Steps to Trigger Behavior
src\geo\projection\globe_util.js
export const GLOBE_ZOOM_THRESHOLD_MIN = 5;
export const GLOBE_ZOOM_THRESHOLD_MAX = 6;
- zoom greater than GLOBE_ZOOM_THRESHOLD_MAX
- zoom out, let map zoom becomes less than GLOBE_ZOOM_THRESHOLD_MAX ( like 5.99)
- It disappeared for a short time (more than about 100~200ms?) and then reappeared.
- But globe to mercator (5.99 to 6.01) has no this problem.
Link to Demonstration
https://docs.mapbox.com/mapbox-gl-js/example/globe/
Expected Behavior
Symbol shows Like Steps 4
Actual Behavior
Symbol disappeared 300ms
In order to avoid the problems caused by vector tile, I change the source code to 4.5 and 5.5
export const GLOBE_ZOOM_THRESHOLD_MIN = 4.5;
export const GLOBE_ZOOM_THRESHOLD_MAX = 5.5;
And I use Chroium Perfornmance to diagnosis time span。350ms。
I have faced a similar issue with my cluster layer circles not rendering when the initial map load zoom is 6 or above. In order to rerender the layer, I have to zoom out to 6 or less, then zoom back in. Other projections work fine though.
I am facing a similar issue when in projection="globe" and zoom >=6 is there any fix or workaround for this?
My ugly workaround right now:
<MapGL
projection={zoom < 6 ? "globe": "mercator"} //TODO: fix me
initialViewState={mapSettings.defaults}
...
/>