Clamp mercator horizon for high pitch angles#7352
Clamp mercator horizon for high pitch angles#7352Timorleiderman wants to merge 1 commit intomaplibre:mainfrom
Conversation
|
Thanks for taking the time to open this PR! Can you also check if this breaks the functionality of allowing the camera to look above the horizon which was added a while back (with clamp to ground false)? Cc: @NathanMOlson |
|
I do not think this change should be made in Maplibre GL JS. For me, allowing pitch angles above 90 is desired behavior. If the camera pitch is far enough above the horizon, the ground should be offscreen. The unit and render tests show the desired behavior. My suggestion is to clamp the pitch angle outside the library if you don't want to allow pitch angles above 90. If you want the library to do it for you, take a look at maxPitch and see if that will serve your needs. |
|
Yeah, I kind of suspected this is what you would say. Makes sense. |
Motivation
Description
maxMercatorHorizonAngleinsidegetMercatorHorizon()insrc/geo/projection/mercator_utils.tsbefore computing tangents.src/geo/projection/mercator_utils.test.tsso 90 degree and 95 degree pitch cases expect a horizon of0.Testing
npm run test-unit -- src/geo/projection/mercator_utils.test.tsNotes