如何使用ESRI获取具有LayerID的特定图层的字段名称

时间:2015-08-14 16:52:26

标签: ios gis arcgis

我实际上尝试过,甚至检查了ESRI示例代码QueryTaskExample。我只需要获取任何图层的字段名称或属性。

我使用了以下方法...

self.queryTask = [AGSQueryTask queryTaskWithURL:[NSURL URLWithString:strMAPURL]]; // here i send like @"http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3"


        self.queryTask.delegate = self;

        //return all fields in query
        self.query = [AGSQuery query];
        self.query.outFields = [NSArray arrayWithObjects:@"*", nil];

        self.query.text = @"Fields";
        [self.queryTask executeWithQuery:self.query];


i access below delegates :

//results are returned
- (void)queryTask:(AGSQueryTask *)queryTask operation:(NSOperation *)op didExecuteWithFeatureSetResult:(AGSFeatureSet *)featureSet {
  //get feature, and load in to table
  self.featureSet = featureSet; 
  [super.tableView reloadData];
}

featureSet.fields //这应该是给我第3层的字段名称....

但是我将Array作为0元素......我需要以与服务器层中相同的顺序获取Fields。

0 个答案:

没有答案