UNPKG

geospatialdraw

Version:
52 lines 1.68 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var source_1 = require("ol/source"); var MockDrawingContext = /** @class */ (function () { function MockDrawingContext() { var _this = this; this.methodCalls = {}; this.source = null; this.source = new source_1.Vector(); this.methodCalls = {}; var methodList = [ 'addInteractions', 'addInteractionsWithoutModify', 'getStyle', 'remakeInteractions', 'removeFeature', 'removeInteractions', 'removeListeners', 'setDrawInteraction', 'setEvent', 'setModifyInteraction', 'updateBufferFeature', 'updateFeature', ]; methodList.forEach(function (functionName) { _this.methodCalls[functionName] = []; // @ts-ignore _this[functionName] = function () { this.methodCalls[functionName].push(arguments); }; }); // @ts-ignore var callCounter = this.getStyle.bind(this); // @ts-ignore this.getStyle = function () { callCounter(); return []; }; } MockDrawingContext.prototype.getSource = function () { return this.source; }; MockDrawingContext.prototype.getMethodCalls = function () { return this.methodCalls; }; MockDrawingContext.prototype.circleRadiusToMeters = function (radius) { return radius; }; return MockDrawingContext; }()); exports.default = MockDrawingContext; //# sourceMappingURL=mock-drawing-context.js.map