Skip to content
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
54503b9
Sync chart cursor across route analysis charts
aleksandr-tata Aug 21, 2026
dfea27a
Fix cursor scrubbing on route attribute charts
aleksandr-tata Aug 21, 2026
b3ec09d
Fix route chart synchronization after zoom and cell reuse
aleksandr-tata Aug 24, 2026
896d765
Fix route chart cursor alignment and distance scale labels
aleksandr-tata Aug 24, 2026
95340fc
Fix route chart cursor snapping and highlight reset
aleksandr-tata Aug 24, 2026
0b1bbae
Remove redundant weak captures from chart updates
aleksandr-tata Aug 25, 2026
0923f9c
Remove redundant Objective-C annotations
aleksandr-tata Aug 25, 2026
979be64
Refactor chart registration after layout
aleksandr-tata Aug 25, 2026
2357bfc
Align route bar charts with primary distance range
aleksandr-tata Aug 25, 2026
eb7572a
Merge branch 'master' into task_5669_sync_chart_cursor
aleksandr-tata Aug 26, 2026
57f70dc
Fix chart axis ranges after switching X-axis mode
aleksandr-tata Aug 26, 2026
2abd298
Fix map marker update during chart zoom and pan
aleksandr-tata Aug 27, 2026
54b7d61
Unregister off-screen route bar charts
aleksandr-tata Aug 27, 2026
be13ac0
Preserve chart Y transform during viewport sync
aleksandr-tata Aug 27, 2026
a7995a3
Fix chart state handling when primary chart is off-screen
aleksandr-tata Aug 28, 2026
02add7c
Avoid duplicate chart viewport synchronization
aleksandr-tata Aug 28, 2026
82079a0
Fix chart viewport and selection state synchronization
aleksandr-tata Sep 2, 2026
789dfdf
Track registered charts across cell reuse
aleksandr-tata Sep 2, 2026
e2ae519
Restore bar chart viewports after axis changes
aleksandr-tata Sep 2, 2026
a8a2bd5
Filter chart selection reset events
aleksandr-tata Sep 2, 2026
0485f92
Avoid duplicate viewport sync in Route Details
aleksandr-tata Sep 2, 2026
b71d286
Use generated Objective-C chart sync selector
aleksandr-tata Sep 2, 2026
ce941b3
Fix chart distance basis for routes with gaps
aleksandr-tata Sep 3, 2026
14699f6
Merge branch 'master' into task_5669_sync_chart_cursor
aleksandr-tata Sep 7, 2026
3f4804c
Fix chart registration across cell reuse
aleksandr-tata Sep 7, 2026
89cd1eb
Fix route chart alignment across GPX gaps
aleksandr-tata Sep 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions OsmAnd.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@
46903D6B29B5F77A004459F1 /* OABaseWebViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 46903D6A29B5F77A004459F1 /* OABaseWebViewController.xib */; };
46903D6E29B664B2004459F1 /* OAWikiLanguagesWebViewContoller.m in Sources */ = {isa = PBXBuildFile; fileRef = 46903D6D29B664B2004459F1 /* OAWikiLanguagesWebViewContoller.m */; };
4695B25F2CF0A5D3003FB38A /* TrackChartHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4695B25E2CF0A5CB003FB38A /* TrackChartHelper.swift */; };
A5C7E00133F0000100C0DE01 /* RouteChartSynchronizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C7E00033F0000100C0DE01 /* RouteChartSynchronizer.swift */; };
46993C0A2986BCB70047F2F5 /* img_help_announcement_time_day@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 46993C092986BCB60047F2F5 /* img_help_announcement_time_day@3x.png */; };
469F0C222C627E2A00874CC6 /* PaletteCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 469F0C212C627E2A00874CC6 /* PaletteCollectionViewCell.swift */; };
469F0C242C627F9000874CC6 /* PaletteCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 469F0C232C627F9000874CC6 /* PaletteCollectionViewCell.xib */; };
Expand Down Expand Up @@ -4681,6 +4682,7 @@
46903D6C29B6649A004459F1 /* OAWikiLanguagesWebViewContoller.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OAWikiLanguagesWebViewContoller.h; sourceTree = "<group>"; };
46903D6D29B664B2004459F1 /* OAWikiLanguagesWebViewContoller.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = OAWikiLanguagesWebViewContoller.m; sourceTree = "<group>"; };
4695B25E2CF0A5CB003FB38A /* TrackChartHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackChartHelper.swift; sourceTree = "<group>"; };
A5C7E00033F0000100C0DE01 /* RouteChartSynchronizer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouteChartSynchronizer.swift; sourceTree = "<group>"; };
46993C092986BCB60047F2F5 /* img_help_announcement_time_day@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "img_help_announcement_time_day@3x.png"; path = "Resources/Icons/img_help_announcement_time_day@3x.png"; sourceTree = "<group>"; };
469F0C212C627E2A00874CC6 /* PaletteCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaletteCollectionViewCell.swift; sourceTree = "<group>"; };
469F0C232C627F9000874CC6 /* PaletteCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PaletteCollectionViewCell.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -12415,6 +12417,7 @@
3284BEBB2EABA32C0011A9BA /* GpxAppearanceInfo.swift */,
FA8516EF2D42946D00B321C6 /* GpxDataItemHandler.swift */,
4695B25E2CF0A5CB003FB38A /* TrackChartHelper.swift */,
A5C7E00033F0000100C0DE01 /* RouteChartSynchronizer.swift */,
DA5A7AC026C563A100F274C7 /* OAGPXDatabase.h */,
DA5A7ABB26C563A100F274C7 /* OAGPXDatabase.mm */,
320F71352A8643550071C0E7 /* OAGPXDocumentAdapter.h */,
Expand Down Expand Up @@ -18334,6 +18337,7 @@
DA9F841C29CC96EF00127DAE /* OAShapeLayer.m in Sources */,
46CBC9722B96126C005CC244 /* GlideBaseWidget.swift in Sources */,
4695B25F2CF0A5D3003FB38A /* TrackChartHelper.swift in Sources */,
A5C7E00133F0000100C0DE01 /* RouteChartSynchronizer.swift in Sources */,
DA5A835526C563A800F274C7 /* OAGPXTrackCell.m in Sources */,
27E3C2032DF1ADD40053958E /* OAStreetNameWidgetParams.mm in Sources */,
DA5A844926C563A900F274C7 /* OADiscountToolbarViewController.mm in Sources */,
Expand Down
8 changes: 7 additions & 1 deletion Sources/Controllers/Map/OAMapViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static const int BOTTOM_CONSTANT = 1;

