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

Method setStyle

src/openlayers/overlay/graphic/Graphic.js:114–124  ·  view source on GitHub ↗

* @function OverlayGraphic.prototype.setStyle * @description 设置要素样式。 * @param {ol.style.Image} style - 样式,ol.style.Image 子类样式对象。

(style)

Source from the content-addressed store, hash-verified

112 * @param {ol.style.Image} style - 样式,ol.style.Image 子类样式对象。
113 */
114 setStyle(style) {
115 if (!this.style && !style) {
116 return;
117 }
118 this.style_ = style;
119 this.styleFunction_ = !style ?
120 undefined : Graphic.createStyleFunction(new Style({
121 image: style
122 }));
123 this.changed();
124 }
125
126 /**
127 * @function OverlayGraphic.prototype.getStyleFunction

Callers 3

constructorMethod · 0.95
cloneMethod · 0.95
drawGraphicsMethod · 0.45

Calls 1

createStyleFunctionMethod · 0.80

Tested by

no test coverage detected