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

Method _buildPathMethod

src/common/overlay/levelRenderer/Area.js:390–396  ·  view source on GitHub ↗

* @function LevelRenderer.Tool.Areal.prototype._buildPathMethod * @description 包含判断。通过buildPath方法来判断,三个方法中较快,但是不支持线条类型的 shape。 * @param {Object} shape - 图形。 * @param {Object} context - 上下文。 * @param {number} area - 目标区域。 * @param {number} x - 横坐标。 * @param {number} y -

(shape, context, area, x, y)

Source from the content-addressed store, hash-verified

388 * @returns {boolean} 图形是否包含鼠标位置,true表示坐标处在图形中。
389 */
390 _buildPathMethod(shape, context, area, x, y) {
391 // 图形类实现路径创建了则用类的path
392 context.beginPath();
393 shape.buildPath(context, area);
394 context.closePath();
395 return context.isPointInPath(x, y);
396 }
397
398 /**
399 * @function LevelRenderer.Tool.Areal.prototype.isOutside

Callers 1

isInsideMethod · 0.95

Calls 1

buildPathMethod · 0.45

Tested by

no test coverage detected