Skip to content

Commit

Permalink
ICL-1520 补充上下游关键设施查询服务 returnFeatures 参数 review by luox
Browse files Browse the repository at this point in the history
  • Loading branch information
xilanhuaweidapao committed Mar 13, 2024
1 parent affe702 commit 0e5757d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/common/iServer/FacilityAnalystStreamParameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {Util} from '../commontypes/Util';
* @param {Object} options - 参数。
* @param {Array.<number>} options.sourceNodeIDs - 指定的设施点 ID 数组。
* @param {number} options.queryType - 分析类型,只能是 0 (上游关键设施查询) 或者是 1(下游关键设施查询)。
* @param {boolean} [options.returnFeatures=true] - 是否返回结果要素的详细描述信息。若为 false,只返回结果要素的 ID 集合。
* @param {number} [options.edgeID] - 指定的弧段 ID,edgeID 与 nodeID 必须指定一个。
* @param {number} [options.nodeID] - 指定的结点 ID,edgeID 与 nodeID 必须指定一个。
* @param {boolean} [options.isUncertainDirectionValid=false] - 指定不确定流向是否有效。
Expand Down Expand Up @@ -39,6 +40,12 @@ export class FacilityAnalystStreamParameters {
*/
this.nodeID = null;

/**
* @member {boolean} [TraceAnalystParameters.prototype.returnFeatures=true]
* @description 是否返回结果要素的详细描述信息。若为 false,只返回结果要素的 ID 集合。
*/
this.returnFeatures = true;

/**
* @member {boolean} [FacilityAnalystStreamParameters.prototype.isUncertainDirectionValid=false]
* @description 指定不确定流向是否有效。指定为 true,表示不确定流向有效,遇到不确定流向时分析继续进行;
Expand All @@ -65,6 +72,7 @@ export class FacilityAnalystStreamParameters {
me.edgeID = null;
me.nodeID = null;
me.weightName = null;
me.returnFeatures = null;
me.isUncertainDirectionValid = null;
me.type = null;
}
Expand Down
3 changes: 2 additions & 1 deletion src/common/iServer/FacilityAnalystStreamService.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ export class FacilityAnalystStreamService extends NetworkAnalystServiceBase {

jsonObject = {
sourceNodeIDs: params.sourceNodeIDs,
isUncertainDirectionValid: params.isUncertainDirectionValid
isUncertainDirectionValid: params.isUncertainDirectionValid,
returnFeatures: params.returnFeatures
};

if (params.edgeID !== null && params.nodeID !== null) {
Expand Down
6 changes: 6 additions & 0 deletions test/common/iServer/FacilityAnalystStreamParametersSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,10 @@ describe('FacilityAnalystStreamParameters', () => {
expect(parameter.isUncertainDirectionValid).toBeFalsy();
parameter.destroy();
});

it('returnFeatures', () => {
var parameter = new FacilityAnalystStreamParameters({ returnFeatures: false });
expect(parameter.returnFeatures).toBeFalsy;
parameter.destroy();
});
});

0 comments on commit 0e5757d

Please sign in to comment.