Skip to content
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

3D view in maplibre #758

Closed
utagawal opened this issue Feb 10, 2023 · 14 comments · Fixed by #953
Closed

3D view in maplibre #758

utagawal opened this issue Feb 10, 2023 · 14 comments · Fixed by #953

Comments

@utagawal
Copy link

In the native viewer of Tileserver-GL (the index page) would it be possible to have 3D view if the sources contains terrain-rgb DEM data ?

@acalcutt
Copy link
Collaborator

Right now, you could add a terrain layer into your style, like
https://github.com/maplibre/demotiles/blob/gh-pages/styles/osm-bright-gl-terrain/style.json#L5224-L5227

I thought in the past about having a toggle button if a raster-dem existed in sources, but you would have to know the name of the layer. maybe in javascript we could iterate though raster-dem sources and make a button for each of them.

@utagawal
Copy link
Author

@acalcutt as always many thanks for the quick reply. We already have the terrain source in our style hence the request.

If we are using the Terrain entry in our json like this :
"terrain": { "source": "TerrainSource", "exaggeration": 1 }

Would it be possible for the maplibre viewer embedded in tileserver-gl to detect it and enable the 3D view ?

@acalcutt
Copy link
Collaborator

I'm not talking about a terrain source, but a terrain layer (like at the very end of the file I linked). It lets maplibre-gl-js to show the terrain.

@acalcutt
Copy link
Collaborator

acalcutt commented Feb 10, 2023

nevermind, it looks like you already have it. Are you talking about vector viewer or raster? vector/view pages should show terrain. raster/rendered pages can not because maplibre-native does not yet support 3d terrain.

@acalcutt
Copy link
Collaborator

Take this as an example ( https://tiles.wifidb.net/styles/WDB_ATV/#12.33/46.11406/8.27133/-24/58 )

With the terrain source and layer, terrain does show in viewer.

@utagawal
Copy link
Author

utagawal commented Feb 10, 2023 via email

@acalcutt
Copy link
Collaborator

I don't see the terrain layer I mentioned in your style. I do see a 'world-rgb-png' source, but its not used for terrain.

@acalcutt
Copy link
Collaborator

acalcutt commented Feb 10, 2023

Your style is confusing to me. how come you link to other rendered styles as sources?

@acalcutt
Copy link
Collaborator

Do you have an actual terrainrgb/terrarium raster-dem somewhere?

@utagawal
Copy link
Author

Made it working (issue was the style was not refreshed as expected du to the recent implementation of nginx cache).

However I see the 3D camera pitch is kind of limited (also in your example), any reason why ?

@acalcutt
Copy link
Collaborator

acalcutt commented Feb 12, 2023

Do you mean the 60 degree pitch limit? it is a maplibre-gl-js default, we would have to change the view template so it sets the 'maxPitch' map option

options.maxPitch default: 60 The maximum pitch of the map (0-85). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.

In my own maps I usually set maxPitch to 85, like in
https://wifidb.net/wifidb/opt/map.php?func=wifidbmap&labeled=0

@utagawal
Copy link
Author

Do you mean the 60 degree pitch limit?
Exactly

we would have to change the view template so it sets the 'maxPitch' [map option](https://maplibre.org/maplibre-gl-js-docs/api/map/)
Any possibility to have this option ? 60° is very restrictive.

@acalcutt
Copy link
Collaborator

acalcutt commented Feb 16, 2023

I don't think it is a good idea until maplibre-gl-js 3.0 is released which has perfomance updates for terrain. The extra angle makes the map have to load a lot more, so this performance is important. Right now above 60deg is considered experimental.

Also, I think it would be nice if sky was implemented first, which I think also may end up a 3.0 thing.

@utagawal
Copy link
Author

Maplibre 3.0 has been released ! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants