diff --git a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageTrackData.h b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageTrackData.h index 51aabd0e0..d4c5a8280 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageTrackData.h +++ b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageTrackData.h @@ -12,8 +12,8 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) MWMMarkGroupID groupId; @property(nonatomic, readwrite, nonnull) TrackInfo * trackInfo; @property(nonatomic, readwrite, nullable) ElevationProfileData * elevationProfileData; -@property(nonatomic, readonly) double activePoint; -@property(nonatomic, readonly) double myPosition; +@property(nonatomic, readonly) double activePointDistance; +@property(nonatomic, readonly) double myPositionDistance; @property(nonatomic) MWMVoidBlock onActivePointChangedHandler; - (instancetype)initWithTrackInfo:(TrackInfo *)trackInfo diff --git a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageTrackData.mm b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageTrackData.mm index c98d17e78..18493ecbf 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageTrackData.mm +++ b/iphone/CoreApi/CoreApi/PlacePageData/Common/PlacePageTrackData.mm @@ -4,7 +4,7 @@ @interface PlacePageTrackData () -@property(nonatomic, readwrite) double activePoint; +@property(nonatomic, readwrite) double activePointDistance; @end @@ -23,7 +23,7 @@ } - (void)updateActivePointDistance:(double)distance { - self.activePoint = distance; + self.activePointDistance = distance; if (self.onActivePointChangedHandler) self.onActivePointChangedHandler(); } @@ -40,8 +40,8 @@ _trackInfo = [[TrackInfo alloc] initWithTrackStatistics:track.GetStatistics()]; auto const & bm = GetFramework().GetBookmarkManager(); - _activePoint = bm.GetElevationActivePoint(_trackId); - _myPosition = bm.GetElevationMyPosition(_trackId); + _activePointDistance = bm.GetElevationActivePoint(_trackId); + _myPositionDistance = bm.GetElevationMyPosition(_trackId); _onActivePointChangedHandler = onActivePointChangedHandler; auto const & elevationInfo = track.GetElevationInfo(); diff --git a/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm b/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm index c351621d1..d9e1b3449 100644 --- a/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm +++ b/iphone/CoreApi/CoreApi/PlacePageData/PlacePageData.mm @@ -119,7 +119,7 @@ static PlacePageRoadType convertRoadType(RoadWarningMarkType roadType) { if (!self || !rawData().IsTrack()) return; auto const & trackInfo = GetFramework().GetBookmarkManager().GetTrackSelectionInfo(rawData().GetTrackId()); - auto latlon = mercator::ToLatLon(trackInfo.m_trackPoint); + auto const latlon = mercator::ToLatLon(trackInfo.m_trackPoint); _locationCoordinate = CLLocationCoordinate2DMake(latlon.m_lat, latlon.m_lon); self.previewData = [[PlacePagePreviewData alloc] initWithRawData:rawData()]; } diff --git a/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfilePresenter.swift b/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfilePresenter.swift index 2fcc31da6..c95b98e3b 100644 --- a/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfilePresenter.swift +++ b/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfilePresenter.swift @@ -2,8 +2,8 @@ import Chart import CoreApi protocol TrackActivePointPresenter: AnyObject { - func updateActivePoint(_ distance: Double) - func updateMyPosition(_ distance: Double) + func updateActivePointDistance(_ distance: Double) + func updateMyPositionDistance(_ distance: Double) } protocol ElevationProfilePresenterProtocol: UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, TrackActivePointPresenter { @@ -71,14 +71,14 @@ extension ElevationProfilePresenter: ElevationProfilePresenterProtocol { configure() } - func updateActivePoint(_ distance: Double) { + func updateActivePointDistance(_ distance: Double) { guard let view, !view.isChartViewInfoHidden else { return } - view.setActivePoint(distance) + view.setActivePointDistance(distance) } - func updateMyPosition(_ distance: Double) { + func updateMyPositionDistance(_ distance: Double) { guard let view, !view.isChartViewInfoHidden else { return } - view.setMyPosition(distance) + view.setMyPositionDistance(distance) } func configure() { @@ -101,8 +101,8 @@ extension ElevationProfilePresenter: ElevationProfilePresenterProtocol { return } - view?.setActivePoint(trackData.activePoint) - view?.setMyPosition(trackData.myPosition) + view?.setActivePointDistance(trackData.activePointDistance) + view?.setMyPositionDistance(trackData.myPositionDistance) } func onDifficultyButtonPressed() { diff --git a/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileViewController.swift b/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileViewController.swift index de14c2fda..062a8436f 100644 --- a/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileViewController.swift +++ b/iphone/Maps/UI/PlacePage/Components/ElevationProfile/ElevationProfileViewController.swift @@ -8,8 +8,8 @@ protocol ElevationProfileViewProtocol: AnyObject { var isChartViewInfoHidden: Bool { get set } func setChartData(_ data: ChartPresentationData) - func setActivePoint(_ distance: Double) - func setMyPosition(_ distance: Double) + func setActivePointDistance(_ distance: Double) + func setMyPositionDistance(_ distance: Double) func reloadDescription() } @@ -143,11 +143,11 @@ extension ElevationProfileViewController: ElevationProfileViewProtocol { chartView.chartData = data } - func setActivePoint(_ distance: Double) { + func setActivePointDistance(_ distance: Double) { chartView.setSelectedPoint(distance) } - func setMyPosition(_ distance: Double) { + func setMyPositionDistance(_ distance: Double) { chartView.myPosition = distance } diff --git a/iphone/Maps/UI/PlacePage/PlacePageInteractor.swift b/iphone/Maps/UI/PlacePage/PlacePageInteractor.swift index 65d4bb4f1..22c07d999 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageInteractor.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageInteractor.swift @@ -56,16 +56,16 @@ class PlacePageInteractor: NSObject { private func subscribeOnTrackActivePointUpdates() { guard placePageData.objectType == .track, let trackData = placePageData.trackData else { return } bookmarksManager.setElevationActivePointChanged(trackData.trackId) { [weak self] distance in - self?.trackActivePointPresenter?.updateActivePoint(distance) + self?.trackActivePointPresenter?.updateActivePointDistance(distance) trackData.updateActivePointDistance(distance) } bookmarksManager.setElevationMyPositionChanged(trackData.trackId) { [weak self] distance in - self?.trackActivePointPresenter?.updateMyPosition(distance) + self?.trackActivePointPresenter?.updateMyPositionDistance(distance) } } private func unsubscribeFromTrackActivePointUpdates() { - guard placePageData.objectType == .track, let trackData = placePageData.trackData else { return } + guard placePageData.trackData?.onActivePointChangedHandler != nil else { return } bookmarksManager.resetElevationActivePointChanged() bookmarksManager.resetElevationMyPositionChanged() }