Revisit the EnhancedLocationUpdate model #46
Labels
breaking
Backwards incompatible changes made to the public API.
code-quality
Affects the developer experience when working in our codebase.
enhancement
New feature or improved functionality.
Background
Recently we've discovered that the Mapbox SDK v2 no longer generates a new location update each second and we are planning to use
intermediateLocations
(called alsokeyPoints
) to help us create accurate rider paths when the GPS location updates are not frequent enough. In that case, we will have 2 lists that contain locations that are in between the previous and the current location:intermediateLocations
andskippedLocations
. Both are important for creating an accurate route and currently are independent of each other. This makes it harder to use them as the users would have to get them in the correct order to be able to draw them on the map.Suggestions
Given the above and the fact that those two list seem to serve the same purpose for the users, I'd suggest that we merge them into one list, that will contain all locations between the previous and current locations in the right order. I would drop the
intermediateLocations
and leave theskippedLocations
as it is already used in theLocationAnimator
to create smooth animations (so less changes would be required in other parts of the AAT).Additionally, the
EnhancedLocationUpdate
has a field calledtype
which can either bePREDICTED
orACTUAL
. This determines whether an enhanced location update is predicted or based on an actual location. Now, the Mapbox SDK does not generate new location updates constantly but rather it creates a new enhanced location update when it receives a raw location update from the GPS. Therefore, as there probably won't be any predicted location updates, thetype
field seems unnecessary and perhaps could be removed as well.Before
This is the current structure of
EnhancedLocationUpdate
(from the AAT Android):After
┆Issue is synchronized with this Jira Task by Unito
The text was updated successfully, but these errors were encountered: