Getting Started with Wemap SDKs
Location tracking, routing, and navigation for iOS.
Overview
The Wemap SDKs provide comprehensive location, routing, and navigation capabilities for iOS apps. They are distributed as several frameworks that share a single session:
- WemapCoreSDK — common types and the foundation for all other SDKs (API access, routing, POIs).
- WemapMapSDK — customizable, interactive maps built on MapLibre.
- WemapGeoARSDK — augmented-reality navigation and points of interest.
- WemapPositioningSDK — indoor/outdoor positioning, see Choosing a Location Source:
- VPS — visual positioning system, camera-based (best for indoor).
- GPS — global positioning system (best for outdoor).
- WemapMapWidgetsSDK — ready-made map controls in SwiftUI and UIKit: the levels rail, the itinerary form and the points-of-interest sheet, see Map Widgets Getting Started. Distributed separately — see Map widgets under Installation.
Each framework has its own reference and getting-started guide — see the Frameworks list below.
Upgrading from 0.x
v1 is a breaking release. Migrating to v1 walks through it in twelve steps, each of which leaves your project compiling, and ends with an index from compiler error to step number. What v1 Covers says what every 1.x release keeps, and what a minor release may add.
Requirements
| Wemap SDK | Xcode | Swift | iOS |
|---|---|---|---|
| 1.x | 26.0+ | 6.2+ | 15.5+ |
The SDKs ship as binary XCFrameworks. A binary Swift framework can only be consumed by the toolchain that built it and newer, so Xcode 26.0 / Swift 6.2 is the minimum — earlier Xcode versions cannot build against the binaries. A 1.x minor release may raise the Xcode and Swift minimum and its CHANGELOG says so; a patch release never does. iOS 15.5 stays the minimum until 2.0.
Installation
Add the SDK as a dependency via Swift Package Manager. It is not published to CocoaPods: the last pod is
1.0.0-beta.1 — Migrating to v1 step 1 moves a Podfile to SPM.
The latest release is 1.0.0. A version range starting there (Up to Next Minor Version in Xcode) picks up
its patches; to stay on that release exactly:
.package(url: "https://github.com/wemap/wemap-sdk-ios-distribution.git", exact: "1.0.0")
An app on 1.0.0-beta.1 or 1.0.0-beta.2 pins that beta exactly — a version range never resolves a
pre-release — so it stays there until you change the pin. Migrating to v1 lists what changed since each beta.
Swift Package Manager
-
In Xcode, choose
File > Add Package Dependencies…. -
Enter the URL
https://github.com/wemap/wemap-sdk-ios-distribution. -
Choose a dependency rule (we recommend Up to Next Minor Version from the latest release).
-
Add the package to your app target.

Map widgets
WemapMapWidgetsSDK ships from its own package,
https://github.com/wemap/wemap-sdk-ios-widgets-distribution, on a 0.x version line: any release may
change its API, so pin the Exact Version. Each widgets release depends on one exact release of the SDKs
and resolves it for you; add wemap-sdk-ios-distribution at that same version, or leave it out.
.package(url: "https://github.com/wemap/wemap-sdk-ios-widgets-distribution.git", exact: "0.3.0")
Creating a session
Every Wemap SDK is driven by a session, which loads a map's data once and owns the shared state the
SDKs build on (routing, POIs, positioning). Create one session and pass it to each component you
use. You need a mapID and a token — contact the Wemap team.
import WemapCoreSDK
// WemapCoreSDK alone (API access, no rendering):
let session = try await CoreSession(mapID: 19158, token: "YOUR_TOKEN", config: SessionConfig(environment: .prod))
import WemapMapSDK
// Map rendering — create a MapSession and pass it to a MapView:
let session = try await MapSession(mapID: 19158, token: "YOUR_TOKEN")
let mapView = MapView(frame: view.bounds, session: session)
The same session can be passed to positioning sources and the AR view, keeping routing, POIs, and user location consistent across every SDK.
Switching over SDK enums
During 1.x, a minor release may add a case to any public enum of the SDKs: an error, an event, a positioning state
or a step direction. A new case is not a breaking change, so your switch statements must handle the cases they
don't know yet with @unknown default:
func handle(_ error: DirectionsServiceError) {
switch error {
case .noItinerariesFound:
showNoRouteMessage()
case .notSupportedTravelMode, .requestFailed, .invalidRules, .graphUnavailable:
showGenericError()
@unknown default:
// A case added in a later 1.x release.
showGenericError()
}
}
The compiler warns about a switch that has no @unknown default branch. If you ignore the warning, your app stops
compiling when the SDK adds a case. Prefer @unknown default to a plain default: it handles the new case at run
time, and the compiler still warns you about it once you build against the new release. Where an enum offers is… properties, such as isReady or isOutdoor, you
can use them instead of a switch.
Two enums are closed and will not change in 1.x: LoadPhase and Levels. Switch over them exhaustively, with no
@unknown default.
Observing streams
Views, managers and location sources report changes as AsyncStream properties. Every one of them follows the same
rules:
- Each consumer gets every value. Reading the property again gives a new stream, so several tasks can observe the same thing independently.
- Values arrive in your task's context. Nothing is promised about the thread they were produced on, nor about the order of values across two different streams.
- A stream ends when its owner ends. A view's, a manager's or a source's own streams finish when it is
deallocated, so your
for awaitloop exits. The user'scoordinates,attitudesand locationerrorsbelong to the session: every location source and both location managers read the same streams, which finish when the session is deallocated. - An error is a value. It arrives on an
errorsstream, and no stream ends because of one.
Beyond these, each stream is one of three kinds, which its documentation names:
| Kind | Streams | A new consumer | A slow consumer |
|---|---|---|---|
| State: what something is now | loadPhases, focusedBuildings, locationStates, cameraStates(frequency:), the VPS source's states, scanStatuses, backgroundScanStatuses, scanIssues and cameraTrackingStates | receives the current value first | receives only the newest value; a value equal to the previous one is never repeated |
| Event: what happened | navigationEvents, navigationInfoUpdates, selectionUpdates, visibilityUpdates, touchedPOIs, touchedPoints, activeLevelChanges, userLocalizationUpdates and every errors | receives only what happens after it subscribed | keeps the 8 most recent values; an older one is dropped and the drop is logged |
| Measurement | coordinates, attitudes | receives the latest value, unless the active location source has stopped or been replaced since | keeps the 8 most recent coordinates and the most recent attitude; the first drop is logged |
An event stream does not tell you the current state. Read the matching property first — getVisiblePOIs(),
getNavigationInfo(), activeNavigation — then follow the stream, creating the stream before reading the property
so that a change landing between the two is not missed.
Examples
For sample implementations, see the official sample-apps repository.
Topics
Frameworks
- WemapCoreSDK
- WemapMapSDK
- WemapGeoARSDK
- WemapPositioningSDKVPSARKit
- WemapPositioningSDKGPS
- WemapMapWidgetsSDK