目前是这个代码
QueryService *queryservice = [[QueryService alloc]init];
ServiceQueryParameter *parameter = [[ServiceQueryParameter alloc]init];
GeoPoint *geo = [[GeoPoint alloc]initWithX:104.06 Y:30.67];
parameter.mServiceAddress = @"http://47.93.81.191:8090";
parameter.mServiceName = @"map-gisMap/rest";
parameter.mMapName = @"gisMap";
parameter.mQueryLayerName = @"gisRoadData@gis";
if(isFirst)
{
[parameter setAttriButeFilter:@"SMID > 10"];
NSLog(@"SMID大于10");
isFirst = !isFirst;
}
else
{
[parameter setAttriButeFilter:@"SMID < 10"];
NSLog(@"SMID小于10");
isFirst = !isFirst;
}
parameter.m_pGeometry = geo;
[parameter setNqueryOption:ATTRIBUTEANDGEOMETRY];
//设置空间查询操作模式
parameter.spatialQueryMode = SQM_DISJOINT;
//设置空间查询中的搜索对象
parameter.spatialQueryObject = geo;
queryservice.queryServiceDelegate = self;
[queryservice queryWithServiceParam:parameter QueryMode:SpatialQuery];
//m_bResultEnable = false;
然后代理里 如何画线呢
-(void)getQueryResult:(FeatureSet *)queryResult exception:(NSException *)exception{
UIAlertView *alert = nil;
if (exception != nil) {
if ([[exception name]isEqualToString:@"mJsonObject is Invalid:"]) {
alert = [[UIAlertView alloc]initWithTitle:@"无效数据服务地址" message:@"请传入正确数据服务地址" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
}else{
alert = [[UIAlertView alloc]initWithTitle:[exception name] message:[exception reason] delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
}
[alert show];
NSLog(@"查询结果异常信息:%@%@",[exception name],[exception reason]);
alert = nil;
return;
}
if (queryResult != nil) {
_Resultrecord = queryResult;
[_mapControl.map refresh];
}