-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] draw polygon don't work with projection globe #2091
Comments
It starts working after a bit updating useControl:
by:
But still don't work if use flyTo before start draw polygon |
I think the error occurs when changing the projection from zoom 0 to the moment when the map becomes flat |
Also this error does not occur when using pure mapbox gl |
mapbox-gl switches between globe and mercator projection under the hood based on zoom level. Unfortunately this behavior is not exposed to third party libraries. The same applies to a lot of mapbox's recent features including terrain, globe, etc. I can try to match it by looking into their source code, but there is no guarantee that it will continue to work with their future releases. You can find a related discussion here. |
This bug related to react-map-gl, not to mapbox-gl, because "Also this error does not occur when using pure mapbox gl" |
Let me clarify. Yes, I understand that this is a problem in react-map-gl. It's not easy to fix because mapbox-gl does not expose any API that notifies react-map-gl when it switches projection modes under the hood. |
Description
Unexpected behaviour when projection is globe - polygon is not closed by clicking on vertex or same issue after flyTo animation
Expected Behavior
No response
Steps to Reproduce
https://visgl.github.io/react-map-gl/examples/draw-polygon with projection "globe"
Environment
Logs
No response
The text was updated successfully, but these errors were encountered: