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

Method createThematicFeature

src/openlayers/overlay/Label.js:108–125  ·  view source on GitHub ↗

* @private * @function Label.prototype.createThematicFeature * @description 创建专题要素。 * @param {FeatureVector} feature - 矢量要素。 * @returns {FeatureThemeVector} 专题图矢量要素。

(feature)

Source from the content-addressed store, hash-verified

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 /**

Callers 7

LabelSpec.jsFile · 0.45
UniqueSpec.jsFile · 0.45
RankSymbolSpec.jsFile · 0.45
GeoFeatureSpec.jsFile · 0.45
GraphThemeLayer.jsFile · 0.45

Calls 3

getStyleByDataMethod · 0.95
transformStyleMethod · 0.80
addShapeMethod · 0.80

Tested by

no test coverage detected