Migrating to v1
Step numbering matches the iOS guide, so a team migrating both platforms can read them side by side. Three headings differ because the platform mechanism differs — noted where they do.
Overview
v1 replaces four things across every module:
- Static singletons → per-instance sessions.
WemapCoreSDK.instanceandWemapMapSDK.instanceare gone; aCoreSessionorMapSessionloads the map data and is shared by the views and location sources of one screen. - Global mutable constants → immutable configs.
CoreConstants,MapConstants,ARConstants,VPSControllerConstantsandStateManagerConstantsare replaced bydata classconfigs, fixed at creation time. - Listeners →
Flow. Every*Listener/*Observerinterface on a manager or a location source is removed in favour of a read-onlyFlowproperty. - Kotlin idiom throughout. Acronyms are no longer all-caps in symbol names, every public
Floatscalar is aDouble, time-valued members arekotlin.time.Duration, and errors are sealed class hierarchies.
Work through the steps in order. Each step leaves the project compiling, so you can stop and test between them. Steps 1–7 apply to every consumer; 8–12 only if you use that feature.
- Effort: a few hours for a map-only app; closer to a day for an app with VPS positioning or a custom location source.
- Toolchain: 1.0 requires Kotlin 2.2, Android Gradle plugin 9.1,
minSdk24, JVM target 11 andcompileSdk37; the current minimums are in Getting started § Requirements.
If you are migrating an iOS app in parallel, the iOS guide uses the same step numbering.
Coming from
1.0.0-beta.2? Only these changed since, and each one stops your project compiling until you apply it:
- Step 1 — Turf, GeoJSON and kotlin-math no longer reach your compile classpath through
core: declare the ones your app uses. An app onmapstill compiles against GeoJSON, which MapLibre exposes.- Step 3 — recalculation and projection onto the itinerary are options of each navigation: pass
NavigationOptionstostartNavigation, withrecalculation(aRecalculationOptions,RecalculationOptions.Disabledto turn it off) andprojection(aProjectionOptions). The twoSessionConfigflags are gone,userPositionThresholdandnavigationRecalculationTimeIntervalareRecalculationOptions.indoorOffRouteDistanceandminimumInterval, andisUserLocationProjectionOnGraphEnabledisSessionConfig.graphProjection.- Step 4 —
CoreSession.mapCenteris aCoordinate, andCoordinate.point, theCoordinate(point, …)constructor and the helpers on MapLibre's geojson andLocationtypes are no longer public: useCoordinate's ownlatitude,longitude,distanceTo,destinationandbearingTo.- Step 6 — the public enums are value classes with
PascalCaseconstants (ScanStatus.STARTEDisScanStatus.Started) and noentries,valueOforname; awhenover one needs anelsebranch.SelectionModeisPointOfInterestSelectionMode,WemapMapView.locationManagerisuserLocationManager,UserLocationViewStateStyle.bearingColorisheadingColor, andStep.getNavigationInstructionstakes thelocale, beforeincludeStreetNames.PointOfInterestType.valueisrawValue, andNavigationError.Unknownis gone.MapPointOfInterestManager.defaultZoomis gone: pass azoomtoselectPoiorcenterToPoi.- Step 7 —
MapViewConfigis no longer public, andWemapMapView.configureandWemapMaptake noconfig: setswitchesLevelsAutomaticallyandstaleStateTimeoutonmapView.userLocationManager. The ComposeMapCameraPositionStateholds aMapCameraPosition, what the camera should do, instead of the live camera:WemapMap'sinitialCameraandcameraUpdateFrequencyareinitialCameraPositionandcameraChangeFrequency.- Step 8 —
VpsARCoreLocationSourceError.TiltTooHighis gone fromerrors: observescanIssue/scanIssuesforScanIssue.DevicePointedTooLow, andTrackingState.isTrackingis no longer public.- Step 9 —
MapSession.createPackdataServicetakes acontextfirst.- Step 10 —
GeoARViewConfigis no longer public, andGeoARView.configureandWemapGeoARtake noconfig: set anARNavigationStyleonarView.navigationManager.style.navigationVisibilityDistanceisvisibilityDistance, and the arrow'sxPercentageOfView/yPercentageOfViewarehorizontalPosition/verticalPosition.setScaleDistanceRatioForFixedSizeis removed.- Step 11 — a custom
LocationSourceimplementsonStart(listener),onStop()andonRelease(), reports to theLocationSourceListenerit is given, and names itscoreSession;start(),stop(),deinit(),coordinates,attitudesanderrorsare extensions imported fromcom.getwemap.sdk.core.location. Implementing one of the SDK's manager, provider or service interfaces needs@OptIn(InternalWemapApi::class).- Step 12 — the models are created only by the SDK,
Segmentcan no longer be subclassed, and the models are no longer@Serializable;ItineraryandNavigationInfoare no longer data classes, so they cannot be destructured;PointOfInterest.externalDatais a JSONString?;PointSpan,NavigationInstructionsHandler, the free functions overQuaternionandDouble3,Incline.localizableIdandtoStepDirection(),Step.Direction.horizontalDirectionLocalizableIdandturnSharpnessLocalizableId,Step.Kind.localizableKey,Itinerary.legsSegments,PointOfInterestSelectionMode.next(),ARPointOfInterestManager.looksAtCamera,BoundingBox.toLatLngBounds()andHeading.fromDeviceAttitude(useAttitude.toHeading()) are no longer public; and no module publishes theversion_namestring resource, whichWemapSDKs.versionreplaces.Some behaviour changed since
1.0.0-beta.2too, with nothing for the compiler to catch: a backend's failed HTTP status throwsWemapError.RequestFailedinstead of Retrofit'sHttpException,Coordinate'sequalsis exact, andUserLocationManager.locationStatesandVpsARCoreLocationSource.cameraTrackingStatesareStateFlows that start with the current state. Check the rows of Changes that compile but behave differently below.Coming from
1.0.0-beta.1? First apply the breaking changes of1.0.0-beta.2, then the list above.
1 · Update the dependency
Rule: move to the latest 1.x release and raise your toolchain floor.
Take the version itself — and the transitive dependency versions that come with it — from the SDK change log. This guide deliberately does not repeat them, so that it stays correct as 1.x moves on.
Five floors changed in v1, and they block the build before anything else does. As of 1.0:
| v0.x | v1.0 | |
|---|---|---|
| Kotlin | 1.9 — no pin, so whatever the 2.0.20 compiler emitted | 2.2 — one below the Kotlin 2.3 the SDK's classes are compiled for |
| Android Gradle plugin | 8.x | 9.1 — set by the AndroidX and Compose releases the SDK depends on |
| minSdk | 23 — 24 for geo-ar | 24 for every module |
| JVM target | 1.8 | 11 — 17 for geo-ar and geo-ar-compose |
| compileSdk | 36 | 37 |
minSdk and the JVM target hold for the whole 1.x line. A 1.x minor release may raise the Kotlin and Android
Gradle plugin minimums, never a patch release; the compileSdk minimum rises when a dependency requires it. The
CHANGELOG announces each, and Getting started § Requirements has the current
minimums. What else 1.x keeps, and what it may add, is in What v1 covers.
No module publishes the version_name string resource any more: read the SDK's version from
WemapSDKs.version.
Two artifacts are new in v1 and are opt-in — nothing else changes if you do not take them:
implementation("com.getwemap.sdk:map-compose:<version>") // Jetpack Compose for the Map SDK
implementation("com.getwemap.sdk:geo-ar-compose:<version>") // Jetpack Compose for the GeoAR SDK
Watch out: eight dependencies the SDK used to expose transitively are now implementation — Retrofit,
Retrofit's SerializationConverter, Coroutines Android, OkHttp's LoggingInterceptor, MapLibre's Turf and
GeoJSON, kotlin-math and (from android-fused-adaptive) PlayServices Base. If your app compiled against any of
them through the SDK, declare it yourself. An app on map still compiles against GeoJSON, which MapLibre exposes;
1.0.0-beta.2 still exposed Turf, GeoJSON and kotlin-math.
Watch out: if you use a MapLibre plugin such as android-plugin-annotation-v9, exclude the
org.maplibre.gl:android-sdk it brings in, or the build fails on duplicate classes: v0.x shipped MapLibre's
android-sdk, and the map now ships its two-engine android-sdk-vulkan-opengl
(MapLibre plugins).
2 · Create a session
Rule: wherever you reached a singleton or passed a MapData, create one session per screen and pass it in.
// before
val mapData = WemapMapSDK.instance.mapData(id = 19158, token = "TOKEN")
mapView.mapData = mapData
mapView.onCreate(savedInstanceState)
mapView.getMapViewAsync { view, map, style, data -> /* … */ }
// after
val session = MapSession.create(context, mapId = 19158, token = "TOKEN", config = SessionConfig())
mapView.configure(session)
lifecycleScope.launch {
runCatching { mapView.awaitLoaded() }
.onSuccess { /* managers are usable */ }
.onFailure { error -> println("Failed to load mapView with error - $error") }
}
Share the same session across a screen's WemapMapView, GeoARView and location sources — that is what
keeps navigation, POI selection and user location consistent. A second map needs its own session. Call
session.deinit() when the screen is done.
CoreSession.create and MapSession.create are suspend; offline maps use
MapSession.create(context, offlineZip, config) (see step 9).
Removed: WemapCoreSDK.instance, WemapCoreSDK.setEnvironment, WemapCoreSDK.setItinerariesEnvironment,
WemapMapSDK.instance, WemapMapSDK.mapData(id, token), ServiceFactory, DependencyManager.
Constructor mapping:
| v0.x | v1.0 |
|---|---|
WemapMapView.mapData = … | mapView.configure(session, config) |
GeoARView.mapData = … | geoARView.configure(session, config) |
WemapVPSARCoreLocationSource(context, mapData) / (context, token) | VpsARCoreLocationSource(context, session, vpsConfig) |
GPSLocationSource(context, mapData) | GpsLocationSource(context, session) |
GmsFusedLocationSource(context) / (context, mapData) | GmsFusedLocationSource(context, session) |
AndroidFusedAdaptiveLocationSource(context, mapData) | AndroidFusedAdaptiveLocationSource(context, session) |
SimulatorLocationSource(mapData, options) | SimulatorLocationSource(session, options) |
Watch out: MapData is no longer for public use. Read map metadata from the session instead: CoreSession exposes
exactly mapId, mapCenter (a Coordinate, where MapData.center was a GeoJSON Point), isVpsEnabled, config,
itineraryProvider, pointOfInterestService, navigationInfoHandler and deinit(); MapSession adds the offline
factories. There is no public graph id — the graph is resolved by the session and reached through
session.itineraryProvider.
Watch out: creating a session is a suspending network call, so it can no longer happen inline in
onViewCreated. Hoist it into a ViewModel so a configuration change does not re-fetch the map — that is what
the sample apps do, and it is also what WemapMap (Compose) expects, since it rebuilds the view when session
changes.
3 · Pass configs instead of setting globals
Rule: every value you used to assign to a *Constants static is now a val property of a config, built in
one constructor call and passed at creation time — except the user-location values and the AR navigation look,
which are properties of the UserLocationManager and ARNavigationManager that apply them. There is no global
mutable configuration left.
// before
CoreConstants.ITINERARY_RECALCULATION_ENABLED = false
CoreConstants.ENVIRONMENT = Environment.Dev()
MapConstants.STALE_TIMEOUT_MILLISECONDS = 10_000
// after
val session = MapSession.create(
context, mapId = 19158, token = "TOKEN",
config = SessionConfig(environment = Environment.Dev)
)
mapView.configure(session)
// once the map has loaded
mapView.userLocationManager.staleStateTimeout = 10.seconds
// recalculation is an option of each navigation, not of the session
mapView.navigationManager.startNavigation(
destination = destination,
options = NavigationOptions(recalculation = RecalculationOptions.Disabled)
)
| v0.x | v1.0 | Passed to |
|---|---|---|
CoreConstants statics | SessionConfig (com.getwemap.sdk.core.configs) | CoreSession.create / MapSession.create |
CoreConstants recalculation and itinerary-projection statics | NavigationOptions | each startNavigation call |
WemapCoreSDK.setEnvironment(…) / CoreConstants.ENVIRONMENT | SessionConfig.environment | CoreSession.create / MapSession.create |
WemapCoreSDK.setItinerariesEnvironment(…) | SessionConfig.directionsEnvironment | CoreSession.create / MapSession.create |
MapConstants statics | UserLocationManager properties | mapView.userLocationManager, once the map has loaded |
ARConstants + ARConstants.DirectionalArrow | ARNavigationStyle + ARNavigationStyle.DirectionalArrow (com.getwemap.sdk.geoar.managers) | geoARView.navigationManager.style, once the AR view has loaded |
VPSControllerConstants, StateManagerConstants | VpsConfig — see step 8 | VpsARCoreLocationSource(…) |
Property-by-property:
| v0.x | v1.0 |
|---|---|
CoreConstants.ITINERARY_RECALCULATION_ENABLED | NavigationOptions.recalculation — RecalculationOptions.Disabled turns it off |
CoreConstants.USER_LOCATION_PROJECTION_ON_ITINERARY_ENABLED | NavigationOptions.projection — ProjectionOptions.Disabled turns it off |
CoreConstants.USER_LOCATION_PROJECTION_ON_GRAPH_ENABLED | SessionConfig.graphProjection — ProjectionOptions() turns it on |
MapConstants.SWITCH_LEVELS_AUTOMATICALLY_ON_USER_MOVEMENTS | UserLocationManager.switchesLevelsAutomatically |
MapConstants.STALE_TIMEOUT_MILLISECONDS (Long, ms) | UserLocationManager.staleStateTimeout (Duration) |
ARConstants.NAVIGATION_VISIBILITY_DISTANCE | ARNavigationStyle.visibilityDistance — now nullable |
ARConstants.STEP_INSTRUCTION_ALTITUDE | ARNavigationStyle.stepInstructionAltitude |
ARConstants.DirectionalArrow.TARGET_DISTANCE (and siblings) | ARNavigationStyle.DirectionalArrow.targetDistance (and siblings) |
ARConstants.DirectionalArrow.X_PERCENTAGE_OF_VIEW / Y_PERCENTAGE_OF_VIEW | ARNavigationStyle.DirectionalArrow.horizontalPosition / verticalPosition |
Three knobs that were public vars are no longer public API:
CoreConstants.INCLUDE_PROJECTION_DISTANCE_INTO_ACCURACY, MapConstants.VISUAL_DEBUGGER_CONFIG and
ARConstants.VISUAL_DEBUGGER_ENABLED. They have no replacement in the public surface.
Other shape changes on the same lines:
MapConstantsmoved frommap.helperstomap.configsand keeps onlyWEMAP_BLUE.ARConstantsis internal.- The
Environmentsealed class andIEnvironmentwere replaced by thecom.getwemap.sdk.core.configs.Environmentenum —Environment.Dev/Environment.Prod.Environment.Prod()no longer compiles. CoreConstants.ITINERARIES_HOST/ITINERARIES_BASE_URLwere stored and settable;SessionConfig.directionsBaseUrlis computed fromdirectionsEnvironment, so the two can no longer disagree.- Every
Booleanreads as a statement about what owns it —is…, or a verb such asuses…— including the ones1.0.0-beta.1shipped under their 0.x names. Your settings keep their meaning; only the names change:
0.x and 1.0.0-beta.1 | v1.0 |
|---|---|
itineraryRecalculationEnabled | NavigationOptions.recalculation.isEnabled — moved, see below |
userLocationProjectionOnItineraryEnabled | NavigationOptions.projection — moved, see below |
userLocationProjectionOnGraphEnabled | SessionConfig.graphProjection — see below |
switchLevelsAutomaticallyOnUserMovements | UserLocationManager.switchesLevelsAutomatically — moved, see below |
UserLocationViewStyles.pulseEnabled | isPulseEnabled |
useGrayscaleImageForVps, useJpgImageForVps | VpsControllerConfig.usesGrayscaleImageForVps, usesJpgImageForVps |
NavigationOptions.stopWhenArrivedAtDestination | stopsWhenArrivedAtDestination |
SimulationOptions.inLoop, restartDelay, simulateAttitude | repeats, repeatDelay, simulatesAttitude |
UseTags.active, clickable | isActive, isClickable |
UserLocalizationUpdate.backgroundScan | isFromBackgroundScan |
Watch out: every config property is a val. Build the config you want in one constructor call — there is
nothing to assign to afterwards, by design. copy() works for deriving a variant.
Recalculation and projection onto the itinerary are options of each navigation, not of the session, so one
session can run a navigation that keeps a hand-built itinerary next to one that reroutes. 1.0.0-beta.2's
SessionConfig.isItineraryRecalculationEnabled and isUserLocationProjectionOnItineraryEnabled are gone; pass
NavigationOptions to each startNavigation instead. The three recalculation values are grouped:
1.0.0-beta.2 | v1.0 |
|---|---|
SessionConfig.isItineraryRecalculationEnabled | NavigationOptions.recalculation — RecalculationOptions.Disabled turns it off |
SessionConfig.isUserLocationProjectionOnItineraryEnabled | NavigationOptions.projection — ProjectionOptions.Disabled turns it off |
SessionConfig.isUserLocationProjectionOnGraphEnabled | SessionConfig.graphProjection — ProjectionOptions() turns it on |
NavigationOptions.userPositionThreshold | RecalculationOptions.indoorOffRouteDistance — outdoorOffRouteDistance is new |
NavigationOptions.navigationRecalculationTimeInterval | RecalculationOptions.minimumInterval |
navigationManager.startNavigation(
destination = destination,
options = NavigationOptions(
projection = ProjectionOptions.Disabled,
recalculation = RecalculationOptions(indoorOffRouteDistance = 20.0, minimumInterval = 10.seconds)
)
)
The user's location is projected only within a maximum distance of the route, 15 meters indoors and 50
outdoors by default: ProjectionOptions.indoorMaxDistance and outdoorMaxDistance. 1.0.0-beta.2 projected it
however far the user was, so a user who left the route stayed drawn on it. Now the user indicator leaves the route
beyond that distance, a location the itinerary does not project is tried on the graph when
SessionConfig.graphProjection is enabled, and the navigation info counts the distance between the user and the
itinerary. To keep a user on the route however far they are, set both distances to Double.POSITIVE_INFINITY.
The user-location settings are properties of UserLocationManager, not of a config, so they can follow a
location source swapped at runtime — a source that delivers in bursts needs a longer stale timeout than GPS. A new
value takes effect at the next fix. MapViewConfig is no longer public API, and configure and WemapMap lose
their config parameter; set the two values on mapView.userLocationManager once the map has loaded — from
onLoaded with Compose:
1.0.0-beta.2 | v1.0 |
|---|---|
MapViewConfig.switchesLevelsAutomaticallyOnUserMovements | UserLocationManager.switchesLevelsAutomatically |
MapViewConfig.staleStateTimeout | UserLocationManager.staleStateTimeout — out-of-range values are clamped when set |
mapView.configure(session, config) | mapView.configure(session) |
WemapMap(session, config = …) | WemapMap(session) |
WemapMap(
session = session,
onLoaded = { mapView ->
mapView.userLocationManager.staleStateTimeout = 10.seconds
mapView.userLocationManager.switchesLevelsAutomatically = false
}
)
How the AR view draws a navigation is a property of its ARNavigationManager, style, not a config: it can be
set again at any time — to move the directional arrow clear of a bottom sheet, for instance — and a new style
applies to the navigation already shown. It stays per AR view, not per navigation, because a navigation started from
the map is drawn by the AR view too. GeoARViewConfig is no longer public API, and configure and WemapGeoAR
lose their config parameter; set the style on geoARView.navigationManager once the view has loaded — from
onLoaded with Compose:
1.0.0-beta.2 | v1.0 |
|---|---|
GeoARViewConfig | ARNavigationStyle (com.getwemap.sdk.geoar.managers) — out-of-range values are clamped when set |
GeoARViewConfig.navigationVisibilityDistance | ARNavigationStyle.visibilityDistance |
GeoARViewConfig.DirectionalArrow.xPercentageOfView / yPercentageOfView | ARNavigationStyle.DirectionalArrow.horizontalPosition / verticalPosition |
geoARView.configure(session, config) | geoARView.configure(session) |
WemapGeoAR(session, config = …) | WemapGeoAR(session) |
WemapGeoAR(
session = session,
onLoaded = { arView ->
arView.navigationManager.style = ARNavigationStyle(
directionalArrow = ARNavigationStyle.DirectionalArrow(verticalPosition = .7f)
)
}
)
Watch out (Java callers): SessionConfig and RecalculationOptions carry a Duration
property, so Kotlin mangles their generated copy() and componentN() into names like copy-45ZY6uE. Build these
from Kotlin.
4 · Update your Coordinate and level usage
Rule: Coordinate is an immutable value type holding its own latitude and longitude — it no longer wraps a
Location — and levels are a Levels value rather than a List<Float>.
// before
val coordinate = Coordinate(someLocation, listOf(0f, 1f))
val accuracy = coordinate.accuracy // Float?
val location = coordinate.location // Location
val time = coordinate.time
// after
val coordinate = Coordinate(someLocation, Levels.Range(0f..1f))
val accuracy = coordinate.horizontalAccuracy // Double, 0.0 or negative means "no accuracy"
val location = coordinate.toLocation()
val time = coordinate.timestamp
| v0.x | v1.0 |
|---|---|
levels: List<Float> (empty meant outdoor) | levels: Levels (Levels.Outdoor by default) |
Coordinate(location, levels, heightFromFloor, heightFromGround) | same shape, levels is a Levels and the heights are Double? |
Coordinate(latitude, longitude, levels: List<Float>) | Coordinate(latitude, longitude, levels: Levels, altitude, bearing, horizontalAccuracy, timestamp, heightFromFloor, heightFromGround) |
| — | Coordinate(latitude, longitude, level: Float, altitude) and (latitude, longitude, range: ClosedRange<Float>, altitude) convenience constructors |
accuracy: Float? | horizontalAccuracy: Double — non-optional |
time: Long | timestamp: Long |
location: Location | toLocation() |
copy(location, levels, …) | copy(latitude, longitude, levels, …) — takes latitude and longitude, not a Location |
Levels is a sealed class with Levels.Outdoor, Levels.Single(level) and Levels.Range(range) (a
ClosedRange<Float>), plus fromArray(List<Float>), toList(), union, contains, intersects,
intersection, diff and the isOutdoor / isSingle / isRange predicates. Segment.levels and the graph
Edge.levels are Levels too. fromArray throws Levels.InitializationError, itself a sealed hierarchy of
InvalidLevelsCount, WrongRangeBoundsOrder and RangeBoundsEqual — match with is.
No longer public API: the Coordinate.ecef and cartesian properties, ecefToEusRot, eusToEcefRot and
the fromECEF / fromCartesian / fromPoint factories, plus the LocationFactory object. ecefToEnuRot and
enuToEcefRot are gone outright, with no internal equivalent. Coordinate.equals(lhs, rhs, eps, epsAlt) is
removed: its tolerant comparison is the public isApproximatelyEqual(other, tolerance, altitudeTolerance), and
equals is exact.
Level moved from core to map — com.getwemap.sdk.core.model.entities.Level is now
com.getwemap.sdk.map.buildings.Level. Its copy() was removed (its constructor was already internal in v0.x),
so a Level can only come from a Building.
Watch out: toLocation() allocates a fresh Location on every call — hold the result rather than calling it
in a loop.
5 · Replace listeners with Flows
iOS calls this step "Replace delegates with
AsyncStream". Same change, different mechanism.
Rule: delete the listener registration and collect the Flow of the same name, scoped to the view's lifecycle.
// before
pointOfInterestManager.addListener(object : PointOfInterestManagerListener {
override fun onPointOfInterestSelected(poi: PointOfInterest) { /* … */ }
override fun onPointOfInterestUnselected(poi: PointOfInterest) { /* … */ }
})
// after
viewLifecycleOwner.lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
pointOfInterestManager.selectionUpdates.collect { update ->
if (update.selected.isNotEmpty()) { /* … */ }
}
}
}
| v0.x listener | v1.0 flows |
|---|---|
LocationSource.listener (LocationSourceListener) | coordinates / attitudes / errors, extensions imported from com.getwemap.sdk.core.location; implementing a source: step 11 |
INavigationManager.addListener / removeListener | navigationEvents (sealed NavigationEvent — Started / Stopped / Arrived / Recalculated) / navigationInfoUpdates / errors |
IPointOfInterestManager.addListener / removeListener | selectionUpdates (PointOfInterestSelectionUpdate) / touchedPois |
BuildingManager.addListener / removeListener | focusedBuildings / activeLevelChanges / errors |
UserLocationManager and ARLocationManager listeners | coordinates / attitudes / errors |
UserLocationManager.coordinateFlow | coordinates |
WemapVPSARCoreLocationSourceListener / …Observer | see step 8 |
| view loading callbacks | see step 7 |
UserLocationManager and ARLocationManager implement the new read-only UserLocationProvider
(coordinates / attitudes / errors / lastCoordinate).
Watch out: in a Fragment, collect from viewLifecycleOwner.lifecycleScope, not lifecycleScope. The
Fragment outlives its view, so a collector on the Fragment's own scope keeps running against a torn-down view and
holds the managers alive with it. repeatOnLifecycle(Lifecycle.State.STARTED) is what makes the collector stop at
ON_STOP and restart at ON_START; without it a plain launch { … collect { } } keeps collecting in the
background. Every screen in the
sample apps uses exactly this shape.
Watch out: the state flows — focusedBuildings, loadPhases, locationStates, states, scanStatuses,
backgroundScanStatuses, cameraTrackingStates and cameraStates(…) — replay their current value to a new
collector; coordinates and attitudes replay the latest fix while the location source runs; the event flows do
not. If you were relying on a listener being called back with the current state at registration time, read the
matching property (getVisiblePois(), getNavigationInfo(), …) instead. The full contract is in
Collecting the SDK's streams.
6 · Update the renamed calls and types
iOS calls this step "Await instead of subscribing". Android's asynchronous calls were already
suspendin v0.x, so nothing changes there — but the same call sites are hit by the renaming themes below.
Rule: the whole public surface was normalized to Kotlin idiom in one release. Most of it is mechanical.
Acronyms are no longer all-caps
POI → Poi, VPS → Vps, GPS → Gps, URL → Url, ID → Id, ECEF → Ecef.
// before
pointOfInterestManager.addPOI(poi)
pointOfInterestManager.hideAllPOIs()
val selected = pointOfInterestManager.getSelectedPOI()
// after
pointOfInterestManager.addPoi(poi)
pointOfInterestManager.hideAllPois()
val selected = pointOfInterestManager.getSelectedPoi()
| v0.x | v1.0 |
|---|---|
getPOIs, addPOI, addPOIs, removePOI, removePOIs | getPois, addPoi, addPois, removePoi, removePois |
showPOI, hidePOI, showPOIs, hidePOIs, showAllPOIs, hideAllPOIs | showPoi, hidePoi, showPois, hidePois, showAllPois, hideAllPois |
getSelectedPOI, getSelectedPOIs, unselectPOI, unselectAllPOIs | getSelectedPoi, getSelectedPois, unselectPoi, unselectAllPois |
selectPOI, centerToPOI | selectPoi, centerToPoi |
sortPOIsByGraphDistance, sortPOIsByDuration | sortPoisByGraphDistance, sortPoisByDuration |
GPSLocationSource | GpsLocationSource |
WemapVPSARCoreLocationSource | VpsARCoreLocationSource |
isVPSAvailableAt, distanceToVPSCoverageFrom | isVpsAvailableAt, distanceToVpsCoverageFrom |
PointOfInterest.imageURL / mediaURL / mediaThumbnailURL | imageUrl / mediaUrl / mediaThumbnailUrl |
AR and other two-letter acronyms stay uppercase (VpsARCoreLocationSource, GeoARView, ARNavigationManager).
Interfaces no longer carry an I prefix
Every interface is now named for the role, with no prefix; where a class already had the bare name, it is the
class that was qualified — *Impl where the interface has one implementation (NavigationManagerImpl), the
distinguishing axis where it has two (DirectionsServiceRemote beside DirectionsServiceLocal). None of those
classes is customer API: most are internal, and the four that are public for cross-module reasons
(NavigationManagerImpl, PointOfInterestManagerImpl, ItineraryProviderImpl, AbstractReferenceCounter)
carry @InternalWemapApi, so they can be renamed again in any 1.x.
// before
val manager: INavigationManager = session.navigationManager
fun observe(provider: IUserLocationProvider) { … }
// after
val manager: NavigationManager = session.navigationManager
fun observe(provider: UserLocationProvider) { … }
The public ones, in full: INavigationManager, IPointOfInterestManager, IUserLocationProvider,
ILoadPhaseProvider, IItineraryProvider, IPointOfInterestService, IMapNavigationManager,
IMapPointOfInterestManager, IPackdataService, IARNavigationManager, IARPointOfInterestManager — drop
the I from each. Nothing else about them changed.
The compact-logging contract is renamed
IStringConvertibleCompact → CompactStringConvertible, and its toStringCompact() → toCompactString(). The
implementors are unchanged: Coordinate, PointOfInterest, PointOfInterestType, Itinerary, TravelMode,
NavigationOptions, ItinerarySearchRules, ItineraryOptions and LineOptions.
NavigationInfo now implements it too, in place of its shortDescription property:
// before
textView.text = info.shortDescription
// after
textView.text = info.toCompactString()
Every public Float scalar is a Double
Coordinate.bearing, Coordinate.heightFromFloor, Coordinate.heightFromGround, Coordinate.bearingTo,
Coordinate.destination, Attitude.accuracy, Heading.accuracy, Itinerary.duration, Leg.duration,
Step.duration, NavigationInfo.remainingTime, NavigationOptions.arrivedDistanceThreshold,
RecalculationOptions.indoorOffRouteDistance (was NavigationOptions.userPositionThreshold),
SimulationOptions.horizontalAccuracy.
Level values stay Float (Levels.Single(0f), Level.id). So do the render-space values of
ARNavigationStyle.DirectionalArrow — horizontalPosition, verticalPosition, distanceFromCamera and scale —
which are screen fractions, scene metres and a model scale passed straight to the AR renderer's Float APIs, as
on iOS. Its real-world distances, targetDistance and targetAltitude, are Double.
Time is kotlin.time.Duration
Time-valued members lost their unit suffix and take a Duration:
| v0.x | v1.0 |
|---|---|
NavigationOptions.navigationRecalculationTimeInterval (raw) | RecalculationOptions.minimumInterval (Duration) |
CoreConstants POI timeout | SessionConfig.pointsOfInterestLoadingTimeout (Duration) |
MapConstants.STALE_TIMEOUT_MILLISECONDS | UserLocationManager.staleStateTimeout (Duration) |
VPSControllerConstants.BACKGROUND_SCAN_TIME_INTERVAL | VpsControllerConfig.backgroundScanTimeInterval (Duration) |
INavigationManager.infoUpdatePeriod + infoUpdateTimeUnit | navigationInfoUpdatesInterval (one Duration) |
SimulationOptions.dispatchPeriod + timeUnit | timeInterval (one Duration); repeatDelay is a Duration |
startNavigation(…, timeout) | timeout is a Duration |
Because Duration is a Kotlin value class, these members are not accessible from Java.
Enum-like types are value classes
Every public enum but the two closed types is a value class, with its constants in PascalCase. A when over one
needs an else branch: a 1.x minor release may add a constant, and the compiler asks for the branch that handles it.
The same holds for every public sealed hierarchy but LoadPhase and Levels.
// before
when (status) {
ScanStatus.STARTED -> showScanning()
ScanStatus.STOPPED -> hideScanning()
}
// after
when (status) {
ScanStatus.Started -> showScanning()
ScanStatus.Stopped -> hideScanning()
else -> hideScanning()
}
| v0.x | v1.0 |
|---|---|
Environment.DEV, PROD | Environment.Dev, Prod |
DistanceFormula.HAVERSINE, HAVERSINE_WITH_LEVELS, HAVERSINE_WITH_ALTITUDE | Haversine, HaversineWithLevels, HaversineWithAltitude |
Incline.UP, DOWN | Incline.Up, Down |
PointOfInterestType.CATEGORY, PICTURE, VIDEO, value | Category, Picture, Video, rawValue |
Step.Direction.STRAIGHT, SLIGHT_RIGHT, U_TURN, … | Straight, SlightRight, UTurn, … |
TravelMode.Preference.DEFAULT, SAFEST, FASTEST, TOURISM | Default, Safest, Fastest, Tourism |
SelectionMode.SINGLE, MULTIPLE | PointOfInterestSelectionMode.Single, Multiple |
CameraChangeReason.PROGRAMMATIC, GESTURE, USER_TRACKING | Programmatic, Gesture, UserTracking |
MapUpdateFrequency.ON_END, CONTINUOUS | OnEnd, Continuous |
UserLocationState.NORMAL, STALE | Normal, Stale |
VpsARCoreLocationSource.ScanStatus.STARTED, STOPPED | Started, Stopped |
VpsARCoreLocationSource.NotPositioningReason.*, DegradedPositioningReason.* | the same names in PascalCase: TooFarFromNavigation, NoRelocalization, None, … |
A value class has no entries, values(), valueOf(), name or ordinal, and is not java.io.Serializable:
to keep one in a Bundle or SavedStateHandle, store its toString() and map it back yourself. The types the
backend sends — Step.Direction, Incline, TravelMode.Preference — expose the raw value as rawValue, and
so does PointOfInterestType, as an Int, where 1.0.0-beta.2 named it value. A travel mode the backend adds
decodes to the new TravelMode.Unknown.
Errors are sealed class hierarchies
Match with is, not by identity.
// before
if (error === NavigationError.noActiveNavigation) { … }
// after
if (error is NavigationError.NoActiveNavigation) { … }
| v0.x | v1.0 |
|---|---|
NavigationError.noActiveNavigation and siblings | NavigationError.NoActiveNavigation, FailedToAddNavigation, FailedToRemoveNavigation, FailedToRetrieveUserLocation, NavigationAlreadyExists and FailedToRecalculateNavigation |
LocationSourceError.trackingLost | LocationSourceError.TrackingLost |
ItineraryServiceError | DirectionsServiceError — NoItinerariesFound(reason), NotSupportedTravelMode, InvalidRules, and the new RequestFailed(code, reason) and GraphUnavailable |
WemapVPSARCoreLocationSourceError | VpsARCoreLocationSourceError — ConnectionTimeout, NotConnectedToInternet, SlowConnectionDetected, FailedToDownloadVpsCoverage, FailedToDownloadLevelsMapping, FailedToCalculateDistanceToVpsCoverage, Unknown |
Retrofit's HttpException, from a request a Wemap backend answers with a failed HTTP status | WemapError.RequestFailed(statusCode, reason), reason being the server's description when its body carries one; a VPS failure still arrives wrapped in VpsARCoreLocationSourceError |
WemapVPSARCoreLocationSourceError.tiltTooHigh | not an error any more: VpsARCoreLocationSource.scanIssues is ScanIssue.DevicePointedTooLow while a scan points too low |
Names aligned with the iOS SDK
A few names changed so that the same call reads the same on both platforms:
| v0.x | v1.0 |
|---|---|
SelectionMode | PointOfInterestSelectionMode |
WemapMapView.locationManager | userLocationManager, named after its UserLocationManager type. GeoARView.locationManager keeps its name |
UserLocationViewStateStyle.bearingColor | headingColor — the cone shows which way the device points, not the direction of travel |
NavigationInstructionsHandler.getContextForLocale(locale, context) + step.getNavigationInstructions(localizedContext) | step.getNavigationInstructions(context, locale) |
Watch out: getNavigationInstructions takes locale second, before includeStreetNames. A call that
passed includeStreetNames by position no longer compiles; name it.
Services and managers: ids bound once, results renamed
| v0.x | v1.0 |
|---|---|
IItineraryProvider.graph(id), ruleNames(graphId) | graph(), ruleNames() — the session binds the ids |
IItineraryProvider.itineraries(…, mapId) | itineraries(…) — no mapId |
itinerariesInfoToMultipleDestinations(origin, pois, mapID) | itinerariesInfoToMultipleDestinations(origin, destinations, travelMode, searchRules) returning List<CoordinateWithItineraryInfo>; itinerariesInfoToMultiplePois(…) is new |
IPointOfInterestService.pointsOfInterestById(mapId, poiId) | pointsOfInterest(id) / pointsOfInterest() |
PointOfInterestWithInfo (a Pair typealias) | PointOfInterestWithItineraryInfo |
ItineraryManager.itineraries | drawnItineraries |
ItineraryManager.getItineraries(…) | computeItineraries(…) |
ItineraryManager.searchRuleNames(graphId) | searchRuleNames() |
ItinerarySearchRules in core.model.services.parameters | core.model.services |
ItineraryInfo in core.model.services.responses | core.model.services |
NavigationInfoHandler() (public constructor) | session.navigationInfoHandler |
PointOfInterestManager.filterByTag(tag), filterByTags(tags, matchMode), TagMatchMode | tagFilter = PointOfInterestTagFilter.tag(tag), .anyOf(tags) / .allOf(tags) |
PointOfInterestManager.removeFilters() | tagFilter = null |
MapNavigationManager.startNavigation gained a trailing cameraMode: Int? on every overload, and its
itineraryOptions parameter is nullable — null keeps the current options, a value replaces them.
Watch out: MapPointOfInterestManager.defaultZoom is no longer public. It was a settable knob in v0.x; pass zoom
to selectPoi / centerToPoi instead. Their zoom is a Double?; without one, the map zooms in to 18 only when
it is further out, where it used to set 18 either way, and a tap on a POI keeps the zoom.
Watch out: the old filters added up — filterByTag("a") then filterByTag("b") kept the POIs carrying
both — while setting tagFilter replaces the filter in place. Combine tags in one PointOfInterestTagFilter,
nesting all and any as needed. It also applies to POIs added after it was set, which the old filters did not.
7 · Views: LoadPhase and non-null managers
Rule: wait for the view with awaitLoaded() (or collect loadPhases), then use its managers directly.
// before
mapView.getMapViewAsync { view, map, style, data ->
view.navigationManager.startNavigation(…)
}
if (mapView.isLoaded) { … }
// after
lifecycleScope.launch {
runCatching { mapView.awaitLoaded() }
.onSuccess { mapView.navigationManager.startNavigation(…) }
.onFailure { error -> /* the map failed to load */ }
}
| v0.x | v1.0 |
|---|---|
WemapMapView.getMapViewAsync(OnMapViewReadyCallback) and the lambda overload | loadPhases: StateFlow<LoadPhase> + suspend fun awaitLoaded() |
GeoARView.getARViewAsync(OnGeoARViewReadyCallback) and the lambda overload | same |
OnMapViewReadyCallback, OnGeoARViewReadyCallback | removed |
WemapMapView.isLoaded / GeoARView.isLoaded | loadPhase.isReady / loadPhase.isLoading / loadPhase.error |
WemapMapView.mapData / GeoARView.mapData | removed — see step 2 |
WemapMapView.map (settable) | read-only |
LoadPhase is Loading / Ready / Failed(error), with isLoading, isReady and error. awaitLoaded() is
an extension on LoadPhaseProvider, so it needs import com.getwemap.sdk.core.awaitLoaded; it returns the
concrete view type, as the old callback did.
Failures are now reported. A map that fails to load settles Failed; in v0.x it logged and told nobody, and
there was nothing to await. A points-of-interest download failure or timeout settles Failed as well, and in that
case every manager stays built and usable. MapError.FailedToLoadMap is the error MapLibre failures carry.
The view drives its own lifecycle. WemapMapView and GeoARView observe a Lifecycle — auto-discovered from
the view tree, or assigned to mapView.lifecycle, or handed to the constructor as sharedLifecycle. Delete your
onCreate / onStart / onResume / onPause / onStop / onSaveInstanceState / onLowMemory / onDestroy
forwarding.
Watch out: those inherited MapLibre methods still compile — WemapMapView extends MapLibre's MapView, so
they cannot be hidden. While a lifecycle is set they are logged and ignored. Leaving the forwarding in place is
silent dead code, not an error.
Watch out: isLoaded was false after a failure, but it was also false while loading, so its closest
equivalent is loadPhase.isReady for the success check and !loadPhase.isLoading for "has settled".
Watch out: one view of each kind per session. A session holds one map-renderer slot and one AR-renderer slot,
so a second WemapMapView on the same session evicts the first, which keeps drawing while no manager drives it.
The Compose map binds a camera position, not the camera. MapCameraPositionState.position is a
MapCameraPosition — Automatic, Camera(state), Fit(bounds, padding), FollowUser(bearing) or Idle — and
the map carries out each one you set. It writes into the state only when the intent changes: Idle when something
else moves the camera (a gesture, an interrupted animation, a level change while following, code or a widget moving
it), FollowUser when the SDK starts following the user, as startNavigation does. Setting a position is
immediate; animate(position) animates it. Read the camera itself with onCameraChange:
1.0.0-beta.2 | v1.0 |
|---|---|
MapCameraPositionState.position: MapCameraState? | position: MapCameraPosition — MapCameraPosition.Camera(state) for a camera |
MapCameraPositionState(position: MapCameraState?) | MapCameraPositionState(position: MapCameraPosition), Automatic by default |
reading cameraPositionState.position for the camera | WemapMap(onCameraChange = { camera -> … }) |
WemapMap(cameraUpdateFrequency = …) | WemapMap(cameraChangeFrequency = …), for onCameraChange |
WemapMap(initialCamera = camera) | WemapMap(initialCameraPosition = MapCameraPosition.Camera(camera)) |
following the user through userLocationManager.cameraMode | position = MapCameraPosition.FollowUser(…) — the mode still works |
val positionState = rememberMapCameraPositionState()
val scope = rememberCoroutineScope()
WemapMap(session = session, cameraPositionState = positionState, onCameraChange = { camera -> save(camera) })
Button(onClick = { scope.launch { positionState.animate(MapCameraPosition.FollowUser()) } }) { Text("Locate me") }
A position that is saved and restored, through rememberMapCameraPositionState, is no longer the camera the user
left: after a pan it is Idle, and the map reopens on its data. Keep the camera onCameraChange delivers — it is
Parcelable, so rememberSaveable keeps it as it is — and reopen with
initialCameraPosition = MapCameraPosition.Camera(saved).
Watch out: do not read a manager off mapView / geoARView in a Fragment's onDestroyView. ON_DESTROY
reaches the view lifecycle before that callback, so the view is already torn down and every manager getter
throws. Nothing view-owned needs undoing there.
8 · If you use positioning (VPS or GPS)
Rule: construct the source with the session and a VpsConfig, and collect its flows instead of registering a
listener.
// before
VPSControllerConstants.BACKGROUND_SCAN_DISTANCE_THRESHOLD = 20.0
StateManagerConstants.DEGRADED_DISTANCE_THRESHOLD = 60.0
val source = WemapVPSARCoreLocationSource(context, mapData)
source.addListener(vpsListener)
// after
val source = VpsARCoreLocationSource(
context, session,
VpsConfig(
controller = VpsControllerConfig(backgroundScanDistanceThreshold = 20.0),
stateManager = VpsStateManagerConfig(degradedDistanceThreshold = 60.0)
)
)
viewLifecycleOwner.lifecycleScope.launch {
repeatOnLifecycle(Lifecycle.State.STARTED) {
launch { source.states.collect { state -> /* … */ } }
launch { source.scanStatuses.collect { status -> /* … */ } }
}
}
VpsConfig composes VpsLocationSourceConfig, VpsControllerConfig, VpsStateManagerConfig,
VpsStaticPositionDetectorConfig and VpsConveyingDetectorConfig — under the parameter names locationSource,
controller, stateManager, staticPositionDetector and conveyingDetector — replacing VPSControllerConstants
and StateManagerConstants.
WemapVPSARCoreLocationSourceListener and WemapVPSARCoreLocationSourceObserver are removed in favour of
states, scanStatuses, backgroundScanStatuses, cameraTrackingStates, userLocalizationUpdates and errors.
listenerExecutor, observers and vpsListeners are gone with them.
The State enum became a sealed class, folding the reasons in:
// before
if (source.state == State.DEGRADED_POSITIONING &&
source.degradedPositioningReason == DegradedPositioningReason.…) { … }
// after
val state = source.state
if (state is State.DegradedPositioning && state.reason == …) { … }
| v0.x | v1.0 |
|---|---|
State.NOT_POSITIONING + notPositioningReason | State.NotPositioning(reason) |
State.DEGRADED_POSITIONING + degradedPositioningReason | State.DegradedPositioning(reason) |
State.ACCURATE_POSITIONING | State.AccuratePositioning |
| comparing to enum constants | is State.X, or the state.isAccurate / state.isLost predicates |
trackingFailureReason | the cameraTrackingStates flow of CameraTrackingState, merging ARCore's TrackingState and TrackingFailureReason |
GPSLocationSource(context, mapData) | GpsLocationSource(context, session) |
CameraTrackingState.copy() and UserLocalizationUpdate.copy() were removed — both types are produced by the
SDK only, and their constructors were already internal. Destructuring and the property getters are unaffected.
Watch out: a source your app starts stays your app's to stop. The SDK reference-counts its own start and
stop requests, so a view disabling its location component no longer stops a source it did not start. Conversely,
do not call start() / stop() on a session-shared source from inside a view callback.
9 · If you use offline maps
Rule: get a packdata service from the session, then open the downloaded package as a session.
// before
val manager: IPackdataManager = …
val packdata = manager.downloadPackdata(mapID = 19158)
val mapData = manager.loadMapData(File(packdata.filePath))
mapView.mapData = mapData
// after
val service = MapSession.createPackdataService(context, mapId = 19158, environment = Environment.Prod)
val packdata = service.downloadPackdata()
val session = MapSession.create(context, offlineZip = File(packdata.filePath), config = SessionConfig())
mapView.configure(session)
| v0.x | v1.0 |
|---|---|
IPackdataManager | PackdataService, from MapSession.createPackdataService(context, mapId, environment) |
downloadPackdata(mapID), isNewPackdataAvailable(mapID, eTag) | downloadPackdata(), isNewPackdataAvailable(eTag) — the map id is bound at construction |
loadMapData(zip) | MapSession.create(context, offlineZip, config) |
Packdata still carries filePath, eTag, version and fileName — filePath is a String, so wrap it in a
File for MapSession.create. The context names your app in the download's User-Agent, as a session's
requests do.
10 · If you use GeoAR
Rule: same as the map — session in, LoadPhase out, and the navigation look set on the navigation manager.
// before
geoARView.mapData = mapData
geoARView.getARViewAsync { view -> view.navigationManager.startNavigation(…) }
// after
geoARView.configure(session)
lifecycleScope.launch {
runCatching { geoARView.awaitLoaded() }
.onSuccess {
geoARView.navigationManager.style = ARNavigationStyle(stepInstructionAltitude = 2.0)
geoARView.navigationManager.startNavigation(…)
}
.onFailure { error -> /* … */ }
}
GeoARView.configure takes a CoreSession — a MapSession is one, so a screen with both views passes the same
instance to each.
ARConstants and ARConstants.DirectionalArrow became ARNavigationStyle and ARNavigationStyle.DirectionalArrow
(step 3); ARConstants itself is internal now. GeoARView.mapData, isLoaded and getARViewAsync are gone
(step 7).
GeoARView is a FrameLayout that holds a SceneView rather than extending one, so everything it used to
inherit — engine, scene, view, renderer, materialLoader, modelLoader, childNodes, addChildNode,
skybox, collisionSystem, cameraNode, startRecording and the rest of SceneView's surface — is no longer
reachable through it, and GeoNode / GeoCameraNode are gone with it. The AR scene is driven through
pointOfInterestManager, navigationManager and locationManager.
Custom POIs are added through the AR view only. addPoi, addPois, removePoi and removePois left
PointOfInterestManager for ARPointOfInterestManager, so mapView.pointOfInterestManager.addPoi(poi) no longer
compiles. It never drew anything on the map while returning true; call it on geoARView.pointOfInterestManager
instead. The map will gain them back once it draws custom POIs.
ARPointOfInterestManager.setScaleDistanceRatioForFixedSize is removed. The ratio is fixed, as on iOS;
isFixedSize is unchanged.
Watch out: GeoARView.destroy() is idempotent in v1 but the Compose wrapper also calls it — if you drive the
view yourself, destroy() is still yours to call exactly once at teardown.
Watch out: GeoARView is final. If you subclassed it, move the behaviour to the caller or to a wrapping
FrameLayout.
11 · If you implement a custom LocationSource
Rule: keep implementing LocationSource, through on hooks the SDK calls: onStart(listener), onStop()
and onRelease(). Report through the LocationSourceListener the SDK hands to onStart, instead of a listener
property it sets. The app keeps calling start(), stop() and deinit(), which the SDK now owns.
// before
class MyLocationSource : LocationSource {
override var listener: LocationSourceListener? = null
override val supportsHeading = true
override val isStarted get() = started
fun report(c: Coordinate) { listener?.onCoordinateChanged(c) }
override fun start() { … }
override fun stop() { … }
override fun deinit() { … }
}
// after
class MyLocationSource(override val coreSession: CoreSession) : LocationSource {
private var listener: LocationSourceListener? = null
override val supportsAttitude = true
fun report(c: Coordinate) { listener?.onCoordinateChanged(c) } // unchanged
override fun onStart(listener: LocationSourceListener) { this.listener = listener; … }
override fun onStop() { listener = null; … }
override fun onRelease() { … }
}
mapView.userLocationManager.locationSource = MyLocationSource(session) // unchanged
| v0.x | v1.0 |
|---|---|
LocationSource.listener, set by the SDK | the listener passed to onStart |
start() | implement onStart(listener); call the start() extension |
stop() | implement onStop(); call the stop() extension |
deinit() | implement onRelease(); call the deinit() extension |
isStarted | kept by the SDK; nothing to implement |
| — | coreSession, the session the source reports to |
LocationSource.supportsHeading | supportsAttitude, false by default |
SimulationOptions.simulateHeading | simulatesAttitude |
- A coordinate you report is processed like the SDK's own sources': projected on the navigation's itinerary, or on the map's graph, when projection is enabled.
coordinates,attitudesanderrorsare the session's streams on every source, yours included, and are extensions onLocationSource: import them fromcom.getwemap.sdk.core.location, asstart(),stop()anddeinit().- The SDK starts and stops the source as its views need it, and hands every start a new listener. The
previous one stops forwarding, as does the listener of a source that was stopped, by the SDK or by your
stop(), or replaced, so a provider callback that arrives late is dropped. The listener can be called from any thread. - Report attitudes only when
supportsAttitudeistrue: otherwise the SDK reports the device sensors' own, and the two would interleave.
The assignment point is unchanged: mapView.userLocationManager.locationSource for the map and
geoARView.locationManager.locationSource for AR.
Watch out: drive a source with start(), stop() and deinit(), never by calling its on hooks yourself.
deinit() stops the source, removes it from the map and AR views of its session, then calls its onRelease(),
the same way for the SDK's sources and yours.
The SDK's manager, provider and service interfaces are not for implementing. They may gain members in a minor
release, which would break an implementation outside the SDK, so implementing one needs
@OptIn(InternalWemapApi::class) and comes with no compatibility guarantee. Calling them needs no opt-in.
| Interface | Module |
|---|---|
UserLocationProvider, LoadPhaseProvider, PointOfInterestManager, NavigationManager, PointOfInterestService, ItineraryProvider | core |
MapPointOfInterestManager, MapNavigationManager, PackdataService | map |
ARPointOfInterestManager, ARNavigationManager | geo-ar |
12 · Symbols that are no longer public API
Rule: these were public in v0.x and are not part of the supported surface any more. There is no
customer-facing replacement for any of them — if your app imports one, plan the migration off it.
They are gated by @InternalWemapApi, a @RequiresOptIn(level = ERROR) marker, and/or moved into an
*.internal.* package that the generated documentation suppresses. Reaching one now fails the build with
"This declaration is experimental and its usage should be marked with @InternalWemapApi".
MapDataandMapDataSerializerCoreConstantsLocationFactoryCoordinate.ecef/cartesian/ecefToEusRot/eusToEcefRot, and thefromECEF/fromCartesian/fromPointfactories (step 4)IItineraryServiceand the Directions wire types —ItineraryParameters,ItinerariesParametersMultiDestinations,IItineraryParametersBase,ItinerariesResponse,ItineraryInfoResponse,ItinerariesInfoResponse,Status,StatusCode,RuleNames—internalrather than gated, exceptItinerariesResponseandStatus;IItineraryParametersBaseis removedMapConstants.VISUAL_DEBUGGER_CONFIG,CoreConstants.INCLUDE_PROJECTION_DISTANCE_INTO_ACCURACYandARConstants.VISUAL_DEBUGGER_ENABLED(step 3)- the
GeoARViewcamera-provider members —bindCameraProjection,bindCameraCapture,startCameraCapture,unbindCamera,onFrame,onCameraProjectionChanged,viewParameters(step 10) GeoARView.addGeoNodeandgeoCamera, and theGeoNode/GeoCameraNodetypes themselves —internal, not gated, becauseGeoARViewno longer extendsSceneView(step 10)GeoComponent- everything else that was still
publicin an*.internal.*package: the graph types (Edge,Vertex,Graphand theirProperties),LocationSourceManager/LocationSources,NavigationManager,PointOfInterestManager,SystemAttitudeSource/AttitudeSourceListener,CameraCaptureProvider/CameraCaptureDelegate/ViewParameters,FileService,PointOfInterestRenderer,ReferenceCounter/ReferenceCounter,ItineraryProvider,ConveyingBuffer,Inclination,Status,LocalServiceBase, every*Serializer,GeoUtils/MathUtils/GeoConstants/PointOfInterestIdGenerator,Polygon.contains/distanceToandMultiPolygon.contains/distanceTo, and — inmap—StyleData,MapAttitudeEngineandStringGenerator - the rest of the
Doublemath port, which stays incom.getwemap.sdk.core.internal.math—Double2,Double4,Bool2/3/4,Mat2/3/4,VectorComponent,MatrixColumn,QuaternionComponent,RotationsOrder, and the top-level functions over every math type,QuaternionandDouble3included (normalize,inverse,cross,slerp…). TheQuaternionandDouble3types themselves are not in this list: see Moved, not gated below. - the helpers on MapLibre's geojson types —
Point.toCoordinate()/toLocation()/distanceTo/destination/bearing,BoundingBox.center,Location.toPoint()/copy(),BoundingBox.toLatLngBounds()inmap— andCoordinate.point. UseCoordinate's ownlatitude/longitude,distanceTo,destinationandbearingTo TrackingState.isTrackinginwemap-vps-arcore; compare withTrackingState.TRACKINGHeading.fromDeviceAttitude; read a heading withAttitude.toHeading()NavigationInstructionsHandler; pass alocaletoStep.getNavigationInstructions(step 6)- the string-resource lookups
Step.Direction.horizontalDirectionLocalizableId/turnSharpnessLocalizableIdandStep.Kind.localizableKey; read the text fromgetNavigationInstructions Itinerary.legsSegmentsPointOfInterestSelectionMode.next()ARPointOfInterestManager.looksAtCamera(0.xlookAtCamera) andMapPointOfInterestManager.defaultZoomIncline.localizableIdandIncline.toStepDirection()
Moved, not gated: Quaternion and Double3 are now com.getwemap.sdk.core.math.Quaternion /
…core.math.Double3, and need no opt-in. Attitude.quaternion is the reason: gating the type left the property
readable but unusable. Update the import, and you can read q.w/x/y/z and use the types' own operators
(q * other, q * vector). The free functions over them (normalize, slerp, cross…) are gated, as on
iOS. The members that route through a still-gated type — the Double2 swizzles
(xy/rg/st), xyzw, the VectorComponent/QuaternionComponent accessors, equals(…, delta) and
toMatrix() — keep the marker. Attitude.headingDegrees / headingRadians / toHeading() are unchanged and
still need nothing.
Moved, not gated: PaginationContainer is now com.getwemap.sdk.core.model.entities.PaginationContainer.
It is what PointOfInterestService.pointsOfInterest() returns, so it is genuinely public API and only its
package was wrong — update the import; nothing else about it changed. (iOS has always had it in
Core/Sources/Model/Entities.)
No longer data classes: Itinerary and NavigationInfo. Destructuring one (val (a, b) = info) or calling
its copy or componentN no longer compiles; read its properties.
Removed outright: PointOfInterest.customerID, NavigationInstructions.direction (read Step.direction),
Coordinate.ecefToEnuRot / enuToEcefRot.
Read-only, built by the SDK: Tag, UseTags, Category, ItineraryInfo and NavigationInstructions stay
public, but their constructors and copy() are not — the SDK produces them, from the map's configuration, a route
or a step, and you read them.
Created only by the SDK now: you still receive these, but can no longer build or copy() them yourself —
Itinerary (except from segments, below), Leg, Destination, CoordinateWithItineraryInfo,
PointOfInterestWithItineraryInfo, Packdata, Segment, LegSegment (build
segments with LegSegment.fromCoordinates(…)), Heading (read one from Attitude.toHeading()) and
Step.Direction.fromAngle. Destructuring and the property getters are unaffected. Segment can no longer be
subclassed either: a class of your own extending it does not compile. To give
VpsARCoreLocationSource an itinerary from your own map, create it with
Itinerary.fromSegments(origin, destination, segments, transitMode).
No longer serializable: the models are not @Serializable any more, so the SDK's wire format is not part of
its API. Attitude, Category, Destination, Incline, Itinerary, ItineraryInfo, ItinerarySearchRules,
Leg, Level, Packdata, PaginationContainer, PointOfInterest and its ExtraMedia, Step with its Kind
and Direction, Tag, TravelMode.Preference and UseTags have no serializer(), and
GeoJsonItinerarySerializer, ItinerarySerializer, QuaternionSerializer and Step.Kind.Serializer are gone.
To keep one between launches, store the values you need in a type of your own — for a Packdata, its eTag,
version and fileName, since the file is what MapSession.create(context, file, config) reads. To give a
location source an itinerary from your own map, build it with Itinerary.fromSegments(…) rather than decoding
GeoJSON.
PointOfInterest.externalData is a JSON String? instead of a kotlinx JsonElement: the free-form data your
map attaches to a point of interest, which you decode with the JSON library of your choice
(Json.parseToJsonElement(poi.externalData) keeps the old type). One you set yourself must be valid JSON. The SDK
no longer brings kotlinx-serialization onto your compile classpath, so declare it yourself if you use it.
Now public: PointOfInterest.ExtraMedia(type, url), so a point of interest you create in code can carry extra
medias.
Removed from the public API: PointSpan, and the Point extensions that took one — bounds(span) and the
+ / - operators. Nothing public returned one.
Changes that compile but behave differently
Nothing in this list produces a compiler error. Check each one against your app.
| Change | What to do |
|---|---|
| The views drive their own lifecycle | your mapView.onStart() / onResume() / … forwarding is logged and ignored — delete it (step 7) |
A map that fails to load settles LoadPhase.Failed | awaitLoaded() throws instead of never returning — handle it |
isLoaded was false while loading and after a failure | loadPhase.isReady for success, !loadPhase.isLoading for "has settled" |
A coordinate's time is encoded in Unix seconds | it was milliseconds on Android; if you persisted or forwarded encoded coordinates, re-check the unit |
MapCameraState equality is exact, and ignores lastChangeReason | a camera you built and the one the map reports after applying it differ by float noise, so compare camera positions instead; equal states hash the same |
| The user-location indicator greys the moment tracking is lost | it no longer stays blue for staleStateTimeout |
startNavigation sets the camera mode itself | it follows with compass when navigation starts |
A second WemapMapView or GeoARView on one session evicts the first | one view of each kind per session; a second map needs its own |
SimulationOptions.repeatDelay defaults to 2 seconds | a repeating simulation restarts sooner than 0.x's 5 seconds; pass repeatDelay = 5.seconds to keep the old pause |
LocationSource.deinit() unregisters the source from its session | your manual locationSource = null at teardown is now redundant |
| A source your app started is no longer stopped by a view | the SDK reference-counts only its own requests — stop what you started |
NavigationInfo, Itinerary, Leg and TravelMode print a summary | toString() no longer dumps the itinerary geometry — read leg, legs, coordinates or steps directly, or toCompactString() for a log line |
Two Itinerary instances are equal only when they are the same instance | an itinerary computed twice over the same route gives two unequal ones — keep the instance you added to remove it from the map or to compare it with the navigated one; two NavigationInfo snapshots no longer compare by value either |
Coordinate's equals is exact | two coordinates that differ by float noise, such as a computed projection and a stored point, are no longer equal; use isApproximatelyEqual(other, tolerance, altitudeTolerance) for those. A HashSet or HashMap of coordinates is now reliable |
| The state flows replay, the event flows do not | a listener that used to be called back at registration has no equivalent on an event flow — read the property |
A Flow completes when its owner ends | a collect on a destroyed view's or a deinitialized source's stream returns instead of suspending forever; a StateFlow never completes |
| A step direction, incline, travel mode, preference or POI type the backend adds no longer fails the response | it reaches your when's else branch — make sure that branch does something sensible |
| Calling the SDK off the main thread throws | creating a session, reading a view's managers, starting or stopping a location source or a navigation, selecting or unselecting a POI and setting the selection mode fail at once with an IllegalStateException; make those calls on the main thread |
A backend's failed HTTP status throws WemapError.RequestFailed(statusCode, reason) | a catch matching Retrofit's HttpException no longer catches it; match WemapError.RequestFailed |
ItineraryProvider.itineraries throws when no route exists | DirectionsServiceError.NoItinerariesFound replaces the empty list; handle it where you tested isEmpty() |
| Route computations and requests time out | the itinerary request of startNavigation has its timeout, 30 seconds by default; computeItineraries, sortPoisByGraphDistance, sortPoisByDuration and ItineraryProvider throw a java.net.SocketTimeoutException after 30 seconds, or, on an offline map, once a longer computation ends; every other request fails after 20 seconds without data, up from 10 |
| The location is projected onto the route only within a maximum distance | 15 meters indoors and 50 outdoors by default; beyond it the user indicator leaves the route. Raise ProjectionOptions.indoorMaxDistance / outdoorMaxDistance to keep the previous behaviour |
selectPoi and centerToPoi without a zoom never zoom out | they zoom in to 18 only when the map is further out; tapping a POI recenters without changing the zoom. Pass a zoom to force one |
| Out-of-range config values are moved into their documented range | a timeout, threshold, distance or VPS setting outside the range its documentation states is clamped and logged instead of used as given, or crashing, and a RecalculationOptions.minimumInterval below 5 seconds is raised to 5 seconds; check the log if a value seems ignored |
"I'm getting this error"
| Error | Go to |
|---|---|
Duplicate class org.maplibre.android… with a MapLibre plugin such as android-plugin-annotation-v9 | Step 1 |
Unresolved reference: WemapCoreSDK / WemapMapSDK | Step 2 |
Unresolved reference: ServiceFactory / DependencyManager | Step 2 |
Unresolved reference: mapData on a view | Step 2 |
Cannot access 'MapData': it is internal / unresolved after an import cleanup | Step 2, Step 12 |
Suspend function 'create' should be called only from a coroutine | Step 2 |
Val cannot be reassigned on a config property | Step 3 |
Unresolved reference: CoreConstants / MapConstants / ARConstants | Step 3 |
Unresolved reference: Prod on Environment | Step 3 |
Type mismatch: inferred type is List<Float> but Levels was expected | Step 4 |
Unresolved reference: accuracy on Coordinate | Step 4 |
Unresolved reference: location on Coordinate | Step 4 |
Unresolved reference: Level after importing from core.model.entities | Step 4 |
Unresolved reference: addListener on a manager | Step 5 |
Unresolved reference: PointOfInterestManagerListener | Step 5 |
Unresolved reference: addPOI / getPOIs / selectPOI (any all-caps acronym) | Step 6 |
Type mismatch: inferred type is Float but Double was expected | Step 6 |
Type mismatch: inferred type is Long but Duration was expected | Step 6 |
Incompatible types: NavigationError and NavigationError.Companion | Step 6 |
Unresolved reference: ItineraryServiceError | Step 6 |
No parameter with name 'itineraryRecalculationEnabled' found and the like | Step 3 |
Unresolved reference: filterByTag / filterByTags / removeFilters | Step 6 |
Unresolved reference: TagMatchMode | Step 6 |
Unresolved reference: getMapViewAsync / getARViewAsync | Step 7 |
Unresolved reference: isLoaded | Step 7 |
Unresolved reference: awaitLoaded | Step 7 — add import com.getwemap.sdk.core.awaitLoaded |
Unresolved reference: WemapVPSARCoreLocationSource | Step 8 |
Unresolved reference: NOT_POSITIONING / notPositioningReason | Step 8 |
Unresolved reference: IPackdataManager | Step 9 |
This class cannot be extended on GeoARView | Step 10 |
This class or interface requires opt-in to be implemented | Step 11 |
Destructuring declaration initializer of type NavigationInfo must have a 'component1()' function (or Itinerary) | Step 12 |
'listener' overrides nothing in a custom LocationSource | Step 11 |
'supportsHeading' overrides nothing | Step 11 |
'start' overrides nothing (or 'stop', 'deinit', 'isStarted'), or does not implement abstract member 'coreSession' (or 'onStart', 'onStop') in a custom LocationSource | Step 11 |
Unresolved reference 'coordinates' (or attitudes, errors, start, stop, deinit) on a location source | Step 11 — import the extension |
This declaration is experimental … @InternalWemapApi | Step 12 |
Cannot access '<init>': it is internal on Tag, UseTags, ItineraryInfo and the like | Step 12 |
Cannot access '<init>': it is internal on Itinerary, Destination, LegSegment and the like | Step 12 |
Unresolved reference: setScaleDistanceRatioForFixedSize | Step 10 |
Unresolved reference: serializer on an SDK model, or GeoJsonItinerarySerializer | Step 12 |
Reference: renamed, moved and removed API
Sorted by old name.
| v0.x symbol | v1.0 replacement | Step |
|---|---|---|
ARConstants | ARNavigationStyle | 3 |
Attitude.accuracy: Float? | Double? | 6 |
Coordinate.accuracy | Coordinate.horizontalAccuracy (Double) | 4 |
Coordinate.ecefToEnuRot / enuToEcefRot | removed | 12 |
Coordinate.levels: List<Float> | Coordinate.levels: Levels | 4 |
Coordinate.location | Coordinate.toLocation() | 4 |
Coordinate.time | Coordinate.timestamp | 4 |
CoreConstants | SessionConfig | 3 |
DependencyManager | CoreSession / MapSession | 2 |
Environment.Prod() / IEnvironment | Environment.Prod (enum) | 3 |
GPSLocationSource | GpsLocationSource | 6, 8 |
Heading.fromDeviceAttitude | Attitude.toHeading() | 12 |
GeoJsonItinerarySerializer | removed — Itinerary.fromSegments(…) | 12 |
HttpException (Retrofit), from a failed request | WemapError.RequestFailed | 6 |
IARNavigationManager | ARNavigationManager | 6 |
IARPointOfInterestManager | ARPointOfInterestManager | 6 |
IItineraryProvider | ItineraryProvider | 6 |
IItineraryProvider.graph(id) | graph() | 6 |
ILoadPhaseProvider | LoadPhaseProvider | 6 |
Incline.localizableId / toStepDirection() | removed | 12 |
IMapNavigationManager | MapNavigationManager | 6 |
IMapPointOfInterestManager | MapPointOfInterestManager | 6 |
IMapPointOfInterestManager.defaultZoom (settable) | removed — pass zoom to selectPoi / centerToPoi | 6, 12 |
INavigationManager | NavigationManager | 6 |
IPackdataManager | PackdataService | 9 |
IPointOfInterestManager | PointOfInterestManager | 6 |
IPointOfInterestManager.getPOIs() | getPois() | 6 |
IPointOfInterestService | PointOfInterestService | 6 |
IPointOfInterestService.pointsOfInterestById(mapId, poiId) | pointsOfInterest(id) | 6 |
IStringConvertibleCompact | CompactStringConvertible | 6 |
ItineraryManager.getItineraries(…) | computeItineraries(…) | 6 |
ItineraryManager.itineraries | drawnItineraries | 6 |
ItineraryServiceError | DirectionsServiceError | 6 |
IUserLocationProvider | UserLocationProvider | 6 |
Level (core.model.entities) | Level (map.buildings), no copy() | 4 |
LocationSource.listener | coordinates / attitudes / errors | 5, 11 |
LocationSource.supportsHeading | supportsAttitude | 11 |
LocationSourceError.trackingLost | LocationSourceError.TrackingLost | 6 |
MapConstants.STALE_TIMEOUT_MILLISECONDS | UserLocationManager.staleStateTimeout (Duration) | 3, 6 |
MapData | session.mapId / mapCenter / isVpsEnabled | 2, 12 |
NavigationError.noActiveNavigation | NavigationError.NoActiveNavigation | 6 |
NavigationInfo.shortDescription | NavigationInfo.toCompactString() | 6 |
NavigationInfoHandler() | session.navigationInfoHandler | 6 |
NavigationInstructions.direction | Step.direction | 12 |
NavigationInstructionsHandler.getContextForLocale | Step.getNavigationInstructions(context, locale) | 6, 12 |
OnMapViewReadyCallback / OnGeoARViewReadyCallback | loadPhases / awaitLoaded() | 7 |
PointOfInterest.customerID | removed | 12 |
PointOfInterest.imageURL | imageUrl | 6 |
PointOfInterestManager.addPoi / addPois / removePoi / removePois | the same, on ARPointOfInterestManager only | 10 |
PointOfInterestManager.filterByTag(…) / filterByTags(…) | PointOfInterestManager.tagFilter | 6 |
PointOfInterestManager.removeFilters() | tagFilter = null | 6 |
PointOfInterestManagerListener | selectionUpdates / touchedPois | 5 |
PointOfInterestWithInfo | PointOfInterestWithItineraryInfo | 6 |
SelectionMode | PointOfInterestSelectionMode | 6 |
ServiceFactory | CoreSession / MapSession | 2 |
SimulationOptions.simulateHeading | simulatesAttitude | 11 |
State (enum) | State (sealed) | 8 |
StateManagerConstants | VpsStateManagerConfig | 3, 8 |
TagMatchMode | PointOfInterestTagFilter | 6 |
toStringCompact() | toCompactString() | 6 |
UserLocationViewStateStyle.bearingColor | headingColor | 6 |
version_name (string resource) | WemapSDKs.version | 1 |
VPSControllerConstants | VpsControllerConfig | 3, 8 |
WemapCoreSDK.instance | CoreSession | 2 |
WemapMapSDK.mapData(id, token) | MapSession.create(context, mapId, token, config) | 2 |
WemapMapView.getMapViewAsync | awaitLoaded() / loadPhases | 7 |
WemapMapView.isLoaded | loadPhase | 7 |
WemapMapView.locationManager | userLocationManager | 6 |
WemapVPSARCoreLocationSource | VpsARCoreLocationSource | 6, 8 |
WemapVPSARCoreLocationSourceError | VpsARCoreLocationSourceError | 6 |
WemapVPSARCoreLocationSourceListener / …Observer | states / scanStatuses / errors / … | 5, 8 |
Getting help
Sample apps: wemap-sdk-sample-apps-android. Anything unclear or missing here — contact the Wemap team.