# Interface: ThreeJsContext

# Table of contents

# Methods

# Methods

# Object3D

Object3D(options: any): any

# Parameters
Name Type
options any

Returns: any


# add

add(obj: any, layerId?: string, sourceId?: string): any

# Parameters
Name Type
obj any
layerId? string
sourceId? string

Returns: any


# clear

clear(layerId?: string, dispose?: boolean): any

# Parameters
Name Type
layerId? string
dispose? boolean

Returns: any


# coneMesh

coneMesh(co: GeoPoint, opts?: { animation?: boolean ; animationUpDown?: boolean ; color?: string | number ; height?: number ; obj3dOpts?: object ; size?: number }): any

创建一个四棱锥

# Parameters
Name Type
co GeoPoint
opts? object
opts.animation? boolean
opts.animationUpDown? boolean
opts.color? string | number
opts.height? number
opts.obj3dOpts? object
opts.size? number

Returns: any


# createSkyLayer

createSkyLayer(): void

Returns: void


# createTerrainLayer

createTerrainLayer(): void

Returns: void


# defaultLights

defaultLights(): any

Returns: any


# dispose

dispose(): any

Returns: any


# extrusion

extrusion(options: any): any

# Parameters
Name Type
options any

Returns: any


# findParent3DObject

findParent3DObject(mesh: any): any

# Parameters
Name Type
mesh any

Returns: any


# flyline

flyline(opts: { color: string | number ; color2?: string | number ; count?: number ; height?: number ; opacity?: number ; range?: number ; size?: number ; source: GeoPoint ; speed?: number ; target: GeoPoint }): any

创建一条飞行线

# Parameters
Name Type
opts object
opts.color string | number
opts.color2? string | number
opts.count? number
opts.height? number
opts.opacity? number
opts.range? number
opts.size? number
opts.source GeoPoint
opts.speed? number
opts.target GeoPoint

Returns: any


# getFeatureCenter

getFeatureCenter(feature: any, obj: any, level: number): any

# Parameters
Name Type
feature any
obj any
level number

Returns: any


# getObjectHeightOnFloor

getObjectHeightOnFloor(coords: any, obj: any, level: number): any

# Parameters
Name Type
coords any
obj any
level number

Returns: any


# getSunPosition

getSunPosition(date: any, coords: any): any

# Parameters
Name Type
date any
coords any

Returns: any


# getSunSky

getSunSky(date: any, sunPos: any): any

# Parameters
Name Type
date any
sunPos any

Returns: any


# getSunTimes

getSunTimes(date: any, coords: any): any

# Parameters
Name Type
date any
coords any

Returns: any


# getWorldSize

getWorldSize(): number

threejs世界坐标总长度.

Returns: number


# label

label(options: any): any

# Parameters
Name Type
options any

Returns: any


# line

line(options: any): any

# Parameters
Name Type
options any

Returns: any


# loadTexture

loadTexture(img: string, defaultImg?: string): any

加载材质,要使用base64图片,返回 THREE.Texture 对象.

# Parameters
Name Type
img string
defaultImg? string

Returns: any


# mapToWorld

mapToWorld(coords: any): any

地图几何坐标转threejs世界坐标.

# Parameters
Name Type
coords any

Returns: any


# mapToWorldLength

mapToWorldLength(coords: any): any

threejs世界坐标地转图几何坐标.

# Parameters
Name Type
coords any

Returns: any

mapToWorldLength(len: number): number

地图几何长度转threejs世界坐标长度.

# Parameters
Name Type
len number

Returns: number


# memory

memory(): any

Returns: any


# programs

programs(): any

Returns: any


# projectToWorld

projectToWorld(coords: any): any

# Parameters
Name Type
coords any

Returns: any


# projectedUnitsPerMeter

projectedUnitsPerMeter(lat: any): any

# Parameters
Name Type
lat any

Returns: any


# queryRenderedFeatures

queryRenderedFeatures(point: any): any

# Parameters
Name Type
point any

Returns: any


# radar

radar(co: GeoPoint, opts?: { color1?: string | number ; color2?: string | number ; size?: number ; speed?: number ; texture1: string ; texture2: string }): any

创建一个扫描雷达

# Parameters
Name Type
co GeoPoint
opts? object
opts.color1? string | number
opts.color2? string | number
opts.size? number
opts.speed? number
opts.texture1 string
opts.texture2 string

Returns: any


# radialGradient

