Class: AbstractContext

AbstractContext

The active context object can normally be obtained from the ContextManager class of the Mizar instance.
A context is the main webGL object that contains its own coordinate reference system, its own data, its own navigation and its own GUI.
Client implementations should not normally instantiate this class directly.

new AbstractContext(mizarConfiguration, mode, ctxOptions)

Parameters:
Name Type Description
mizarConfiguration Mizar.configuration Mizar configuration
mode CONTEXT the type of context
ctxOptions AbstractContext.skyContext | AbstractContext.planetContext sky or planet options
Implements:
Listens to Events:

Methods


<protected> _fillDataProvider(layer, mizarDescription)

Fill data-provider-type layer by features coming from data object
Parameters:
Name Type Description
layer Layer layer in which data should be added.
mizarDescription Object See the base properties AbstractLayer.configuration and a specific layer for specific properties

getTileManager()

Implements:

registerNoStandardDataProvider(type, loadFunc)

Registers no standard data provider and call them in the addLayer method.
Parameters:
Name Type Description
type string data provider key
loadFunc function Function
Example

Registers planets on the sky

var planetProvider = ProviderFactory.create(Constants.PROVIDER.Planet);
  this.registerNoStandardDataProvider("planets", planetProvider.loadFiles);

getContextConfiguration()

Implements:

getMizarConfiguration()

Implements:

getLonLatFromPixel()

Implements:

getPixelFromLonLat()

Implements:

getElevation()

Implements:

getPositionTracker()

Implements:

getElevationTracker()

Implements:

getLayers()

Implements:

getLayerByID()

Implements:

getLayerByName()

Implements:

addLayer()

Implements:

removeLayer()

Implements:

removeAllLayers()

Implements:

addDraw()

Implements:

removeDraw()

Implements:

initTouchNavigation(options)

Initializes the touch navigation handler.
Parameters:
Name Type Description
options Object to add touch navigation
Properties
Name Type Description
navigation Navigation Navigation object

refresh()

Implements:

initCanvas(canvas)

Initialization of the canvas element. When no canvas element is provided, sets to full screen.
Parameters:
Name Type Description
canvas Object Canvas object
Properties
Name Type Argument Description
parentElement Object <nullable>
HTML object

iniGlobeEvents(globe)

Initializes the planet or sky events.
Parameters:
Name Type Description
globe AbstractGlobe Planet or Sky object

show()

Implements:

showComponents()

Implements:

hideComponents()

Implements:

hide()

Implements:

setComponentVisibility()

Implements:

showAdditionalLayers()

Implements:

hideAdditionalLayers()

Implements:

setBackgroundLayer()

Implements:

setBackgroundLayerByID()

Implements:

getAdditionalLayers()

Implements:

getRenderContext()

Implements:

<abstract> disbable()


<abstract> enable()

Implements:

<abstract> setCompassVisible()

Implements:

getMode()

Implements:

<abstract> setCoordinateSystem()

Implements:

getNavigation()

Implements:

getCoordinateSystem()

Implements:

addAnimation()

Implements:

removeAnimation()

Implements:

render()

Implements:
  • Context#render

dispose()

Implements:

<abstract> destroy()

Implements:

Type Definitions


planetContext

Planet context configuration
Type:
  • Object
Properties:
Name Type Argument Default Description
tileErrorTreshold float <optional>
3
continuousRendering float <optional>
false
renderContext RenderContext <optional>
Context rendering
coordinateSystem AbstractProjection.configuration | AbstractProjection.azimuth_configuration | AbstractProjection.mercator_configuration CRS configuration
planetLayer PlanetLayer <optional>
planetLayer
navigation AbstractNavigation.planet_configuration | AbstractNavigation.flat_configuration navigation configuration

skyContext

sky context configuration
Type:
  • Object
Properties:
Name Type Argument Default Description
tileErrorTreshold float <optional>
1.5
continuousRendering float <optional>
true
radius float <optional>
10.0 Vector distance of the sky
minFar int <optional>
15
coordinateSystem AbstractProjection.configuration | AbstractProjection.azimuth_configuration | AbstractProjection.mercator_configuration CRS configuration
renderContext RenderContext <optional>
Context rendering
navigation AbstractNavigation.astro_configuration navigation configuration
compass string <optional>
"compassDiv" div element where compass is displayed