@protocol OAMapRendererViewProtocol;

@class OASWptPt, OASMetadata, OASGpxFile, OASearchWptAPI, OAMapRendererView, OAMapLayers, OAWorldRegion, OAMapRendererEnvironment, OAMapPresentationEnvironment, OAObservable, LineChartView, TrackChartHelper, OASGpxTrackAnalysis, OASTrkSegment, OAPOILayer, OATargetPoint;
@class OASWptPt, OASMetadata, OASGpxFile, OASearchWptAPI, OAMapRendererView, OAMapLayers, OAWorldRegion, OAMapRendererEnvironment, OAMapPresentationEnvironment, OAObservable, LineChartView, TrackChartHelper, OASGpxTrackAnalysis, OASTrkSegment, OAPOILayer, OATargetPoint, OASKQuadRect;

typedef NS_ENUM(NSInteger, EOAMapPanDirection) {
EOAMapPanDirectionUp = 0,
Expand Down Expand Up @@ -246,6 +246,12 @@ typedef NS_ENUM(NSInteger, EOAMapPanDirection) {
segment:(nullable OASTrkSegment *)segment
trackChartHelper:(TrackChartHelper *)trackChartHelper;

- (void)fitTrackOnMapWithRect:(OASKQuadRect *)rect
location:(CLLocationCoordinate2D)location
forceFit:(BOOL)forceFit
trackChartHelper:(TrackChartHelper *)trackChartHelper
NS_SWIFT_NAME(fitTrack(rect:location:forceFit:trackChartHelper:));

- (void)contextMenuDidShow:(id)targetObj;
- (void)contextMenuDidHide;

Expand Down
45 changes: 28 additions & 17 deletions Sources/Controllers/Map/OAMapViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4500,24 +4500,35 @@ - (void)fitTrackOnMap:(LineChartView *)lineChartView
endPos:endPos
analysis:analysis
segment:segment];
if (rect.left != 0 && rect.right != 0)
{
auto point = OsmAnd::Utilities::convertLatLonTo31(OsmAnd::LatLon(location.latitude, location.longitude));
CGPoint mapPoint;
[self.mapView convert:&point toScreen:&mapPoint checkOffScreen:YES];
[self fitTrackOnMapWithRect:rect
location:location
forceFit:forceFit
trackChartHelper:trackChartHelper];
}

if (forceFit && [trackChartHelper.delegate respondsToSelector:@selector(centerMapOnBBox:)])
{
[trackChartHelper.delegate centerMapOnBBox:rect];
}
else if (CLLocationCoordinate2DIsValid(location)
&& !CGRectContainsPoint(trackChartHelper.screenBBox, mapPoint))
{
if (!trackChartHelper.isLandscape && [trackChartHelper.delegate respondsToSelector:@selector(adjustViewPort:)])
[trackChartHelper.delegate adjustViewPort:trackChartHelper.isLandscape];
[self goToPosition:[OANativeUtilities convertFromPointI:point]
animated:YES];
}
- (void)fitTrackOnMapWithRect:(OASKQuadRect *)rect
location:(CLLocationCoordinate2D)location
forceFit:(BOOL)forceFit
trackChartHelper:(TrackChartHelper *)trackChartHelper
{
if (rect.left == 0 || rect.right == 0)
return;

auto point = OsmAnd::Utilities::convertLatLonTo31(OsmAnd::LatLon(location.latitude, location.longitude));
CGPoint mapPoint;
[self.mapView convert:&point toScreen:&mapPoint checkOffScreen:YES];

if (forceFit && [trackChartHelper.delegate respondsToSelector:@selector(centerMapOnBBox:)])
{
[trackChartHelper.delegate centerMapOnBBox:rect];
}
else if (CLLocationCoordinate2DIsValid(location)
&& !CGRectContainsPoint(trackChartHelper.screenBBox, mapPoint))
{
if (!trackChartHelper.isLandscape && [trackChartHelper.delegate respondsToSelector:@selector(adjustViewPort:)])
[trackChartHelper.delegate adjustViewPort:trackChartHelper.isLandscape];
[self goToPosition:[OANativeUtilities convertFromPointI:point]
animated:YES];
}
}

Expand Down
8 changes: 6 additions & 2 deletions Sources/Controllers/PlanRoute/Cells/AnalyzeCardCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@
//

import UIKit
import DGCharts

final class AnalyzeCardCell: UITableViewCell {

let cardView = UIView()

private enum Layout {
static let cornerRadius: CGFloat = 24
static let horizontalInset: CGFloat = 16
}

let cardView = UIView()

weak var chartView: BarLineChartViewBase?

override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupView()
Expand All @@ -27,6 +30,7 @@ final class AnalyzeCardCell: UITableViewCell {

override func prepareForReuse() {
super.prepareForReuse()
chartView = nil
cardView.subviews.forEach { $0.removeFromSuperview() }
}

Expand Down
Loading