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

Method drawCircle

src/openlayers/overlay/HeatMap.js:277–293  ·  view source on GitHub ↗

* @function HeatMap.drawCircle * @description 绘制热点半径圆。 * @param {number} r - 热点半径。 * @private

(r)

Source from the content-addressed store, hash-verified

275 * @private
276 */
277 drawCircle(r) {
278 var blur = r / 2;
279
280 var circle = this.circle = document.createElement('canvas'),
281 ctx = circle.getContext("2d");
282
283 circle.height = 2 * r;
284 circle.width = 2 * r;
285 ctx.shadowOffsetX = ctx.shadowOffsetY = 2 * r;
286 ctx.shadowBlur = blur;
287 ctx.shadowColor = "#000000";
288
289 ctx.beginPath();
290 ctx.arc(-r, -r, r / 2, 0, Math.PI * 2, true);
291 ctx.closePath();
292 ctx.fill();
293 }
294
295 /**
296 * @function HeatMap.createGradient

Callers 3

drawMethod · 0.95
HeatMapLayer.jsFile · 0.45
ol.jsFile · 0.45

Calls 3

createElementMethod · 0.80
arcMethod · 0.80
getContextMethod · 0.45

Tested by

no test coverage detected