Globe

Source: Globe.ts:176

Creates a WebGL context with globe.

Example

Basic initialization

CODE
globus = new Globe({
    atmosphere: false,
    target: 'globus',
    name: 'Earth',
    controls: [
         new control.Navigation(),
         new control.KeyboardNavigation(),
         new control.EarthCoordinates(),
         new control.LayerSwitcher({),
         new control.TouchNavigation(),
         new control.Sun()
     ],
    terrain: new GlobusRGBTerrain(),
    layers: [new OpenStreetMap(), new Bing()],
    atmosphereEnabled: true
});

Constructor

new Globe(options: IGlobeParams): Globe

Parameters

  • options (IGlobeParams) — Options:
    • options.target (string | HTMLElement) — HTML element id where planet canvas have to be created.
    • options.name (string, optional) — Planet name. Default is uniq identifier.
    • options.terrain (EmptyTerrain | Array.<EmptyTerrain>, optional) — Terrain provider or providers array, where the first one becomes active. Default no terrain - og.terrain.EmptyTerrain.
    • options.controls (Array.<Control>, optional) — Controls.
    • options.layers (Array.<Layer>, optional) — Planet layers.
    • options.viewExtent (Extent | ExtentBoundingBox, optional) — [options.viewExtent] - Viewable starting extent.
    • options.autoActivate (boolean, optional, default: true) — Globe rendering auto activation flag. True is default.
    • options.idleMode (boolean, optional, default: false) — Skips a frame rendering when nothing has been changed. False is default.
    • options.attributionContainer (HTMLElement, optional) — Container for attribution list.
    • options.uiContainer (HTMLElement, optional) — Container for dialogs, the render container by default.
    • options.maxGridSize (number, optional, default: 128) — = Maximal segment grid size. 128 is default
    • options.fontsSrc (string, optional) — Fonts collection url.
    • options.resourcesSrc (string, optional) — Resources root src.
    • options.nightTextureSrc (string, optional) — Night-glowing image sources
    • options.specularTextureSrc (string, optional) — Specular water mask image sourcr
    • options.maxAltitude (number, optional) — Maximal camera altitude above terrain
    • options.minAltitude (number, optional, default: "1.0") — Minimal camera altitude above terrain
    • options.maxEqualZoomAltitude (number, optional) — Maximal altitude since segments on the screen became the same zoom level
    • options.minEqualZoomAltitude (number, optional, default: "10000.0") — Minimal altitude since segments on the screen became the same zoom level
    • options.minEqualZoomCameraSlope (number, optional, default: 0.8) — Minimal camera slope above the globe where segments on the screen became the same zoom level
    • options.loadingBatchSize (number, optional, default: 12)
    • options.quadTreeStrategyPrototype (number, optional) — Prototype of quadTree. QuadTreeStrategy for Earth is default.
    • options.msaa (number, optional, default: 0) — MSAA antialiasing parameter: 2,4,8,16. Default is 0.
    • options.deferredDisabled (boolean, optional, default: false) — Disables deferred and WOIT pipelines and renders objects with forward shaders.
    • options.pixelRatio (number, optional) — Device pixel ratio. Default is current screen DPI.
    • options.atmosphereEnabled (boolean, optional) — Enables atmosphere effect.
    • options.transtitionOpacityEnabled (boolean, optional) — Enables terrain smooth opacity transition effect.
    • options.atmosphereParameters (IAtmosphereParams, optional) — Atmosphere model parameters.
    • options.gamma (number, optional) — Gamma
    • options.exposure (number, optional) — Exposure
    • options.transparentBackground (boolean, optional, default: false) — Enables a transparent WebGL canvas background so HTML behind the globe container remains visible.
    • options.frameOpacity (number, optional, default: "1.0") — Frame opacity applied by renderer transparency flags.
    • options.reverseDepth (boolean, optional, default: true) — Enables reverse-Z depth for the planet camera perspective mode.

Instance Methods

fadeIn()

Starts screen brightness fading in effect by the duration time.

fadeOut()

Starts screen brightness fading out effect by the duration time.

Instance Fields

$inner: Element

Dom element where WebGL canvas creates