Closed joecusdin closed 3 months ago
This is not a bug, add model before you add the model layer.
Ok thanks @linze99. I used a model which was part of the style sheet assuming I could use it (e.g. a tree which is part of the standard style...those turbine towers are in the style). I'll add them after the style has loaded in future.
Hey @joecusdin,
The problem here is that geojson layers have a different scope than basemap defined layers. Right now you cannot use already loaded models from basemap style in your own layers.
However, no need to set addModel
, you can directly reference the modelUrl in the model-id section. like "model-id" : "mapbox://models/mapbox/turbinerotor-lod1.glb". And the models should load correcltly
Ok thanks for the clarification @jtorresfabra
mapbox-gl-js version: 3.4.0
browser: Chrome Version 122.0.6261.69
Steps to Trigger Behavior
Link to Demonstration
https://codepen.io/Joe-djc/pen/ZENeJQV#
Expected Behavior
3D models show at positions of GeoJSON points
Actual Behavior
No 3D models are shown, and no errors are thrown. In the demonstration, I have added a circle layer using the same source to show where I expect the models to appear. I am using the "turbinetower-lod1" model (part of the standard style).
Expecting to see 'Turbine Towers' on the black circles