User's Location as Point of Origin
iOS v4
if let userPosition = mapControl?.positionProvider?.latestPosition?.coordinate {
let userPositionToMPPoint = MPPoint(latitude: userPosition.latitude, longitude: userPosition.longitude)
let destination = MPPoint(latitude: 57.05803, longitude: 9.950509, z: 0.00)
let directionsQuery = MPDirectionsQuery(originPoint: userPositionToMPPoint, destinationPoint: destination)
let directionsService = MPMapsIndoors.shared.directionsService
let route = try? await directionsService.routingWith(query: directionsQuery)
let rendere = mapControl?.newDirectionsRenderer()
rendere?.route = route
}Last updated
Was this helpful?