首页 / 浏览问题 / 移动GIS / 问题详情
ios 如何请求网络上的数据 画线 ?
9EXP 2017年08月28日
目前是这个代码

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

        

    }

1个回答

queryResult及是Featureset对象,里面有getGeometry方法获取查询的结果,获取到几何对象后,就可以进行绘制了,例如将几何对象绘制到跟踪层中
1,752EXP 2017年08月29日
...