Skip to main content

Interface: ViewerOptions

viewer.ViewerOptions

Interface for the options that can be provided to the Viewer.

Properties#

accessToken#

• Optional accessToken: string

Optional access token for API requests of resources.

description Can be a user access token or a client access token.

A Mapillary client access token can be obtained by signing in and registering an application.

The access token can also be set through the Viewer.setAccessToken method.

Defined in#

viewer/options/ViewerOptions.ts:27


cameraControls#

• Optional cameraControls: CameraControls

Value specifying the initial camera controls of the viewer.

default CameraControls.Street

Defined in#

viewer/options/ViewerOptions.ts:35


combinedPanning#

• Optional combinedPanning: boolean

Value specifying if combined panning should be activated.

default true

Defined in#

viewer/options/ViewerOptions.ts:42


component#

• Optional component: ComponentOptions

Component options.

Defined in#

viewer/options/ViewerOptions.ts:47


container#

• container: string | HTMLElement

The HTML element in which MapillaryJS will render the viewer, or the element's string id. The specified element must have no children.

Defined in#

viewer/options/ViewerOptions.ts:54


dataProvider#

• Optional dataProvider: IDataProvider

Optional data provider class instance for API and static resource requests.

description The data provider will override the default MapillaryJS data provider and take responsibility for all IO handling.

The data provider takes precedence over the ViewerOptions.accessToken property.

A data provider instance must implement all members specified in the IDataProvider interface. This can be done by extending the DataProviderBase class or implementing the interface directly.

Defined in#

viewer/options/ViewerOptions.ts:71


imageId#

• Optional imageId: string

Optional image-id to start from. The id can be any Mapillary image. If a id is provided the viewer is bound to that id until it has been fully loaded. If null is provided no image is loaded at viewer initialization and the viewer is not bound to any particular id. Any image can then be navigated to with e.g. viewer.moveTo("<my-image-id>").

Defined in#

viewer/options/ViewerOptions.ts:81


imageTiling#

• Optional imageTiling: boolean

Value indicating if the viewer should fetch high resolution image tiles.

description Can be used when extending MapillaryJS with a custom data provider. If no image tiling server exists the image tiling can be inactivated to avoid error messages about non-existing tiles in the console.

default true

Defined in#

viewer/options/ViewerOptions.ts:94


renderMode#

• Optional renderMode: RenderMode

The render mode in the viewer.

default RenderMode.Fill

Defined in#

viewer/options/ViewerOptions.ts:101


sprite#

• Optional sprite: string

A base URL for retrieving a PNG sprite image and json metadata file. File name extensions will be automatically appended.

Defined in#

viewer/options/ViewerOptions.ts:107


trackResize#

• Optional trackResize: boolean

If true, the viewer will automatically resize when the browser window resizes.

default true

Defined in#

viewer/options/ViewerOptions.ts:115


transitionMode#

• Optional transitionMode: TransitionMode

The transtion mode in the viewer.

default TransitionMode.Default

Defined in#

viewer/options/ViewerOptions.ts:122


url#

• Optional url: UrlOptions

The URL options.

Defined in#

viewer/options/ViewerOptions.ts:127