mapillary-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

mapillary-js Build Status

WebGL JavaScript library for displaying street level photos from Mapillary

**ATTENTION! This is a beta release

Using mapillary-js

Include via HTML tags:

<link rel="stylesheet" href="https://npmcdn.com/mapillary-js@0.0.5/dist/mapillary-js.min.css">
<script src="https://npmcdn.com/mapillary-js@0.0.5/dist/mapillary-js.min.js"></script>

Make sure to check out Examples section below or API Documentation for more information.

Alternatively, you can npm install mapillary-js to use it with module loader/bundler of your choice.

Examples

Documentation

Changelog

Every release is described on the GitHub Releases page.

License

MIT License

Index

Enumerations

Classes

Interfaces

Enumerations

EdgeDirection

EdgeDirection:

Enumeration for edge directions

enum

{number}

readonly
description

Directions for edges in node graph describing sequence, spatial and node type relations between nodes.

Next

Next:

Next node in the sequence

Pano

Pano:

Panorama in general direction

Prev

Prev:

Previous node in the sequence

RotateLeft

RotateLeft:

Rotate with small counter clockwise angle change

RotateRight

RotateRight:

Rotate with small clockwise angle change

StepBackward

StepBackward:

Step backward keeping viewing direction

StepForward

StepForward:

Step forward keeping viewing direction

StepLeft

StepLeft:

Step to the left keeping viewing direction

StepRight

StepRight:

Step to the right keeping viewing direction

TurnLeft

TurnLeft:

Turn 90 degrees counter clockwise

TurnRight

TurnRight:

Turn 90 degrees clockwise

TurnU

TurnU:

Turn 180 degrees

ImageSize

ImageSize:

Enumeration for image sizes

enum

{number}

readonly
description

Image sizes in pixels for the long side of the image.

Size1024

Size1024:

1024 pixels image size

Size2048

Size2048:

2048 pixels image size

Size320

Size320:

320 pixels image size

Size640

Size640:

640 pixels image size

Classes

Viewer

Viewer:

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

on

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

    Parameters

    • eventType: string
    • fn: any

    Returns void

loadingchanged

loadingchanged: string

Fired when the viewer is loading more data

nodechanged

nodechanged: string

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

_componentController

_componentController: ComponentController

Private ComponentController object which manages component states

_container

_container: Container

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

_eventLauncher

_eventLauncher: EventLauncher

Private EventLauncher object which fires events on behalf of the viewer

_navigator

_navigator: Navigator

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

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

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): void
  • Move close to given latitude and longitude

    Parameters

    • lat: number

      Latitude

    • lon: number

      Longitude

    Returns void

moveDir

  • Move in a given direction

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

    example

    viewer.moveToDir(Mapillary.EdgeDirection['NEXT'])

    Parameters

    Returns void

moveToKey

  • moveToKey(key: string): void
  • Navigate to a given photo key

    throws

    {ParamaterMapillaryError} If no key is provided

    Parameters

    • key: string

      a valid Mapillary photo key

    Returns void

off

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

Interfaces

IViewerOptions

IViewerOptions:

attribution

attribution: boolean

Show attribution

default

true

baseImageSize

baseImageSize: ImageSize

Default size of the thumbnail used in the viewer

default

{ImageSize}

cache

cache: boolean

Cache images ahead.

default

true

cover

cover: boolean

Use a cover and avoid loading initial data from Mapillary.

default

true

debug

debug: boolean

Show debug interface.

default

false

direction

direction: boolean

Show direction arrows for navigation.

default

true

image

image: boolean

Show static images without transitions.

default

true

imageplane

imageplane: boolean

Show image planes in 3D using WebGL.

default

true

keyboard

keyboard: boolean

Enable use of keyboard commands.

default

true

loading

loading: boolean

Show indication of loading.

default

true

maxImageSize

maxImageSize: ImageSize

The max size of an image shown in the viewer will be used when user pauses.

default

{ImageSize}

mouse

mouse: boolean

Enable mouse interface (needed for panorama navigation)

default

true

navigation

navigation: boolean

Show static navigation arrows in the corners.

default

false

player

player: boolean

Add play ability to the viewer.

default

false

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc