Skip to content

geo.map

15 functions / 6 types

Modules

Index

FunctionDescription
getGroundColorRead the color a map’s ground is drawn in where no imagery layer covers it. Fails with WrongNodeKind when map is not a map.
getLevelBlendRead the part of the level blend band a map’s imagery blends across, as geo.map.set_level_blend set it.
getMapRead a map: how it is shown, its layers and how its streaming is going. Fails with WrongNodeKind when map is not a map.
getMapsRead every map in the scene, in the order they were spawned, each as geo.map.get_map reads it.
getTerrainGeomorphRead whether a map draws its terrain heights morphed by camera position, as geo.map.set_terrain_geomorph set it.
getTerrainQualityRead the terrain detail every map draws at.
setAirSet the air around the body a map is drawn on, or none. Without air the ground takes the light above the air. Nothing is fetched again.
setAutoExposureGive one map a curve of its own, over its viewports’ curves, for an app that wants each body to look its own way. Absent curve clears it, and the map takes its viewports’ curves again.
setGroundColorSet the color a map’s ground is drawn in where no imagery layer covers it, and answer the color now drawn there.
setLevelBlendSet how sharply a map’s imagery changes from one level of detail to the next.
setSurfaceSet the figure and relief of the body a map is drawn on. The map is drawn again on the new figure from the next frame, and the tiles it holds are kept.
setTerrainGeomorphSet whether a map draws its terrain heights morphed by camera position.
setTerrainHeightScaleSet what every height a map draws is multiplied by, about the surface its heights are measured from. Picks, heights read as drawn, cameras and ENU nodes on the ground follow it. 1 draws the ground at the height its source reports.
setTerrainQualitySet the terrain detail of every map. Higher detail draws finer tiles and costs more GPU time and network traffic. The change applies from the next frame.
spawnMapSpawn a map of streamed imagery and terrain into the scene as a node, and answer the node.
TypeDescription
FlatProjectionThe projection the flat map is drawn in.
MapAirWhat the air around a map’s body is made of, in the units of physically based sky models: the scattering and absorption of the gas, its aerosol and its ozone for each meter of path, each over the red, green and blue channels, with the heights they thin over.
MapElevationThe common height reference used to combine elevation layers and report height samples.
MapStateThe state of a map, as of the last drawn frame.
MapSurfaceThe figure and relief of the body a map is drawn on.
TerrainQualityHow much terrain detail the map draws. Higher draws finer tiles and costs more.

getGroundColor

getGroundColor(args: { map: SceneNode }, transactionId?: string): Promise<ColorColorRgb>

Read the color a map’s ground is drawn in where no imagery layer covers it. Fails with WrongNodeKind when map is not a map.

Returns: An 8-bit colour without an alpha channel. Every channel runs from 0 to 255.

Returns Promise<ColorColorRgb>.

map : SceneNode

The node geo.map.spawn_map answered for the map.

transactionId optional : string

getLevelBlend

getLevelBlend(args: { map: SceneNode }, transactionId?: string): Promise<number>

Read the part of the level blend band a map’s imagery blends across, as geo.map.set_level_blend set it.

Fails with the WrongNodeKind error kind when map is not a map.

Returns Promise<number>.

map : SceneNode

The node geo.map.spawn_map answered for the map.

transactionId optional : string

getMap

getMap(args: { map: SceneNode }, transactionId?: string): Promise<GeoMapMapState>

Read a map: how it is shown, its layers and how its streaming is going. Fails with WrongNodeKind when map is not a map.

Returns: The state of a map, as of the last drawn frame.

Returns Promise<GeoMapMapState>.

map : SceneNode

The node geo.map.spawn_map answered for the map.

transactionId optional : string

getMaps

getMaps(transactionId?: string): Promise<Array<GeoMapMapState>>

Read every map in the scene, in the order they were spawned, each as geo.map.get_map reads it.

Returns Promise<Array<GeoMapMapState>>.

transactionId optional : string

getTerrainGeomorph

getTerrainGeomorph(args: { map: SceneNode }, transactionId?: string): Promise<boolean>

Read whether a map draws its terrain heights morphed by camera position, as geo.map.set_terrain_geomorph set it.

Fails with the WrongNodeKind error kind when map is not a map.

Returns Promise<boolean>.

map : SceneNode

The node geo.map.spawn_map answered for the map.

transactionId optional : string

getTerrainQuality

getTerrainQuality(transactionId?: string): Promise<GeoMapTerrainQuality | undefined>

Read the terrain detail every map draws at.

Returns nothing when the detail set matches none of the named levels.

Returns Promise<GeoMapTerrainQuality | undefined>.

transactionId optional : string

setAir

setAir(args: { air?: GeoMapMapAir; map: SceneNode }, transactionId?: string): Promise<void>

Set the air around the body a map is drawn on, or none. Without air the ground takes the light above the air. Nothing is fetched again.

Fails with WrongNodeKind when map is not a map, and with InvalidArgument when air holds a value that is not finite or out of range.

Returns Promise<void>.

air optional : GeoMapMapAir

The air. Absent, none.

map : SceneNode

The node geo.map.spawn_map answered for the map.

transactionId optional : string

setAutoExposure

setAutoExposure(args: { albedo?: number; curve?: GeoViewportExposureCurve; map: SceneNode }, transactionId?: string): Promise<void>

Give one map a curve of its own, over its viewports’ curves, for an app that wants each body to look its own way. Absent curve clears it, and the map takes its viewports’ curves again.

Fails with WrongNodeKind when map is not a map, and with InvalidArgument when the curve is empty, a point’s lux or share is not a finite number above zero, the lux do not rise strictly, or albedo is negative or not finite.

Returns Promise<void>.

albedo optional : number

The albedo of the reference ground the curve’s shares are for. Absent, the viewport’s.

curve optional : GeoViewportExposureCurve

How bright each amount of light on this map should look.

map : SceneNode

The node geo.map.spawn_map answered for the map.

transactionId optional : string

setGroundColor

setGroundColor(args: { color?: ColorColorRgb; map: SceneNode }, transactionId?: string): Promise<ColorColorRgb>

Set the color a map’s ground is drawn in where no imagery layer covers it, and answer the color now drawn there.

Every imagery layer is drawn over this color, so it shows wherever no layer has a tile and wherever a layer’s tiles are clear, such as past the area a regional layer maps. A map starts with the color geo.map.spawn_map was given, or a neutral gray. Fails with WrongNodeKind when map is not a map.

Returns: An 8-bit colour without an alpha channel. Every channel runs from 0 to 255.

Returns Promise<ColorColorRgb>.

color optional : ColorColorRgb

sRGB color with 8-bit channels (0 to 255). Absent, a neutral gray.

map : SceneNode

The node geo.map.spawn_map answered for the map.

transactionId optional : string

setLevelBlend

setLevelBlend(args: { map: SceneNode; share: number }, transactionId?: string): Promise<void>

Set how sharply a map’s imagery changes from one level of detail to the next.

Where the detail a pixel needs lies between two levels, the map blends the two across a band. share is the part of that band the map blends across: 1, the default, blends across the whole band, and less switches between levels more sharply, which suits a map seen straight down.

Fails with the InvalidArgument error kind when share is not above 0 and at most 1, and with WrongNodeKind when map is not a map.

Returns Promise<void>.

map : SceneNode

The node geo.map.spawn_map answered for the map.

share : number

The part of the blend band to blend across, above 0 and at most 1.

transactionId optional : string

setSurface

setSurface(args: { map: SceneNode; surface: GeoMapMapSurface }, transactionId?: string): Promise<void>

Set the figure and relief of the body a map is drawn on. The map is drawn again on the new figure from the next frame, and the tiles it holds are kept.

Fails with WrongNodeKind when map is not a map, and with InvalidArgument when surface describes no figure.

Returns Promise<void>.

map : SceneNode

The node geo.map.spawn_map answered for the map.

transactionId optional : string

setTerrainGeomorph

setTerrainGeomorph(args: { enabled: boolean; map: SceneNode }, transactionId?: string): Promise<void>

