Replies: 1 comment 6 replies
-
Yes, |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to use TerrainExtension to overlay GeoJSON or MVTs onto Google 3D tiles.
I appreciate this is new and experimental so i'm not sure if this should work and if not whether it may be supported in future.
I'm trying to add MapboxLayers with TerrainExtension but they don't display on the map.
Here is the code:
`// Add Google 3D tiles as interleaved mapbox layer
map.addLayer(new MapboxLayer({
id: 'deckgl-3d',
type: Tile3DLayer,
data: TILESET_URL,
onTilesetLoad: tileset3d => {
tileset3d.options.onTraversalComplete = selectedTiles => {
const uniqueCredits = new Set();
selectedTiles.forEach(tile => {
const {copyright} = tile.content.gltf.asset;
copyright.split(';').forEach(uniqueCredits.add, uniqueCredits);
});
setCredits([...uniqueCredits].join('; '));
return selectedTiles;
};
},
loadOptions: {
fetch: {headers: {'X-GOOG-API-KEY': GOOGLE_MAPS_API_KEY}}
},
operation: 'terrain+draw'
}))
// Add a GeoJSON layer using TerrainExtension
map.addLayer(new MapboxLayer({
id: 'lines',
type: GeoJsonLayer,
data: geojson,
extensions: [new TerrainExtension()],
stroked: true,
filled: true,
getLineColor: [255, 160, 122,255],
getFillColor: [255, 160, 122,255],
getLineWidth:50
}))`
I am also trying to understand if I could drape MVTLayer as well as GeoJSON in the same way.
Beta Was this translation helpful? Give feedback.
All reactions