MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / initBaseParameter

Method initBaseParameter

src/common/overlay/RankSymbol.js:67–142  ·  view source on GitHub ↗

* @function FeatureThemeRankSymbol.prototype.initBaseParameter * @description 初始化专题要素(图形)基础参数。 * 在调用此方法前,此类的图表模型相关属性都是不可用的 ,此方法在 assembleShapes 函数中调用。 * 调用此函数关系到 setting 对象的以下属性。 * @param {Array. } codomain - 值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。 * @param {number} [

()

Source from the content-addressed store, hash-verified

65 * @returns {boolean} 初始化参数是否成功。
66 */
67 initBaseParameter() {
68 // 参数初始化是否成功
69 var isSuccess = true;
70
71 // setting 属性是否已成功赋值
72 if (!this.setting) {
73 return false;
74 }
75 var sets = this.setting;
76
77 // 图表偏移
78 if (sets.XOffset) {
79 this.XOffset = sets.XOffset;
80 }
81 if (sets.YOffset) {
82 this.YOffset = sets.YOffset;
83 }
84 this.XOffset = sets.XOffset ? sets.XOffset : 0;
85 this.YOffset = sets.YOffset ? sets.YOffset : 0;
86
87 // 其他默认值
88 this.origonPoint = [];
89 this.chartBox = [];
90 this.dataViewBox = [];
91
92 this.DVBParameter = sets.dataViewBoxParameter ? sets.dataViewBoxParameter : [0, 0, 0, 0];
93
94 this.DVBOrigonPoint = [];
95 this.DVBCenterPoint = [];
96 this.origonPointOffset = [];
97
98 // 图表位置
99 this.resetLocation();
100
101 // 专题要素宽度 w
102 var w = this.width;
103 // 专题要素高度 h
104 var h = this.height;
105 // 专题要素像素位置 loc
106 var loc = this.location;
107
108 // 专题要素像素位置 loc
109 this.origonPoint = [loc[0] - w / 2, loc[1] - h / 2];
110 // 专题要素原点(左上角)
111 var op = this.origonPoint;
112
113 // 图表框([left, bottom, right, top])
114 this.chartBox = [op[0], op[1] + h, op[0] + w, op[1]];
115 // 图表框
116 var cb = this.chartBox;
117
118 // 数据视图框参数,它是图表框各方向对应的内偏距
119 var dbbP = this.DVBParameter;
120 // 数据视图框 ([left, bottom, right, top])
121 this.dataViewBox = [cb[0] + dbbP[0], cb[1] - dbbP[1], cb[2] - dbbP[2], cb[3] + dbbP[3]];
122 // 数据视图框
123 var dvb = this.dataViewBox;
124 //检查数据视图框是否合法

Callers

nothing calls this directly

Calls 1

resetLocationMethod · 0.80

Tested by

no test coverage detected