MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / createThematicFeature

Method createThematicFeature

src/openlayers/overlay/Range.js:63–83  ·  view source on GitHub ↗

* @private * @function Range.prototype.createThematicFeature * @description 创建专题图要素。 * @param {Object} feature - 要创建的专题图形要素。

(feature)

Source from the content-addressed store, hash-verified

61 * @param {Object} feature - 要创建的专题图形要素。
62 */
63 createThematicFeature(feature) {
64 //赋 style
65 var style = this.getStyleByData(feature);
66 //创建专题要素时的可选参数
67 var options = {};
68 options.nodesClipPixel = this.nodesClipPixel;
69 options.isHoverAble = this.isHoverAble;
70 options.isMultiHover = this.isMultiHover;
71 options.isClickAble = this.isClickAble;
72 options.highlightStyle = ShapeFactory.transformStyle(this.highlightStyle);
73
74 //将数据转为专题要素(ThemeVector)
75 var thematicFeature = new ThemeVector(feature, this, ShapeFactory.transformStyle(style), options);
76
77 //直接添加图形到渲染器
78 for (var m = 0; m < thematicFeature.shapes.length; m++) {
79 this.renderer.addShape(thematicFeature.shapes[m]);
80 }
81
82 return thematicFeature;
83 }
84
85 /**
86 * @private

Callers

nothing calls this directly

Calls 3

getStyleByDataMethod · 0.95
transformStyleMethod · 0.80
addShapeMethod · 0.80

Tested by

no test coverage detected