Move olx.render.State to ol/render
This commit is contained in:
@@ -4,49 +4,3 @@
|
|||||||
*/
|
*/
|
||||||
let olx;
|
let olx;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {{context: CanvasRenderingContext2D,
|
|
||||||
* feature: (module:ol/Feature~Feature|ol.render.Feature),
|
|
||||||
* geometry: module:ol/geom/SimpleGeometry~SimpleGeometry,
|
|
||||||
* pixelRatio: number,
|
|
||||||
* resolution: number,
|
|
||||||
* rotation: number}}
|
|
||||||
*/
|
|
||||||
olx.render.State;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Canvas context that the layer is being rendered to.
|
|
||||||
* @type {CanvasRenderingContext2D}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.render.State.prototype.context;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Pixel ratio used by the layer renderer.
|
|
||||||
* @type {number}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.render.State.prototype.pixelRatio;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Resolution that the render batch was created and optimized for. This is
|
|
||||||
* not the view's resolution that is being rendered.
|
|
||||||
* @type {number}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.render.State.prototype.resolution;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Rotation of the rendered layer in radians.
|
|
||||||
* @type {number}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.render.State.prototype.rotation;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@@ -6,6 +6,18 @@ import {create as createTransform, scale as scaleTransform} from './transform.js
|
|||||||
import CanvasImmediateRenderer from './render/canvas/Immediate.js';
|
import CanvasImmediateRenderer from './render/canvas/Immediate.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} State
|
||||||
|
* @property {CanvasRenderingContext2D} context Canvas context that the layer is being rendered to.
|
||||||
|
* @property {module:ol/Feature~Feature|module:ol/render/Feature~Feature} feature
|
||||||
|
* @property {module:ol/geom/SimpleGeometry~SimpleGeometry} geometry
|
||||||
|
* @property {number} pixelRatio Pixel ratio used by the layer renderer.
|
||||||
|
* @property {number} resolution Resolution that the render batch was created and optimized for.
|
||||||
|
* This is not the view's resolution that is being rendered.
|
||||||
|
* @property {number} rotation Rotation of the rendered layer in radians.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function to be used when sorting features before rendering.
|
* A function to be used when sorting features before rendering.
|
||||||
* It takes two instances of {@link module:ol/Feature} or
|
* It takes two instances of {@link module:ol/Feature} or
|
||||||
|
|||||||
@@ -565,7 +565,7 @@ CanvasReplay.prototype.replay_ = function(
|
|||||||
const coordinateCache = this.coordinateCache_;
|
const coordinateCache = this.coordinateCache_;
|
||||||
const viewRotation = this.viewRotation_;
|
const viewRotation = this.viewRotation_;
|
||||||
|
|
||||||
const state = /** @type {olx.render.State} */ ({
|
const state = /** @type {module:ol/render~State} */ ({
|
||||||
context: context,
|
context: context,
|
||||||
pixelRatio: this.pixelRatio,
|
pixelRatio: this.pixelRatio,
|
||||||
resolution: this.resolution,
|
resolution: this.resolution,
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ import Stroke from '../style/Stroke.js';
|
|||||||
* Custom renderer function. Takes two arguments:
|
* Custom renderer function. Takes two arguments:
|
||||||
*
|
*
|
||||||
* 1. The pixel coordinates of the geometry in GeoJSON notation.
|
* 1. The pixel coordinates of the geometry in GeoJSON notation.
|
||||||
* 2. The {@link olx.render.State} of the layer renderer.
|
* 2. The {@link module:ol/render~State} of the layer renderer.
|
||||||
*
|
*
|
||||||
* @typedef {function((module:ol/coordinate~Coordinate|Array<module:ol/coordinate~Coordinate>|Array.<Array.<module:ol/coordinate~Coordinate>>),olx.render.State)}
|
* @typedef {function((module:ol/coordinate~Coordinate|Array<module:ol/coordinate~Coordinate>|Array.<Array.<module:ol/coordinate~Coordinate>>),module:ol/render~State)}
|
||||||
* RenderFunction
|
* RenderFunction
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user