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

Function createCircle

libs/mapv/mapv.js:1031–1049  ·  view source on GitHub ↗

* @author kyle / http://nikai.us/

(size)

Source from the content-addressed store, hash-verified

1029 */
1030
1031function createCircle(size) {
1032
1033 var shadowBlur = size / 2;
1034 var r2 = size + shadowBlur;
1035 var offsetDistance = 10000;
1036
1037 var circle = new Canvas(r2 * 2, r2 * 2);
1038 var context = circle.getContext('2d');
1039
1040 context.shadowBlur = shadowBlur;
1041 context.shadowColor = 'black';
1042 context.shadowOffsetX = context.shadowOffsetY = offsetDistance;
1043
1044 context.beginPath();
1045 context.arc(r2 - offsetDistance, r2 - offsetDistance, size, 0, Math.PI * 2, true);
1046 context.closePath();
1047 context.fill();
1048 return circle;
1049}
1050
1051function colorize(pixels, gradient, options) {
1052 var max = getMax(options);

Callers 1

drawGrayFunction · 0.85

Calls 2

arcMethod · 0.80
getContextMethod · 0.45

Tested by

no test coverage detected