-
-
Notifications
You must be signed in to change notification settings - Fork 727
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
Map freeze if mouse event below terrain #3928
Comments
I think solving the following issue will probably avoid this scenario. |
I also feel like adding exception handler feels like a hack and that it would be best to solve this at the source. However, can the camera really be kept above terrain at all times. What about an animated camera using If it helps, I can add these handlers in a pull request. Another solution could be to prevent the LatLng constructor from throwing errors in such cases, e.g. adding a parameter flag like |
Yes, there was an initial PR to do it, but it changed the map settings so it needed more work: |
I feel that a try/catch or similar - although it may feel like you have simply hacked around the problem - is actually pretty valid here:
|
Your points are valid, and I won't reject a PR to patch the code until we properly fix the problem. I would advise to add a comment to saying this should be removed after the issue is resolved. |
maplibre-gl-js version: 4.1.2
browser: Chrome 123
Steps to Trigger Behavior
Link to Demonstration
https://maplibre.org/maplibre-gl-js/docs/examples/3d-terrain/
Expected Behavior
Map can be moved / dragged
Actual Behavior
Map UI freezes completely and unrecoverable. To the end user, this is like "crashing" the application.
Reason for failure
The map freezes because
map.unproject
throws an error if it cannot calculate coordinates below terrain. It seems this can happen quite easily with normal user interaction.Ideas for remediations
The text was updated successfully, but these errors were encountered: