2013-03-04 19 views
15

UIオートメーションを使用してユーザーのパスを自動化しようとしています。UIATarget.setLocationWithOptionsコースが適用されない

var target = UIATarget.localTarget(); 

var waypoints = [ 
    {location: {latitude: 37.33170, longitude: -122.03020}, options: {course: 180}}, 
    {location: {latitude: 37.33170, longitude: -122.03022}, options: {course: 180}}, 
    {location: {latitude: 37.33170, longitude: -122.03025}, options: {course: 180}}, 
    {location: {latitude: 37.33170, longitude: -122.03027}, options: {course: 180}}, 
    {location: {latitude: 37.33170, longitude: -122.03030}, options: {course: 180}}, 
    {location: {latitude: 37.33170, longitude: -122.03032}, options: {course: 180}}, 
    {location: {latitude: 37.33170, longitude: -122.03035}, options: {course: 180}}, 
    {location: {latitude: 37.33170, longitude: -122.03037}, options: {course: 180}}, 
    {location: {latitude: 37.33170, longitude: -122.03040}, options: {course: 180}} 
]; 

for (var waypointIndex = 0; waypointIndex < waypoints.length; waypointIndex++) 
{ 
    if (waypointIndex == 0) 
     target.delay(5); 

    var waypoint = waypoints[waypointIndex]; 
    target.setLocationWithOptions(waypoint.location, waypoint.options); 

    target.delay(1); 

    if (waypointIndex == (waypoints.length - 1)) 
     waypointIndex = 0; 
} 

場所の部分は問題なく適用され、ユーザーのインジケータがパスに沿って移動:理想的には、MKMapView内のユーザーの場所は、私が自動化スクリプトでexplicatedてきたウェイポイントのリストに従って更新します。しかし、コースオプションは何もしていないようです。私は90180-903.141.57をオプションの値として試してみましたが、無駄です。

また、speed: 8のパラメータをoptionsに変更しようとしましたが、変更はありません。

これはonly way to simulate headings at allのように見え、course option is totally valid and documentedと表示されているため、動作していないのは残念です。

厄介なハックの回避策:シミュレーションの場所(GPXファイル経由)の場合、物理デバイス上でデバイスの回転が機能します。この方法で、ルートをシミュレートして回転を得ることができます。

+0

動きの速度も供給する必要はありませんか? –

+0

なぜ私はしなければならないのか分かりませんが、私はそれを撃つでしょう! –

+0

私の考えは、あなたが実際に移動することなくコースを作ることができないことと、場所を更新するだけで環境があなたのスピードを計算しないことです。 –

答えて

2

は楽器で私のために、この作品のような座標:

{location:{longitude:2.105528,latitude:41.414359}, options:{speed:20, course: 290, altitude:200, horizontalAccuracy:10, verticalAccuracy:15}} 

は、水平方向と垂直方向の精度に試してみて、そして多分標高。

幸運を祈る!

関連する問題