* @function ServerTheme.prototype.fromJson * @description 将服务端 JSON 对象转换成当前客户端对象。 * @param {Object} jsonObject - 要转换的 JSON 对象。
(jsonObject)
| 61 | * @param {Object} jsonObject - 要转换的 JSON 对象。 |
| 62 | */ |
| 63 | fromJson(jsonObject) { |
| 64 | super.fromJson(jsonObject); |
| 65 | var themeObj = this.theme; |
| 66 | var themeT = themeObj && themeObj.type; |
| 67 | switch (themeT) { |
| 68 | case 'LABEL': |
| 69 | this.theme = ThemeLabel.fromObj(themeObj); |
| 70 | break; |
| 71 | case 'UNIQUE': |
| 72 | this.theme = ThemeUnique.fromObj(themeObj); |
| 73 | break; |
| 74 | case 'GRAPH': |
| 75 | this.theme = ThemeGraph.fromObj(themeObj); |
| 76 | break; |
| 77 | case 'DOTDENSITY': |
| 78 | this.theme = ThemeDotDensity.fromObj(themeObj); |
| 79 | break; |
| 80 | case 'GRADUATEDSYMBOL': |
| 81 | this.theme = ThemeGraduatedSymbol.fromObj(themeObj); |
| 82 | break; |
| 83 | case 'RANGE': |
| 84 | this.theme = ThemeRange.fromObj(themeObj); |
| 85 | break; |
| 86 | default: |
| 87 | break; |
| 88 | } |
| 89 | if (this.themeElementPosition) { |
| 90 | //待测试 |
| 91 | this.themeElementPosition = new LonLat(this.themeElementPosition.x, this.themeElementPosition.y); |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * @function ServerTheme.prototype.toServerJSONObject |