在Xcode中使用GPX来模拟位置变化时,有没有办法控制速度? [英] When using GPX in Xcode to simulate location changes, is there a way to control the speed?
问题描述
我在Xcode 4.2中使用以下GPX文件来模拟位置更改。它运作良好,但我无法控制位置变化的速度。邮票似乎不起作用。有没有人有这方面的解决方案?
I'm using the following GPX file in Xcode 4.2 to simulate a location change. It works well, but I can't control the speed of the location change. stamp seems to be not working. Does anyone have a solution for this?
<?xml version="1.0"?>
<gpx version="1.1" creator="Xcode">
<wpt lat="37.331705" lon="-122.030237"></wpt>
<wpt lat="37.331705" lon="-122.030337"></wpt>
<wpt lat="37.331705" lon="-122.030437"></wpt>
<wpt lat="37.331705" lon="-122.030537"></wpt>
</gpx>
推荐答案
我不认为(知道)这是可以直接在GPX中使用,但您可以使用Instruments / Automation测试位置更改。
I don't think (know) that this is possible in the GPX directly, but you can test location change with Instruments/Automation.
您可以使用如下脚本:
var target = UIATarget.localTarget();
target.setLocation(<location);
target.delay(5);
target.setLocation(...);
依此类推。我从WWDC11视频中采用了这个示例 https://developer.apple.com/videos / play / wwdc2011 / 518 / (测试位置感知应用程序)
And so on. I took this example from the WWDC11 video https://developer.apple.com/videos/play/wwdc2011/518/ (Testing your location-aware applications)
我知道这实际上并不能让你定义速度,但是我希望延迟能以某种方式解释。也许那会对你有所帮助。
I'm aware that this doesn't actually let you define the speed, but the delays somehow account for that I hope. Maybe that'll help you.
这篇关于在Xcode中使用GPX来模拟位置变化时,有没有办法控制速度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!