[ios] Fix track selection point updates on every new selection

On the every new tap on the `Track` or during the `Elevation chart` dragging, the track `Active point` will be updated now. It allows to keep the current selected track point coordinates up to date and fix the bug when the `route to/route from` buttons use only the initial coordinates.
Key changes:
1. the `Active point` and `My position` points are moved from the `Elevation profile` to the `PlacePageTrackData` because this properties are related to the whole track. Not only chart. The chart is only one of the consumers of this data updates.
2. The subscription to the active point updates is moved from the `Elevation profile` to the `PlacePagePresenter`. The reason - see 1.
2. The callback `onActivePointChanged` is added to notify that the active point is updated
3. When the callback is triggered the `PlacePageTrackData` fetches the new coordinates from the core and saves it. This coordinates are used by the `route to/from` buttons.

Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
Kiryl Kaveryn
2025-06-17 21:22:47 +04:00
committed by Konstantin Pastbin
parent 927299f4a9
commit aec82794ac
13 changed files with 126 additions and 65 deletions

View File

@@ -43,13 +43,10 @@ class PlacePageTrackLayout: IPlacePageLayout {
}()
lazy var elevationMapViewController: ElevationProfileViewController? = {
guard trackData.trackInfo.hasElevationInfo,
let elevationProfileData = trackData.elevationProfileData else {
guard trackData.trackInfo.hasElevationInfo, trackData.elevationProfileData != nil else {
return nil
}
return ElevationProfileBuilder.build(trackInfo: trackData.trackInfo,
elevationProfileData: elevationProfileData,
delegate: interactor)
return ElevationProfileBuilder.build(trackData: trackData, delegate: interactor)
}()
lazy var actionBarViewController: ActionBarViewController = {