Methods¶
The 270 AR plugin adds the following methods to the Viewer. These are available after the Viewer is done initialising, ie on onLoadComplete().
AR methods are accessible via the Ar namespace, for example: el.Ar.startAR().
startAR¶
Starts the AR experience. Takes parameters on WebXR supported devices such as Android.
el.AR.startAr({surface: 'horizontal', overlay: document.querySelector('#myOverlay')});
Parameters:
- surface:
- Type:
string - Default:
''
The preferred surface for the model to orient itself to, eithervertical(placement on walls) orhorizontal(placement on floors, tables, etc). Default is empty, which means no preference.
- Type:
- overlay:
- Type:
HTMLElement - Default:
none
When passed, the element will be shown over the AR experience. This is useful for adding extra interactivity to your AR experience. If none is passed, a basic close button is added to the top right corner.
- Type:
stopAR¶
Stops the AR experience and restores the original Viewer.
el.Ar.stopAR();