现在有这样一个需求,iserver通过工作空间发布了地图服务和数据服务,然后在前端绘制数据(点和线,几十万级别),而iclassic可以通过地图服务或者数据服务得到相应的数据,请问这两种方式,那种效率高?
第一种,通过地图服务得到要素数据
var host = window.isLocal ? window.server : "https://iserver.supermap.io",
var url = host + "/iserver/services/map-world/rest/maps/World";
var queryParam, queryBySQLParams, queryBySQLService;
queryParam = new SuperMap.REST.FilterParameter({
name: "Capitals@World.1"
});
queryBySQLParams = new SuperMap.REST.QueryBySQLParameters({
queryParams: [queryParam]
});
queryBySQLService = new SuperMap.REST.QueryBySQLService(url, {
eventListeners: {"processCompleted": processCompleted, "processFailed": processFailed}
});
queryBySQLService.processAsync(queryBySQLParams);
第二种,通过数据服务得到要素数据
var host = window.isLocal ? window.server : "https://iserver.supermap.io",
var url = host + "/iserver/services/data-jingjin/rest/data";
var getFeatureParam, getFeatureBySQLService, getFeatureBySQLParams;
getFeatureParam = new SuperMap.REST.FilterParameter({
name: "Jingjin",
attributeFilter: "SMID > -1"
});
getFeatureBySQLParams = new SuperMap.REST.GetFeaturesBySQLParameters({
queryParameter: getFeatureParam,
toIndex: 500,
datasetNames: ["Jingjin:BaseMap_R"]
});
getFeatureBySQLService = new SuperMap.REST.GetFeaturesBySQLService(url, {
eventListeners: {"processCompleted": processCompleted, "processFailed": processFailed}
});
getFeatureBySQLService.processAsync(getFeatureBySQLParams);