How to create route from GPX file with Skobbler?

320 views Asked by At

I need to create a route in my mobile app, using the GPX route I received from the server. I couldn't find any guides on the official skobbler site, nor on the web.

This is what I tried, but failed

SKGPSFileElement* gpxFile;
gpxFile.type = SKGPSFileElementGPXRoute;
gpxFile.name = @"route";
gpxFile.extensions = @"gpx";
[[SKRoutingService sharedInstance] calculateRouteWithSettings:nil GPSFileElement:gpxFile];

Any hints?

1

There are 1 answers

2
Ando On BEST ANSWER

The easiest would be to look at the Tracks example in the demo project as there you already have the code required to read, draw and transform this GPX track to a route.

I think it would go something like this (using the SKGPSFileElement and SKGPSFilesService helper classes):

SKGPSFileElement* root = [[SKGPSFilesService sharedInstance] loadFileAtPath:path error:nil];

Note: if you're just interested in passing the content of the GPX track as an array of points to the routing engine you can use the calculateRouteWithSettings:customLocations API