Migration from v6 to v8¶
Requisites¶
Update your pointrwebsdk.js and pointr.css to v8
<link href="https://pointr.blob.core.windows.net/websdk/8.0.0/css/pointr.css" rel="stylesheet" />
<script type="text/javascript" src="https://pointr.blob.core.windows.net/websdk/8.0.0/pointrwebsdk.js"></script>
Options¶
Instead of apiToken and apiDevice, clientInternalIdentifier and clientSecret are required in options.
apiUrl: "https://API_URL",
clientInternalIdentifier: "CLIENT_INTERNAL_IDENTIFIER",
clientSecret: "CLIENT_SECRET",
To learn our new optional options please check our v8 getting started page.
Events¶
v6 only supports buildings one by one and it doesn’t support any world mode or any 3d maps. To bring that support we changed some of the terminologies we used.
SDK v6 | SDK v8 |
---|---|
facility | building |
venue | site |
If you have facility or venue in your code you need to update it with building and site.
Besides that we’ve changed our event implementation from
var uiController = pointrWeb.getUiController();
var mapViewController = uiController.getMapViewController();
var mapView = mapViewController.getView();
mapView.addListener({
MapView_onViewShown: function () {
console.log("Map shown!");
},
MapView_onLevelChanged: function (newLevel) {
console.log("Map level changed to ", newLevel);
},
});
to
var events = pointrWeb
.getUiController()
.getMapViewController()
.getView().events;
var uiController = pointrWeb.getUiController();
var mapViewController = uiController.getMapViewController();
var mapView = mapViewController.getView();
var events = mapView.events;
var callback1 = () => {
console.log("Map shown!");
};
mapView.on(events.viewShown, callback1);
var callback2 = (newLevel) => {
console.log("Map level changed to ", newLevel);
};
mapView.on(events.levelChanged, callback2);
and we’ve added a new bunch of cool events and options.
Advanced sdk api users¶
To support multiple building, site and world mode most of the api functions are changed or modified. So if you’re a user of sdk api we recommend you to check our latest v8 api and use the new functions.