Skip to content

Commit

Permalink
【feature】restdata restmap 查询统一由iserver转成4326
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongjiaojiao committed Oct 10, 2024
1 parent 3725f41 commit 529e531
Showing 1 changed file with 14 additions and 25 deletions.
39 changes: 14 additions & 25 deletions src/common/_utils/iServerRestService.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,17 @@ export default class iServerRestService extends Events {
const expectCountOptions = this._calcFeaturesExpectCountOptions(queryInfo);
const pickedCommonParams = {
startRecord: expectCountOptions.fromIndex,
expectCount: expectCountOptions.maxFeatures
expectCount: expectCountOptions.maxFeatures,
prjCoordSys: {
epsgCode: 4326
},
queryParams: [
{
name: queryInfo.name,
attributeFilter: queryInfo.attributeFilter,
orderBy: queryInfo.orderBy
}
]
};
if (queryInfo.bounds) {
const params = this._getMapFeaturesParamsByGeometry(queryInfo, pickedCommonParams);
Expand All @@ -292,6 +302,9 @@ export default class iServerRestService extends Events {
const expectCountOptions = this._calcFeaturesExpectCountOptions(queryInfo);
const pickedCommonParams = {
...expectCountOptions,
targetPrj: {
epsgCode: 4326
},
returnFeaturesOnly: this.options.returnFeaturesOnly
};
if (queryInfo.bounds) {
Expand All @@ -306,27 +319,13 @@ export default class iServerRestService extends Events {
_getMapFeaturesParamsBySql(queryInfo, commonParams) {
return new QueryBySQLParameters({
...commonParams,
queryParams: [
{
name: queryInfo.name,
attributeFilter: queryInfo.attributeFilter,
orderBy: queryInfo.orderBy
}
],
queryOption: this.options.hasGeometry === false ? 'ATTRIBUTE' : 'ATTRIBUTEANDGEOMETRY'
});
}

_getMapFeaturesParamsByGeometry(queryInfo, commonParams) {
return new QueryByGeometryParameters({
...commonParams,
queryParams: [{
name: queryInfo.name,
attributeFilter: queryInfo.attributeFilter
}],
prjCoordSys: {
epsgCode: 4326
},
spatialQueryMode: 'INTERSECT',
geometry: this._transBoundsToGeometry(queryInfo)
});
Expand Down Expand Up @@ -444,16 +443,6 @@ export default class iServerRestService extends Events {
});
return;
}
// vertified 表示已经验证过 epsgCode且转化了features 比如iportalData从content.json获取的features
if (!results.result.vertified) {
// 关系型存储发布成服务后坐标一定是4326,但真实数据可能不是4326,判断一下暂时按照3857处理
data.features = await checkAndRectifyFeatures({
features: data.features,
epsgCode: this.options.epsgCode,
projectionUrl: this.projectionUrl,
options: { proxy: this.options.proxy }
});
}

/**
* @event iServerRestService#getdatasucceeded
Expand Down

0 comments on commit 529e531

Please sign in to comment.