Open stefaniliskovic opened 3 years ago
Pass a getMapboxRef callback to Kepler instance.
<Kepler
id="foo"
mapboxApiAccessToken={mapboxApiAccessToken}
width={width}
height={height}
getMapboxRef={setMapboxRef}
/>
once you have access to mapbox ref you can add dem source and configure map to show 3D terrain
useEffect(() => {
if(mapboxRef) {
const map = mapboxRef.getMap();
map.on('load', () => {
map.addSource("mapbox-dem", {
type: "raster-dem",
url: "mapbox://mapbox.mapbox-terrain-dem-v1",
tileSize: 512,
maxZoom: 16,
});
map.setTerrain({ source: "mapbox-dem", exaggeration });
});
}
}, [mapboxRef])
Is it possibile to use Mapbox 3D terrain in kepler as a map style ?