我需要使用从服务器收到的 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:customLocations接口(interface)
关于objective-c - 如何使用 Skobbler 从 GPX 文件创建路线?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30781681/