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

Method setStyle

src/openlayers/overlay/Graphic.js:428–444  ·  view source on GitHub ↗

* @function Graphic.prototype.setStyle * @description 设置图层要素整体样式(接口仅在 webgl 渲染时有用)。 * @param {Object} styleOptions - 样式对象。 * @param {Array. } [styleOptions.color=[0, 0, 0, 255]] - 点颜色。 * @param {number} [styleOptions.radius=10] - 点半径,单位为像素。 * @param {number} [sty

(styleOptions)

Source from the content-addressed store, hash-verified

426 * @param {boolean} [styleOptions.outline=false] - 是否显示边框。
427 */
428 setStyle(styleOptions) {
429 let self = this;
430 let styleOpt = {
431 color: self.color,
432 radius: self.radius,
433 opacity: self.opacity,
434 highlightColor: self.highlightColor,
435 radiusScale: self.radiusScale,
436 radiusMinPixels: self.radiusMinPixels,
437 radiusMaxPixels: self.radiusMaxPixels,
438 strokeWidth: self.strokeWidth,
439 outline: self.outline
440 };
441
442 CommonUtil.extend(self, CommonUtil.extend(styleOpt, styleOptions));
443 self.update();
444 }
445
446 /**
447 * @function Graphic.prototype.getLayerState

Callers 1

_highLightMethod · 0.45

Calls 2

extendMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected