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:66

Parameters

properties

any

capabilities

any

Returns

UGMap

Properties

beforeDrawListeners

beforeDrawListeners: any[] | undefined

Defined in: UGMap.d.ts:293


camera

camera: any

Defined in: UGMap.d.ts:168


cameraAnimation

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

Defined in: UGMap.d.ts:319


computeElevationAtlasProbe

computeElevationAtlasProbe: any

Defined in: UGMap.d.ts:98


computeElevationProbe

computeElevationProbe: any

Defined in: UGMap.d.ts:97


computePick

computePick: any

Defined in: UGMap.d.ts:209


controller

controller: Controller | undefined

Defined in: UGMap.d.ts:254


csm

csm: any

Defined in: UGMap.d.ts:259


css2DRenderer

css2DRenderer: any

Defined in: UGMap.d.ts:215


cssLabelsContainer

cssLabelsContainer: any

Defined in: UGMap.d.ts:216


cssLabelsScene

cssLabelsScene: any

Defined in: UGMap.d.ts:180


currentDate

currentDate: Date | undefined

Defined in: UGMap.d.ts:78


disposeControllerEvents

disposeControllerEvents: { } | undefined

Defined in: UGMap.d.ts:277


disposed

disposed: boolean | undefined

Defined in: UGMap.d.ts:253


distToGround

distToGround: number | undefined

Defined in: UGMap.d.ts:153


domContainer

domContainer: HTMLElement | null

Defined in: UGMap.d.ts:72


domOverlayContainer

domOverlayContainer: HTMLDivElement | undefined

Defined in: UGMap.d.ts:219


elevationAtlasProbeBuffer

elevationAtlasProbeBuffer: any

Defined in: UGMap.d.ts:92


elevationAtlasProbeSlice

elevationAtlasProbeSlice: any

Defined in: UGMap.d.ts:96


elevationAtlasProbeUV

elevationAtlasProbeUV: any

Defined in: UGMap.d.ts:95


elevationExageration

elevationExageration: number | undefined

Defined in: UGMap.d.ts:383


elevationProbeBuffer

elevationProbeBuffer: any

Defined in: UGMap.d.ts:91


elevationProbeLatHiLo

elevationProbeLatHiLo: any

Defined in: UGMap.d.ts:94


elevationProbeLonHiLo

elevationProbeLonHiLo: any

Defined in: UGMap.d.ts:93


featureTrackingController

featureTrackingController: FeatureTrackingController | undefined

Defined in: UGMap.d.ts:255


FloatingOffset

FloatingOffset: any

Defined in: UGMap.d.ts:70


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:73


logDepthBufFC

logDepthBufFC: number | undefined

Defined in: UGMap.d.ts:148


minHeightAboveGround

minHeightAboveGround: any

Defined in: UGMap.d.ts:71


mrt

mrt: any

Defined in: UGMap.d.ts:212


overlayScene

overlayScene: any

Defined in: UGMap.d.ts:182


pause

pause: boolean | undefined

Defined in: UGMap.d.ts:282


pickBuffer

pickBuffer: any

Defined in: UGMap.d.ts:190


pickCameraNearFar

pickCameraNearFar: any

Defined in: UGMap.d.ts:202


pickCamFwd

pickCamFwd: any

Defined in: UGMap.d.ts:201


pickCamPos

pickCamPos: any

Defined in: UGMap.d.ts:200


pickDepthBias

pickDepthBias: any

Defined in: UGMap.d.ts:207


pickFar0

pickFar0: any

Defined in: UGMap.d.ts:196


pickFar1

pickFar1: any

Defined in: UGMap.d.ts:197


pickFar2

pickFar2: any

Defined in: UGMap.d.ts:198


pickFar3

pickFar3: any

Defined in: UGMap.d.ts:199


pickLdf

pickLdf: any

Defined in: UGMap.d.ts:203


pickNear0

pickNear0: any

Defined in: UGMap.d.ts:192


pickNear1

pickNear1: any

Defined in: UGMap.d.ts:193


pickNear2

pickNear2: any

Defined in: UGMap.d.ts:194


pickNear3

pickNear3: any

Defined in: UGMap.d.ts:195


pickUseSceneDepth

pickUseSceneDepth: any

Defined in: UGMap.d.ts:204


pickUseSplatsDepth

pickUseSplatsDepth: any

Defined in: UGMap.d.ts:206


pickUseVectorDepth

pickUseVectorDepth: any

Defined in: UGMap.d.ts:205


pickUV

pickUV: any

Defined in: UGMap.d.ts:191


planet

planet: Planet | undefined

Defined in: UGMap.d.ts:256


postProcessing

postProcessing: any

Defined in: UGMap.d.ts:171


postQuad

postQuad: any

Defined in: UGMap.d.ts:257


postScene

postScene: any

Defined in: UGMap.d.ts:258


primaryGBuffer

primaryGBuffer: any

Defined in: UGMap.d.ts:185


raycaster

raycaster: any

Defined in: UGMap.d.ts:74


renderCamera

renderCamera: any

Defined in: UGMap.d.ts:169


renderer

renderer: any

Defined in: UGMap.d.ts:211


scene

scene: any

Defined in: UGMap.d.ts:173


sceneShiftListeners

sceneShiftListeners: any[] | undefined

Defined in: UGMap.d.ts:306


secondaryGBuffer

secondaryGBuffer: any

Defined in: UGMap.d.ts:186


selection

selection: { } | undefined

Defined in: UGMap.d.ts:405


selectionListeners

selectionListeners: any[] | undefined

Defined in: UGMap.d.ts:385


shadowUniforms

shadowUniforms: any

Defined in: UGMap.d.ts:76


splatsMRT

splatsMRT: any

Defined in: UGMap.d.ts:213


splatsRT

splatsRT: any

Defined in: UGMap.d.ts:188


splatsScene

splatsScene: any

Defined in: UGMap.d.ts:177


stats

stats: any

Defined in: UGMap.d.ts:269


sunPosition

sunPosition: any

Defined in: UGMap.d.ts:75


targetFPS

targetFPS: number

Defined in: UGMap.d.ts:67


ultraClock

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

Defined in: UGMap.d.ts:80


vectorScene

vectorScene: any

Defined in: UGMap.d.ts:175


vectorsRT

vectorsRT: any

Defined in: UGMap.d.ts:187


worldFromDepth

worldFromDepth: { } | undefined

Defined in: UGMap.d.ts:208

Methods

addBeforeDrawListener()

addBeforeDrawListener(listener): void

Defined in: UGMap.d.ts:292

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:236

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:305

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:384

Parameters

calback

any

Returns

void


cancelAnimation()

cancelAnimation(): void

Defined in: UGMap.d.ts:318

cancel any ongoing camera animation

Returns

void


cartesianToLlhFastSFCT()

cartesianToLlhFastSFCT(xyz): void

Defined in: UGMap.d.ts:377

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:121

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:252

disposes of the entire map

Returns

void


flyToFeatureByUUID()

flyToFeatureByUUID(uuid, options?): { } | undefined

Defined in: UGMap.d.ts:134

Parameters

uuid

any

options?

Object

Returns

{ } | undefined


getAreaController()

getAreaController(): Controller | undefined

Defined in: UGMap.d.ts:274

Returns

Controller | undefined


getFeatureTrackingController()

getFeatureTrackingController(): FeatureTrackingController | undefined

Defined in: UGMap.d.ts:275

Returns

FeatureTrackingController | undefined


getLayerByID()

getLayerByID(id): Layer

Defined in: UGMap.d.ts:265

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:248

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:112

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:273

Returns

Controller | undefined


getShapeCreationController()

getShapeCreationController(): Controller | undefined

Defined in: UGMap.d.ts:271

Returns

Controller | undefined


getShapeEditController()

getShapeEditController(): Controller | undefined

Defined in: UGMap.d.ts:272

Returns

Controller | undefined


llhToCartesianFastSFCT()

llhToCartesianFastSFCT(llh): void

Defined in: UGMap.d.ts:371

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:340

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:358

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:281

Pauses the rendering of all the layers.

Returns

void


raycastTerrain()

raycastTerrain(raycaster): Vector3

Defined in: UGMap.d.ts:364

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:243

Parameters

dispose?

boolean

Returns

void


removeBeforeDrawListener()

removeBeforeDrawListener(listener): void

Defined in: UGMap.d.ts:299

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:242

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:312

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:390

deletes selected objects

Returns

void


removeSelectionListener()

removeSelectionListener(callback): void

Defined in: UGMap.d.ts:386

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:286

Resumes the rendering of all the layers

Returns

void


screenPixelRayCast()

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

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<any>

Resolves with the hit position, null for a no-hit, or undefined on error/out-of-bounds


select()

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

Defined in: UGMap.d.ts:400

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:316

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:77

Parameters

date

any

Returns

void


setElevationExageration()

setElevationExageration(elevationExageration): void

Defined in: UGMap.d.ts:382

Set an elevation exageration factor

Parameters

elevationExageration

number

Returns

void


setLayer()

setLayer(layer, index): void

Defined in: UGMap.d.ts:230

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:42

Parameters

properties

Object

Returns

Promise<UGMap>