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

Method handleSvgColor

src/common/mapping/WebMapV2Base.js:868–885  ·  view source on GitHub ↗
(style, canvas)

Source from the content-addressed store, hash-verified

866 }
867
868 handleSvgColor(style, canvas) {
869 const { fillColor, fillOpacity, strokeColor, strokeOpacity, strokeWidth } = style;
870 const context = canvas.getContext('2d');
871 if (style.text) {
872 this._drawTextWithCanvas({ context, canvas, style });
873 return;
874 }
875 if (fillColor) {
876 context.fillStyle = ColorsPickerUtil.getColorWithOpacity(fillColor, fillOpacity);
877 context.fill();
878 }
879
880 if (strokeColor || strokeWidth) {
881 context.strokeStyle = ColorsPickerUtil.getColorWithOpacity(strokeColor, strokeOpacity);
882 context.lineWidth = strokeWidth;
883 context.stroke();
884 }
885 }
886
887 _createPointsData(lineData, layerInfo, properties) {
888 let data = [];

Callers 2

loadImagePromiseMethod · 0.80

Calls 3

_drawTextWithCanvasMethod · 0.95
getColorWithOpacityMethod · 0.80
getContextMethod · 0.45

Tested by

no test coverage detected