--- id: v3 title: 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.x` | `v3.x` | | ------------------ | ---------------------- | | `cameraProjection` | `cameraProjectionType` | ## Viewer class ### Constructor parameters All parameters of the viewer constructor now goes into the viewer options object. `v3.x`: ```js var mly = new Mapillary.Viewer({ apiClient: '', container: '', imageKey: '', userToken: '', // your other viewer options }); ``` `v2.x`: ```js var mly = new Mapillary.Viewer( '', '', '', { // your other viewer options }, '', ); ``` ### Move close to The `Mapillary.Viewer.moveCloseTo` method has been removed, use the [Mapillary REST API](https://www.mapillary.com/developer/api-documentation/#search-images) for this functionality instead. ### Auth token The name of the method for setting a user auth token has changed. `v3.x`: ```ts viewer.setUserToken(''); ``` `v3.x`: ```ts viewer.setAuthToken(''); ``` ### 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`: ```js var provider = new Mapillary.API.FalcorDataProvider({ apiHost: '', clientToken: '', clusterReconstructionHost: '', imageHost: '', imageTileHost: '', meshHost: '', scheme: '', userToken: '', }); var mly = new Mapillary.Viewer({ apiClient: provider, container: '', imageKey: '', url: { exploreHost: '', scheme: '', }, }); ``` `v2.x`: ```js var mly = new Mapillary.Viewer( '', '', '', { url: { apiHost: '', clusterReconstructionHost: '', exploreHost: '', imageHost: '', imageTileHost: '', meshHost: '', scheme: '', }, }, '', ); ```