Sets the orbit camera’s initial position and target. Useful in deeplinks and when a non-top-down camera angle is desired. Note that the camera’s look-at target is always along the y-axis.
If a tile layer has a demPath set and one of its tile dem request fails for whatever reason (such as a 404) or does not have a demPath set, it will try to get the corresponding DEM tile specified in demFallback.
Representative of the tilemapresource.xml file outputted following tile generation. Note: proj is the only key currently in use.
Parameter
Type
Default
Description
tileMapResource.bounds
number[]
[0,0,0,0]
minx, miny, maxx, max
tileMapResource.origin
number[]
[0,0]
x, y
tileMapResource.proj
string
null (wgs84)
proj4 string describing the global tileset’s projection
tileMapResource.resunitsperpixel
string
34
proj4 string describing the global tileset’s projection
tileMapResource.reszoomlevel
string
0
proj4 string describing the global tileset’s projection
Example
{tileMapResource:{// this is also the defaultbounds:[0,0,0,0],origin:[0,0],proj:null,// proj4 string describing the global tileset projectionresunitsperpixel:34,reszoomlevel:0,},}
options.LOD
Configure how the internal level of detail (LOD) works. LOD makes it so that terrain farther away from you is at increasingly lower resolutions. LOD is implemented in LithoSphere in a dead simple way. Instead of just grabbing the tiles from you zoom and viewport, it grabs tiles above your zoom level (lower resolution) and renders them below high resolution tiles. It picks which tiles to pull by first looking at the coordinate at the center of your screen and then working a radius number of tiles outwards. Note: This only works if useLOD is set to true.
Parameter
Type
Required
Default
Description
LOD[i].radiusOfTiles
number
true
N/A
How many tiles outward from the center to use for this LOD level
LOD[i].zoomsUp
number
true
N/A
How many zoom levels upward (closer to 0) to pull tiles from
Example
{useLOD:true,LOD:[// this is also the default{radiusOfTiles:4,zoomsUp:3},{radiusOfTiles:2,zoomsUp:7},{radiusOfTiles:2,zoomsUp:11},],}
options.starsphere
A skydome but with its missing half and far up beyond the sky.
Parameter
Type
Required
Default
Description
starsphere.url
string
true
N/A
URL of an image to wrap around the inside of the skydome
starsphere.color
string
false
‘#AAAAAA’
What color light to shine upon our skydome image
Example
{starsphere:{url:'https://awesomesite.nasa.gov/public/images/eso0932a.jpg',color:'#FF0000',// Tinge it all red},}
options.atmosphere
Parameter
Type
Required
Default
Description
atmosphere.color
string
false
‘#FFFFFF’
What color should the atmosphere of the planet be?
Example
{atmosphere:{color:'#111111',},}
A Full Example
constLitho=newLithoSphere.default('container',{initialView:{lng:137.4071927368641,lat:-4.626571631163808,zoom:16,},wireframeMode:true,exaggeration:2,showAxes:true,useLOD:true,renderOnlyWhenOpen:true,starsphere:{url:'https://awesomesite.nasa.gov/public/images/eso0932a.jpg',color:'#666666',},atmosphere:{color:'#111111',},highlightColor:'yellow',//css color for vector hover highlights | default 'yellow'activeColor:'red',//css color for active vector features | default 'red'})
Moving Forward
Check out the Layers page next for more information about how you can add and configure layers.