Skip to main content

v3.x

MapillaryJS v3.x Migration Guide#

This page describes how to migrate from MapillaryJS v2.x to MapillaryJS v3.x.

Components#

The stats and loading components have been removed. Configuring these components in the component options struct will no longer have any effect.

Node class#

The following property names have changed.

v2.xv3.x
cameraProjectioncameraProjectionType

Viewer class#

Constructor parameters#

All parameters of the viewer constructor now goes into the viewer options object.

v3.x:

var mly = new Mapillary.Viewer({  apiClient: '<your client id>',  container: '<your container id>',  imageKey: '<your optional image key for initializing the viewer>',  userToken: '<your optional auth token>',  // your other viewer options});

v2.x:

var mly = new Mapillary.Viewer(  '<your container id>',  '<your client id>',  '<your optional image key for initializing the viewer>',  {    // your other viewer options  },  '<your optional auth token>',);

Move close to#

The Mapillary.Viewer.moveCloseTo method has been removed, use the Mapillary REST API for this functionality instead.

Auth token#

The name of the method for setting a user auth token has changed.

v3.x:

viewer.setUserToken('<your user token>');

v3.x:

viewer.setAuthToken('<your user token>');

URL options#

Most URL options now need to be set through the Falcor data provider. When setting the Falcor data provider explicitly, the client and user tokens also need to be set on the provider.

v3.x:

var provider = new Mapillary.API.FalcorDataProvider({  apiHost: '<your api host>',  clientToken: '<your client id>',  clusterReconstructionHost: '<your cluster reconstruction host>',  imageHost: '<your image host>',  imageTileHost: '<your image tile host>',  meshHost: '<your mesh host>',  scheme: '<your scheme for all falcor data provider hosts>',  userToken: '<your optional auth token>',});
var mly = new Mapillary.Viewer({  apiClient: provider,  container: '<your container id>',  imageKey: '<your optional image key for initializing the viewer>',  url: {    exploreHost: '<your explore host>',    scheme: '<your explore scheme>',  },});

v2.x:

var mly = new Mapillary.Viewer(  '<your container id>',  '<your client id>',  '<your image key>',  {    url: {      apiHost: '<your api host>',      clusterReconstructionHost: '<your cluster reconstruction host>',      exploreHost: '<your explore host>',      imageHost: '<your image host>',      imageTileHost: '<your image tile host>',      meshHost: '<your mesh host>',      scheme: '<your scheme for all hosts>',    },  },  '<your optional auth token>',);