iserver9d查询不超过1000条?

0 投票
var getFeaturesByGeometryParameters, getFeaturesByGeometryService;
            getFeaturesByGeometryParameters = new SuperMap.REST.GetFeaturesByGeometryParameters(
                {
                    datasetNames: [CONFIG.QUERY_DATA_SOURCE_NAME + ":" + CONFIG.QUERY_DATA_SET_NAME],
                    toIndex: -1,
                    maxFeatures: 99999,
                    spatialQueryMode: SuperMap.REST.SpatialQueryMode.CONTAIN,
                    geometry: geometry
                });
            var url = CONFIG.QUERY_URL;
            getFeaturesByGeometryService = new SuperMap.REST.GetFeaturesByGeometryService(
                url, {
                    eventListeners: {
                        "processCompleted": processCompleted,
                        "processFailed": processFailed
                    }
                });

以上是我的代码,已经设置了maxFeatures = 99999,返回的数据仍然只有1000条

5月 9, 2018 分类:  271次浏览 | 用户: liuk 初出茅庐 (24 分)

1个回答

0 投票
 
已采纳
​
    SuperMap.REST.GetFeaturesByGeometryParameters.toJsonParameters = function(params) {
    var filterParameter,
        geometry,
        parasByGeometry;
        
    geometry = SuperMap.REST.ServerGeometry.fromGeometry(params.geometry);
    parasByGeometry = {
        datasetNames: params.datasetNames,
        getFeatureMode: "SPATIAL",
        geometry: geometry,
        spatialQueryMode: params.spatialQueryMode
    };
    if(params.fields) {
        filterParameter = new SuperMap.REST.FilterParameter();
        filterParameter.name = params.datasetNames;
        filterParameter.fields = params.fields;
        parasByGeometry.queryParameter = filterParameter;
    }
    if (typeof(params.maxFeatures)=="number"&&!isNaN(params.maxFeatures)) { 
                parasByGeometry.maxFeatures = params.maxFeatures; 
            } 
    if(params.attributeFilter){
        parasByGeometry.attributeFilter = params.attributeFilter;
        parasByGeometry.getFeatureMode = "SPATIAL_ATTRIBUTEFILTER";
    }   
    
    return SuperMap.Util.toJSON(parasByGeometry);
}; 

​

你好,在getFeaturesByGeometryService.processAsync(getFeaturesByGeometryParameters);这句代码前,调用一下上面的代码,将参数maxFeatures加入请求的参数里面

5月 9, 2018 用户: 刘美玲 名扬四海 (1,322 分)
采纳于 5月 9, 2018 用户:liuk
非常感谢,已经可以了
...