Table of Contents

AR session off-site usage

This article introduces how to use AR session when not on-site.

Before you start

Enable simulator mode

Using simulator mode can avoid the situation where developers must be stationed on-site for a long time during the development of AR applications.

In this mode, the session does not use GNSS data or uses fake GNSS data input.

Warning

After enabling simulator mode, a specific watermark will appear on the screen.

When the mini-program is officially released, AR session is not allowed to use simulator mode. Be sure to remove the relevant configuration before going live.

Do not use GNSS data

Use the EasyARSession's setGeoLocationInput(inputMode, geoLocation) method to pass only the "Simulator" string. After that, the session will not perform any longitude- and latitude-related positioning.

session.setGeoLocationInput("Simulator");  

Use simulated GNSS data

If you need to simulate the user being at a specific location, use the EasyARSession's setGeoLocationInput(inputMode, geoLocation) method to pass the "Simulator" string and the specified longitude and latitude. After that, the session will use simulated longitude and latitude data for positioning.

const targetLongitude = 123.45; // longitude  
const targetLatitude = 32.1; // latitude  
session.setGeoLocationInput("Simulator", { longitude: targetLongitude, latitude: targetLatitude });  
Warning

Simulated input must use longitude and latitude data in the WGS-84 coordinate system.

Using incorrect longitude and latitude data may cause positioning failure or confusion.