Is there any way to add 3d building textures in mapbox GL JS?
Hi, I want to ask, Is there any way to add 3d building textures on map using GL JS? I found the option to change the color of the buildings in mapbox studio but I want to add textures to the 3D buildings to give more realistic look like Unity. Or does mapbox supports unity webGL builds?
Hi @Vinita18 there's no way to apply textures to a 3d extrusion layer, but our new custom layer interface may suit your needs. They allow for rendering 3d models on your map as seen here. If you have further questions, our support team is available to help.
EDIT: I should have mentioned fill-extrusion-pattern as well. This may be what you were looking for.
The example posted above no longer works. @ryanhamley has the required code changed?
@spencerthayer I'm not sure why that link doesn't work, but we have an official example of adding 3d models to GL JS now: https://docs.mapbox.com/mapbox-gl-js/example/add-3d-model/
It's working, but you changed the map center, but not the model origin, so the model is being rendered somewhere offscreen.