Closed 1ec5 closed 2 years ago
As a workaround, PassiveLocationDataSource does emit the latest snapped location as locationKey
(also provided in PassiveLocationDataSourceDelegate methods), so you could keep track of the snapped locations as they come in. The downside is that, whenever the map matcher changes its mind about which road the user is traveling along, that cache of historical locations won’t be completely consistent with the current match.
@1ec5 passiveLocationDataSourceDidUpdate now contains matching result that contains keypoints.
passiveLocationDataSourceDidUpdate now contains matching result that contains keypoints.
For reference, this notification has been renamed to Notification.Name.passiveLocationManagerDidUpdate
. As of #3669, mapMatchingResultKey
is set to a MapMatchingResult
; that class has a keyPoints
property.
When posting a
passiveLocationDataSourceDidUpdate
notification, PassiveLocationDataSource should include key points in the user info dictionary. ThekeyPointsKey
should be set to a LineString or perhaps an array ofCLLocation
s representing the locations that lead up to the current location, derived from theNavigationStatus.key_points
property.https://github.com/mapbox/mapbox-navigation-ios/blob/fd6d1d1c7067a78d4256b360d260b06a570835ba/MapboxCoreNavigation/PassiveLocationDataSource.swift#L151-L156
Here’s the Android implementation for comparison:
https://github.com/mapbox/mapbox-navigation-android/blob/b9a36dd2b0596d55d42f927609508336e58e0937/libnavigation-core/src/main/java/com/mapbox/navigation/core/trip/session/MapboxTripSession.kt#L502 https://github.com/mapbox/mapbox-navigation-android/blob/fa5a2b059289ba188285ac411d7bf7f250d3780b/libnavigation-core/src/main/java/com/mapbox/navigation/core/trip/session/LocationObserver.kt#L17-L24
/cc @mapbox/navigation-ios @mattlozada