WemapGeoAR
Displays a Wemap AR scene — camera background, geo nodes, points of interest and navigation.
The AR view itself is handed to onLoaded once it has finished loading, and everything the SDK offers is reached through it. There is no parallel Compose API and, deliberately, no wrapper parameters for values the SDK already exposes as flows — the user coordinate, navigation info and POI selection are read directly:
var arView by remember { mutableStateOf<GeoARView?>(null) }
WemapGeoAR(
session = session,
modifier = Modifier.fillMaxSize(),
onLoaded = { arView = it },
onFailed = { error -> Log.e("GeoAR", "Failed to load", error) }
)
val coordinate by (arView?.locationManager?.coordinates ?: emptyFlow())
.collectAsStateWithLifecycle(null)There is no camera state here, unlike WemapMap. The AR camera follows the device and the user's position, so it is not app state to drive.
AR needs an attached com.getwemap.sdk.core.location.LocationSource to position the scene, and camera permission — request it before this composable enters composition. Sharing one session with a WemapMapView and the screen's location sources is what keeps navigation, POI selection and user location consistent; the session must outlive the composable, so hoist it into a ViewModel rather than a remember.
Parameters
the session this view renders. Create it once per screen and share it.
the Modifier applied to the view.
rendering configuration. Read once, when the view is created — later changes are ignored, exactly as with GeoARView.configure.
whether the scene draws an opaque background. false makes the surface translucent and moves it behind other content, for compositing the scene over something else. Read once, at creation, and ignored when factory is supplied — pass it to your own constructor there instead.
invoked once with the loaded AR view. Its managers are available from this point on.
invoked with the error when loading fails. A failed points-of-interest download leaves every manager usable — see LoadPhase.Failed.
invoked on every load-phase transition, including the initial LoadPhase.Loading.
builds the AR view. Unlike WemapMap's equivalent this is not for a subclass — GeoARView is final — but for reaching the constructor arguments this composable does not expose, above all sharedLifecycle: supply it when the view tree has no lifecycle owner to discover, such as a plain ComposeView inside a Dialog. Do not call configure in it — this composable does that. Read once, when the view is created.