Class: MagoTools

MagoTools(viewer)

MagoTools is a class that creates a viewer to render points on a globe.

Constructor

new MagoTools(viewer)

Parameters:
Name Type Description
viewer Viewer Cesium Viewer instance
Source:
Example
const magoTools = new MagoTools(viewer);
magoTools.test();

Classes

MagoTools

Methods

addPoint(lon, lat, cssColor, entitiesCollection) → {void}

Samples random points on the globe.
Parameters:
Name Type Default Description
lon number longitude degrees
lat number latitude degrees
cssColor String #ffcc00 CSS color string "#ff0000"
entitiesCollection null
Source:
Returns:
Type
void
Example
magoTools.addPoint(126.978388, 37.566610, "#ff0000")

addRandomPoint(cssColor, entitiesCollection) → {void}

Adds a point to the globe.
Parameters:
Name Type Default Description
cssColor String #ff0000 CSS color string "#ff0000"
entitiesCollection null
Source:
Returns:
Type
void
Example
magoTools.addPoint(126.978388, 37.566610, "#ff0000")

addRandomPoints(count, cssColor, entitiesCollection) → {void}

Samples random points on the globe.
Parameters:
Name Type Default Description
count number
cssColor string #00ff00 CSS color string "#ff0000"
entitiesCollection null
Source:
Returns:
Type
void
Example
magoTools.addRandomPoints(1000, "#ffff00")

changeGlobeColor(cssColor) → {void}

Changes the color of the globe.
Parameters:
Name Type Description
cssColor string CSS color string "#ff0000"
Source:
Returns:
Type
void
Example
magoTools.changeGlobeColor("#ff0000")

(async) changeTerrain(url) → {Promise.<void>}

Changes the terrain provider of the
Parameters:
Name Type Description
url String
Source:
Returns:
Type
Promise.<void>
Example
changeTerrain('url')

createGridImageryProvider() → {void}

Creates a grid imagery provider on the globe.
Source:
Returns:
Type
void
Example
magoTools.createGridImageryProvider()

createModel(url, lon, lat) → {void}

Creates a 3D model on the globe.
Parameters:
Name Type Description
url String
lon number
lat number
Source:
Returns:
Type
void
Example
createModel('/assets/lowpoly-tree.glb', 126.978388, 37.566610)

createVworldImageryLayer(type, hybrid, extension, vworldKey) → {module:cesium.ImageryLayer}

VWORLD Imagery Layer Provider on the globe.
Parameters:
Name Type Description
type String Base, Satellite, White, Midnight
hybrid boolean
extension String jpeg, png
vworldKey String 00000000-0000-0000-0000-000000000000
Source:
Returns:
Type
module:cesium.ImageryLayer
Example
magoTools.createVworldImageryLayer('Satellite', true, 'jpeg', '00000000-0000-0000-0000-000000000000')

createVworldImageryLayerWithoutToken(type, extension) → {module:cesium.ImageryLayer}

VWORLD Imagery Layer Provider on the globe.
Parameters:
Name Type Description
type String Base, Satellite, White, Midnight
extension String jpeg, png
Source:
Returns:
Type
module:cesium.ImageryLayer
Example
magoTools.createVworldImageryLayer('Satellite', true, 'jpeg', '00000000-0000-0000-0000-000000000000')

flyTo(lon, lat, height, duration) → {void}

Samples random points on the globe.
Parameters:
Name Type Default Description
lon number longitude degrees
lat number latitude degrees
height number 1000 height meters
duration number 0 duration seconds
Source:
Returns:
Type
void
Example
magoTools.flyTo(126.978388, 37.566610, 10000)

initPosition(lon, lat, height) → {void}

Initializes the viewer to render points on a globe.
Parameters:
Name Type Default Description
lon number 0 longitude degrees
lat number 0 latitude degrees
height number 0 height meters
Source:
Returns:
Type
void
Example
magoTools.initPosition(126.978388, 37.566610, 10000)

test() → {void}

Tests the MagoTools class. draws points on the globe.
Source:
Returns:
Type
void
Example
const magoTools = new MagoTools(viewer);
magoTools.test()