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

Method fromJson

src/common/iServer/Grid.js:156–188  ·  view source on GitHub ↗

* @function Grid.prototype.fromJson * @description 将服务端 JSON 对象转换成当前客户端对象。 * @param {Object} jsonObject - 要转换的 JSON 对象。

(jsonObject)

Source from the content-addressed store, hash-verified

154 * @param {Object} jsonObject - 要转换的 JSON 对象。
155 */
156 fromJson(jsonObject) {
157 super.fromJson(jsonObject);
158 if (this.specialColor) {
159 this.specialColor = new ServerColor(this.specialColor.red,
160 this.specialColor.green,
161 this.specialColor.blue);
162 }
163 if (this.colors) {
164 var colors = [],
165 color;
166 for (var i in this.colors) {
167 color = this.colors[i];
168 colors.push(new ServerColor(color.red, color.green, color.blue));
169 }
170 this.colors = colors;
171 }
172 if (this.dashStyle) {
173 this.dashStyle = new ServerStyle(this.dashStyle);
174 }
175 if (this.solidStyle) {
176 this.solidStyle = new ServerStyle(this.solidStyle);
177 }
178 if (this.colorDictionary) {
179 var colorDics = [],
180 colorDic;
181 for (var key in this.colorDictionary) {
182 colorDic = this.colorDictionary[key];
183 colorDics.push(new ColorDictionary({elevation: key, color: colorDic}));
184 }
185 this.colorDictionarys = colorDics;
186 }
187 delete this.colorDictionary;
188 }
189
190 /**
191 * @function Grid.prototype.toServerJSONObject

Callers 15

GridSpec.jsFile · 0.45
ImageSpec.jsFile · 0.45
RouteSpec.jsFile · 0.45
ServerThemeSpec.jsFile · 0.45
toiClientFeatureMethod · 0.45
WebMap.jsFile · 0.45
HeatMapLayer.jsFile · 0.45
ThemeLayer.jsFile · 0.45
fromObjMethod · 0.45
fromObjMethod · 0.45
fromObjMethod · 0.45

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected