About
Materials are the render (styling) options for a layer. Each material is set via its key on the layer configuration (for example polygon on a vector layer, or terrain on a terrain layer). Which materials a layer accepts depends on its type.
Materials by layer type
Section titled “Materials by layer type”| Layer type | Materials (config keys) |
|---|---|
vector | point, billboard, text, polyline, polygon |
raster | raster, hillshade, elevationHeatmap |
terrain | terrain |
3d-tiles | model |
Material reference
Section titled “Material reference”| Material | Config key | Used by |
|---|---|---|
| PointMaterial | point | vector |
| BillboardMaterial | billboard | vector |
| TextMaterial | text | vector |
| PolylineMaterial | polyline | vector |
| PolygonMaterial | polygon | vector |
| RasterMaterial | raster | raster |
| HillshadeMaterial | hillshade | raster (raster-dem) |
| ElevationHeatmapMaterial | elevationHeatmap | raster (raster-dem) |
| TerrainMaterial | terrain | terrain |
| ModelMaterial | model | 3d-tiles |
Usage example
Section titled “Usage example”// A vector layer can take several materials at onceview.addLayer({ type: "vector", source: features, point: { color: 0xff0000, size: 10 }, polyline: { color: 0x00ff00, width: 2 }, polygon: { color: 0x0000ff, opacity: 0.5 },});Related Resources
Section titled “Related Resources”- Layer Types — layer types and how to add them
- About Source — the data side