Models
The Models component registers 3D model assets to be used in the map. Models can be referenced by model layers to display 3D objects on the map.Import
Basic Usage
Props
models
Pairs of model names to GLTF/GLB file paths, URLs, or asset IDs.Keys are the model names that will be used to reference the model in layer styles. Values can be:
- URL strings pointing to
.gltfor.glbfiles - Asset IDs from
require()statements - Local file paths (with
file://prefix)
Examples
- Basic 3D Models
- Multiple Models
- Dynamic Models
- Animated Models
Model Format Support
The Models component supports:- GLTF (
.gltf) - Text-based format with external resources - GLB (
.glb) - Binary format with embedded resources (recommended for better performance)
Performance Considerations
- Use GLB format instead of GLTF for better loading performance
- Keep model file sizes small (under 1MB when possible)
- Reduce polygon count for models that will be displayed at small scales
- Consider using LOD (Level of Detail) techniques for complex models
- Cache models locally when possible instead of loading from remote URLs
Related Components
- ModelLayer - Layer that renders 3D models
- ShapeSource - Data source for model positions
- MapView - The map container