new IcosphereLookup( textureSrc ) → {IcosphereLookup}

Description
Creates a IcosphereLookup object
Parameters
Name Type Description
textureSrc String Texture image src URL

Members


material :ShaderMaterial

Description
ShaderMaterial

lookup :Lookup

Description
Data Lookup

currentSelection :number

Description
Current selection id, -1 == no selection

previousSelection :number

Description
Previous selection id, -1 == no selection

inAnimation :Tween

Description
Animation driving the highlight in

outAnimation :Tween

Description
Animation driving the highlight out

currentHover :number

Description
Current Hover id, -1 == no hover

hoverables :Hoverable

Description
Hoverable object array

hoverableUniforms :Array

Description
List of hoverable uniforms

selection0 :number


selection1 :number


current :number


dataTexture :DataTexture

Description
Data texture for object

dataTextureSize :number

Description
Length of dataTexture side, it is square

updateCMDs :Array

Description
Commands to update geometry

highlightAnimationProps :Object

Description
Animation properties for highlighting

init

Description
Initialize object into WebglContext
Parameters
Name Type Description
gl WebglContext WebglContext to initialize into
onInit function Callback to fire when initialized

getValueForId

Description
Get data value from id
Parameters
Name Type Description
id String Id to lookup
Returns
data

getValueForCode

Description
Get data value from Code
Parameters
Name Type Description
code String Code to lookup
Returns
data

getValueForName

Description
Get data value from Name
Parameters
Name Type Description
Name String Name to lookup
Returns
data

setIdColor

Description
Sets a color in datatexture for id
Parameters
Name Type Description
id String set datatexture color
color * Hex code for color, ex: '#ffffff
alpha * [0-1] representation of alpha

getIdColor

Description
Gets the current color in datatexture for id
Parameters
Name Type Description
id String set datatexture color
Returns
UInt8Array in [R,G,B,A] format

createCollisionGeo

Description
Create collision geometry, used in raycasting

rayCastFrom

Description
Raycast to object
Parameters
Name Type Description
ray Object Ray to cast
Returns
Collision point

hitTest

Description
Does the ray intersect with the object?
Parameters
Name Type Description
ray Object Ray to cast
Returns

onSelectionCB

Description
Unused function

onSelection

Description
Parses collision object to drawable specific data
Parameters
Name Type Description
lat number target latitude
lon number target longitude
collision Object Collision description

onHover

Description
Unused function

update

Description
Updates Uniforms in WebglContext
Parameters
Name Type Description
gl WebglContext WebglContext
sceneProps Object Scene uniform object
time number frametime

draw

Description
Draws object to WebglContext
Parameters
Name Type Description
gl WebglContext WebglContext to draw to

setCountryHover

Description
Set hover state for country id to hover
Parameters
Name Type Description
countryIndex number CountryId to hover

highlightId

Description
Highlights a region on the globe using id
Parameters
Name Type Description
id String Id to highlight

unhighlightId

Description
Ramps down a highlighted region from datatexture to surface texture
Parameters
Name Type Description
id String Id to unhighlight

addDataset

Description
Add an Id lookup dataset to globe
Parameters
Name Type Description
data Object Id dataset