OGC3DTilesLayer

A layer for loading a OGC3DTiles tileset.

Constructor

new OGC3DTilesLayer(properties, scaleXopt, scaleYopt, scaleZopt, yawopt, pitchopt, rollopt)

Parameters:
NameTypeAttributesDefaultDescription
propertiesObject
Properties
NameTypeAttributesDefaultDescription
idString | Numberlayer id should be unique
nameStringthe name can be anything you want and is intended for labeling
urlStringurl of the root tileset.json
displayCopyrightBoolean<optional>
false(optional) display copyright information when present in tiles by concatenating all copyright info for all displayed tiles
displayErrorsBoolean<optional>
false(optional) display loading errors
proxyBoolean<optional>
(optional) the url to a proxy service. Instead of fetching tiles via a GET request, a POST will be sent to the proxy url with the real tile address in the body of the request.
queryParamsBoolean<optional>
(optional) path params to add to individual tile urls (starts with "?").
scaleXnumber<optional>
1scale on X axes.
scaleYnumber<optional>
1scale on Y axes. defaults to the scaleX property if defined.
scaleZnumber<optional>
1scale on Z axes. defaults to the scaleX property if defined.
yawnumber<optional>
0Yaw angle in degrees. (0 means local z axis points north ccw rotation)
pitchnumber<optional>
0Pitch angle in degrees (0 means the x-z plane alligns with the horizon )
rollnumber<optional>
0Roll angle in degrees. (ccw rotation about the local z axis)
properties.geometricErrorMultiplierNumber<optional>
1(optional) between 0 and infinity, defaults to 1. controls the level of detail.
properties.longitudeNumber<optional>
0(optional) longitude of the model's center point in degrees.
properties.latitudeNumber<optional>
0(optional) latitude of the model's center point in degrees.
properties.heightNumber<optional>
0(optional) height in meters above sea level.
properties.loadOutsideViewBoolean<optional>
false(optional) if true, will load tiles outside the view at the lowest possible LOD.
properties.selectableBoolean<optional>
false(optional) if true, the tileset can be selected.
properties.boundsArray.<Number><optional>
[-180, -90, 180, 90]min longitude, min latitude, max longitude, max latitude in degrees
properties.visibleBoolean<optional>
truelayer will be rendered if true (true by default)
properties.loadingStrategyString<optional>
"INCREMENTAL"loading strategy, "INCREMENTAL" (default) or "IMMEDIATE". "IMMEDIATE" mode loads only the ideal LOD while "INCREMENTAL" loads intermediate LODs.
properties.updateCallbackfunction<optional>
A callback called on every tileset update with a stats object indicating number of tiles loaded/visualized, max loaded LOD, and percentage of the tileset loaded

Extends

Methods

addListener(key, listener)

Adds a listener for layer events
Parameters:
NameTypeDescription
key*can be anything but should be unique
listenerfunctiona function : (layer, eventType)=>{}

dispose()

disposes of any resources used by this layer
Overrides

getBounds() → {THREE.Box2}

Returns:
bounds in longitude latitude (degrees)
Type: 
THREE.Box2

getCenter(sfct) → {THREE.Vector3}

Moves a given point to this layer's center in degree longitude/latitude
Parameters:
NameTypeDescription
sfctTHREE.Vector3a point to move
Returns:
the input point
Type: 
THREE.Vector3

getID()

Overrides
Returns:
layer id

getName()

Overrides
Returns:
layer name

getSelectableObjects()

Get all the selectable objects of this layer.
Returns:
an array of ray-castable objects with a property "layer" pointing to this layer.

move(longitudeopt, latitudeopt, heightopt, yawopt, pitchopt, rollopt, scaleXopt, scaleYopt, scaleZopt)

Sets the object position and orientation based on Longitude, Latitude, Height, Yaw, Pitch, Roll
Parameters:
NameTypeAttributesDefaultDescription
longitudenumber<optional>
0a longitude in degrees
latitudenumber<optional>
0a latitude in degrees
heightnumber<optional>
0a height in meters above WGS 84 sea level
yawnumber<optional>
0Yaw angle in degrees. (0 points north ccw rotation)
pitchnumber<optional>
0Pitch angle in degrees (-90 to 90)
rollnumber<optional>
0Roll angle in degrees.
scaleXnumber<optional>
1scale on X axes.
scaleYnumber<optional>
1scale on Y axes. defaults to the scaleX property if defined.
scaleZnumber<optional>
1scale on Z axes. defaults to the scaleX property if defined.

removeListener(key)

Removes the listener associated to the given key
Parameters:
NameTypeDescription
key*can be anything but should be unique

select(objectsToSelect) → {Boolean}

selects an object from this layer
Parameters:
NameTypeDescription
objectsToSelectObject
Overrides
Returns:
true if the object was selected, false otherwise
Type: 
Boolean

setName(name)

change the layer name
Parameters:
NameTypeDescription
nameString
Overrides

setVisible(visible)

Modifies the layer visibility
Parameters:
NameTypeDescription
visibleBoolean

unselect(objectsToUnselect) → {Boolean}

un-selects an object from this layer
Parameters:
NameTypeDescription
objectsToUnselectObject
Returns:
true if the object was un-selected, false otherwise
Type: 
Boolean