new Map(properties)
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
properties | Object | Properties
|
Methods
_setDate(date)
Set the date (sun position)
Parameters:
Name | Type | Description |
---|---|---|
date | Date |
addLayer(layer, index)
appends the layer to the end of the list of layers, replacing any layer already at that position.
Parameters:
Name | Type | Description |
---|---|---|
layer | Layer | |
index | Number |
cartesianToLlhFastSFCT(llh)
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:
Name | Type | Description |
---|---|---|
llh | THREE. |
getLayerByID(id) → {Layer}
Fetches a specific layer by ID.
Parameters:
Name | Type | Description |
---|---|---|
id | Number | |
Returns:
the layer with given ID if any
- Type:
- Layer
getLayers() → {Array.<Layer>}
Returns an array of layers currently loaded on the map
Returns:
the list of layers
- Type:
- Array.<Layer>
llhToCartesianFastSFCT(llh)
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:
Name | Type | Description |
---|---|---|
llh | THREE. |
moveAndLookAt(cameraPosition, cameraAim)
Moves the camera to a location in lon lat height and looks at another location in lon lat height.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cameraPosition | Object | an object representing the camera desired location in lon lat height (according to WGS84 coordinates)Properties
| ||||||||||||
cameraAim | Object | an object representing the camera desired target in lon lat height (according to WGS84 coordinates)Properties
|
moveCameraAboveSurface()
Moves the camera 1 meter above the ground.
pauseRendering()
Pauses the rendering of all the layers.
removeLayer(index, dispose)
removes the layer at the specific index optionally "disposing" of any resources the layer is using.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
index | Number | ||
dispose | Boolean | true |
resetCameraNearFar()
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.
resumeRendering()
Resumes the rendering of all the layers
screenPixelRayCast(x, y, sideEffect) → {THREE.Vector3}
Get the hit location of a ray going from the camera through a pixel on screen or undefined if the ray does not hit anything.
Parameters:
Name | Type | Description |
---|---|---|
x | Number | a screen pixel x coordinate |
y | Number | a screen pixel y coordinate |
sideEffect | THREE. | a THREE.Vector3 that will be moved to the ray hit location |
Returns:
the sideEffect object.
- Type:
- THREE.
Vector3
select(screenLocation, type)
select action at a particular location on this map (normalized between -1 and 1)
Parameters:
Name | Type | Description |
---|---|---|
screenLocation | THREE. | |
type | Number | 0(Add), 1(Remove) or 2(Replace) |
setCameraUp()
reset the camera up so that the camera roll alligns with the horizon
setElevationExageration(elevationExageration)
Set an elevation exageration factor
Parameters:
Name | Type | Description |
---|---|---|
elevationExageration | Number |
setLayer(layer, index)
Sets the given layer at the given index disposing of any layer previously at that index.
Parameters:
Name | Type | Description |
---|---|---|
layer | Layer | |
index | Number |