アプリ アプリケーションのグラフィック レイヤーにルートを描画しようとしていますが、これが正しい方法なのか、それとも別の方法があるのか わかりません。ArgGIS で NSArray を使用してマップを描画しようとしているところに問題があります。
*編集 NSArray を JSON 文字列に戻し、ArcGIS を使用して JSON 文字列で描画しようとしました
これは私がやったことです:
NSArray *BusRoute=[jsonResult objectForKey:@"BusRoute"];
int i;
int count = [BusRoute count];
for (i = 0; i < count; i++)
{
NSDictionary *dic = [BusRoute objectAtIndex: i];
NSString *Duration = [dic valueForKey:@"Duration"];
//---PATH---
NSArray *PATH = [dic valueForKey:@"PATH"];
NSLog(@"PATH = %@", PATH);
self.path = PATH;
}
NSError *writeError = nil;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:path options:NSJSONWritingPrettyPrinted error:&writeError];
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSLog(@"JSON Output: %@", jsonString);
if (self.jsonString) {
// symbolize the returned route graphic
self.jsonString.routeGraphic.symbol = [self routeSymbol];
// add the route graphic to the graphic's layer
[self._graphicsLayer addGraphic:self.jsonString.routeGraphic];
// tell the graphics layer to redraw
[self._graphicsLayer dataChanged];
}
*JSON 文字列の出力
JSON Output: [
[
"38909,35576;38872,35589;38861,35593;38848,35597;38697,35650;38695,35651;38695,35651;38609,35681;38583,35689;38553,35697;38508,35700;38476...;29560,40043"
]
]
これは、マップ上に描画する必要があるパスの一部です。
PATH = (( "38909,35576;38872,35589;38861,35593;38848,35597;38697,35650;38695,35651;38695,35651;38609,35681;38583,35689;38553,35697;38508,35700;38476,35696;38476,35696;....))
この行self.jsonData.routeGraphic.symbol = [self routeSymbol];
でエラーが発生しますProperty 'Property 'jsonData' not found on object of type 'MapViewController *'
解決するにはどうすればいいですか?助けてください
NSArray
* ArcGIS を使用してパスの線を引くにはどうすればよいですか?