如何使用 Skobbler 从 GPX 文件创建路线?
How to create route from GPX file with Skobbler?
我需要使用从服务器收到的 GPX 路线在我的移动应用程序中创建路线。
我在 skobbler 官方网站和网络上都找不到任何指南。
这是我尝试过的方法,但失败了
SKGPSFileElement* gpxFile;
gpxFile.type = SKGPSFileElementGPXRoute;
gpxFile.name = @"route";
gpxFile.extensions = @"gpx";
[[SKRoutingService sharedInstance] calculateRouteWithSettings:nil GPSFileElement:gpxFile];
有什么提示吗?
最简单的方法是查看 demo project 中的 Tracks 示例,因为您已经拥有读取、绘制和转换此 GPX 轨道所需的代码一条路线。
我认为它会像这样(使用 SKGPSFileElement 和 SKGPSFilesService 助手 类):
SKGPSFileElement* root = [[SKGPSFilesService sharedInstance] loadFileAtPath:path error:nil];
注意:如果您只是想将 GPX 轨道的内容作为点数组传递给路由引擎,您可以使用 calculateRouteWithSettings:customLocationsAPI
我需要使用从服务器收到的 GPX 路线在我的移动应用程序中创建路线。 我在 skobbler 官方网站和网络上都找不到任何指南。
这是我尝试过的方法,但失败了
SKGPSFileElement* gpxFile;
gpxFile.type = SKGPSFileElementGPXRoute;
gpxFile.name = @"route";
gpxFile.extensions = @"gpx";
[[SKRoutingService sharedInstance] calculateRouteWithSettings:nil GPSFileElement:gpxFile];
有什么提示吗?
最简单的方法是查看 demo project 中的 Tracks 示例,因为您已经拥有读取、绘制和转换此 GPX 轨道所需的代码一条路线。
我认为它会像这样(使用 SKGPSFileElement 和 SKGPSFilesService 助手 类):
SKGPSFileElement* root = [[SKGPSFilesService sharedInstance] loadFileAtPath:path error:nil];
注意:如果您只是想将 GPX 轨道的内容作为点数组传递给路由引擎,您可以使用 calculateRouteWithSettings:customLocationsAPI