mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.26k stars 2.23k forks source link

Globe view rerenders all items on map on zoom level 6 (all items disappear for a short while) #11936

Open Philip2809 opened 2 years ago

Philip2809 commented 2 years ago

mapbox-gl-js version: Beta with globe

browser: Brave

Using the beta version with the globe projection causes this error: https://user-images.githubusercontent.com/51290462/170308268-a10349d0-a9d4-4eb6-af95-bf5ed90700d6.mp4

From my quick test it happens when you enter zoom level 6

Best regards Philip

Philip2809 commented 2 years ago

Hi again!

This also happens on a otherwise empty map, this codepen sent by @avpeery when I asked about #11934. From a closer perspective and looking at how the lightning changes my best guess this is because you are switching between a flat map and a globe map? Is there any workaround for this? This would also explain why the fitbounds works when the zoom is more then 6 (from my quick testing the change happens then), as when the map is flat you can use the same code as before. A solution to the fitbounds, if the area is small enough, is that you can start flying until you hit zoom 6, then stop the moving and run a fitbounds function. I have no ideas on how to solve the reloading of the icons, any ideas there?

I have attached a video of my findings: https://user-images.githubusercontent.com/51290462/170443286-9e198606-1917-43ee-b816-87e4c605f1ad.mp4

Best Regards Philip

avpeery commented 2 years ago

Hi @Philip2809 Thanks for opening this ticket! At zoom level 6, globe transitions to mercator (switching from draping to 2d) which causes the re-rendering in the examples you've provided.