Skip to main content

ViewerOptions

wemap-sdk-js


Interface: ViewerOptions

Behaviour options for a WemapViewer. Identity (emmid), auth and the VPS endpoint are NOT here — they come from @wemap/core (core.init()).

Properties​

claimClick?​

optional claimClick?: (click) => boolean

Whether a click in this direction is the host's, e.g. on something it draws: it then walks nowhere and is reported as a click, and the floor pointer hides.

Parameters​

click​

ViewerClick

Returns​

boolean


maxFov?​

optional maxFov?: number

Widest vertical field of view the wheel zooms out to, in degrees. Defaults to 80.


optional navigation?: boolean

In-panorama navigation: hovering the floor shows a disc and a cross on the nearest node; clicking walks there. Defaults to true.


onClick?​

optional onClick?: (click) => void

Fired with the view direction of a click that walks nowhere, in navigate mode.

Parameters​

click​

ViewerClick

Returns​

void


onError?​

optional onError?: (error) => void

Fired when the graph, an image, a located point or a measurement fails to load.

Parameters​

error​

Error

Returns​

void


onHeadingChange?​

optional onHeadingChange?: (heading) => void

Fired when look heading changes (degrees), e.g. to sync a compass.

Parameters​

heading​

number

Returns​

void


onLocate?​

optional onLocate?: (point) => void

Fired with the position under a click, in locate click mode.

Parameters​

point​

LocatedPoint

Returns​

void


onMeasure?​

optional onMeasure?: (measurement) => void

Fired with the distance between two clicks, in measure click mode.

Parameters​

measurement​

Measurement

Returns​

void


onNavigate?​

optional onNavigate?: (nodeId) => void

Fired as soon as a move to a node starts (programmatically or by click), and again with the node still on screen if the new image fails to load.

Parameters​

nodeId​

number

Returns​

void


onReady?​

optional onReady?: () => void

Fired once, when the first image is on screen.

Returns​

void


walkable?​

optional walkable?: (from, to) => boolean

Whether walking from one node to another is possible, e.g. false when a wall stands between them: the floor pointer then targets the nearest walkable node.

Parameters​

from​

ViewerNode

to​

ViewerNode

Returns​

boolean


zoom?​

optional zoom?: boolean

Enable mouse-wheel zoom. Defaults to true.