-
-
Notifications
You must be signed in to change notification settings - Fork 717
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.queryTerrainElevation not returning expected values #3736
Comments
This is dependant on the loaded tiles, in different zoom levels you'd have different terrain tiles, which might change the elevation value. |
Thanks for the response. I understand you might get slightly different elevation values based on zoom level, but is it expected that if we're querying the exact same location every time (Everest, which is 8,849m high) we'd get values that fluctuate widely (143, 646, 12 in a quick test I just did moving around a little on the demo page)? |
Yeah, I see your point. CC: @prozessor13 |
CC: @manhcuongincusar1 maplibre-gl-js/src/ui/camera.ts Line 1493 in db07ac4
|
This is not a bug but rather a problem of naming and documentation.
queryTerrainElevation was introduced to solve this issue. And it still solves it well. What to doPlan A Change the misleading comments, explain what queryTerrainElevation really does. Plan B (better but with breaking changes).
Also we need to fix "3d models with terrain" page. Currently I see no custom objects there. |
I would advise to change the docs as an initial solution. |
Thanks for the explanations. I've updated the test page so it's now displaying the following:
|
map.queryTerrainElevation
returns unexpected values. I've created a demo page that loads elevation tiles and centers on Everest. It then displays the value ofmap.queryTerrainElevation
whenever the mapidle
event is triggered.maplibre-gl-js version: 4.0.2
browser: Chrome Version 121.0.6167.85
Steps to Trigger Behavior
Link to Demonstration
https://design-deploy.eu/maptest.html
Expected Behavior
The page runs:
I'd expect the values written to be close to the height of Everest.
Actual Behavior
Values fluctuate quite widely, also including minus values.
The text was updated successfully, but these errors were encountered: