Skip to content

@jdultra/ultra-globe


@jdultra/ultra-globe / UGMap

Class: UGMap

Defined in: UGMap.d.ts:1

Constructors

Constructor

new UGMap(properties, capabilities): UGMap

Defined in: UGMap.d.ts:70

Parameters

properties

any

capabilities

any

Returns

UGMap

Properties

beforeDrawListeners

beforeDrawListeners: any[] | undefined

Defined in: UGMap.d.ts:280


camera

camera: any

Defined in: UGMap.d.ts:168


cameraAnimation

cameraAnimation: { isDone: Object; animate: Object; } | undefined

Defined in: UGMap.d.ts:131


computeElevationAtlasProbe

computeElevationAtlasProbe: any

Defined in: UGMap.d.ts:101


computeElevationProbe

computeElevationProbe: any

Defined in: UGMap.d.ts:100


computePick

computePick: any

Defined in: UGMap.d.ts:208


controller

controller: Controller | undefined

Defined in: UGMap.d.ts:243


csm

csm: any

Defined in: UGMap.d.ts:247


disposeControllerEvents

disposeControllerEvents: { } | undefined

Defined in: UGMap.d.ts:264


disposed

disposed: boolean | undefined

Defined in: UGMap.d.ts:242


distToGround

distToGround: number | undefined

Defined in: UGMap.d.ts:153


domContainer

domContainer: HTMLElement | null

Defined in: UGMap.d.ts:76


elevationAtlasProbeBuffer

elevationAtlasProbeBuffer: any

Defined in: UGMap.d.ts:95


elevationAtlasProbeSlice

elevationAtlasProbeSlice: any

Defined in: UGMap.d.ts:99


elevationAtlasProbeUV

elevationAtlasProbeUV: any

Defined in: UGMap.d.ts:98


elevationExageration

elevationExageration: number | undefined

Defined in: UGMap.d.ts:364


elevationProbeBuffer

elevationProbeBuffer: any

Defined in: UGMap.d.ts:94


elevationProbeLatHiLo

elevationProbeLatHiLo: any

Defined in: UGMap.d.ts:97


elevationProbeLonHiLo

elevationProbeLonHiLo: any

Defined in: UGMap.d.ts:96


FloatingOffset

FloatingOffset: any

Defined in: UGMap.d.ts:74


fsQuad

fsQuad: any

Defined in: UGMap.d.ts:141


gbufferBlitMaterial

gbufferBlitMaterial: any

Defined in: UGMap.d.ts:136


heightAboveEllipsoid

heightAboveEllipsoid: any

Defined in: UGMap.d.ts:146


labelsScene

labelsScene: any

Defined in: UGMap.d.ts:179


layerManager

layerManager: LayerManager

Defined in: UGMap.d.ts:77


logDepthBufFC

logDepthBufFC: number | undefined

Defined in: UGMap.d.ts:148


minHeightAboveGround

minHeightAboveGround: any

Defined in: UGMap.d.ts:75


mrt

mrt: any

Defined in: UGMap.d.ts:211


overlayScene

overlayScene: any

Defined in: UGMap.d.ts:181


pause

pause: boolean | undefined

Defined in: UGMap.d.ts:269


pickBuffer

pickBuffer: any

Defined in: UGMap.d.ts:189


pickCameraNearFar

pickCameraNearFar: any

Defined in: UGMap.d.ts:201


pickCamFwd

pickCamFwd: any

Defined in: UGMap.d.ts:200


pickCamPos

pickCamPos: any

Defined in: UGMap.d.ts:199


pickDepthBias

pickDepthBias: any

Defined in: UGMap.d.ts:206


pickFar0

pickFar0: any

Defined in: UGMap.d.ts:195


pickFar1

pickFar1: any

Defined in: UGMap.d.ts:196


pickFar2

pickFar2: any

Defined in: UGMap.d.ts:197


pickFar3

pickFar3: any

Defined in: UGMap.d.ts:198


pickLdf

pickLdf: any

Defined in: UGMap.d.ts:202


pickNear0

pickNear0: any

Defined in: UGMap.d.ts:191


pickNear1

pickNear1: any

Defined in: UGMap.d.ts:192


pickNear2

pickNear2: any

Defined in: UGMap.d.ts:193


pickNear3

pickNear3: any

Defined in: UGMap.d.ts:194


pickUseSceneDepth

pickUseSceneDepth: any

Defined in: UGMap.d.ts:203


pickUseSplatsDepth

pickUseSplatsDepth: any

Defined in: UGMap.d.ts:205


pickUseVectorDepth

pickUseVectorDepth: any

Defined in: UGMap.d.ts:204


pickUV

pickUV: any

Defined in: UGMap.d.ts:190


planet

planet: Planet | undefined

Defined in: UGMap.d.ts:244


postProcessing

postProcessing: any

Defined in: UGMap.d.ts:171


postQuad

postQuad: any

Defined in: UGMap.d.ts:245


postScene

postScene: any

Defined in: UGMap.d.ts:246


primaryGBuffer

primaryGBuffer: any

Defined in: UGMap.d.ts:184


raycaster

raycaster: any

Defined in: UGMap.d.ts:78


renderCamera

renderCamera: any

Defined in: UGMap.d.ts:169


renderer

renderer: any

Defined in: UGMap.d.ts:210


scene

scene: any

Defined in: UGMap.d.ts:173


sceneShiftListeners

sceneShiftListeners: any[] | undefined

Defined in: UGMap.d.ts:293


secondaryGBuffer

secondaryGBuffer: any

Defined in: UGMap.d.ts:185


selection

selection: { } | undefined

Defined in: UGMap.d.ts:386


selectionListeners

selectionListeners: any[] | undefined

Defined in: UGMap.d.ts:366


shadowUniforms

shadowUniforms: any

Defined in: UGMap.d.ts:80


splatsMRT

splatsMRT: any

Defined in: UGMap.d.ts:212


splatsRT

splatsRT: any

Defined in: UGMap.d.ts:187


splatsScene

splatsScene: any

Defined in: UGMap.d.ts:177


stats

stats: any

Defined in: UGMap.d.ts:257


sunPosition

sunPosition: any

Defined in: UGMap.d.ts:79


targetFPS

targetFPS: number

Defined in: UGMap.d.ts:71


ultraClock

ultraClock: { addListener: Object; setDate: Object; getDate: Object; dispose: Object; isAutoPlay: Object; setAutoPlay: Object; } | undefined

Defined in: UGMap.d.ts:83


vectorScene

vectorScene: any

Defined in: UGMap.d.ts:175


vectorsRT

vectorsRT: any

Defined in: UGMap.d.ts:186


worldFromDepth

worldFromDepth: { } | undefined

Defined in: UGMap.d.ts:207

Methods

addBeforeDrawListener()

addBeforeDrawListener(listener): void

Defined in: UGMap.d.ts:279

Register a function to be called before drawing objects on screen but after adjusting the scene origin to minimize precision issues

Parameters

listener

Function

a function that receives the map as argument

Returns

void


addLayer()

addLayer(layer): number

Defined in: UGMap.d.ts:225

appends the layer to the end of the list of layers, replacing any layer already at that position.

Parameters

layer

Layer

Returns

number


addSceneShiftListener()

addSceneShiftListener(listener): void

Defined in: UGMap.d.ts:292

Register a function to be called whenever the scene origin is changed to minimize precision issues

Parameters

listener

Function

a function that receives the map as argument

Returns

void


addSelectionListener()

addSelectionListener(calback): void

Defined in: UGMap.d.ts:365

Parameters

calback

any

Returns

void


cancelAnimation()

Call Signature

cancelAnimation(): void

Defined in: UGMap.d.ts:128

cancel any ongoing camera animation

Returns

void

Call Signature

cancelAnimation(): void

Defined in: UGMap.d.ts:130

cancel any ongoing camera animation

Returns

void


cartesianToLlhFastSFCT()

cartesianToLlhFastSFCT(xyz): void

Defined in: UGMap.d.ts:358

Transforms a xyz point (degrees) to llh coordinates (EPSG:4326). The transform is slightly inaccurate compared to proj4 but it's 2.5 times faster

Parameters

xyz

any

Returns

void


debugLoadedElevationAtLonLat()

debugLoadedElevationAtLonLat(lonDeg, latDeg): Promise<Object>

Defined in: UGMap.d.ts:124

Diagnostics helper for UGMap.getLoadedElevationAtLonLat. Logs which loaded tiles/meta entries should match, and what the atlas contains at the sampled UV.

Parameters

lonDeg

number

latDeg

number

Returns

Promise<Object>

debug info


dispose()

dispose(): void

Defined in: UGMap.d.ts:241

disposes of the entire map

Returns

void


getAreaController()

getAreaController(): Controller | undefined

Defined in: UGMap.d.ts:262

Returns

Controller | undefined


getLayerByID()

getLayerByID(id): Layer

Defined in: UGMap.d.ts:253

Fetches a specific layer by ID.

Parameters

id

string | number

Returns

Layer

the layer with given ID if any


getLayers()

getLayers(): Layer[]

Defined in: UGMap.d.ts:237

Returns an array of layers currently loaded on the map

Returns

Layer[]

the list of layers


getLoadedElevationAtLonLat()

getLoadedElevationAtLonLat(lonDeg, latDeg): Promise<number>

Defined in: UGMap.d.ts:115

Reads the elevation at the given lon/lat from the currently loaded elevation atlas.

Notes:

  • This does not trigger tile loading.
  • Coordinates are in degrees.
  • Uses hi/lo splitting to match the shader-side bounds checks.

Parameters

lonDeg

number

longitude in degrees

latDeg

number

latitude in degrees

Returns

Promise<number>

elevation in meters (includes Planet.elevationExageration)


getRullerController()

getRullerController(): Controller | undefined

Defined in: UGMap.d.ts:261

Returns

Controller | undefined


getShapeCreationController()

getShapeCreationController(): Controller | undefined

Defined in: UGMap.d.ts:259

Returns

Controller | undefined


getShapeEditController()

getShapeEditController(): Controller | undefined

Defined in: UGMap.d.ts:260

Returns

Controller | undefined


llhToCartesianFastSFCT()

llhToCartesianFastSFCT(llh): void

Defined in: UGMap.d.ts:352

Transforms a lon lat height point (degrees) to cartesian coordinates (EPSG:4978). The transform is slightly inaccurate compared to proj4 but it's 3 times faster

Parameters

llh

Vector3

Returns

void


moveAndLookAt()

moveAndLookAt(cameraPosition, cameraAim, ease?): Function

Defined in: UGMap.d.ts:321

Moves the camera to a location in lon lat height and looks at another location in lon lat height.

Parameters

cameraPosition

Object

an object representing the camera desired location in lon lat height (according to WGS84 coordinates)

cameraAim

Object

an object representing the camera desired target in lon lat height (according to WGS84 coordinates)

ease?

Object

ease function params

  • [ease.time = 2000] ease total time in ms
  • [ease.function = undefined] defaults to a quadratic ease-in-out function. specify your own function that accepts a number between 0 and 1 and returns a number between 0 and 1.
  • [ease.callback = undefined] callback called with no parameter when the camera movement is finished.

Returns

Function

a cancel function that stops the animation


moveCameraAboveSurface()

moveCameraAboveSurface(camera?): void

Defined in: UGMap.d.ts:152

Moves the camera above the ground.

Parameters

camera?

any

Returns

void


orbit()

orbit(center, start?, time?, onMoveCallback?): Object

Defined in: UGMap.d.ts:339

Parameters

center

Object

a center point in lon lat height (x,y,z properties)

start?

Object

a start camera location in lon lat height (x,y,z properties). defaults to the current camera position

time?

number

the time in ms for a full orbit

onMoveCallback?

Function

a callback function called every time the camera moves with the camera as argument

Returns

Object

a cancel function that can be used to stop the animation


pauseRendering()

pauseRendering(): void

Defined in: UGMap.d.ts:268

Pauses the rendering of all the layers.

Returns

void


raycastTerrain()

raycastTerrain(raycaster): Vector3

Defined in: UGMap.d.ts:345

raycast only on terrain

Parameters

raycaster

any

Returns

Vector3

the nearest point along the raycaster ray in lon lat height


removeAllLayers()

removeAllLayers(dispose?): void

Defined in: UGMap.d.ts:232

Parameters

dispose?

boolean

Returns

void


removeBeforeDrawListener()

removeBeforeDrawListener(listener): void

Defined in: UGMap.d.ts:286

Removes a function that is called before drawing objects on screen but after adjusting the scene origin to minimize precision issues

Parameters

listener

Function

a function that receives the map as argument

Returns

void


removeLayer()

removeLayer(layer, dispose?): void

Defined in: UGMap.d.ts:231

removes the layer at the specific index optionally "disposing" of any resources the layer is using.

Parameters

layer

any

a layer or layer id

dispose?

boolean

disposes of the layer and assocaiated resources if true

Returns

void


removeSceneShiftListener()

removeSceneShiftListener(listener): void

Defined in: UGMap.d.ts:299

Removes a function that is called whenever the scene origin is changed to minimize precision issues

Parameters

listener

Function

a function that receives the map as argument

Returns

void


removeSelected()

removeSelected(): void

Defined in: UGMap.d.ts:371

deletes selected objects

Returns

void


removeSelectionListener()

removeSelectionListener(callback): void

Defined in: UGMap.d.ts:367

Parameters

callback

any

Returns

void


resetCameraNearFar()

resetCameraNearFar(): void

Defined in: UGMap.d.ts:145

When moving the map.camera manually, you may want to call this method to correctly set the camera near and far to limit z-fighting artefacts.

Returns

void


resumeRendering()

resumeRendering(): void

Defined in: UGMap.d.ts:273

Resumes the rendering of all the layers

Returns

void


screenPixelRayCast()

screenPixelRayCast(x, y, sideEffect, useSceneDepth?, useVectorDepth?, useSplatsDepth?, depthBias?): Promise<Vector3>

Defined in: UGMap.d.ts:166

Async WebGPU picking using Compute Shader. Reads world position directly from GBuffer Texture [2].

Parameters

x

number

Screen pixel x

y

number

Screen pixel y

sideEffect

Vector3

Optional vector to update

useSceneDepth?

boolean

When true, considers meshes depth.

useVectorDepth?

boolean

When true, considers vectors depth.

useSplatsDepth?

boolean

When true, considers splats depth.

depthBias?

number

Bias added to the sampled depth value (depth-buffer units), pushing the reconstructed position slightly further away.

Returns

Promise<Vector3>

Resolves with the hit position or undefined


select()

select(screenLocation, type): Promise<{ selection: Object; selected: any[]; unselected: any[]; }>

Defined in: UGMap.d.ts:381

Select action at a particular location on this map (normalized between -1 and 1). This method is asynchronous because it may perform an async WebGPU pick to obtain a world position from the GBuffer when layers require raycast-on-depth.

Parameters

screenLocation

Vector2

NDC coords in range [-1,1]

type

number

0(Add), 1(Remove) or 2(Replace)

Returns

Promise<{ selection: Object; selected: any[]; unselected: any[]; }>

Resolves with an object containing the current selection map and arrays of selected/unselected objects

Async


setCameraUp()

setCameraUp(camera?): void

Defined in: UGMap.d.ts:303

reset the camera up so that the camera roll alligns with the horizon

Parameters

camera?

any

Returns

void


setDate()

setDate(date): void

Defined in: UGMap.d.ts:81

Parameters

date

any

Returns

void


setElevationExageration()

setElevationExageration(elevationExageration): void

Defined in: UGMap.d.ts:363

Set an elevation exageration factor

Parameters

elevationExageration

number

Returns

void


setLayer()

setLayer(layer, index): void

Defined in: UGMap.d.ts:219

Sets the given layer at the given index disposing of any layer previously at that index.

Parameters

layer

Layer

index

number

Returns

void


create()

static create(properties): Promise<UGMap>

Defined in: UGMap.d.ts:44

Parameters

properties

Object

Returns

Promise<UGMap>