Options
Fog, sky, light and terrain — each a spec and a property path. Created with kind options.
| Type | Class |
|---|---|
"fog" | FogOptions |
"light" | LightOptions |
"sky" | SkyOptions |
"terrain" | TerrainOptions |
"fog" — FogOptions
{"type": "fog"}
| Key | Type | Always required | Notes |
|---|
| Property | Type | Access | Description |
|---|---|---|---|
color | color | read/write | Returns the fog color. |
enabled | boolean | read/write | Returns whether the fog is drawn at all. |
highColor | color | read/write | Returns the color of the upper atmosphere. |
horizonBlend | number | read/write | Returns how far up the sky the fog is blended in. |
rangeEnd | number | read/write | Returns where the fog reaches full strength. |
rangeStart | number | read/write | Returns where the fog starts. |
shaderSource | string | read/write | Returns the custom fog fragment shader source, or an empty string if the built-in blend is used. |
spaceColor | color | read/write | Returns the color of the sky at the zenith, beyond the atmosphere. |
starIntensity | number | read/write | Returns how brightly stars are drawn beyond the atmosphere. |
verticalRangeEnd | number | read/write | Returns the altitude the fog has fully faded out at. |
verticalRangeStart | number | read/write | Returns the altitude the fog starts fading out at. |
"light" — LightOptions
{"type": "light"}
| Key | Type | Always required | Notes |
|---|
| Property | Type | Access | Description |
|---|---|---|---|
ambientColor | color | read/write | Returns the ambient light color. |
ambientIntensity | number | read/write | Returns the ambient light intensity. |
dayCycleLightStops | struct std::vector<massif::LightStop> | read/write | Returns the day-cycle light curve - the "formula" an hour is turned into a look by. |
dayCycleLightsEnabled | boolean | read/write | Returns whether the sun's COLOURS follow its position. |
dayCycleRisingLightStops | struct std::vector<massif::LightStop> | read/write | Returns the curve used while the sun is RISING, if the app set one. |
shadowBias | number | read/write | Returns the shadow depth bias scale. |
shadowCascades | integer | read/write | Returns the number of shadow cascades. |
shadowCasterMargin | integer | read/write | Returns the shadow caster margin in tiles. |
shadowDistance | number | read/write | Returns the shadow distance. |
shadowMapSize | integer | read/write | Returns the shadow map resolution. |
shadowNormalOffset | number | read/write | Returns the shadow normal offset. |
shadowSoftness | number | read/write | Returns the shadow softness. |
shadowStrength | number | read/write | Returns the shadow strength. |
sunAltitude | number | read/write | Returns the sun altitude in degrees above the horizon. |
sunAzimuth | number | read/write | Returns the sun azimuth in degrees. |
sunColor | color | read/write | Returns the sun (directional light) color. |
sunIntensity | number | read/write | Returns the sun light intensity. |
sunOverridingStyle | boolean | read/write | Returns whether this sun overrides the one a style states. |
terrainLightingEnabled | boolean | read/write | Returns whether the sun lights the 3D terrain surface. |
"sky" — SkyOptions
{"type": "sky"}
| Key | Type | Always required | Notes |
|---|
| Property | Type | Access | Description |
|---|---|---|---|
atmosphereColor | color | read/write | Returns the tint applied to Rayleigh scattering. |
atmosphereLuminance | number | read/write | Returns the exposure applied to the scattered light. |
atmosphereSunIntensity | number | read/write | Returns the brightness of the sun driving the atmosphere. |
enabled | boolean | read/write | Returns whether the shader sky is enabled. |
groundColor | color | read/write | Returns the ground color. |
haloColor | color | read/write | Returns the tint applied to Mie scattering. |
horizonBlend | number | read/write | Returns the angular blend width between the horizon color and the sky color. |
horizonColor | color | read/write | Returns the horizon color. |
quality | enum | read/write | Returns how finely the atmosphere is integrated. |
shaderSource | string | read/write | Returns the custom sky fragment shader source, or an empty string if the built-in shader is used. |
skyColor | color | read/write | Returns the zenith sky color. |
sunDiscEnabled | boolean | read/write | Returns whether the built-in shader draws a sun disc. |
type | enum | read/write | Returns what the sky pass draws. |
"terrain" — TerrainOptions
{"type": "terrain", "source": …}
| Key | Type | Always required | Notes |
|---|---|---|---|
source | object std::shared_ptr<TileDataSource> | yes | an id of kind source, or an inline spec |
| Property | Type | Access | Description |
|---|---|---|---|
autoFlattenDuration | number | read/write | Returns how long the terrain takes to sink flat. |
autoFlattenParallax | number | read/write | Returns the screen parallax below which the terrain renders flat. |
autoFlattenRiseDuration | number | read/write | Returns how long the terrain takes to rise back into 3D. |
autoFlattenTilt | number | read/write | Returns the tilt at or above which the terrain renders flat. |
backgroundColor | color | read/write | Returns the terrain background color. |
billboardOcclusionEnabled | boolean | read/write | Returns the billboard/label terrain occlusion state. |
billboardOcclusionTolerance | number | read/write | Returns the billboard/label terrain occlusion tolerance. |
bridges3DEnabled | boolean | read/write | Returns whether bridges and tunnels stand on their own chord (3D bridges). |
cameraClampDuration | number | read/write | Returns the duration of the camera terrain-following correction animation. |
cameraClearance | number | read/write | Returns the camera terrain clearance floor: an explicit minimum height the camera is kept above the terrain surface, in meters. |
depthBias | number | read/write | Returns the clip-space depth bias used when depth-testing draped 2D geometry against the terrain. |
drapeCacheSize | integer | read/write | Returns the drape cache budget in megabytes. |
drapeFillsEnabled | boolean | read/write | Returns whether polygon fills are draped as a render-to-texture surface. |
drapeLinesEnabled | boolean | read/write | Returns whether vt tile lines are also draped (in addition to fills). |
drapeResolution | integer | read/write | Returns the per-tile drape texture resolution, 0 when it follows the screen. |
drapeWorkingSet | integer | read/write | Returns how many drape tiles the automatic resolution assumes are cached at once. |
elevationPrefetchEnabled | boolean | read/write | Returns whether elevation tile prefetching is enabled. |
enabled | boolean | read/write | Returns the enabled state of the terrain. |
exaggeration | number | read/write | Returns the terrain height exaggeration factor. |
flattenMode | enum | read/write | Returns how far a flattened terrain goes back towards a plain 2D map. |
flattenRatio | number | read/write | Returns how far the terrain is flattened right now, 0 (full 3D) to 1 (flat). |
flattened | boolean | read/write | Returns whether the map is asked to render flat. This is the 2D/3D state, whether it was set by the app or by auto-flattening; the switch itself is animated, so for a moment after a change the map is still on its way there. |
maxTileZoomCoarsening | integer | read/write | Returns how many zoom levels below the camera a tile may coarsen to. |
maxTileZoomOffset | integer | read/write | Returns the maximum visible tile zoom offset, relative to the camera zoom level. |
meshResolution | integer | read/write | Returns the terrain mesh resolution. |
minZoom | integer | read/write | Returns the minimum tile zoom level with 3D terrain. |
noDrapeLayerFilter | string | read/write | Returns the style layers that are kept out of the terrain drape bake. |
seamlessTileEdgesEnabled | boolean | read/write | Returns whether seamless tile edge handling is enabled. |
surfaceShaderSource | string | read/write | Returns the custom terrain surface fragment shader source, or an empty string if no shaded surface is drawn. |
switching | boolean | read-only | Returns whether the switch is holding the ground flat while the tiles 3D needs load. |
textOcclusionOpacity | number | read/write | Returns the opacity a label keeps while its anchor is behind 3D content. |
tileEdgeStitchingEnabled | boolean | read/write | Returns whether cross-LOD tile edge stitching is enabled. |
viewDistance | number | read/write | Returns the minimum view distance, in meters. |
viewDistanceFactor | number | read/write | Returns the factor applied to the view distance. |