ios 如何请求网络上的数据 画线 ?

0 投票
111 浏览
目前是这个代码

    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];

        

    }
最新提问 8月 28, 2017 分类:  111次浏览 | 用户: 尼古拉斯益达 (0 分)

1个回答

0 投票
queryResult及是Featureset对象,里面有getGeometry方法获取查询的结果,获取到几何对象后,就可以进行绘制了,例如将几何对象绘制到跟踪层中
最新回答 8月 29, 2017 用户: 周仕斌 才高八斗 (961 分)
...