Skip to content

Commit

Permalink
Fix gpx routing
Browse files Browse the repository at this point in the history
  • Loading branch information
crimean committed Jul 31, 2018
1 parent aab6c51 commit ab4a5a2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Sources/GPX/OAGPXDocumentPrimitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import "OALocationPoint.h"

#include <OsmAndCore.h>
#include <OsmAndCore/GpxDocument.h>
Expand Down Expand Up @@ -44,7 +45,7 @@ typedef enum

@end

@interface OALocationMark : NSObject
@interface OALocationMark : NSObject<OALocationPoint>

@property (nonatomic) CLLocationCoordinate2D position;
@property (nonatomic) NSString *name;
Expand Down Expand Up @@ -150,7 +151,7 @@ typedef enum
@property (nonatomic) double ageOfGpsData;
@property (nonatomic) int dgpsStationId;

- (void)fillWithWpt:(OAGpxWpt *)gpxWpt;
- (void) fillWithWpt:(OAGpxWpt *)gpxWpt;

@end

Expand Down
37 changes: 34 additions & 3 deletions Sources/GPX/OAGPXDocumentPrimitives.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import "OAGPXDocumentPrimitives.h"
#import "OAGPXTrackAnalysis.h"
#import "OAUtilities.h"
#import "OAPointDescription.h"

@implementation OAMetadata
@end
Expand Down Expand Up @@ -84,14 +85,39 @@ - (NSUInteger) hash
return result;
}

- (double) getLatitude
{
return self.position.latitude;
}

- (double) getLongitude
{
return self.position.longitude;
}

- (UIColor *) getColor
{
return nil;
}

- (OAPointDescription *) getPointDescription
{
return [[OAPointDescription alloc] initWithType:POINT_TYPE_WPT name:self.name];
}

- (BOOL) isVisible
{
return YES;
}

@end

@implementation OAExtraData
@end

@implementation OAGpxWpt

- (instancetype)init
- (instancetype) init
{
self = [super init];
if (self)
Expand All @@ -110,7 +136,7 @@ - (instancetype)init
return self;
}

- (void)fillWithWpt:(OAGpxWpt *)gpxWpt
- (void) fillWithWpt:(OAGpxWpt *)gpxWpt
{
self.wpt = gpxWpt.wpt;

Expand Down Expand Up @@ -139,14 +165,19 @@ - (void)fillWithWpt:(OAGpxWpt *)gpxWpt
self.extraData = gpxWpt.extraData;
}

- (UIColor *) getColor
{
return [OAUtilities colorFromString:self.color];
}

@end

@implementation OAGpxTrk
@end

@implementation OAGpxTrkPt

- (instancetype)init
- (instancetype) init
{
self = [super init];
if (self)
Expand Down

0 comments on commit ab4a5a2

Please sign in to comment.