SphereMap.Viewer

new Viewer(options)

Main core component of sphereMAP library. It represent main visible 'window' contained spherical photos and another data layers.

Parameters:
Name Type Description
options smx.ViewerOptions

Options for creating viewer object.

Source:
  • Viewer.js, line 45

Members

Methods

activateTool(toolId)

Activate passed tool.

Parameters:
Name Type Description
toolId string

Activated tool ID.

Source:
  • Viewer.js, line 131

addLinesLayer(options)

Add new layer with vector lines.

Parameters:
Name Type Description
options smx.LinesDataObjectOptions

Layer options.

Source:
  • Viewer.js, line 143

addPointsLayer(options)

Add new layer with vector points.

Parameters:
Name Type Description
options smx.PointsDataObjectOptions

Layer options.

Source:
  • Viewer.js, line 239

addWmsLayer(options)

Add new layer provided by OGC WMS Servers.

Parameters:
Name Type Description
options smx.WmsDataObjectOptions

Layer options.

Source:
  • Viewer.js, line 281

changeDataObjectVisibility(layerId, visibility)

Change visibility of specified layer.

Parameters:
Name Type Description
layerId string

ID of attached layer.

visibility boolean

Value of visibility.

Source:
  • Viewer.js, line 327

deactivateTool(toolId)

Deactivate passed tool.

Parameters:
Name Type Description
toolId string

Deactivated tool ID.

Source:
  • Viewer.js, line 420

getGeoVectorLayer() → {SphereMap.GeoVectorLayer}

Return GeoVectorLayer object.

Source:
  • Viewer.js, line 471
Returns:
Type
SphereMap.GeoVectorLayer

getLicenseValue(name) → {*}

Return requested value from license.

Parameters:
Name Type Description
name string

Name of requested value.

Source:
  • Viewer.js, line 481
Returns:
  • Returned value
Type
*

initLicense(licenseKey, projectKey, params, successCallback, failCallback)

Initialize license from sphereMAP license service. This method must be called before use any functionality of sphereMAP library.

Parameters:
Name Type Argument Description
licenseKey string

Key of owned license.

projectKey string

Key of requested project.

params Object <optional>

Additional parameters.

successCallback function <optional>

Callback function called when license is obtained successfuly.

failCallback function <optional>

Callback function called when error is occured during obtaining license.

Source:
  • Viewer.js, line 728

initProject(project)

Initialize project.

Parameters:
Name Type Description
project smx.Project

Project options.

Source:
  • Viewer.js, line 646

loadContext(contextOptions, directionAngle, phiAngle)

Load context for spherical photo.

Parameters:
Name Type Argument Description
contextOptions smx.SpherePhotoContext

Context options.

directionAngle number <optional>

Set DIRECTION angle for context.

phiAngle number <optional>

Set PHI angle for context.

Source:
  • Viewer.js, line 865

removeLinesLayer(id)

Remove layer with vector lines.

Parameters:
Name Type Description
id string

ID of layer.

Source:
  • Viewer.js, line 1176

removePointsLayer(id)

Remove layer with vector points.

Parameters:
Name Type Description
id string

ID of layer.

Source:
  • Viewer.js, line 1194

removeWmsLayer(id)

Remove WMS layer.

Parameters:
Name Type Description
id string

ID of layer.

Source:
  • Viewer.js, line 1203

rotateSphere(rotation)

Rotate sphere.

Parameters:
Name Type Description
rotation smx.Vector

Rotation vector.

Source:
  • Viewer.js, line 1220

setCallback(callbacks)

Initialize callback functions. Actually supported events:

  • angleChange - callback called when actual look angle is changed. Angle change is monitored only in XY plane (left and right). If look angle is changed only in Z-axis (up and down), callback is not called.
  • contextChange - callback called when actual spherical photo context is changed (move to another spherical photo).
  • click - callback called when user click on spherical photo. Callback function has one parameter with normalized 3D vector of clicked direction.
  • groundClick - callback called when user click on spherical photo. Callback function has one parameter with geo-coordinates on ground where was clicked.
  • drawLineGround - callback called when user finished draw line on spherical photo. The callback will be called with two arguments. The first argument is array with geo-coordinates, the second is indicator if drawn geometry is topologically valid.
  • drawPolygonGround - callback called when user finished draw line on spherical photo. The callback will be called with two arguments. The first argument is array with geo-coordinates, the second is indicator if drawn geometry is topologically valid.
  • drawingLineGround - callback called when user is drawing line on spherical photo. The callback will be called with two arguments. The first argument is array with geo-coordinates, the second is indicator if drawn geometry is topologically valid.
  • drawingPolygonGround - callback called when user is drawing line on spherical photo. The callback will be called with two arguments. The first argument is array with geo-coordinates, the second is indicator if drawn geometry is topologically valid.
Parameters:
Name Type Description
callbacks smx.ViewerCallbackOptions

Callback options.

Source:
  • Viewer.js, line 1249

setDataObjectVisibility(layerVisibilities)

Set visibility for more layers at once.

Parameters:
Name Type Description
layerVisibilities Object

ToDo

Source:
  • Viewer.js, line 1281

updateSize(width, height)

Update viewport size.

Parameters:
Name Type Description
width number
height number
Source:
  • Viewer.js, line 1318