v3.x
v3.x
Migration Guide#
MapillaryJS This page describes how to migrate from MapillaryJS v2.x
to MapillaryJS v3.x
.
#
ComponentsThe stats
and loading
components have been removed. Configuring these components in the component options struct will no longer have any effect.
#
Node classThe following property names have changed.
v2.x | v3.x |
---|---|
cameraProjection | cameraProjectionType |
#
Viewer class#
Constructor parametersAll 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 toThe Mapillary.Viewer.moveCloseTo
method has been removed, use the Mapillary REST API for this functionality instead.
#
Auth tokenThe 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 optionsMost 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>',);