* @private * @function Label.prototype.createThematicFeature * @description 创建专题要素。 * @param {FeatureVector} feature - 矢量要素。 * @returns {FeatureThemeVector} 专题图矢量要素。
(feature)
| 106 | * @returns {FeatureThemeVector} 专题图矢量要素。 |
| 107 | */ |
| 108 | createThematicFeature(feature) { |
| 109 | //赋 style |
| 110 | var style = this.getStyleByData(feature); |
| 111 | //创建专题要素时的可选参数 |
| 112 | var options = {}; |
| 113 | options.nodesClipPixel = this.nodesClipPixel; |
| 114 | options.isHoverAble = this.isHoverAble; |
| 115 | options.isMultiHover = this.isMultiHover; |
| 116 | options.isClickAble = this.isClickAble; |
| 117 | options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle); |
| 118 | //将数据转为专题要素(Vector) |
| 119 | var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options); |
| 120 | //直接添加图形到渲染器 |
| 121 | for (var m = 0; m < thematicFeature.shapes.length; m++) { |
| 122 | this.renderer.addShape(thematicFeature.shapes[m]); |
| 123 | } |
| 124 | return thematicFeature; |
| 125 | } |
| 126 | |
| 127 | |
| 128 | /** |
no test coverage detected