At August 8 2023 there was a Mapbox announcement about supporting 3D environments in an upcoming release v3, see the blog post https://www.mapbox.com/blog/standard-core-style
There is a live demo site, see https://labs.mapbox.com/labs-standard/#16.64/48.86137/2.290976/-20/62. It shows 3D Tiles models (glTF/b3dm) like the Eiffel Tower in Paris and 3D model trees (glTF models):
Exploring at bit further, there are 2 new data sources defined: ‘model’ (for glTF 2.0 models) and ‘batched-model’ (for 3D Tiles – b3dm). With these new data sources we can add our own (building) 3D models and instanced 3D models (like trees, benches, traffic lights) to the map.
I’ve created some samples that demonstrate how to use these new data sources.
One sample is demonstrating how to add a 3D glTF model to the map using GeoJSON. In this demo a new building placed on the Dam Square in Amsterdam, see https://bertt.github.io/mapbox_3dtiles_samples/samples/standard/3dmodel/
The location of the building is defined in a GeoJSON file (building.geojson):
The glTF model (building.glb) is added in the ‘models’ section of style.json (see https://bertt.github.io/mapbox_3dtiles_samples/samples/standard/3dmodel/style.json)
In the building layer the building source and model are combined:
This construction works on a small number of items, but doesn’t scale well for a lot of items (like trees of a country). Instead of using a GeoJSON data source we can also use a vector tiles data source.
For a demo of using vector tiles in combination with a ‘model’ data source see trees of Utrecht demo (https://bertt.github.io/mapbox_3dtiles_samples/samples/standard/trees/#15.1/52.08999/5.12577/0/58).
In this case the location of the trees is defined in vector tiles (these are protocol buffer files), they are visualized using a tree.glb model:
Tree Layer:
The vector tiles are created by Tippecanoe, see https://bertt.wordpress.com/2023/01/06/creating-vector-pmtiles-with-tippecanoe/ for more information about this tool.
In a next blog I’ll explore the new ‘batched-model’ data source for placing 3D models of buildings.
is this a possibility to show a whole city of lod2 like 3dtiles in cesium?
working on it, demo see https://bertt.github.io/mapbox_3dtiles_samples/samples/standard/delaware/
very nice.
What else is possible?
i checked queryRenderedFeatures on click but this doesnt give me any features.
would be filtering, dynamic coloring on feature properties possible?
also in your example are only lod1 building, but i think lod2 should than also be possible?
higher level lod demo see https://bertt.github.io/mapbox_3dtiles_samples/samples/standard/tienhoven/
a lot more is possible (see CesiumJS) but not supported out of the box I’m afraid
These glTF’s contain Ext_Structural_Metadata, would be nice to show it on click. Also combination with terrain is something to figure out.
thanks.
good point.
i thought that mapboxGL will automatically place it on the terrain. I’m wrong?
that means that also mapboxs landscapes objects will not automatically be placed on the terrain surface?
hope boath, selection and placing on terrain will be supported in the near future.
which tools you are using to create 3dtiles with b3dm? i dont think there are so much tools on the market for creation.
https://github.com/geodan/pg2b3dm
very nice thanks. looks like very good documented!
hey,
do you test if
attributecolumns
can be read from mapboxGL (for example for the style expression: model-color)?@helmuth345 don’t think anything with the attributes works now in Mapbox GL JS
at least in new version 3.3.0 its supports now
queryRenderedFeatures
of models :-).https://github.com/mapbox/mapbox-gl-js/releases/tag/v3.3.0
tested it but it gives only the ? height ? property of the whole glTF. way to go
hope you find a way to write it in the way mapbox need it. maybe it can be find inside the reading of mapboxGl?