UNPKG

ol

Version:

OpenLayers mapping library

230 lines • 8.6 kB
export default Executor; export type SerializableInstructions = { /** * The rendering instructions. */ instructions: any[]; /** * The rendering hit detection instructions. */ hitDetectionInstructions: any[]; /** * The array of all coordinates. */ coordinates: number[]; /** * The text states (decluttering). */ textStates: { [x: string]: import("../canvas.js").TextState; }; /** * The fill states (decluttering). */ fillStates: { [x: string]: import("../canvas.js").FillState; }; /** * The stroke states (decluttering). */ strokeStates: { [x: string]: import("../canvas.js").StrokeState; }; }; declare class Executor { /** * @param {number} resolution Resolution. * @param {number} pixelRatio Pixel ratio. * @param {boolean} overlaps The replay can have overlapping geometries. * @param {SerializableInstructions} instructions The serializable instructions */ constructor(resolution: number, pixelRatio: number, overlaps: boolean, instructions: SerializableInstructions); /** * @protected * @type {boolean} */ protected overlaps: boolean; /** * @protected * @type {number} */ protected pixelRatio: number; /** * @protected * @const * @type {number} */ protected resolution: number; /** * @private * @type {boolean} */ private alignFill_; /** * @type {Array<*>} */ declutterItems: Array<any>; /** * @protected * @type {Array<*>} */ protected instructions: Array<any>; /** * @protected * @type {Array<number>} */ protected coordinates: Array<number>; /** * @private * @type {!Object<number,import("../../coordinate.js").Coordinate|Array<import("../../coordinate.js").Coordinate>|Array<Array<import("../../coordinate.js").Coordinate>>>} */ private coordinateCache_; /** * @private * @type {!import("../../transform.js").Transform} */ private renderedTransform_; /** * @protected * @type {Array<*>} */ protected hitDetectionInstructions: Array<any>; /** * @private * @type {Array<number>} */ private pixelCoordinates_; /** * @private * @type {number} */ private viewRotation_; /** * @type {!Object<string, import("../canvas.js").FillState>} */ fillStates: { [x: string]: import("../canvas.js").FillState; }; /** * @type {!Object<string, import("../canvas.js").StrokeState>} */ strokeStates: { [x: string]: import("../canvas.js").StrokeState; }; /** * @type {!Object<string, import("../canvas.js").TextState>} */ textStates: { [x: string]: import("../canvas.js").TextState; }; /** * @private * @type {Object<string, Object<string, number>>} */ private widths_; /** * @private * @type {Object<string, import("../canvas.js").Label>} */ private labels_; /** * @param {string} text Text. * @param {string} textKey Text style key. * @param {string} fillKey Fill style key. * @param {string} strokeKey Stroke style key. * @return {import("../canvas.js").Label} Label. */ createLabel(text: string, textKey: string, fillKey: string, strokeKey: string): import("../canvas.js").Label; /** * @param {CanvasRenderingContext2D} context Context. * @param {import("../../coordinate.js").Coordinate} p1 1st point of the background box. * @param {import("../../coordinate.js").Coordinate} p2 2nd point of the background box. * @param {import("../../coordinate.js").Coordinate} p3 3rd point of the background box. * @param {import("../../coordinate.js").Coordinate} p4 4th point of the background box. * @param {Array<*>} fillInstruction Fill instruction. * @param {Array<*>} strokeInstruction Stroke instruction. */ replayTextBackground_(context: CanvasRenderingContext2D, p1: number[], p2: number[], p3: number[], p4: number[], fillInstruction: any[], strokeInstruction: any[]): void; /** * @param {CanvasRenderingContext2D} context Context. * @param {number} x X. * @param {number} y Y. * @param {import("../canvas.js").Label|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} imageOrLabel Image. * @param {number} anchorX Anchor X. * @param {number} anchorY Anchor Y. * @param {import("../canvas.js").DeclutterGroup} declutterGroup Declutter group. * @param {number} height Height. * @param {number} opacity Opacity. * @param {number} originX Origin X. * @param {number} originY Origin Y. * @param {number} rotation Rotation. * @param {number} scale Scale. * @param {boolean} snapToPixel Snap to pixel. * @param {number} width Width. * @param {Array<number>} padding Padding. * @param {Array<*>} fillInstruction Fill instruction. * @param {Array<*>} strokeInstruction Stroke instruction. */ replayImageOrLabel_(context: CanvasRenderingContext2D, x: number, y: number, imageOrLabel: HTMLCanvasElement | HTMLImageElement | HTMLVideoElement | import("../canvas.js").Label, anchorX: number, anchorY: number, declutterGroup: any[], height: number, opacity: number, originX: number, originY: number, rotation: number, scale: number, snapToPixel: boolean, width: number, padding: number[], fillInstruction: any[], strokeInstruction: any[]): void; /** * @private * @param {CanvasRenderingContext2D} context Context. */ private fill_; /** * @private * @param {CanvasRenderingContext2D} context Context. * @param {Array<*>} instruction Instruction. */ private setStrokeStyle_; /** * @param {import("../canvas.js").DeclutterGroup} declutterGroup Declutter group. * @param {import("../../Feature.js").FeatureLike} feature Feature. * @param {number} opacity Layer opacity. * @param {?} declutterTree Declutter tree. * @return {?} Declutter tree. */ renderDeclutter(declutterGroup: any[], feature: import("../Feature.js").default | import("../../Feature.js").default<any>, opacity: number, declutterTree: any): any; /** * @private * @param {string} text The text to draw. * @param {string} textKey The key of the text state. * @param {string} strokeKey The key for the stroke state. * @param {string} fillKey The key for the fill state. * @return {{label: import("../canvas.js").Label, anchorX: number, anchorY: number}} The text image and its anchor. */ private drawLabelWithPointPlacement_; /** * @private * @param {CanvasRenderingContext2D} context Context. * @param {import("../../transform.js").Transform} transform Transform. * @param {Array<*>} instructions Instructions array. * @param {boolean} snapToPixel Snap point symbols and text to integer pixels. * @param {function(import("../../Feature.js").FeatureLike): T|undefined} featureCallback Feature callback. * @param {import("../../extent.js").Extent=} opt_hitExtent Only check features that intersect this * extent. * @return {T|undefined} Callback result. * @template T */ private execute_; /** * @param {CanvasRenderingContext2D} context Context. * @param {import("../../transform.js").Transform} transform Transform. * @param {number} viewRotation View rotation. * @param {boolean} snapToPixel Snap point symbols and text to integer pixels. */ execute(context: CanvasRenderingContext2D, transform: number[], viewRotation: number, snapToPixel: boolean): void; /** * @param {CanvasRenderingContext2D} context Context. * @param {import("../../transform.js").Transform} transform Transform. * @param {number} viewRotation View rotation. * @param {function(import("../../Feature.js").FeatureLike): T=} opt_featureCallback * Feature callback. * @param {import("../../extent.js").Extent=} opt_hitExtent Only check features that intersect this * extent. * @return {T|undefined} Callback result. * @template T */ executeHitDetection<T>(context: CanvasRenderingContext2D, transform: number[], viewRotation: number, opt_featureCallback?: (arg0: import("../Feature.js").default | import("../../Feature.js").default<any>) => T, opt_hitExtent?: number[]): T; } //# sourceMappingURL=Executor.d.ts.map