Class: Globe

og/Globe~Globe

Creates a WebGL context with globe.

new Globe(options)

Name Type Description
options object Options:
Name Type Description
target string HTML element id where planet canvas have to be created.
skybox og.scene.RenderNode optional Render skybox. null - default.
name string optional Planet name. Default is unic identifier.
terrain og.terrain.Terrain optional Terrain provider. Default no terrain - og.terrain.EmptyTerrain.
controls Array.<og.control.Control> optional Renderer controls array.
layers Array.<og.Layer> optional Planet layers.
viewExtent og.Extent optional Viewable starting extent.
autoActivate boolean optional Globe rendering auto activation flag. True is default.
Example

Basic initialization

globus = new og.Globe({
    'atmosphere': false,
    'target': 'globus',
    'name': 'Earth',
    'controls': [
         new og.control.MouseNavigation({ autoActivate: true }),
         new og.control.KeyboardNavigation({ autoActivate: true }),
         new og.control.EarthCoordinates({ autoActivate: true, center: false }),
         new og.control.LayerSwitcher({ autoActivate: true }),
         new og.control.ZoomControl({ autoActivate: true }),
         new og.control.TouchNavigation({ autoActivate: true }),
         new og.control.Sun({ autoActivate: true })
     ],
    'terrain': new og.terrain.GlobusTerrain(),
    'layers': [
         new og.layer.XYZ("OpenStreetMap", { isBaseLayer: true, url: "http://b.tile.openstreetmap.org/{z}/{x}/{y}.png", visibility: true, attribution: 'Data @ OpenStreetMap contributors, ODbL' })
     ],
    'autoActivate': true
});

Members

divElement

Dom element where WebGL canvas creates

rendererog.Renderer

Interface for the renderer context(events, input states, renderer nodes etc.)

Methods

staticmodule:og/Globe~Globe.isUndefined(obj){boolean}

Returns true if the object pointer is undefined.
Name Type Description
obj Object Object pointer.
Returns:
Type Description
boolean Returns true if object is undefined.

fadeIn()

Starts screen brightness fading in effect by the duration time.

fadeOut(duration)

Starts screen brightness fading out effect by the duration time.
Name Type Description
duration number Fadeout duration time.