Set whether a map draws its terrain heights morphed by camera position.

With it on, the terrain blends smoothly from one level of detail to the next as the camera moves, tiles meet on one height along their edges, and elevation that arrives late blends in rather than popping. Off, the default, draws the terrain as it always has, so the two can be compared at runtime.

Fails with the WrongNodeKind error kind when map is not a map.

Returns Promise<void>.

enabled : boolean

map : SceneNode

The node geo.map.spawn_map answered for the map.

transactionId optional : string

setTerrainHeightScale

setTerrainHeightScale(args: { exaggeration: number; map: SceneNode }, transactionId?: string): Promise<void>

Set what every height a map draws is multiplied by, about the surface its heights are measured from. Picks, heights read as drawn, cameras and ENU nodes on the ground follow it. 1 draws the ground at the height its source reports.

Fails with WrongNodeKind when map is not a map, and with InvalidArgument when exaggeration is negative or not finite.

Returns Promise<void>.

exaggeration : number

map : SceneNode

The node geo.map.spawn_map answered for the map.

transactionId optional : string

setTerrainQuality

setTerrainQuality(args: { quality: GeoMapTerrainQuality }, transactionId?: string): Promise<void>

Set the terrain detail of every map. Higher detail draws finer tiles and costs more GPU time and network traffic. The change applies from the next frame.

Returns Promise<void>.

transactionId optional : string

spawnMap

spawnMap(args?: { air?: GeoMapMapAir; coordinateCrs?: GeoCrsId; elevation?: GeoMapMapElevation; flatProjection?: GeoMapFlatProjection; groundColor?: ColorColorRgb; surface?: GeoMapMapSurface; terrainHeightScale?: number; terrainQuality?: GeoMapTerrainQuality; view?: GeoMapViewMode }, transactionId?: string): Promise<SceneNode>

Spawn a map of streamed imagery and terrain into the scene as a node, and answer the node.

The map stands at the scene origin with its north pole along the scene’s up axis, z, until its transform is set with the scene.transform statements, which move, turn and scale it. Every statement that acts on the map takes the answered node as map, and scene.despawn removes the map with its layers, ENU nodes and paths. The map and every statement that changes it change the scene only: nothing is saved with a project or undone, and they work outside versioned mode.

The map is drawn on the ellipsoid surface describes, lit through the air air describes, and its ground is drawn in groundColor where no imagery layer covers it.

Spawning a map does not change camera control. Geographic navigation acquires control of its selected camera. Despawning the map releases that control and preserves the camera’s world pose.

The map starts with no layers. Fails with InvalidArgument when surface or air holds a value that is not finite or out of range, when the registry does not hold coordinateCrs, and when coordinateCrs is on a body of another equatorial radius than surface.

Returns Promise<SceneNode>.

air optional : GeoMapMapAir

The air around the body. Absent, none, and the ground takes the light above the air.

coordinateCrs optional : GeoCrsId

Coordinates returned by map conversions, independent of globe or flat display mode. Absent, OGC:CRS84 on the Earth. A map of another body requires the code of that body’s geographic system, such as IAU_2015:49900, which the registry has to hold: register its definition with geo.crs.register first. OGC:CRS84 then names longitude and latitude on the map’s own figure.

elevation optional : GeoMapMapElevation

The common elevation reference. Absent, heights above a geoid with no geoid model, which no terrain can be placed in: the map draws its imagery on the body’s figure and refuses elevation layers.

flatProjection optional : GeoMapFlatProjection

The projection the flat map is drawn in. Absent, Web Mercator.

groundColor optional : ColorColorRgb

sRGB color with 8-bit channels (0 to 255) the ground is drawn in where no imagery layer covers it. Absent, a neutral gray.

surface optional : GeoMapMapSurface

The figure and relief of the body to map. Its equatorial radius has to match the figure of coordinateCrs on another body. Absent, the figure coordinateCrs names, or the WGS 84 Earth, with the Earth’s lowest and highest ground.

terrainHeightScale optional : number

