maplibre-gl-js icon indicating copy to clipboard operation
maplibre-gl-js copied to clipboard

Add 3D Tiles / batched-model support

Open bertt opened this issue 4 months ago • 5 comments

In MapBox GL JS v3 there is support for 'batched-model', with this we can add glTF 2.0 models to the map (like 3D Tiles).

Demo: https://bertt.github.io/mapbox_3dtiles_samples/samples/standard/tienhoven/

image

Sample code:

map.addSource('bag-3d', {
        "type": "batched-model",
        "maxzoom": 15,
        "minzoom": 15,
        "tiles": [
          "https://bertt.github.io/mapbox_3dtiles_samples/samples/standard/tienhoven/content/{z}-{x}-{y}.glb"
        ]
      }
)});

// add the custom style layer to the map
map.on('style.load', () => {
  map.addLayer({
    id: 'bag-layer',
    type: 'model',
    source: 'bag-3d',          
  });

Can we have support for batched-model in MapLibre as well?

bertt avatar Mar 05 '24 13:03 bertt