Table of Contents

Off-site use of AR Session

This article describes how to use AR Session when you are not on site.

Before you begin

Enable Simulator mode

Using Simulator mode can avoid the need for developers to stay on site for a long time during AR application development.

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

Warning

After Simulator mode is enabled, a specific watermark will appear on the view.

When the mini program is officially released, AR Session is not allowed to use Simulator mode. Be sure to remove the related configuration before going online.

Do not use GNSS data

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

session.setGeoLocationInput("Simulator");

Use simulated GNSS data

To simulate that the user is at a specific location, use the EasyARSession method setGeoLocationInput(inputMode, geoLocation) and pass the "Simulator" string together with the specified longitude and latitude. After that, the session uses the simulated longitude and latitude data for localization.

const targetLongitude = 123.45; // 经度
const targetLatitude = 32.1; // 纬度
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 localization to fail or become disordered.