radialGradient(co: GeoPoint, opts?: { color?: any ; size?: number ; speed?: number }): any

创建一个径向渐变球

# Parameters
Name Type
co GeoPoint
opts? object
opts.color? any
opts.size? number
opts.speed? number

Returns: any


# realSunlight

realSunlight(helper?: boolean): any

# Parameters
Name Type
helper? boolean

Returns: any


# remove

remove(obj: any): any

# Parameters
Name Type
obj any

Returns: any


# removeByName

removeByName(name: string): any

# Parameters
Name Type
name string

Returns: any


# removeLayer

removeLayer(layerId: string): any

# Parameters
Name Type
layerId string

Returns: any


# repaint

repaint(): void

Returns: void


# setBuildingShadows

setBuildingShadows(options: any): any

# Parameters
Name Type
options any

Returns: any


# setDefaultView

setDefaultView(options: any, defOptions: any): any

# Parameters
Name Type
options any
defOptions any

Returns: any


# setLayerHeigthProperty

setLayerHeigthProperty(layerId: string, level: number): any

# Parameters
Name Type
layerId string
level number

Returns: any


# setLayerZoomRange

setLayerZoomRange(layerId: string, minZoomLayer: number, maxZoomLayer: number): any

# Parameters
Name Type
layerId string
minZoomLayer number
maxZoomLayer number

Returns: any


# setLayoutProperty

setLayoutProperty(layerId: string, name: string, value: any): any

# Parameters
Name Type
layerId string
name string
value any

Returns: any


# setObjectsScale

setObjectsScale(): any

Returns: any


# setStyle

setStyle(styleId: string, options: any): any

# Parameters
Name Type
styleId string
options any

Returns: any


# setSunlight

setSunlight(newDate: any, coords: any): any

# Parameters
Name Type
newDate any
coords any

Returns: any


# sphere

sphere(options: any): any

# Parameters
Name Type
options any

Returns: any


# toggle

toggle(layerId: string, visible?: boolean): any

# Parameters
Name Type
layerId string
visible? boolean

Returns: any


# toggleLayer

toggleLayer(layerId: string, visible?: boolean): any

# Parameters
Name Type
layerId string
visible? boolean

Returns: any


# tooltip

tooltip(options: any): any

# Parameters
Name Type
options any

Returns: any


# tube

tube(options: any): any

# Parameters
Name Type
options any

Returns: any


# unprojectFromWorld

unprojectFromWorld(v3: any): any

# Parameters
Name Type
v3 any

Returns: any


# update

update(): any

Returns: any


# updateLightHelper

updateLightHelper(): any

Returns: any


# updateSunGround

updateSunGround(sunPos: any): any

# Parameters
Name Type
sunPos any

Returns: any


# updateSunSky

updateSunSky(sunPos: any): any

# Parameters
Name Type
sunPos any

Returns: any


# wall

wall(pts: GeoPoint[], opts?: { color1?: string | number ; color2?: string | number ; flyline?: boolean ; height?: number ; obj3dOpts?: object ; offsetX?: number ; offsetY?: number ; opacity?: number ; repeatX?: number ; repeatY?: number ; texture1?: string ; texture2?: string }): any

创建一个立体光墙

# Parameters
Name Type
pts GeoPoint[]
opts? object
opts.color1? string | number
opts.color2? string | number
opts.flyline? boolean
opts.height? number
opts.obj3dOpts? object
opts.offsetX? number
opts.offsetY? number
opts.opacity? number
opts.repeatX? number
opts.repeatY? number
opts.texture1? string
opts.texture2? string

Returns: any


# wave

wave(co: GeoPoint, opts?: { color?: string | number ; size?: number ; speed?: number ; texture?: string }): any

创建一个波动光圈

# Parameters
Name Type
co GeoPoint
opts? object
opts.color? string | number
opts.size? number
opts.speed? number
opts.texture? string

Returns: any


# waveWall

waveWall(co: GeoPoint, opts?: { color?: string | number ; height?: number ; opacity?: number ; size?: number ; speed?: number ; texture?: string }): any

创建一个波动光圈

# Parameters
Name Type
co GeoPoint
opts? object
opts.color? string | number
opts.height? number
opts.opacity? number
opts.size? number
opts.speed? number
opts.texture? string

Returns: any


# worldToMapLength

worldToMapLength(len: number): number

threejs世界坐标长度转地图几何长度.

# Parameters
Name Type
len number

Returns: number

vjmap / Exports / ThreeJsContextOptions