Skip to main content
Version: 1.x (beta)

GeoARSDK - Getting started

Overlay Wemap navigation and points of interest on the camera in augmented reality.

Overview​

WemapGeoARSDK enables AR navigation within your app. It has no built-in LocationSource, so you attach one from WemapPositioningSDK.

Requirements​

See the common requirements in Getting started.

Permissions​

AR requires camera access. Declare NSCameraUsageDescription in your Info.plist:

<key>NSCameraUsageDescription</key>
<string>Camera is used to show navigation in AR and provide accurate indoor navigation</string>

Request permission before creating and presenting WemapGeoARSDK/GeoARView — otherwise a denied user sees a black background where the camera feed should be:

import AVFoundation

func requestCameraPermission() {
AVCaptureDevice.requestAccess(for: .video) { granted in
// continue with GeoARView only if `granted`
}
}

Adding a GeoARView​

Create the view with your session and add it to the hierarchy:

func showGeoARView(session: CoreSession) async throws {
let arView = GeoARView(frame: view.bounds, session: session, config: GeoARViewConfig())
view.addSubview(arView)

_ = try await arView.awaitLoaded()
// now it's safe to access GeoARView properties
}

Reading a manager earlier fails with a message naming the property, rather than an unexplained nil. To observe loading instead of awaiting it, use WemapGeoARSDK/GeoARView/loadPhases — a stream of LoadPhase that replays the current phase.

In SwiftUI, use WemapGeoARSDK/GeoAR instead — see SwiftUI guide.

Attaching a location source​

Attach any LocationSource from WemapPositioningSDK to the view's WemapGeoARSDK/ARLocationManager:

arView.locationManager.locationSource = try VPSARKitLocationSource(session: session)

Examples​

For sample implementations, see the official sample-apps repository.