What every height the map draws is multiplied by, about the surface its heights are measured from. Absent, 1.

terrainQuality optional : GeoMapTerrainQuality

The terrain detail of every map. Absent, the detail already set, which starts at medium.

view optional : GeoMapViewMode

Absent, the globe.

transactionId optional : string

FlatProjection

Enum

The projection the flat map is drawn in.

PlateCarree = 1

Longitude and latitude drawn as plain x and y.

WebMercator = 0

EPSG:3857, which stretches the ground toward the poles and cuts them off.

MapAir

What the air around a map’s body is made of, in the units of physically based sky models: the scattering and absorption of the gas, its aerosol and its ozone for each meter of path, each over the red, green and blue channels, with the heights they thin over.

atmosphereHeight : number

The height of the top of the air over the ground, in meters.

groundAlbedo : MathVec3

The share of sunlight the ground throws back into the air.

mieAbsorption : MathVec3

Absorption of the aerosol at the ground, for each meter.

mieAbsorptionExponent : number

The power of the wavelength the aerosol’s absorption falls with.

mieG : MathVec3

The Cornette and Shanks asymmetry of the aerosol’s phase function, between -1, backward, and 1, forward, with 0 even. Where miePeakShare is above zero, this is the broad lobe only.

miePeakG : MathVec3

The asymmetry of a second, narrow lobe of the aerosol’s phase function, between -1 and 1.

miePeakShare : MathVec3

The share of the aerosol’s scattered light in the lobe at miePeakG, from 0 to 1.

mieScaleHeight : number

Meters over which the aerosol thins by a factor of e.

mieScattering : MathVec3

Scattering of the aerosol at the ground, for each meter.

mieScatteringExponent : number

The power of the wavelength the aerosol’s scattering falls with. Zero is grey.

mieSoot : number

The share of mieScattering the aerosol absorbs instead of scattering, as soot does.

ozoneAbsorption : MathVec3

Absorption of the ozone at the middle of its band, for each meter.

ozoneLayerAltitude : number

The height of the middle of the ozone band, in meters.

ozoneLayerHalfWidth : number

Meters from the middle of the ozone band to where it thins to nothing, both ways.

rayleighScaleHeight : number

Meters over which the gas thins by a factor of e.

rayleighScattering : MathVec3

Rayleigh scattering of the gas at the ground, for each meter.

MapElevation

The common height reference used to combine elevation layers and report height samples.

reference : GeoElevationReference

Orthometric heights need a geoid model, so an orthometric reference without one is refused. An elevation layer whose reference cannot be converted to this one is refused too.

MapState

The state of a map, as of the last drawn frame.

coordinateCrs : GeoCrsId

The coordinate CRS used by position results, independent of the display projection.

drawnTiles : number

Tiles drawn in the last frame.

elevationReference optional : GeoElevationReference

error optional : string

Why the map could not be drawn with its current settings, such as when a build runs no map workers. Absent while it draws.

layers optional : Array<GeoMapLayerLayerInfo>

Every layer of the map in draw order: imagery bottom first, then elevation bottom first.

morph : number

How far the map has morphed from the globe, 0, toward the flat map, 1.

node : SceneNode

The map’s node, as geo.map.spawn_map answered it.

requestsInFlight : number

Tile requests the map is waiting on.

surface : GeoMapMapSurface

The figure and relief of the body the map is drawn on.

view : GeoMapViewMode

The view shown, or the view a change in progress heads for.

MapSurface

The figure and relief of the body a map is drawn on.

equatorialRadius : number

The radius at the equator, the ellipsoid’s semi-major axis, in meters. Positive and finite.

highestGround : number

The highest ground on the body, in meters over the figure, assumed until elevation loads. No lower than lowestGround.

lowestGround : number

The lowest ground on the body, in meters over the figure, assumed until elevation loads. Negative where ground stands under the figure.

polarRadius : number

The radius at either pole, in meters. Positive and no greater than the equatorial radius.

TerrainQuality

Enum

How much terrain detail the map draws. Higher draws finer tiles and costs more.

High = 2

Low = 0

Medium = 1