Rename ExecutorGroup and move getMaxExtent to Executor
This commit is contained in:
committed by
Guillaume Beraudo
parent
f9dcadb982
commit
94bf02176e
+12
-22
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @module ol/render/canvas/InstructionsGroupExecutor
|
* @module ol/render/canvas/ExecutorGroup
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {numberSafeCompareFunction} from '../../array.js';
|
import {numberSafeCompareFunction} from '../../array.js';
|
||||||
@@ -7,14 +7,14 @@ import {createCanvasContext2D} from '../../dom.js';
|
|||||||
import {buffer, createEmpty, extendCoordinate} from '../../extent.js';
|
import {buffer, createEmpty, extendCoordinate} from '../../extent.js';
|
||||||
import {transform2D} from '../../geom/flat/transform.js';
|
import {transform2D} from '../../geom/flat/transform.js';
|
||||||
import {isEmpty} from '../../obj.js';
|
import {isEmpty} from '../../obj.js';
|
||||||
import ExecutorGroup from '../ExecutorGroup.js';
|
import BaseExecutorGroup from '../ExecutorGroup.js';
|
||||||
import ReplayType from '../ReplayType.js';
|
import ReplayType from '../ReplayType.js';
|
||||||
import {ORDER} from '../replay.js';
|
import {ORDER} from '../replay.js';
|
||||||
import {create as createTransform, compose as composeTransform} from '../../transform.js';
|
import {create as createTransform, compose as composeTransform} from '../../transform.js';
|
||||||
import CanvasInstructionsExecutor from './InstructionsExecutor.js';
|
import CanvasInstructionsExecutor from './InstructionsExecutor.js';
|
||||||
|
|
||||||
|
|
||||||
class InstructionsGroupExectuor extends ExecutorGroup {
|
class ExecutorGroup extends BaseExecutorGroup {
|
||||||
/**
|
/**
|
||||||
* @param {number} tolerance Tolerance.
|
* @param {number} tolerance Tolerance.
|
||||||
* @param {import("../../extent.js").Extent} maxExtent Max extent.
|
* @param {import("../../extent.js").Extent} maxExtent Max extent.
|
||||||
@@ -85,7 +85,7 @@ class InstructionsGroupExectuor extends ExecutorGroup {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {!Object<string, !Object<ReplayType, CanvasReplay>>}
|
* @type {!Object<string, !Object<ReplayType, import("./InstructionsExecutor").default>>}
|
||||||
*/
|
*/
|
||||||
this.executorsByZIndex_ = {};
|
this.executorsByZIndex_ = {};
|
||||||
|
|
||||||
@@ -102,23 +102,6 @@ class InstructionsGroupExectuor extends ExecutorGroup {
|
|||||||
this.hitDetectionTransform_ = createTransform();
|
this.hitDetectionTransform_ = createTransform();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
addDeclutter(group) {
|
|
||||||
let declutter = null;
|
|
||||||
if (this.declutterTree_) {
|
|
||||||
if (group) {
|
|
||||||
declutter = this.declutterGroup_;
|
|
||||||
/** @type {number} */ (declutter[4])++;
|
|
||||||
} else {
|
|
||||||
declutter = this.declutterGroup_ = createEmpty();
|
|
||||||
declutter.push(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return declutter;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {CanvasRenderingContext2D} context Context.
|
* @param {CanvasRenderingContext2D} context Context.
|
||||||
* @param {import("../../transform.js").Transform} transform Transform.
|
* @param {import("../../transform.js").Transform} transform Transform.
|
||||||
@@ -299,6 +282,13 @@ class InstructionsGroupExectuor extends ExecutorGroup {
|
|||||||
return flatClipCoords;
|
return flatClipCoords;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {import("../../extent.js").Extent} The extent of the replay group.
|
||||||
|
*/
|
||||||
|
getMaxExtent() {
|
||||||
|
return this.maxExtent_;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
@@ -488,4 +478,4 @@ export function replayDeclutter(declutterReplays, context, rotation, snapToPixel
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export default InstructionsGroupExectuor;
|
export default ExecutorGroup;
|
||||||
@@ -299,13 +299,6 @@ class CanvasBuilderGroup extends BuilderGroup {
|
|||||||
return flatClipCoords;
|
return flatClipCoords;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return {import("../../extent.js").Extent} The extent of the replay group.
|
|
||||||
*/
|
|
||||||
getMaxExtent() {
|
|
||||||
return this.maxExtent_;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {buffer, createEmpty, containsExtent, getWidth} from '../../extent.js';
|
|||||||
import RenderEventType from '../../render/EventType.js';
|
import RenderEventType from '../../render/EventType.js';
|
||||||
import {labelCache, rotateAtOffset} from '../../render/canvas.js';
|
import {labelCache, rotateAtOffset} from '../../render/canvas.js';
|
||||||
import CanvasBuilderGroup from '../../render/canvas/InstructionsGroupBuilder.js';
|
import CanvasBuilderGroup from '../../render/canvas/InstructionsGroupBuilder.js';
|
||||||
import InstructionsGroupExecutor from '../../render/canvas/InstructionsGroupExecutor.js';
|
import InstructionsGroupExecutor from '../../render/canvas/ExecutorGroup.js';
|
||||||
import CanvasLayerRenderer from './Layer.js';
|
import CanvasLayerRenderer from './Layer.js';
|
||||||
import {defaultOrder as defaultRenderOrder, getTolerance as getRenderTolerance, getSquaredTolerance as getSquaredRenderTolerance, renderFeature} from '../vector.js';
|
import {defaultOrder as defaultRenderOrder, getTolerance as getRenderTolerance, getSquaredTolerance as getSquaredRenderTolerance, renderFeature} from '../vector.js';
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ class CanvasVectorLayerRenderer extends CanvasLayerRenderer {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @type {import("../../render/canvas/InstructionsGroupExecutor").default}
|
* @type {import("../../render/canvas/ExecutorGroup").default}
|
||||||
*/
|
*/
|
||||||
this.replayGroup_ = null;
|
this.replayGroup_ = null;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {
|
|||||||
scale as scaleTransform,
|
scale as scaleTransform,
|
||||||
translate as translateTransform
|
translate as translateTransform
|
||||||
} from '../../transform.js';
|
} from '../../transform.js';
|
||||||
import CanvasGroupExecutor from '../../render/canvas/InstructionsGroupExecutor.js';
|
import CanvasGroupExecutor from '../../render/canvas/ExecutorGroup.js';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import CanvasLineStringBuilder from '../../../../../src/ol/render/canvas/LineStr
|
|||||||
import CanvasPolygonBuilder from '../../../../../src/ol/render/canvas/PolygonBuilder.js';
|
import CanvasPolygonBuilder from '../../../../../src/ol/render/canvas/PolygonBuilder.js';
|
||||||
import CanvasReplay from '../../../../../src/ol/render/canvas/InstructionsBuilder.js';
|
import CanvasReplay from '../../../../../src/ol/render/canvas/InstructionsBuilder.js';
|
||||||
import CanvasInstructionsGroupBuilder from '../../../../../src/ol/render/canvas/InstructionsGroupBuilder.js';
|
import CanvasInstructionsGroupBuilder from '../../../../../src/ol/render/canvas/InstructionsGroupBuilder.js';
|
||||||
import CanvasInstructionsGroupExecutor from '../../../../../src/ol/render/canvas/InstructionsGroupExecutor.js';
|
import CanvasInstructionsGroupExecutor from '../../../../../src/ol/render/canvas/ExecutorGroup.js';
|
||||||
import {renderFeature} from '../../../../../src/ol/renderer/vector.js';
|
import {renderFeature} from '../../../../../src/ol/renderer/vector.js';
|
||||||
import Fill from '../../../../../src/ol/style/Fill.js';
|
import Fill from '../../../../../src/ol/style/Fill.js';
|
||||||
import Stroke from '../../../../../src/ol/style/Stroke.js';
|
import Stroke from '../../../../../src/ol/style/Stroke.js';
|
||||||
|
|||||||
Reference in New Issue
Block a user