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

Method _getDefaultStyle

src/openlayers/overlay/Graphic.js:391–408  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

389 }
390
391 _getDefaultStyle() {
392 const target = {};
393 if (this.color) {
394 target.fill = new FillStyle({
395 color: this.toRGBA(this.color)
396 });
397 }
398 if (this.radius) {
399 target.radius = this.radius;
400 }
401 if (this.outline) {
402 target.stroke = new FillStyle({
403 color: this.toRGBA(this.color),
404 width: this.strokeWidth
405 });
406 }
407 return new CircleStyle(target);
408 }
409
410 toRGBA(colorArray) {
411 return `rgba(${colorArray[0]},${colorArray[1]},${colorArray[2]},${(colorArray[3] || 255) / 255})`;

Callers 3

updateMethod · 0.95
GraphicLayer.jsFile · 0.80
drawGraphicsMethod · 0.80

Calls 1

toRGBAMethod · 0.95

Tested by

no test coverage detected