Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Viewer

Hierarchy

  • EventEmitter
    • Viewer

Index

Constructors

constructor

  • Create a new viewer instance

    class

    Viewer

    Parameters

    • id: string

      required id of an DOM element which will be transformed into the viewer

    • clientId: string

      required Mapillary API ClientID, can be obtained from http://www.mapillary.com/map/settings/integrations

    • Optional key: string

      optional photoId to start from, can be any Mapillary photo, if null no image is loaded

    • Optional options: IViewerOptions

      optional configuration object specifing Viewer's initial setup

    Returns Viewer

Events

on

  • on(eventType: string, fn: any): void
  • Subscribe to an event by its name

    Parameters

    • eventType: string
    • fn: any

    Returns void

Static loadingchanged

loadingchanged: string = "loadingchanged"

Fired when the viewer is loading more data

Static nodechanged

nodechanged: string = "nodechanged"

Fired every time the viewer goes to a new node (photo)

Properties

Private _componentController

_componentController: ComponentController

Private ComponentController object which manages component states

Private _container

_container: Container

Private Container object which maintains the DOM Element, renderers and relevant services

Private _eventLauncher

_eventLauncher: EventLauncher

Private EventLauncher object which fires events on behalf of the viewer

Private _navigator

_navigator: Navigator

Private Navigator object which controls navigation throught the vast seas of Mapillary

Methods

activateComponent

  • activateComponent(name: string): void
  • Activate a Component

    Parameters

    • name: string

      Name of the component which will become active

    Returns void

activateCover

  • activateCover(): void
  • Activate the Cover (deactivates all other components)

    Returns void

auth

  • auth(token: string, projectKey?: string): void
  • Set an OAuth 2.0 bearer token for API requests of protected resources.

    description

    When the supplied access token is an empty string or null, any previously set access token will be cleared.

    Parameters

    • token: string

      OAuth 2.0 bearer token.

    • Optional projectKey: string

      Deprecated

    Returns void

deactivateComponent

  • deactivateComponent(name: string): void
  • Deactivate a Component

    Parameters

    • name: string

      Name of component which become inactive

    Returns void

deactivateCover

  • deactivateCover(): void
  • Deactivate the Cover (activates all components marked as active)

    Returns void

fire

  • fire(eventType: string, data: any): void
  • Parameters

    • eventType: string
    • data: any

    Returns void

getComponent

  • getComponent(name: string): Component
  • Get a Component

    Parameters

    • name: string

      Name of component

    Returns Component

moveCloseTo

  • moveCloseTo(lat: number, lon: number): when.Promise
  • Move close to given latitude and longitude

    Parameters

    • lat: number

      Latitude

    • lon: number

      Longitude

    Returns when.Promise

moveDir

  • Move in a given direction

    This method has to be called through EdgeDirection enumeration as in the example.

    example

    viewer.moveDir(Mapillary.EdgeDirection.Next);

    Parameters

    Returns when.Promise

moveToKey

  • moveToKey(key: string): when.Promise
  • Navigate to a given photo key

    throws

    {ParamaterMapillaryError} If no key is provided

    Parameters

    • key: string

      a valid Mapillary photo key

    Returns when.Promise

off

  • off(eventType: string, fn: any): void

resize

  • resize(): void
  • Detect the viewer's new width and height and resize it.

    description

    The components will also detect the viewer's new size and resize their rendered elements if needed.

    Returns void

setRenderMode

  • Sets the viewer's render mode.

    example

    viewer.setRenderMode(Mapillary.RenderMode.Letterbox);

    Parameters

    Returns void

Generated using TypeDoc