mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

globe projection zoom out from `GLOBE_ZOOM_THRESHOLD_MAX` to 5.9 repaint symbol disappeared about 200 ms

Open zxj5470 opened this issue 1 year ago • 2 comments

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;
  1. zoom greater than GLOBE_ZOOM_THRESHOLD_MAX image
  2. zoom out, let map zoom becomes less than GLOBE_ZOOM_THRESHOLD_MAX ( like 5.99) image
  3. It disappeared for a short time (more than about 100~200ms?) and then reappeared.
  4. 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

zxj5470 avatar Jul 21 '22 09:07 zxj5470

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。

image

zxj5470 avatar Jul 21 '22 09:07 zxj5470

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.

TheKeenestKeen avatar Jul 24 '22 07:07 TheKeenestKeen

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}
     ...
/>          

tonnoz avatar Apr 17 '23 19:04 tonnoz