Detect current view mode!

This isn’t documented in the GitHub - shapespark/shapespark-viewer-api: JavaScript API for interacting with the Shapespark 3D scene., but per this forum thread: Get details of view by name
the view object is now passed to the onViewSwitchDone callback as the second argument. You can inspect the mode property. Something like:

WALK.getViewer().onViewSwitchDone(function(viewName, view) {
    if (view.mode === 'orbit') {
      console.log('Switched to an orbit view ' + viewName);
    }
});
2 Likes