Transformed types
Using the [ts.js codemod](https://gist.github.com/tschaub/1ea498c9d1e5268cf36d212b3949be4e): jscodeshift --transform ts.js src
This commit is contained in:
@@ -13,7 +13,7 @@ class RenderBox extends Disposable {
|
||||
super();
|
||||
|
||||
/**
|
||||
* @type {module:ol/geom/Polygon}
|
||||
* @type {import("../geom/Polygon.js").default}
|
||||
* @private
|
||||
*/
|
||||
this.geometry_ = null;
|
||||
@@ -28,19 +28,19 @@ class RenderBox extends Disposable {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/PluggableMap}
|
||||
* @type {import("../PluggableMap.js").default}
|
||||
*/
|
||||
this.map_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/pixel~Pixel}
|
||||
* @type {import("../pixel.js").Pixel}
|
||||
*/
|
||||
this.startPixel_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/pixel~Pixel}
|
||||
* @type {import("../pixel.js").Pixel}
|
||||
*/
|
||||
this.endPixel_ = null;
|
||||
|
||||
@@ -68,7 +68,7 @@ class RenderBox extends Disposable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/PluggableMap} map Map.
|
||||
* @param {import("../PluggableMap.js").default} map Map.
|
||||
*/
|
||||
setMap(map) {
|
||||
if (this.map_) {
|
||||
@@ -83,8 +83,8 @@ class RenderBox extends Disposable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/pixel~Pixel} startPixel Start pixel.
|
||||
* @param {module:ol/pixel~Pixel} endPixel End pixel.
|
||||
* @param {import("../pixel.js").Pixel} startPixel Start pixel.
|
||||
* @param {import("../pixel.js").Pixel} endPixel End pixel.
|
||||
*/
|
||||
setPixels(startPixel, endPixel) {
|
||||
this.startPixel_ = startPixel;
|
||||
@@ -116,7 +116,7 @@ class RenderBox extends Disposable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {module:ol/geom/Polygon} Geometry.
|
||||
* @return {import("../geom/Polygon.js").default} Geometry.
|
||||
*/
|
||||
getGeometry() {
|
||||
return this.geometry_;
|
||||
|
||||
@@ -7,11 +7,11 @@ import Event from '../events/Event.js';
|
||||
class RenderEvent extends Event {
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/EventType} type Type.
|
||||
* @param {module:ol/render/VectorContext=} opt_vectorContext Vector context.
|
||||
* @param {module:ol/PluggableMap~FrameState=} opt_frameState Frame state.
|
||||
* @param {import("./EventType.js").default} type Type.
|
||||
* @param {import("./VectorContext.js").default=} opt_vectorContext Vector context.
|
||||
* @param {import("../PluggableMap.js").FrameState=} opt_frameState Frame state.
|
||||
* @param {?CanvasRenderingContext2D=} opt_context Context.
|
||||
* @param {?module:ol/webgl/Context=} opt_glContext WebGL Context.
|
||||
* @param {?import("../webgl/Context.js").default=} opt_glContext WebGL Context.
|
||||
*/
|
||||
constructor(type, opt_vectorContext, opt_frameState, opt_context, opt_glContext) {
|
||||
|
||||
@@ -19,14 +19,14 @@ class RenderEvent extends Event {
|
||||
|
||||
/**
|
||||
* For canvas, this is an instance of {@link module:ol/render/canvas/Immediate}.
|
||||
* @type {module:ol/render/VectorContext|undefined}
|
||||
* @type {import("./VectorContext.js").default|undefined}
|
||||
* @api
|
||||
*/
|
||||
this.vectorContext = opt_vectorContext;
|
||||
|
||||
/**
|
||||
* An object representing the current render frame state.
|
||||
* @type {module:ol/PluggableMap~FrameState|undefined}
|
||||
* @type {import("../PluggableMap.js").FrameState|undefined}
|
||||
* @api
|
||||
*/
|
||||
this.frameState = opt_frameState;
|
||||
@@ -42,7 +42,7 @@ class RenderEvent extends Event {
|
||||
/**
|
||||
* WebGL context. Only available when a WebGL renderer is used, null
|
||||
* otherwise.
|
||||
* @type {module:ol/webgl/Context|null|undefined}
|
||||
* @type {import("../webgl/Context.js").default|null|undefined}
|
||||
* @api
|
||||
*/
|
||||
this.glContext = opt_glContext;
|
||||
|
||||
@@ -14,7 +14,7 @@ import {create as createTransform, compose as composeTransform} from '../transfo
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/transform~Transform}
|
||||
* @type {import("../transform.js").Transform}
|
||||
*/
|
||||
const tmpTransform = createTransform();
|
||||
|
||||
@@ -24,7 +24,7 @@ const tmpTransform = createTransform();
|
||||
* structure, optimized for vector tile rendering and styling. Geometry access
|
||||
* through the API is limited to getting the type and extent of the geometry.
|
||||
*
|
||||
* @param {module:ol/geom/GeometryType} type Geometry type.
|
||||
* @param {import("../geom/GeometryType.js").default} type Geometry type.
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates. These always need
|
||||
* to be right-handed for polygons.
|
||||
* @param {Array<number>|Array<Array<number>>} ends Ends or Endss.
|
||||
@@ -35,7 +35,7 @@ class RenderFeature {
|
||||
constructor(type, flatCoordinates, ends, properties, id) {
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/extent~Extent|undefined}
|
||||
* @type {import("../extent.js").Extent|undefined}
|
||||
*/
|
||||
this.extent_;
|
||||
|
||||
@@ -47,7 +47,7 @@ class RenderFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/geom/GeometryType}
|
||||
* @type {import("../geom/GeometryType.js").default}
|
||||
*/
|
||||
this.type_ = type;
|
||||
|
||||
@@ -95,7 +95,7 @@ class RenderFeature {
|
||||
|
||||
/**
|
||||
* Get the extent of this feature's geometry.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @return {import("../extent.js").Extent} Extent.
|
||||
* @api
|
||||
*/
|
||||
getExtent() {
|
||||
@@ -185,7 +185,7 @@ class RenderFeature {
|
||||
/**
|
||||
* For API compatibility with {@link module:ol/Feature~Feature}, this method is useful when
|
||||
* determining the geometry type in style function (see {@link #getType}).
|
||||
* @return {module:ol/render/Feature} Feature.
|
||||
* @return {import("./Feature.js").default} Feature.
|
||||
* @api
|
||||
*/
|
||||
getGeometry() {
|
||||
@@ -210,7 +210,7 @@ class RenderFeature {
|
||||
|
||||
/**
|
||||
* Get the type of this feature's geometry.
|
||||
* @return {module:ol/geom/GeometryType} Geometry type.
|
||||
* @return {import("../geom/GeometryType.js").default} Geometry type.
|
||||
* @api
|
||||
*/
|
||||
getType() {
|
||||
@@ -221,8 +221,8 @@ class RenderFeature {
|
||||
* Transform geometry coordinates from tile pixel space to projected.
|
||||
* The SRS of the source and destination are expected to be the same.
|
||||
*
|
||||
* @param {module:ol/proj~ProjectionLike} source The current projection
|
||||
* @param {module:ol/proj~ProjectionLike} destination The desired projection.
|
||||
* @param {import("../proj.js").ProjectionLike} source The current projection
|
||||
* @param {import("../proj.js").ProjectionLike} destination The desired projection.
|
||||
*/
|
||||
transform(source, destination) {
|
||||
source = getProjection(source);
|
||||
@@ -257,7 +257,7 @@ RenderFeature.prototype.getFlatCoordinates =
|
||||
|
||||
/**
|
||||
* Get the feature for working with its geometry.
|
||||
* @return {module:ol/render/Feature} Feature.
|
||||
* @return {import("./Feature.js").default} Feature.
|
||||
*/
|
||||
RenderFeature.prototype.getSimplifiedGeometry =
|
||||
RenderFeature.prototype.getGeometry;
|
||||
|
||||
@@ -8,8 +8,8 @@ class ReplayGroup {
|
||||
/**
|
||||
* @abstract
|
||||
* @param {number|undefined} zIndex Z index.
|
||||
* @param {module:ol/render/ReplayType} replayType Replay type.
|
||||
* @return {module:ol/render/VectorContext} Replay.
|
||||
* @param {import("./ReplayType.js").default} replayType Replay type.
|
||||
* @return {import("./VectorContext.js").default} Replay.
|
||||
*/
|
||||
getReplay(zIndex, replayType) {}
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ class VectorContext {
|
||||
/**
|
||||
* Render a geometry with a custom renderer.
|
||||
*
|
||||
* @param {module:ol/geom/SimpleGeometry} geometry Geometry.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../geom/SimpleGeometry.js").default} geometry Geometry.
|
||||
* @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature.
|
||||
* @param {Function} renderer Renderer.
|
||||
*/
|
||||
drawCustom(geometry, feature, renderer) {}
|
||||
@@ -21,92 +21,92 @@ class VectorContext {
|
||||
/**
|
||||
* Render a geometry.
|
||||
*
|
||||
* @param {module:ol/geom/Geometry} geometry The geometry to render.
|
||||
* @param {import("../geom/Geometry.js").default} geometry The geometry to render.
|
||||
*/
|
||||
drawGeometry(geometry) {}
|
||||
|
||||
/**
|
||||
* Set the rendering style.
|
||||
*
|
||||
* @param {module:ol/style/Style} style The rendering style.
|
||||
* @param {import("../style/Style.js").default} style The rendering style.
|
||||
*/
|
||||
setStyle(style) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Circle} circleGeometry Circle geometry.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {import("../geom/Circle.js").default} circleGeometry Circle geometry.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
*/
|
||||
drawCircle(circleGeometry, feature) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {module:ol/style/Style} style Style.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
* @param {import("../style/Style.js").default} style Style.
|
||||
*/
|
||||
drawFeature(feature, style) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/GeometryCollection} geometryCollectionGeometry Geometry collection.
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {import("../geom/GeometryCollection.js").default} geometryCollectionGeometry Geometry collection.
|
||||
* @param {import("../Feature.js").default} feature Feature.
|
||||
*/
|
||||
drawGeometryCollection(geometryCollectionGeometry, feature) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/LineString|module:ol/render/Feature} lineStringGeometry Line string geometry.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../geom/LineString.js").default|import("./Feature.js").default} lineStringGeometry Line string geometry.
|
||||
* @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature.
|
||||
*/
|
||||
drawLineString(lineStringGeometry, feature) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/MultiLineString|module:ol/render/Feature} multiLineStringGeometry MultiLineString geometry.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../geom/MultiLineString.js").default|import("./Feature.js").default} multiLineStringGeometry MultiLineString geometry.
|
||||
* @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature.
|
||||
*/
|
||||
drawMultiLineString(multiLineStringGeometry, feature) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/MultiPoint|module:ol/render/Feature} multiPointGeometry MultiPoint geometry.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../geom/MultiPoint.js").default|import("./Feature.js").default} multiPointGeometry MultiPoint geometry.
|
||||
* @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature.
|
||||
*/
|
||||
drawMultiPoint(multiPointGeometry, feature) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/MultiPolygon} multiPolygonGeometry MultiPolygon geometry.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../geom/MultiPolygon.js").default} multiPolygonGeometry MultiPolygon geometry.
|
||||
* @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature.
|
||||
*/
|
||||
drawMultiPolygon(multiPolygonGeometry, feature) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Point|module:ol/render/Feature} pointGeometry Point geometry.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../geom/Point.js").default|import("./Feature.js").default} pointGeometry Point geometry.
|
||||
* @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature.
|
||||
*/
|
||||
drawPoint(pointGeometry, feature) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Polygon|module:ol/render/Feature} polygonGeometry Polygon geometry.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../geom/Polygon.js").default|import("./Feature.js").default} polygonGeometry Polygon geometry.
|
||||
* @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature.
|
||||
*/
|
||||
drawPolygon(polygonGeometry, feature) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../geom/Geometry.js").default|import("./Feature.js").default} geometry Geometry.
|
||||
* @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature.
|
||||
*/
|
||||
drawText(geometry, feature) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/style/Fill} fillStyle Fill style.
|
||||
* @param {module:ol/style/Stroke} strokeStyle Stroke style.
|
||||
* @param {import("../style/Fill.js").default} fillStyle Fill style.
|
||||
* @param {import("../style/Stroke.js").default} strokeStyle Stroke style.
|
||||
*/
|
||||
setFillStrokeStyle(fillStyle, strokeStyle) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/style/Image} imageStyle Image style.
|
||||
* @param {module:ol/render/canvas~DeclutterGroup=} opt_declutterGroup Declutter.
|
||||
* @param {import("../style/Image.js").default} imageStyle Image style.
|
||||
* @param {import("./canvas.js").DeclutterGroup=} opt_declutterGroup Declutter.
|
||||
*/
|
||||
setImageStyle(imageStyle, opt_declutterGroup) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/style/Text} textStyle Text style.
|
||||
* @param {module:ol/render/canvas~DeclutterGroup=} opt_declutterGroup Declutter.
|
||||
* @param {import("../style/Text.js").default} textStyle Text style.
|
||||
* @param {import("./canvas.js").DeclutterGroup=} opt_declutterGroup Declutter.
|
||||
*/
|
||||
setTextStyle(textStyle, opt_declutterGroup) {}
|
||||
}
|
||||
|
||||
@@ -10,14 +10,14 @@ import {create as createTransform} from '../transform.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} FillState
|
||||
* @property {module:ol/colorlike~ColorLike} fillStyle
|
||||
* @property {import("../colorlike.js").ColorLike} fillStyle
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Object} FillStrokeState
|
||||
* @property {module:ol/colorlike~ColorLike} [currentFillStyle]
|
||||
* @property {module:ol/colorlike~ColorLike} [currentStrokeStyle]
|
||||
* @property {import("../colorlike.js").ColorLike} [currentFillStyle]
|
||||
* @property {import("../colorlike.js").ColorLike} [currentStrokeStyle]
|
||||
* @property {string} [currentLineCap]
|
||||
* @property {Array<number>} currentLineDash
|
||||
* @property {number} [currentLineDashOffset]
|
||||
@@ -25,8 +25,8 @@ import {create as createTransform} from '../transform.js';
|
||||
* @property {number} [currentLineWidth]
|
||||
* @property {number} [currentMiterLimit]
|
||||
* @property {number} [lastStroke]
|
||||
* @property {module:ol/colorlike~ColorLike} [fillStyle]
|
||||
* @property {module:ol/colorlike~ColorLike} [strokeStyle]
|
||||
* @property {import("../colorlike.js").ColorLike} [fillStyle]
|
||||
* @property {import("../colorlike.js").ColorLike} [strokeStyle]
|
||||
* @property {string} [lineCap]
|
||||
* @property {Array<number>} lineDash
|
||||
* @property {number} [lineDashOffset]
|
||||
@@ -44,7 +44,7 @@ import {create as createTransform} from '../transform.js';
|
||||
* @property {string} lineJoin
|
||||
* @property {number} lineWidth
|
||||
* @property {number} miterLimit
|
||||
* @property {module:ol/colorlike~ColorLike} strokeStyle
|
||||
* @property {import("../colorlike.js").ColorLike} strokeStyle
|
||||
*/
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ export const defaultFont = '10px sans-serif';
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {module:ol/color~Color}
|
||||
* @type {import("../color.js").Color}
|
||||
*/
|
||||
export const defaultFillStyle = [0, 0, 0, 1];
|
||||
|
||||
@@ -120,7 +120,7 @@ export const defaultMiterLimit = 10;
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {module:ol/color~Color}
|
||||
* @type {import("../color.js").Color}
|
||||
*/
|
||||
export const defaultStrokeStyle = [0, 0, 0, 1];
|
||||
|
||||
@@ -156,7 +156,7 @@ export const defaultLineWidth = 1;
|
||||
/**
|
||||
* The label cache for text rendering. To change the default cache size of 2048
|
||||
* entries, use {@link module:ol/structs/LRUCache#setSize}.
|
||||
* @type {module:ol/structs/LRUCache<HTMLCanvasElement>}
|
||||
* @type {import("../structs/LRUCache.js").default<HTMLCanvasElement>}
|
||||
* @api
|
||||
*/
|
||||
export const labelCache = new LRUCache();
|
||||
@@ -278,7 +278,7 @@ function getMeasureContext() {
|
||||
|
||||
/**
|
||||
* @param {string} font Font to use for measuring.
|
||||
* @return {module:ol/size~Size} Measurement.
|
||||
* @return {import("../size.js").Size} Measurement.
|
||||
*/
|
||||
export const measureTextHeight = (function() {
|
||||
let span;
|
||||
@@ -337,7 +337,7 @@ export const resetTransform = createTransform();
|
||||
|
||||
/**
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {module:ol/transform~Transform|null} transform Transform.
|
||||
* @param {import("../transform.js").Transform|null} transform Transform.
|
||||
* @param {number} opacity Opacity.
|
||||
* @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} image Image.
|
||||
* @param {number} originX Origin X.
|
||||
|
||||
@@ -7,7 +7,7 @@ import CanvasReplay from '../canvas/Replay.js';
|
||||
class CanvasImageReplay extends CanvasReplay {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Maximum extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Maximum extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {boolean} overlaps The replay can have overlapping geometries.
|
||||
@@ -18,7 +18,7 @@ class CanvasImageReplay extends CanvasReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/render/canvas~DeclutterGroup}
|
||||
* @type {import("../canvas.js").DeclutterGroup}
|
||||
*/
|
||||
this.declutterGroup_ = null;
|
||||
|
||||
@@ -198,7 +198,7 @@ class CanvasImageReplay extends CanvasReplay {
|
||||
const origin = imageStyle.getOrigin();
|
||||
this.anchorX_ = anchor[0];
|
||||
this.anchorY_ = anchor[1];
|
||||
this.declutterGroup_ = /** @type {module:ol/render/canvas~DeclutterGroup} */ (declutterGroup);
|
||||
this.declutterGroup_ = /** @type {import("../canvas.js").DeclutterGroup} */ (declutterGroup);
|
||||
this.hitDetectionImage_ = hitDetectionImage;
|
||||
this.image_ = image;
|
||||
this.height_ = size[1];
|
||||
|
||||
@@ -29,8 +29,8 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
/**
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/transform~Transform} transform Transform.
|
||||
* @param {import("../../extent.js").Extent} extent Extent.
|
||||
* @param {import("../../transform.js").Transform} transform Transform.
|
||||
* @param {number} viewRotation View rotation.
|
||||
*/
|
||||
constructor(context, pixelRatio, extent, transform, viewRotation) {
|
||||
@@ -50,13 +50,13 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../../extent.js").Extent}
|
||||
*/
|
||||
this.extent_ = extent;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/transform~Transform}
|
||||
* @type {import("../../transform.js").Transform}
|
||||
*/
|
||||
this.transform_ = transform;
|
||||
|
||||
@@ -68,31 +68,31 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/render/canvas~FillState}
|
||||
* @type {?import("../canvas.js").FillState}
|
||||
*/
|
||||
this.contextFillState_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/render/canvas~StrokeState}
|
||||
* @type {?import("../canvas.js").StrokeState}
|
||||
*/
|
||||
this.contextStrokeState_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/render/canvas~TextState}
|
||||
* @type {?import("../canvas.js").TextState}
|
||||
*/
|
||||
this.contextTextState_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/render/canvas~FillState}
|
||||
* @type {?import("../canvas.js").FillState}
|
||||
*/
|
||||
this.fillState_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/render/canvas~StrokeState}
|
||||
* @type {?import("../canvas.js").StrokeState}
|
||||
*/
|
||||
this.strokeState_ = null;
|
||||
|
||||
@@ -200,19 +200,19 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/render/canvas~FillState}
|
||||
* @type {?import("../canvas.js").FillState}
|
||||
*/
|
||||
this.textFillState_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/render/canvas~StrokeState}
|
||||
* @type {?import("../canvas.js").StrokeState}
|
||||
*/
|
||||
this.textStrokeState_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/render/canvas~TextState}
|
||||
* @type {?import("../canvas.js").TextState}
|
||||
*/
|
||||
this.textState_ = null;
|
||||
|
||||
@@ -224,7 +224,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/transform~Transform}
|
||||
* @type {import("../../transform.js").Transform}
|
||||
*/
|
||||
this.tmpLocalTransform_ = createTransform();
|
||||
|
||||
@@ -375,7 +375,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
* Render a circle geometry into the canvas. Rendering is immediate and uses
|
||||
* the current fill and stroke styles.
|
||||
*
|
||||
* @param {module:ol/geom/Circle} geometry Circle geometry.
|
||||
* @param {import("../../geom/Circle.js").default} geometry Circle geometry.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -415,7 +415,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
* Set the rendering style. Note that since this is an immediate rendering API,
|
||||
* any `zIndex` on the provided style will be ignored.
|
||||
*
|
||||
* @param {module:ol/style/Style} style The rendering style.
|
||||
* @param {import("../../style/Style.js").default} style The rendering style.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -429,7 +429,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
* Render a geometry into the canvas. Call
|
||||
* {@link module:ol/render/canvas/Immediate#setStyle} first to set the rendering style.
|
||||
*
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry The geometry to render.
|
||||
* @param {import("../../geom/Geometry.js").default|import("../Feature.js").default} geometry The geometry to render.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -437,28 +437,28 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
const type = geometry.getType();
|
||||
switch (type) {
|
||||
case GeometryType.POINT:
|
||||
this.drawPoint(/** @type {module:ol/geom/Point} */ (geometry));
|
||||
this.drawPoint(/** @type {import("../../geom/Point.js").default} */ (geometry));
|
||||
break;
|
||||
case GeometryType.LINE_STRING:
|
||||
this.drawLineString(/** @type {module:ol/geom/LineString} */ (geometry));
|
||||
this.drawLineString(/** @type {import("../../geom/LineString.js").default} */ (geometry));
|
||||
break;
|
||||
case GeometryType.POLYGON:
|
||||
this.drawPolygon(/** @type {module:ol/geom/Polygon} */ (geometry));
|
||||
this.drawPolygon(/** @type {import("../../geom/Polygon.js").default} */ (geometry));
|
||||
break;
|
||||
case GeometryType.MULTI_POINT:
|
||||
this.drawMultiPoint(/** @type {module:ol/geom/MultiPoint} */ (geometry));
|
||||
this.drawMultiPoint(/** @type {import("../../geom/MultiPoint.js").default} */ (geometry));
|
||||
break;
|
||||
case GeometryType.MULTI_LINE_STRING:
|
||||
this.drawMultiLineString(/** @type {module:ol/geom/MultiLineString} */ (geometry));
|
||||
this.drawMultiLineString(/** @type {import("../../geom/MultiLineString.js").default} */ (geometry));
|
||||
break;
|
||||
case GeometryType.MULTI_POLYGON:
|
||||
this.drawMultiPolygon(/** @type {module:ol/geom/MultiPolygon} */ (geometry));
|
||||
this.drawMultiPolygon(/** @type {import("../../geom/MultiPolygon.js").default} */ (geometry));
|
||||
break;
|
||||
case GeometryType.GEOMETRY_COLLECTION:
|
||||
this.drawGeometryCollection(/** @type {module:ol/geom/GeometryCollection} */ (geometry));
|
||||
this.drawGeometryCollection(/** @type {import("../../geom/GeometryCollection.js").default} */ (geometry));
|
||||
break;
|
||||
case GeometryType.CIRCLE:
|
||||
this.drawCircle(/** @type {module:ol/geom/Circle} */ (geometry));
|
||||
this.drawCircle(/** @type {import("../../geom/Circle.js").default} */ (geometry));
|
||||
break;
|
||||
default:
|
||||
}
|
||||
@@ -470,8 +470,8 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
* this method is called. If you need `zIndex` support, you should be using an
|
||||
* {@link module:ol/layer/Vector~VectorLayer} instead.
|
||||
*
|
||||
* @param {module:ol/Feature} feature Feature.
|
||||
* @param {module:ol/style/Style} style Style.
|
||||
* @param {import("../../Feature.js").default} feature Feature.
|
||||
* @param {import("../../style/Style.js").default} style Style.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -488,7 +488,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
* Render a GeometryCollection to the canvas. Rendering is immediate and
|
||||
* uses the current styles appropriate for each geometry in the collection.
|
||||
*
|
||||
* @param {module:ol/geom/GeometryCollection} geometry Geometry collection.
|
||||
* @param {import("../../geom/GeometryCollection.js").default} geometry Geometry collection.
|
||||
* @override
|
||||
*/
|
||||
drawGeometryCollection(geometry) {
|
||||
@@ -502,7 +502,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
* Render a Point geometry into the canvas. Rendering is immediate and uses
|
||||
* the current style.
|
||||
*
|
||||
* @param {module:ol/geom/Point|module:ol/render/Feature} geometry Point geometry.
|
||||
* @param {import("../../geom/Point.js").default|import("../Feature.js").default} geometry Point geometry.
|
||||
* @override
|
||||
*/
|
||||
drawPoint(geometry) {
|
||||
@@ -520,7 +520,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
* Render a MultiPoint geometry into the canvas. Rendering is immediate and
|
||||
* uses the current style.
|
||||
*
|
||||
* @param {module:ol/geom/MultiPoint|module:ol/render/Feature} geometry MultiPoint geometry.
|
||||
* @param {import("../../geom/MultiPoint.js").default|import("../Feature.js").default} geometry MultiPoint geometry.
|
||||
* @override
|
||||
*/
|
||||
drawMultiPoint(geometry) {
|
||||
@@ -538,7 +538,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
* Render a LineString into the canvas. Rendering is immediate and uses
|
||||
* the current style.
|
||||
*
|
||||
* @param {module:ol/geom/LineString|module:ol/render/Feature} geometry LineString geometry.
|
||||
* @param {import("../../geom/LineString.js").default|import("../Feature.js").default} geometry LineString geometry.
|
||||
* @override
|
||||
*/
|
||||
drawLineString(geometry) {
|
||||
@@ -564,7 +564,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
* Render a MultiLineString geometry into the canvas. Rendering is immediate
|
||||
* and uses the current style.
|
||||
*
|
||||
* @param {module:ol/geom/MultiLineString|module:ol/render/Feature} geometry MultiLineString geometry.
|
||||
* @param {import("../../geom/MultiLineString.js").default|import("../Feature.js").default} geometry MultiLineString geometry.
|
||||
* @override
|
||||
*/
|
||||
drawMultiLineString(geometry) {
|
||||
@@ -595,7 +595,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
* Render a Polygon geometry into the canvas. Rendering is immediate and uses
|
||||
* the current style.
|
||||
*
|
||||
* @param {module:ol/geom/Polygon|module:ol/render/Feature} geometry Polygon geometry.
|
||||
* @param {import("../../geom/Polygon.js").default|import("../Feature.js").default} geometry Polygon geometry.
|
||||
* @override
|
||||
*/
|
||||
drawPolygon(geometry) {
|
||||
@@ -629,7 +629,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
/**
|
||||
* Render MultiPolygon geometry into the canvas. Rendering is immediate and
|
||||
* uses the current style.
|
||||
* @param {module:ol/geom/MultiPolygon} geometry MultiPolygon geometry.
|
||||
* @param {import("../../geom/MultiPolygon.js").default} geometry MultiPolygon geometry.
|
||||
* @override
|
||||
*/
|
||||
drawMultiPolygon(geometry) {
|
||||
@@ -667,7 +667,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/canvas~FillState} fillState Fill state.
|
||||
* @param {import("../canvas.js").FillState} fillState Fill state.
|
||||
* @private
|
||||
*/
|
||||
setContextFillState_(fillState) {
|
||||
@@ -686,7 +686,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/canvas~StrokeState} strokeState Stroke state.
|
||||
* @param {import("../canvas.js").StrokeState} strokeState Stroke state.
|
||||
* @private
|
||||
*/
|
||||
setContextStrokeState_(strokeState) {
|
||||
@@ -742,7 +742,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/canvas~TextState} textState Text state.
|
||||
* @param {import("../canvas.js").TextState} textState Text state.
|
||||
* @private
|
||||
*/
|
||||
setContextTextState_(textState) {
|
||||
@@ -777,8 +777,8 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
* Set the fill and stroke style for subsequent draw operations. To clear
|
||||
* either fill or stroke styles, pass null for the appropriate parameter.
|
||||
*
|
||||
* @param {module:ol/style/Fill} fillStyle Fill style.
|
||||
* @param {module:ol/style/Stroke} strokeStyle Stroke style.
|
||||
* @param {import("../../style/Fill.js").default} fillStyle Fill style.
|
||||
* @param {import("../../style/Stroke.js").default} strokeStyle Stroke style.
|
||||
* @override
|
||||
*/
|
||||
setFillStrokeStyle(fillStyle, strokeStyle) {
|
||||
@@ -824,7 +824,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
* Set the image style for subsequent draw operations. Pass null to remove
|
||||
* the image style.
|
||||
*
|
||||
* @param {module:ol/style/Image} imageStyle Image style.
|
||||
* @param {import("../../style/Image.js").default} imageStyle Image style.
|
||||
* @override
|
||||
*/
|
||||
setImageStyle(imageStyle) {
|
||||
@@ -854,7 +854,7 @@ class CanvasImmediateRenderer extends VectorContext {
|
||||
* Set the text style for subsequent draw operations. Pass null to
|
||||
* remove the text style.
|
||||
*
|
||||
* @param {module:ol/style/Text} textStyle Text style.
|
||||
* @param {import("../../style/Text.js").default} textStyle Text style.
|
||||
* @override
|
||||
*/
|
||||
setTextStyle(textStyle) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import CanvasReplay from '../canvas/Replay.js';
|
||||
class CanvasLineStringReplay extends CanvasReplay {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Maximum extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Maximum extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {boolean} overlaps The replay can have overlapping geometries.
|
||||
|
||||
@@ -13,7 +13,7 @@ import CanvasReplay from '../canvas/Replay.js';
|
||||
class CanvasPolygonReplay extends CanvasReplay {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Maximum extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Maximum extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {boolean} overlaps The replay can have overlapping geometries.
|
||||
@@ -196,7 +196,7 @@ class CanvasPolygonReplay extends CanvasReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
|
||||
* @param {import("../../geom/Geometry.js").default|import("../Feature.js").default} geometry Geometry.
|
||||
*/
|
||||
setFillStrokeStyles_(geometry) {
|
||||
const state = this.state;
|
||||
|
||||
@@ -30,13 +30,13 @@ import {
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../../extent.js").Extent}
|
||||
*/
|
||||
const tmpExtent = createEmpty();
|
||||
|
||||
|
||||
/**
|
||||
* @type {!module:ol/transform~Transform}
|
||||
* @type {!import("../../transform.js").Transform}
|
||||
*/
|
||||
const tmpTransform = createTransform();
|
||||
|
||||
@@ -44,7 +44,7 @@ const tmpTransform = createTransform();
|
||||
class CanvasReplay extends VectorContext {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Maximum extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Maximum extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {boolean} overlaps The replay can have overlapping geometries.
|
||||
@@ -67,7 +67,7 @@ class CanvasReplay extends VectorContext {
|
||||
/**
|
||||
* @protected
|
||||
* @const
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../../extent.js").Extent}
|
||||
*/
|
||||
this.maxExtent = maxExtent;
|
||||
|
||||
@@ -116,7 +116,7 @@ class CanvasReplay extends VectorContext {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../../extent.js").Extent}
|
||||
*/
|
||||
this.bufferedMaxExtent_ = null;
|
||||
|
||||
@@ -134,13 +134,13 @@ class CanvasReplay extends VectorContext {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object<number,module:ol/coordinate~Coordinate|Array<module:ol/coordinate~Coordinate>|Array<Array<module:ol/coordinate~Coordinate>>>}
|
||||
* @type {!Object<number,import("../../coordinate.js").Coordinate|Array<import("../../coordinate.js").Coordinate>|Array<Array<import("../../coordinate.js").Coordinate>>>}
|
||||
*/
|
||||
this.coordinateCache_ = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!module:ol/transform~Transform}
|
||||
* @type {!import("../../transform.js").Transform}
|
||||
*/
|
||||
this.renderedTransform_ = createTransform();
|
||||
|
||||
@@ -158,9 +158,9 @@ class CanvasReplay extends VectorContext {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {module:ol/render/canvas~FillStrokeState}
|
||||
* @type {import("../canvas.js").FillStrokeState}
|
||||
*/
|
||||
this.state = /** @type {module:ol/render/canvas~FillStrokeState} */ ({});
|
||||
this.state = /** @type {import("../canvas.js").FillStrokeState} */ ({});
|
||||
|
||||
/**
|
||||
* @private
|
||||
@@ -172,10 +172,10 @@ class CanvasReplay extends VectorContext {
|
||||
|
||||
/**
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {module:ol/coordinate~Coordinate} p1 1st point of the background box.
|
||||
* @param {module:ol/coordinate~Coordinate} p2 2nd point of the background box.
|
||||
* @param {module:ol/coordinate~Coordinate} p3 3rd point of the background box.
|
||||
* @param {module:ol/coordinate~Coordinate} p4 4th point of the background box.
|
||||
* @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.
|
||||
*/
|
||||
@@ -203,7 +203,7 @@ class CanvasReplay extends VectorContext {
|
||||
* @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} image Image.
|
||||
* @param {number} anchorX Anchor X.
|
||||
* @param {number} anchorY Anchor Y.
|
||||
* @param {module:ol/render/canvas~DeclutterGroup} declutterGroup Declutter group.
|
||||
* @param {import("../canvas.js").DeclutterGroup} declutterGroup Declutter group.
|
||||
* @param {number} height Height.
|
||||
* @param {number} opacity Opacity.
|
||||
* @param {number} originX Origin X.
|
||||
@@ -249,13 +249,13 @@ class CanvasReplay extends VectorContext {
|
||||
const boxX = x - padding[3];
|
||||
const boxY = y - padding[0];
|
||||
|
||||
/** @type {module:ol/coordinate~Coordinate} */
|
||||
/** @type {import("../../coordinate.js").Coordinate} */
|
||||
let p1;
|
||||
/** @type {module:ol/coordinate~Coordinate} */
|
||||
/** @type {import("../../coordinate.js").Coordinate} */
|
||||
let p2;
|
||||
/** @type {module:ol/coordinate~Coordinate} */
|
||||
/** @type {import("../../coordinate.js").Coordinate} */
|
||||
let p3;
|
||||
/** @type {module:ol/coordinate~Coordinate} */
|
||||
/** @type {import("../../coordinate.js").Coordinate} */
|
||||
let p4;
|
||||
if (fillStroke || rotation !== 0) {
|
||||
p1 = [boxX, boxY];
|
||||
@@ -406,7 +406,7 @@ class CanvasReplay extends VectorContext {
|
||||
let flatCoordinates, replayEnd, replayEnds, replayEndss;
|
||||
let offset;
|
||||
if (type == GeometryType.MULTI_POLYGON) {
|
||||
geometry = /** @type {module:ol/geom/MultiPolygon} */ (geometry);
|
||||
geometry = /** @type {import("../../geom/MultiPolygon.js").default} */ (geometry);
|
||||
flatCoordinates = geometry.getOrientedFlatCoordinates();
|
||||
replayEndss = [];
|
||||
const endss = geometry.getEndss();
|
||||
@@ -421,10 +421,10 @@ class CanvasReplay extends VectorContext {
|
||||
} else if (type == GeometryType.POLYGON || type == GeometryType.MULTI_LINE_STRING) {
|
||||
replayEnds = [];
|
||||
flatCoordinates = (type == GeometryType.POLYGON) ?
|
||||
/** @type {module:ol/geom/Polygon} */ (geometry).getOrientedFlatCoordinates() :
|
||||
/** @type {import("../../geom/Polygon.js").default} */ (geometry).getOrientedFlatCoordinates() :
|
||||
geometry.getFlatCoordinates();
|
||||
offset = this.drawCustomCoordinates_(flatCoordinates, 0,
|
||||
/** @type {module:ol/geom/Polygon|module:ol/geom/MultiLineString} */ (geometry).getEnds(),
|
||||
/** @type {import("../../geom/Polygon.js").default|import("../../geom/MultiLineString.js").default} */ (geometry).getEnds(),
|
||||
stride, replayEnds);
|
||||
this.instructions.push([CanvasInstruction.CUSTOM,
|
||||
replayBegin, replayEnds, geometry, renderer, inflateCoordinatesArray]);
|
||||
@@ -446,8 +446,8 @@ class CanvasReplay extends VectorContext {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../../geom/Geometry.js").default|import("../Feature.js").default} geometry Geometry.
|
||||
* @param {import("../../Feature.js").default|import("../Feature.js").default} feature Feature.
|
||||
*/
|
||||
beginGeometry(geometry, feature) {
|
||||
this.beginGeometryInstruction1_ = [CanvasInstruction.BEGIN_GEOMETRY, feature, 0];
|
||||
@@ -479,7 +479,7 @@ class CanvasReplay extends VectorContext {
|
||||
* @param {Array<*>} instruction Instruction.
|
||||
*/
|
||||
setStrokeStyle_(context, instruction) {
|
||||
context.strokeStyle = /** @type {module:ol/colorlike~ColorLike} */ (instruction[1]);
|
||||
context.strokeStyle = /** @type {import("../../colorlike.js").ColorLike} */ (instruction[1]);
|
||||
context.lineWidth = /** @type {number} */ (instruction[2]);
|
||||
context.lineCap = /** @type {string} */ (instruction[3]);
|
||||
context.lineJoin = /** @type {string} */ (instruction[4]);
|
||||
@@ -491,14 +491,14 @@ class CanvasReplay extends VectorContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/canvas~DeclutterGroup} declutterGroup Declutter group.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../canvas.js").DeclutterGroup} declutterGroup Declutter group.
|
||||
* @param {import("../../Feature.js").default|import("../Feature.js").default} feature Feature.
|
||||
*/
|
||||
renderDeclutter_(declutterGroup, feature) {
|
||||
if (declutterGroup && declutterGroup.length > 5) {
|
||||
const groupCount = declutterGroup[4];
|
||||
if (groupCount == 1 || groupCount == declutterGroup.length - 5) {
|
||||
/** @type {module:ol/structs/RBush~Entry} */
|
||||
/** @type {import("../../structs/RBush.js").Entry} */
|
||||
const box = {
|
||||
minX: /** @type {number} */ (declutterGroup[0]),
|
||||
minY: /** @type {number} */ (declutterGroup[1]),
|
||||
@@ -529,13 +529,13 @@ class CanvasReplay extends VectorContext {
|
||||
/**
|
||||
* @private
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {module:ol/transform~Transform} transform Transform.
|
||||
* @param {import("../../transform.js").Transform} transform Transform.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {Array<*>} instructions Instructions array.
|
||||
* @param {boolean} snapToPixel Snap point symbols and text to integer pixels.
|
||||
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Only check features that intersect this
|
||||
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): 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
|
||||
@@ -575,7 +575,7 @@ class CanvasReplay extends VectorContext {
|
||||
const coordinateCache = this.coordinateCache_;
|
||||
const viewRotation = this.viewRotation_;
|
||||
|
||||
const state = /** @type {module:ol/render~State} */ ({
|
||||
const state = /** @type {import("../../render.js").State} */ ({
|
||||
context: context,
|
||||
pixelRatio: this.pixelRatio,
|
||||
resolution: this.resolution,
|
||||
@@ -585,14 +585,14 @@ class CanvasReplay extends VectorContext {
|
||||
// When the batch size gets too big, performance decreases. 200 is a good
|
||||
// balance between batch size and number of fill/stroke instructions.
|
||||
const batchSize = this.instructions != instructions || this.overlaps ? 0 : 200;
|
||||
let /** @type {module:ol/Feature|module:ol/render/Feature} */ feature;
|
||||
let /** @type {import("../../Feature.js").default|import("../Feature.js").default} */ feature;
|
||||
let x, y;
|
||||
while (i < ii) {
|
||||
const instruction = instructions[i];
|
||||
const type = /** @type {module:ol/render/canvas/Instruction} */ (instruction[0]);
|
||||
const type = /** @type {import("./Instruction.js").default} */ (instruction[0]);
|
||||
switch (type) {
|
||||
case CanvasInstruction.BEGIN_GEOMETRY:
|
||||
feature = /** @type {module:ol/Feature|module:ol/render/Feature} */ (instruction[1]);
|
||||
feature = /** @type {import("../../Feature.js").default|import("../Feature.js").default} */ (instruction[1]);
|
||||
if ((skipFeatures &&
|
||||
skippedFeaturesHash[getUid(feature).toString()]) ||
|
||||
!feature.getGeometry()) {
|
||||
@@ -639,7 +639,7 @@ class CanvasReplay extends VectorContext {
|
||||
case CanvasInstruction.CUSTOM:
|
||||
d = /** @type {number} */ (instruction[1]);
|
||||
dd = instruction[2];
|
||||
const geometry = /** @type {module:ol/geom/SimpleGeometry} */ (instruction[3]);
|
||||
const geometry = /** @type {import("../../geom/SimpleGeometry.js").default} */ (instruction[3]);
|
||||
const renderer = instruction[4];
|
||||
const fn = instruction.length == 6 ? instruction[5] : undefined;
|
||||
state.geometry = geometry;
|
||||
@@ -666,7 +666,7 @@ class CanvasReplay extends VectorContext {
|
||||
// Remaining arguments in DRAW_IMAGE are in alphabetical order
|
||||
anchorX = /** @type {number} */ (instruction[4]);
|
||||
anchorY = /** @type {number} */ (instruction[5]);
|
||||
declutterGroup = featureCallback ? null : /** @type {module:ol/render/canvas~DeclutterGroup} */ (instruction[6]);
|
||||
declutterGroup = featureCallback ? null : /** @type {import("../canvas.js").DeclutterGroup} */ (instruction[6]);
|
||||
const height = /** @type {number} */ (instruction[7]);
|
||||
const opacity = /** @type {number} */ (instruction[8]);
|
||||
const originX = /** @type {number} */ (instruction[9]);
|
||||
@@ -704,7 +704,7 @@ class CanvasReplay extends VectorContext {
|
||||
const begin = /** @type {number} */ (instruction[1]);
|
||||
const end = /** @type {number} */ (instruction[2]);
|
||||
const baseline = /** @type {number} */ (instruction[3]);
|
||||
declutterGroup = featureCallback ? null : /** @type {module:ol/render/canvas~DeclutterGroup} */ (instruction[4]);
|
||||
declutterGroup = featureCallback ? null : /** @type {import("../canvas.js").DeclutterGroup} */ (instruction[4]);
|
||||
const overflow = /** @type {number} */ (instruction[5]);
|
||||
const fillKey = /** @type {string} */ (instruction[6]);
|
||||
const maxAngle = /** @type {number} */ (instruction[7]);
|
||||
@@ -760,7 +760,7 @@ class CanvasReplay extends VectorContext {
|
||||
break;
|
||||
case CanvasInstruction.END_GEOMETRY:
|
||||
if (featureCallback !== undefined) {
|
||||
feature = /** @type {module:ol/Feature|module:ol/render/Feature} */ (instruction[1]);
|
||||
feature = /** @type {import("../../Feature.js").default|import("../Feature.js").default} */ (instruction[1]);
|
||||
const result = featureCallback(feature);
|
||||
if (result) {
|
||||
return result;
|
||||
@@ -814,7 +814,7 @@ class CanvasReplay extends VectorContext {
|
||||
}
|
||||
}
|
||||
|
||||
context.fillStyle = /** @type {module:ol/colorlike~ColorLike} */ (instruction[1]);
|
||||
context.fillStyle = /** @type {import("../../colorlike.js").ColorLike} */ (instruction[1]);
|
||||
++i;
|
||||
break;
|
||||
case CanvasInstruction.SET_STROKE_STYLE:
|
||||
@@ -850,7 +850,7 @@ class CanvasReplay extends VectorContext {
|
||||
|
||||
/**
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {module:ol/transform~Transform} transform Transform.
|
||||
* @param {import("../../transform.js").Transform} transform Transform.
|
||||
* @param {number} viewRotation View rotation.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
@@ -864,13 +864,13 @@ class CanvasReplay extends VectorContext {
|
||||
|
||||
/**
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {module:ol/transform~Transform} transform Transform.
|
||||
* @param {import("../../transform.js").Transform} transform Transform.
|
||||
* @param {number} viewRotation View rotation.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {function((module:ol/Feature|module:ol/render/Feature)): T=} opt_featureCallback
|
||||
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T=} opt_featureCallback
|
||||
* Feature callback.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Only check features that intersect this
|
||||
* @param {import("../../extent.js").Extent=} opt_hitExtent Only check features that intersect this
|
||||
* extent.
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template T
|
||||
@@ -903,7 +903,7 @@ class CanvasReplay extends VectorContext {
|
||||
let begin = -1;
|
||||
for (i = 0; i < n; ++i) {
|
||||
instruction = hitDetectionInstructions[i];
|
||||
type = /** @type {module:ol/render/canvas/Instruction} */ (instruction[0]);
|
||||
type = /** @type {import("./Instruction.js").default} */ (instruction[0]);
|
||||
if (type == CanvasInstruction.END_GEOMETRY) {
|
||||
begin = i;
|
||||
} else if (type == CanvasInstruction.BEGIN_GEOMETRY) {
|
||||
@@ -966,8 +966,8 @@ class CanvasReplay extends VectorContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/canvas~FillStrokeState} state State.
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
|
||||
* @param {import("../canvas.js").FillStrokeState} state State.
|
||||
* @param {import("../../geom/Geometry.js").default|import("../Feature.js").default} geometry Geometry.
|
||||
* @return {Array<*>} Fill instruction.
|
||||
*/
|
||||
createFill(state, geometry) {
|
||||
@@ -981,14 +981,14 @@ class CanvasReplay extends VectorContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/canvas~FillStrokeState} state State.
|
||||
* @param {import("../canvas.js").FillStrokeState} state State.
|
||||
*/
|
||||
applyStroke(state) {
|
||||
this.instructions.push(this.createStroke(state));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/canvas~FillStrokeState} state State.
|
||||
* @param {import("../canvas.js").FillStrokeState} state State.
|
||||
* @return {Array<*>} Stroke instruction.
|
||||
*/
|
||||
createStroke(state) {
|
||||
@@ -1001,9 +1001,9 @@ class CanvasReplay extends VectorContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/canvas~FillStrokeState} state State.
|
||||
* @param {function(this:module:ol/render/canvas/Replay, module:ol/render/canvas~FillStrokeState, (module:ol/geom/Geometry|module:ol/render/Feature)):Array<*>} createFill Create fill.
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
|
||||
* @param {import("../canvas.js").FillStrokeState} state State.
|
||||
* @param {function(this:import("./Replay.js").default, import("../canvas.js").FillStrokeState, (import("../../geom/Geometry.js").default|import("../Feature.js").default)):Array<*>} createFill Create fill.
|
||||
* @param {import("../../geom/Geometry.js").default|import("../Feature.js").default} geometry Geometry.
|
||||
*/
|
||||
updateFillStyle(state, createFill, geometry) {
|
||||
const fillStyle = state.fillStyle;
|
||||
@@ -1016,8 +1016,8 @@ class CanvasReplay extends VectorContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/canvas~FillStrokeState} state State.
|
||||
* @param {function(this:module:ol/render/canvas/Replay, module:ol/render/canvas~FillStrokeState)} applyStroke Apply stroke.
|
||||
* @param {import("../canvas.js").FillStrokeState} state State.
|
||||
* @param {function(this:import("./Replay.js").default, import("../canvas.js").FillStrokeState)} applyStroke Apply stroke.
|
||||
*/
|
||||
updateStrokeStyle(state, applyStroke) {
|
||||
const strokeStyle = state.strokeStyle;
|
||||
@@ -1048,8 +1048,8 @@ class CanvasReplay extends VectorContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../../geom/Geometry.js").default|import("../Feature.js").default} geometry Geometry.
|
||||
* @param {import("../../Feature.js").default|import("../Feature.js").default} feature Feature.
|
||||
*/
|
||||
endGeometry(geometry, feature) {
|
||||
this.beginGeometryInstruction1_[2] = this.instructions.length;
|
||||
@@ -1065,7 +1065,7 @@ class CanvasReplay extends VectorContext {
|
||||
* Get the buffered rendering extent. Rendering will be clipped to the extent
|
||||
* provided to the constructor. To account for symbolizers that may intersect
|
||||
* this extent, we calculate a buffered extent (e.g. based on stroke width).
|
||||
* @return {module:ol/extent~Extent} The buffered rendering extent.
|
||||
* @return {import("../../extent.js").Extent} The buffered rendering extent.
|
||||
* @protected
|
||||
*/
|
||||
getBufferedMaxExtent() {
|
||||
|
||||
@@ -19,9 +19,9 @@ import {create as createTransform, compose as composeTransform} from '../../tran
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object<module:ol/render/ReplayType,
|
||||
* function(new: module:ol/render/canvas/Replay, number, module:ol/extent~Extent,
|
||||
* number, number, boolean, Array<module:ol/render/canvas~DeclutterGroup>)>}
|
||||
* @type {Object<import("../ReplayType.js").default,
|
||||
* function(new: import("./Replay.js").default, number, import("../../extent.js").Extent,
|
||||
* number, number, boolean, Array<import("../canvas.js").DeclutterGroup>)>}
|
||||
*/
|
||||
const BATCH_CONSTRUCTORS = {
|
||||
'Circle': CanvasPolygonReplay,
|
||||
@@ -36,7 +36,7 @@ const BATCH_CONSTRUCTORS = {
|
||||
class CanvasReplayGroup extends ReplayGroup {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Max extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Max extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {boolean} overlaps The replay group can have overlapping geometries.
|
||||
@@ -61,7 +61,7 @@ class CanvasReplayGroup extends ReplayGroup {
|
||||
this.declutterTree_ = declutterTree;
|
||||
|
||||
/**
|
||||
* @type {module:ol/render/canvas~DeclutterGroup}
|
||||
* @type {import("../canvas.js").DeclutterGroup}
|
||||
* @private
|
||||
*/
|
||||
this.declutterGroup_ = null;
|
||||
@@ -74,7 +74,7 @@ class CanvasReplayGroup extends ReplayGroup {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../../extent.js").Extent}
|
||||
*/
|
||||
this.maxExtent_ = maxExtent;
|
||||
|
||||
@@ -104,7 +104,7 @@ class CanvasReplayGroup extends ReplayGroup {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object<string, !Object<module:ol/render/ReplayType, module:ol/render/canvas/Replay>>}
|
||||
* @type {!Object<string, !Object<import("../ReplayType.js").default, import("./Replay.js").default>>}
|
||||
*/
|
||||
this.replaysByZIndex_ = {};
|
||||
|
||||
@@ -116,14 +116,14 @@ class CanvasReplayGroup extends ReplayGroup {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/transform~Transform}
|
||||
* @type {import("../../transform.js").Transform}
|
||||
*/
|
||||
this.hitDetectionTransform_ = createTransform();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {boolean} group Group with previous replay.
|
||||
* @return {module:ol/render/canvas~DeclutterGroup} Declutter instruction group.
|
||||
* @return {import("../canvas.js").DeclutterGroup} Declutter instruction group.
|
||||
*/
|
||||
addDeclutter(group) {
|
||||
let declutter = null;
|
||||
@@ -141,7 +141,7 @@ class CanvasReplayGroup extends ReplayGroup {
|
||||
|
||||
/**
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {module:ol/transform~Transform} transform Transform.
|
||||
* @param {import("../../transform.js").Transform} transform Transform.
|
||||
*/
|
||||
clip(context, transform) {
|
||||
const flatClipCoords = this.getClipCoords(transform);
|
||||
@@ -154,7 +154,7 @@ class CanvasReplayGroup extends ReplayGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array<module:ol/render/ReplayType>} replays Replays.
|
||||
* @param {Array<import("../ReplayType.js").default>} replays Replays.
|
||||
* @return {boolean} Has replays of the provided types.
|
||||
*/
|
||||
hasReplays(replays) {
|
||||
@@ -182,13 +182,13 @@ class CanvasReplayGroup extends ReplayGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} rotation Rotation.
|
||||
* @param {number} hitTolerance Hit tolerance in pixels.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
|
||||
* @param {function((module:ol/Feature|module:ol/render/Feature)): T} callback Feature callback.
|
||||
* @param {Object<string, module:ol/render/canvas~DeclutterGroup>} declutterReplays Declutter replays.
|
||||
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T} callback Feature callback.
|
||||
* @param {Object<string, import("../canvas.js").DeclutterGroup>} declutterReplays Declutter replays.
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template T
|
||||
*/
|
||||
@@ -219,7 +219,7 @@ class CanvasReplayGroup extends ReplayGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../../extent.js").Extent}
|
||||
*/
|
||||
let hitExtent;
|
||||
if (this.renderBuffer_ !== undefined) {
|
||||
@@ -239,7 +239,7 @@ class CanvasReplayGroup extends ReplayGroup {
|
||||
let replayType;
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../../Feature.js").default|import("../Feature.js").default} feature Feature.
|
||||
* @return {?} Callback result.
|
||||
*/
|
||||
function featureCallback(feature) {
|
||||
@@ -299,7 +299,7 @@ class CanvasReplayGroup extends ReplayGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/transform~Transform} transform Transform.
|
||||
* @param {import("../../transform.js").Transform} transform Transform.
|
||||
* @return {Array<number>} Clip coordinates.
|
||||
*/
|
||||
getClipCoords(transform) {
|
||||
@@ -335,7 +335,7 @@ class CanvasReplayGroup extends ReplayGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {Object<string, Object<module:ol/render/ReplayType, module:ol/render/canvas/Replay>>} Replays.
|
||||
* @return {Object<string, Object<import("../ReplayType.js").default, import("./Replay.js").default>>} Replays.
|
||||
*/
|
||||
getReplays() {
|
||||
return this.replaysByZIndex_;
|
||||
@@ -350,13 +350,13 @@ class CanvasReplayGroup extends ReplayGroup {
|
||||
|
||||
/**
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {module:ol/transform~Transform} transform Transform.
|
||||
* @param {import("../../transform.js").Transform} transform Transform.
|
||||
* @param {number} viewRotation View rotation.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
|
||||
* @param {boolean} snapToPixel Snap point symbols and test to integer pixel.
|
||||
* @param {Array<module:ol/render/ReplayType>=} opt_replayTypes Ordered replay types to replay.
|
||||
* @param {Array<import("../ReplayType.js").default>=} opt_replayTypes Ordered replay types to replay.
|
||||
* Default is {@link module:ol/render/replay~ORDER}
|
||||
* @param {Object<string, module:ol/render/canvas~DeclutterGroup>=} opt_declutterReplays Declutter replays.
|
||||
* @param {Object<string, import("../canvas.js").DeclutterGroup>=} opt_declutterReplays Declutter replays.
|
||||
*/
|
||||
replay(
|
||||
context,
|
||||
|
||||
@@ -17,7 +17,7 @@ import TextPlacement from '../../style/TextPlacement.js';
|
||||
class CanvasTextReplay extends CanvasReplay {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Maximum extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Maximum extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {boolean} overlaps The replay can have overlapping geometries.
|
||||
@@ -28,7 +28,7 @@ class CanvasTextReplay extends CanvasReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/render/canvas~DeclutterGroup}
|
||||
* @type {import("../canvas.js").DeclutterGroup}
|
||||
*/
|
||||
this.declutterGroup_;
|
||||
|
||||
@@ -70,34 +70,34 @@ class CanvasTextReplay extends CanvasReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/render/canvas~FillState}
|
||||
* @type {?import("../canvas.js").FillState}
|
||||
*/
|
||||
this.textFillState_ = null;
|
||||
|
||||
/**
|
||||
* @type {!Object<string, module:ol/render/canvas~FillState>}
|
||||
* @type {!Object<string, import("../canvas.js").FillState>}
|
||||
*/
|
||||
this.fillStates = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {?module:ol/render/canvas~StrokeState}
|
||||
* @type {?import("../canvas.js").StrokeState}
|
||||
*/
|
||||
this.textStrokeState_ = null;
|
||||
|
||||
/**
|
||||
* @type {!Object<string, module:ol/render/canvas~StrokeState>}
|
||||
* @type {!Object<string, import("../canvas.js").StrokeState>}
|
||||
*/
|
||||
this.strokeStates = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/render/canvas~TextState}
|
||||
* @type {import("../canvas.js").TextState}
|
||||
*/
|
||||
this.textState_ = /** @type {module:ol/render/canvas~TextState} */ ({});
|
||||
this.textState_ = /** @type {import("../canvas.js").TextState} */ ({});
|
||||
|
||||
/**
|
||||
* @type {!Object<string, module:ol/render/canvas~TextState>}
|
||||
* @type {!Object<string, import("../canvas.js").TextState>}
|
||||
*/
|
||||
this.textStates = {};
|
||||
|
||||
@@ -200,24 +200,24 @@ class CanvasTextReplay extends CanvasReplay {
|
||||
end = flatCoordinates.length;
|
||||
break;
|
||||
case GeometryType.LINE_STRING:
|
||||
flatCoordinates = /** @type {module:ol/geom/LineString} */ (geometry).getFlatMidpoint();
|
||||
flatCoordinates = /** @type {import("../../geom/LineString.js").default} */ (geometry).getFlatMidpoint();
|
||||
break;
|
||||
case GeometryType.CIRCLE:
|
||||
flatCoordinates = /** @type {module:ol/geom/Circle} */ (geometry).getCenter();
|
||||
flatCoordinates = /** @type {import("../../geom/Circle.js").default} */ (geometry).getCenter();
|
||||
break;
|
||||
case GeometryType.MULTI_LINE_STRING:
|
||||
flatCoordinates = /** @type {module:ol/geom/MultiLineString} */ (geometry).getFlatMidpoints();
|
||||
flatCoordinates = /** @type {import("../../geom/MultiLineString.js").default} */ (geometry).getFlatMidpoints();
|
||||
end = flatCoordinates.length;
|
||||
break;
|
||||
case GeometryType.POLYGON:
|
||||
flatCoordinates = /** @type {module:ol/geom/Polygon} */ (geometry).getFlatInteriorPoint();
|
||||
flatCoordinates = /** @type {import("../../geom/Polygon.js").default} */ (geometry).getFlatInteriorPoint();
|
||||
if (!textState.overflow && flatCoordinates[2] / this.resolution < width) {
|
||||
return;
|
||||
}
|
||||
stride = 3;
|
||||
break;
|
||||
case GeometryType.MULTI_POLYGON:
|
||||
const interiorPoints = /** @type {module:ol/geom/MultiPolygon} */ (geometry).getFlatInteriorPoints();
|
||||
const interiorPoints = /** @type {import("../../geom/MultiPolygon.js").default} */ (geometry).getFlatInteriorPoints();
|
||||
flatCoordinates = [];
|
||||
for (i = 0, ii = interiorPoints.length; i < ii; i += 3) {
|
||||
if (textState.overflow || interiorPoints[i + 2] / this.resolution >= width) {
|
||||
@@ -356,7 +356,7 @@ class CanvasTextReplay extends CanvasReplay {
|
||||
* @private
|
||||
* @param {number} begin Begin.
|
||||
* @param {number} end End.
|
||||
* @param {module:ol/render/canvas~DeclutterGroup} declutterGroup Declutter group.
|
||||
* @param {import("../canvas.js").DeclutterGroup} declutterGroup Declutter group.
|
||||
*/
|
||||
drawChars_(begin, end, declutterGroup) {
|
||||
const strokeState = this.textStrokeState_;
|
||||
@@ -366,7 +366,7 @@ class CanvasTextReplay extends CanvasReplay {
|
||||
const strokeKey = this.strokeKey_;
|
||||
if (strokeState) {
|
||||
if (!(strokeKey in this.strokeStates)) {
|
||||
this.strokeStates[strokeKey] = /** @type {module:ol/render/canvas~StrokeState} */ ({
|
||||
this.strokeStates[strokeKey] = /** @type {import("../canvas.js").StrokeState} */ ({
|
||||
strokeStyle: strokeState.strokeStyle,
|
||||
lineCap: strokeState.lineCap,
|
||||
lineDashOffset: strokeState.lineDashOffset,
|
||||
@@ -379,7 +379,7 @@ class CanvasTextReplay extends CanvasReplay {
|
||||
}
|
||||
const textKey = this.textKey_;
|
||||
if (!(this.textKey_ in this.textStates)) {
|
||||
this.textStates[this.textKey_] = /** @type {module:ol/render/canvas~TextState} */ ({
|
||||
this.textStates[this.textKey_] = /** @type {import("../canvas.js").TextState} */ ({
|
||||
font: textState.font,
|
||||
textAlign: textState.textAlign || defaultTextAlign,
|
||||
scale: textState.scale
|
||||
@@ -388,7 +388,7 @@ class CanvasTextReplay extends CanvasReplay {
|
||||
const fillKey = this.fillKey_;
|
||||
if (fillState) {
|
||||
if (!(fillKey in this.fillStates)) {
|
||||
this.fillStates[fillKey] = /** @type {module:ol/render/canvas~FillState} */ ({
|
||||
this.fillStates[fillKey] = /** @type {import("../canvas.js").FillState} */ ({
|
||||
fillStyle: fillState.fillStyle
|
||||
});
|
||||
}
|
||||
@@ -440,7 +440,7 @@ class CanvasTextReplay extends CanvasReplay {
|
||||
if (!textStyle) {
|
||||
this.text_ = '';
|
||||
} else {
|
||||
this.declutterGroup_ = /** @type {module:ol/render/canvas~DeclutterGroup} */ (declutterGroup);
|
||||
this.declutterGroup_ = /** @type {import("../canvas.js").DeclutterGroup} */ (declutterGroup);
|
||||
|
||||
const textFillStyle = textStyle.getFill();
|
||||
if (!textFillStyle) {
|
||||
@@ -448,7 +448,7 @@ class CanvasTextReplay extends CanvasReplay {
|
||||
} else {
|
||||
fillState = this.textFillState_;
|
||||
if (!fillState) {
|
||||
fillState = this.textFillState_ = /** @type {module:ol/render/canvas~FillState} */ ({});
|
||||
fillState = this.textFillState_ = /** @type {import("../canvas.js").FillState} */ ({});
|
||||
}
|
||||
fillState.fillStyle = asColorLike(
|
||||
textFillStyle.getColor() || defaultFillStyle);
|
||||
@@ -460,7 +460,7 @@ class CanvasTextReplay extends CanvasReplay {
|
||||
} else {
|
||||
strokeState = this.textStrokeState_;
|
||||
if (!strokeState) {
|
||||
strokeState = this.textStrokeState_ = /** @type {module:ol/render/canvas~StrokeState} */ ({});
|
||||
strokeState = this.textStrokeState_ = /** @type {import("../canvas.js").StrokeState} */ ({});
|
||||
}
|
||||
const lineDash = textStrokeStyle.getLineDash();
|
||||
const lineDashOffset = textStrokeStyle.getLineDashOffset();
|
||||
|
||||
@@ -6,7 +6,7 @@ import ReplayType from '../render/ReplayType.js';
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Array<module:ol/render/ReplayType>}
|
||||
* @type {Array<import("./ReplayType.js").default>}
|
||||
*/
|
||||
export const ORDER = [
|
||||
ReplayType.POLYGON,
|
||||
|
||||
@@ -12,7 +12,7 @@ export const DEFAULT_FONT = '10px sans-serif';
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {module:ol/color~Color}
|
||||
* @type {import("../color.js").Color}
|
||||
*/
|
||||
export const DEFAULT_FILLSTYLE = [0.0, 0.0, 0.0, 1.0];
|
||||
|
||||
@@ -53,7 +53,7 @@ export const DEFAULT_MITERLIMIT = 10;
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {module:ol/color~Color}
|
||||
* @type {import("../color.js").Color}
|
||||
*/
|
||||
export const DEFAULT_STROKESTYLE = [0.0, 0.0, 0.0, 1.0];
|
||||
|
||||
|
||||
@@ -18,14 +18,14 @@ import WebGLBuffer from '../../webgl/Buffer.js';
|
||||
class WebGLCircleReplay extends WebGLReplay {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Max extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Max extent.
|
||||
*/
|
||||
constructor(tolerance, maxExtent) {
|
||||
super(tolerance, maxExtent);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/render/webgl/circlereplay/defaultshader/Locations}
|
||||
* @type {import("./circlereplay/defaultshader/Locations.js").default}
|
||||
*/
|
||||
this.defaultLocations_ = null;
|
||||
|
||||
@@ -172,7 +172,7 @@ class WebGLCircleReplay extends WebGLReplay {
|
||||
getDeleteResourcesFunction(context) {
|
||||
// We only delete our stuff here. The shaders and the program may
|
||||
// be used by other CircleReplay instances (for other layers). And
|
||||
// they will be deleted when disposing of the module:ol/webgl/Context~WebGLContext
|
||||
// they will be deleted when disposing of the import("../../webgl/Context.js").WebGLContext
|
||||
// object.
|
||||
const verticesBuffer = this.verticesBuffer;
|
||||
const indicesBuffer = this.indicesBuffer;
|
||||
@@ -296,7 +296,7 @@ class WebGLCircleReplay extends WebGLReplay {
|
||||
/**
|
||||
* @private
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {Object} skippedFeaturesHash Ids of features to skip.
|
||||
*/
|
||||
drawReplaySkipping_(gl, context, skippedFeaturesHash) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import WebGLBuffer from '../../webgl/Buffer.js';
|
||||
class WebGLImageReplay extends WebGLTextureReplay {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Max extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Max extent.
|
||||
*/
|
||||
constructor(tolerance, maxExtent) {
|
||||
super(tolerance, maxExtent);
|
||||
|
||||
@@ -10,12 +10,12 @@ import WebGLReplayGroup from '../webgl/ReplayGroup.js';
|
||||
|
||||
class WebGLImmediateRenderer extends VectorContext {
|
||||
/**
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {import("../../coordinate.js").Coordinate} center Center.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} rotation Rotation.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {import("../../size.js").Size} size Size.
|
||||
* @param {import("../../extent.js").Extent} extent Extent.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
*/
|
||||
constructor(context, center, resolution, rotation, size, extent, pixelRatio) {
|
||||
@@ -58,38 +58,38 @@ class WebGLImmediateRenderer extends VectorContext {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/style/Image}
|
||||
* @type {import("../../style/Image.js").default}
|
||||
*/
|
||||
this.imageStyle_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/style/Fill}
|
||||
* @type {import("../../style/Fill.js").default}
|
||||
*/
|
||||
this.fillStyle_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/style/Stroke}
|
||||
* @type {import("../../style/Stroke.js").default}
|
||||
*/
|
||||
this.strokeStyle_ = null;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/style/Text}
|
||||
* @type {import("../../style/Text.js").default}
|
||||
*/
|
||||
this.textStyle_ = null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/render/webgl/ReplayGroup} replayGroup Replay group.
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry Geometry.
|
||||
* @param {import("./ReplayGroup.js").default} replayGroup Replay group.
|
||||
* @param {import("../../geom/Geometry.js").default|import("../Feature.js").default} geometry Geometry.
|
||||
* @private
|
||||
*/
|
||||
drawText_(replayGroup, geometry) {
|
||||
const context = this.context_;
|
||||
const replay = /** @type {module:ol/render/webgl/TextReplay} */ (
|
||||
const replay = /** @type {import("./TextReplay.js").default} */ (
|
||||
replayGroup.getReplay(0, ReplayType.TEXT));
|
||||
replay.setTextStyle(this.textStyle_);
|
||||
replay.drawText(geometry, null);
|
||||
@@ -109,7 +109,7 @@ class WebGLImmediateRenderer extends VectorContext {
|
||||
* Set the rendering style. Note that since this is an immediate rendering API,
|
||||
* any `zIndex` on the provided style will be ignored.
|
||||
*
|
||||
* @param {module:ol/style/Style} style The rendering style.
|
||||
* @param {import("../../style/Style.js").default} style The rendering style.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -123,7 +123,7 @@ class WebGLImmediateRenderer extends VectorContext {
|
||||
* Render a geometry into the canvas. Call
|
||||
* {@link ol/render/webgl/Immediate#setStyle} first to set the rendering style.
|
||||
*
|
||||
* @param {module:ol/geom/Geometry|module:ol/render/Feature} geometry The geometry to render.
|
||||
* @param {import("../../geom/Geometry.js").default|import("../Feature.js").default} geometry The geometry to render.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
@@ -131,28 +131,28 @@ class WebGLImmediateRenderer extends VectorContext {
|
||||
const type = geometry.getType();
|
||||
switch (type) {
|
||||
case GeometryType.POINT:
|
||||
this.drawPoint(/** @type {module:ol/geom/Point} */ (geometry), null);
|
||||
this.drawPoint(/** @type {import("../../geom/Point.js").default} */ (geometry), null);
|
||||
break;
|
||||
case GeometryType.LINE_STRING:
|
||||
this.drawLineString(/** @type {module:ol/geom/LineString} */ (geometry), null);
|
||||
this.drawLineString(/** @type {import("../../geom/LineString.js").default} */ (geometry), null);
|
||||
break;
|
||||
case GeometryType.POLYGON:
|
||||
this.drawPolygon(/** @type {module:ol/geom/Polygon} */ (geometry), null);
|
||||
this.drawPolygon(/** @type {import("../../geom/Polygon.js").default} */ (geometry), null);
|
||||
break;
|
||||
case GeometryType.MULTI_POINT:
|
||||
this.drawMultiPoint(/** @type {module:ol/geom/MultiPoint} */ (geometry), null);
|
||||
this.drawMultiPoint(/** @type {import("../../geom/MultiPoint.js").default} */ (geometry), null);
|
||||
break;
|
||||
case GeometryType.MULTI_LINE_STRING:
|
||||
this.drawMultiLineString(/** @type {module:ol/geom/MultiLineString} */ (geometry), null);
|
||||
this.drawMultiLineString(/** @type {import("../../geom/MultiLineString.js").default} */ (geometry), null);
|
||||
break;
|
||||
case GeometryType.MULTI_POLYGON:
|
||||
this.drawMultiPolygon(/** @type {module:ol/geom/MultiPolygon} */ (geometry), null);
|
||||
this.drawMultiPolygon(/** @type {import("../../geom/MultiPolygon.js").default} */ (geometry), null);
|
||||
break;
|
||||
case GeometryType.GEOMETRY_COLLECTION:
|
||||
this.drawGeometryCollection(/** @type {module:ol/geom/GeometryCollection} */ (geometry), null);
|
||||
this.drawGeometryCollection(/** @type {import("../../geom/GeometryCollection.js").default} */ (geometry), null);
|
||||
break;
|
||||
case GeometryType.CIRCLE:
|
||||
this.drawCircle(/** @type {module:ol/geom/Circle} */ (geometry), null);
|
||||
this.drawCircle(/** @type {import("../../geom/Circle.js").default} */ (geometry), null);
|
||||
break;
|
||||
default:
|
||||
// pass
|
||||
@@ -189,7 +189,7 @@ class WebGLImmediateRenderer extends VectorContext {
|
||||
drawPoint(geometry, data) {
|
||||
const context = this.context_;
|
||||
const replayGroup = new WebGLReplayGroup(1, this.extent_);
|
||||
const replay = /** @type {module:ol/render/webgl/ImageReplay} */ (
|
||||
const replay = /** @type {import("./ImageReplay.js").default} */ (
|
||||
replayGroup.getReplay(0, ReplayType.IMAGE));
|
||||
replay.setImageStyle(this.imageStyle_);
|
||||
replay.drawPoint(geometry, data);
|
||||
@@ -215,7 +215,7 @@ class WebGLImmediateRenderer extends VectorContext {
|
||||
drawMultiPoint(geometry, data) {
|
||||
const context = this.context_;
|
||||
const replayGroup = new WebGLReplayGroup(1, this.extent_);
|
||||
const replay = /** @type {module:ol/render/webgl/ImageReplay} */ (
|
||||
const replay = /** @type {import("./ImageReplay.js").default} */ (
|
||||
replayGroup.getReplay(0, ReplayType.IMAGE));
|
||||
replay.setImageStyle(this.imageStyle_);
|
||||
replay.drawMultiPoint(geometry, data);
|
||||
@@ -240,7 +240,7 @@ class WebGLImmediateRenderer extends VectorContext {
|
||||
drawLineString(geometry, data) {
|
||||
const context = this.context_;
|
||||
const replayGroup = new WebGLReplayGroup(1, this.extent_);
|
||||
const replay = /** @type {module:ol/render/webgl/LineStringReplay} */ (
|
||||
const replay = /** @type {import("./LineStringReplay.js").default} */ (
|
||||
replayGroup.getReplay(0, ReplayType.LINE_STRING));
|
||||
replay.setFillStrokeStyle(null, this.strokeStyle_);
|
||||
replay.drawLineString(geometry, data);
|
||||
@@ -265,7 +265,7 @@ class WebGLImmediateRenderer extends VectorContext {
|
||||
drawMultiLineString(geometry, data) {
|
||||
const context = this.context_;
|
||||
const replayGroup = new WebGLReplayGroup(1, this.extent_);
|
||||
const replay = /** @type {module:ol/render/webgl/LineStringReplay} */ (
|
||||
const replay = /** @type {import("./LineStringReplay.js").default} */ (
|
||||
replayGroup.getReplay(0, ReplayType.LINE_STRING));
|
||||
replay.setFillStrokeStyle(null, this.strokeStyle_);
|
||||
replay.drawMultiLineString(geometry, data);
|
||||
@@ -290,7 +290,7 @@ class WebGLImmediateRenderer extends VectorContext {
|
||||
drawPolygon(geometry, data) {
|
||||
const context = this.context_;
|
||||
const replayGroup = new WebGLReplayGroup(1, this.extent_);
|
||||
const replay = /** @type {module:ol/render/webgl/PolygonReplay} */ (
|
||||
const replay = /** @type {import("./PolygonReplay.js").default} */ (
|
||||
replayGroup.getReplay(0, ReplayType.POLYGON));
|
||||
replay.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_);
|
||||
replay.drawPolygon(geometry, data);
|
||||
@@ -315,7 +315,7 @@ class WebGLImmediateRenderer extends VectorContext {
|
||||
drawMultiPolygon(geometry, data) {
|
||||
const context = this.context_;
|
||||
const replayGroup = new WebGLReplayGroup(1, this.extent_);
|
||||
const replay = /** @type {module:ol/render/webgl/PolygonReplay} */ (
|
||||
const replay = /** @type {import("./PolygonReplay.js").default} */ (
|
||||
replayGroup.getReplay(0, ReplayType.POLYGON));
|
||||
replay.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_);
|
||||
replay.drawMultiPolygon(geometry, data);
|
||||
@@ -340,7 +340,7 @@ class WebGLImmediateRenderer extends VectorContext {
|
||||
drawCircle(geometry, data) {
|
||||
const context = this.context_;
|
||||
const replayGroup = new WebGLReplayGroup(1, this.extent_);
|
||||
const replay = /** @type {module:ol/render/webgl/CircleReplay} */ (
|
||||
const replay = /** @type {import("./CircleReplay.js").default} */ (
|
||||
replayGroup.getReplay(0, ReplayType.CIRCLE));
|
||||
replay.setFillStrokeStyle(this.fillStyle_, this.strokeStyle_);
|
||||
replay.drawCircle(geometry, data);
|
||||
|
||||
@@ -38,14 +38,14 @@ const Instruction = {
|
||||
class WebGLLineStringReplay extends WebGLReplay {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Max extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Max extent.
|
||||
*/
|
||||
constructor(tolerance, maxExtent) {
|
||||
super(tolerance, maxExtent);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/render/webgl/linestringreplay/defaultshader/Locations}
|
||||
* @type {import("./linestringreplay/defaultshader/Locations.js").default}
|
||||
*/
|
||||
this.defaultLocations_ = null;
|
||||
|
||||
@@ -386,7 +386,7 @@ class WebGLLineStringReplay extends WebGLReplay {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../../Feature.js").default|import("../Feature.js").default} feature Feature.
|
||||
* @param {number=} opt_index Index count.
|
||||
*/
|
||||
setPolygonStyle(feature, opt_index) {
|
||||
@@ -532,7 +532,7 @@ class WebGLLineStringReplay extends WebGLReplay {
|
||||
/**
|
||||
* @private
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {Object} skippedFeaturesHash Ids of features to skip.
|
||||
*/
|
||||
drawReplaySkipping_(gl, context, skippedFeaturesHash) {
|
||||
|
||||
@@ -31,15 +31,15 @@ import WebGLBuffer from '../../webgl/Buffer.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} PolygonSegment
|
||||
* @property {module:ol/render/webgl/PolygonReplay~PolygonVertex} p0
|
||||
* @property {module:ol/render/webgl/PolygonReplay~PolygonVertex} p1
|
||||
* @property {PolygonVertex} p0
|
||||
* @property {PolygonVertex} p1
|
||||
*/
|
||||
|
||||
|
||||
class WebGLPolygonReplay extends WebGLReplay {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Max extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Max extent.
|
||||
*/
|
||||
constructor(tolerance, maxExtent) {
|
||||
super(tolerance, maxExtent);
|
||||
@@ -49,7 +49,7 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/render/webgl/polygonreplay/defaultshader/Locations}
|
||||
* @type {import("./polygonreplay/defaultshader/Locations.js").default}
|
||||
*/
|
||||
this.defaultLocations_ = null;
|
||||
|
||||
@@ -143,8 +143,8 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
* @private
|
||||
* @param {Array<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} stride Stride.
|
||||
* @param {module:ol/structs/LinkedList} list Linked list.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
* @param {import("../../structs/LinkedList.js").default} list Linked list.
|
||||
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
|
||||
* @param {boolean} clockwise Coordinate order should be clockwise.
|
||||
*/
|
||||
processFlatCoordinates_(flatCoordinates, stride, list, rtree, clockwise) {
|
||||
@@ -152,11 +152,11 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
0, flatCoordinates.length, stride);
|
||||
let i, ii;
|
||||
let n = this.vertices.length / 2;
|
||||
/** @type {module:ol/render/webgl/PolygonReplay~PolygonVertex} */
|
||||
/** @type {PolygonVertex} */
|
||||
let start;
|
||||
/** @type {module:ol/render/webgl/PolygonReplay~PolygonVertex} */
|
||||
/** @type {PolygonVertex} */
|
||||
let p0;
|
||||
/** @type {module:ol/render/webgl/PolygonReplay~PolygonVertex} */
|
||||
/** @type {PolygonVertex} */
|
||||
let p1;
|
||||
const extents = [];
|
||||
const segments = [];
|
||||
@@ -194,7 +194,7 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
/**
|
||||
* Returns the rightmost coordinates of a polygon on the X axis.
|
||||
* @private
|
||||
* @param {module:ol/structs/LinkedList} list Polygons ring.
|
||||
* @param {import("../../structs/LinkedList.js").default} list Polygons ring.
|
||||
* @return {Array<number>} Max X coordinates.
|
||||
*/
|
||||
getMaxCoords_(list) {
|
||||
@@ -215,8 +215,8 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
/**
|
||||
* Classifies the points of a polygon list as convex, reflex. Removes collinear vertices.
|
||||
* @private
|
||||
* @param {module:ol/structs/LinkedList} list Polygon ring.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
* @param {import("../../structs/LinkedList.js").default} list Polygon ring.
|
||||
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
|
||||
* @param {boolean} ccw The orientation of the polygon is counter-clockwise.
|
||||
* @return {boolean} There were reclassified points.
|
||||
*/
|
||||
@@ -250,11 +250,11 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/structs/LinkedList} hole Linked list of the hole.
|
||||
* @param {import("../../structs/LinkedList.js").default} hole Linked list of the hole.
|
||||
* @param {number} holeMaxX Maximum X value of the hole.
|
||||
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
|
||||
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
|
||||
* @param {number} listMaxX Maximum X value of the polygon.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
|
||||
* @return {boolean} Bridging was successful.
|
||||
*/
|
||||
bridgeHole_(hole, holeMaxX, list, listMaxX, rtree) {
|
||||
@@ -264,11 +264,11 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
}
|
||||
|
||||
const p1 = seg.p1;
|
||||
/** @type {module:ol/render/webgl/PolygonReplay~PolygonVertex} */
|
||||
/** @type {PolygonVertex} */
|
||||
const p2 = {x: listMaxX, y: p1.y, i: -1};
|
||||
let minDist = Infinity;
|
||||
let i, ii, bestPoint;
|
||||
/** @type {module:ol/render/webgl/PolygonReplay~PolygonVertex} */
|
||||
/** @type {PolygonVertex} */
|
||||
let p5;
|
||||
|
||||
const intersectingSegments = this.getIntersections_({p0: p1, p1: p2}, rtree, true);
|
||||
@@ -325,8 +325,8 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
|
||||
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
|
||||
*/
|
||||
triangulate_(list, rtree) {
|
||||
let ccw = false;
|
||||
@@ -374,8 +374,8 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
|
||||
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
|
||||
* @param {boolean} simple The polygon is simple.
|
||||
* @param {boolean} ccw Orientation of the polygon is counter-clockwise.
|
||||
* @return {boolean} There were processed ears.
|
||||
@@ -432,8 +432,8 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
|
||||
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
|
||||
* @param {boolean=} opt_touch Resolve touching segments.
|
||||
* @return {boolean} There were resolved intersections.
|
||||
*/
|
||||
@@ -499,8 +499,8 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
|
||||
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
|
||||
* @return {boolean} The polygon is simple.
|
||||
*/
|
||||
isSimple_(list, rtree) {
|
||||
@@ -517,7 +517,7 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
|
||||
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
|
||||
* @return {boolean} Orientation is clockwise.
|
||||
*/
|
||||
isClockwise_(list) {
|
||||
@@ -536,8 +536,8 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/structs/LinkedList} list Linked list of the polygon.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
* @param {import("../../structs/LinkedList.js").default} list Linked list of the polygon.
|
||||
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
|
||||
*/
|
||||
splitPolygon_(list, rtree) {
|
||||
const start = list.firstItem();
|
||||
@@ -582,13 +582,13 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
* @param {number} x X coordinate.
|
||||
* @param {number} y Y coordinate.
|
||||
* @param {number} i Index.
|
||||
* @return {module:ol/render/webgl/PolygonReplay~PolygonVertex} List item.
|
||||
* @return {PolygonVertex} List item.
|
||||
*/
|
||||
createPoint_(x, y, i) {
|
||||
let numVertices = this.vertices.length;
|
||||
this.vertices[numVertices++] = x;
|
||||
this.vertices[numVertices++] = y;
|
||||
/** @type {module:ol/render/webgl/PolygonReplay~PolygonVertex} */
|
||||
/** @type {PolygonVertex} */
|
||||
const p = {
|
||||
x: x,
|
||||
y: y,
|
||||
@@ -600,11 +600,11 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p0 First point of segment.
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p1 Second point of segment.
|
||||
* @param {module:ol/structs/LinkedList} list Polygon ring.
|
||||
* @param {module:ol/structs/RBush=} opt_rtree Insert the segment into the R-Tree.
|
||||
* @return {module:ol/render/webgl/PolygonReplay~PolygonSegment} segment.
|
||||
* @param {PolygonVertex} p0 First point of segment.
|
||||
* @param {PolygonVertex} p1 Second point of segment.
|
||||
* @param {import("../../structs/LinkedList.js").default} list Polygon ring.
|
||||
* @param {import("../../structs/RBush.js").default=} opt_rtree Insert the segment into the R-Tree.
|
||||
* @return {PolygonSegment} segment.
|
||||
*/
|
||||
insertItem_(p0, p1, list, opt_rtree) {
|
||||
const seg = {
|
||||
@@ -621,10 +621,10 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonSegment} s0 Segment before the remove candidate.
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonSegment} s1 Remove candidate segment.
|
||||
* @param {module:ol/structs/LinkedList} list Polygon ring.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
* @param {PolygonSegment} s0 Segment before the remove candidate.
|
||||
* @param {PolygonSegment} s1 Remove candidate segment.
|
||||
* @param {import("../../structs/LinkedList.js").default} list Polygon ring.
|
||||
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
|
||||
*/
|
||||
removeItem_(s0, s1, list, rtree) {
|
||||
if (list.getCurrItem() === s1) {
|
||||
@@ -638,12 +638,12 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p0 First point.
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p1 Second point.
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p2 Third point.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
* @param {PolygonVertex} p0 First point.
|
||||
* @param {PolygonVertex} p1 Second point.
|
||||
* @param {PolygonVertex} p2 Third point.
|
||||
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
|
||||
* @param {boolean=} opt_reflex Only include reflex points.
|
||||
* @return {Array<module:ol/render/webgl/PolygonReplay~PolygonVertex>} Points in the triangle.
|
||||
* @return {Array<PolygonVertex>} Points in the triangle.
|
||||
*/
|
||||
getPointsInTriangle_(p0, p1, p2, rtree, opt_reflex) {
|
||||
const result = [];
|
||||
@@ -667,10 +667,10 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonSegment} segment Segment.
|
||||
* @param {module:ol/structs/RBush} rtree R-Tree of the polygon.
|
||||
* @param {PolygonSegment} segment Segment.
|
||||
* @param {import("../../structs/RBush.js").default} rtree R-Tree of the polygon.
|
||||
* @param {boolean=} opt_touch Touching segments should be considered an intersection.
|
||||
* @return {Array<module:ol/render/webgl/PolygonReplay~PolygonSegment>} Intersecting segments.
|
||||
* @return {Array<PolygonSegment>} Intersecting segments.
|
||||
*/
|
||||
getIntersections_(segment, rtree, opt_touch) {
|
||||
const p0 = segment.p0;
|
||||
@@ -693,10 +693,10 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
* See http://paulbourke.net/geometry/pointlineplane/.
|
||||
*
|
||||
* @private
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p0 First point.
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p1 Second point.
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p2 Third point.
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p3 Fourth point.
|
||||
* @param {PolygonVertex} p0 First point.
|
||||
* @param {PolygonVertex} p1 Second point.
|
||||
* @param {PolygonVertex} p2 Third point.
|
||||
* @param {PolygonVertex} p3 Fourth point.
|
||||
* @param {boolean=} opt_touch Touching segments should be considered an intersection.
|
||||
* @return {Array<number>|undefined} Intersection coordinates.
|
||||
*/
|
||||
@@ -716,11 +716,11 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p0 Point before the start of the diagonal.
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p1 Start point of the diagonal.
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p2 Ear candidate.
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p3 End point of the diagonal.
|
||||
* @param {module:ol/render/webgl/PolygonReplay~PolygonVertex} p4 Point after the end of the diagonal.
|
||||
* @param {PolygonVertex} p0 Point before the start of the diagonal.
|
||||
* @param {PolygonVertex} p1 Start point of the diagonal.
|
||||
* @param {PolygonVertex} p2 Ear candidate.
|
||||
* @param {PolygonVertex} p3 End point of the diagonal.
|
||||
* @param {PolygonVertex} p4 Point after the end of the diagonal.
|
||||
* @return {boolean} Diagonal is inside the polygon.
|
||||
*/
|
||||
diagonalIsInside_(p0, p1, p2, p3, p4) {
|
||||
@@ -966,7 +966,7 @@ class WebGLPolygonReplay extends WebGLReplay {
|
||||
/**
|
||||
* @private
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {Object} skippedFeaturesHash Ids of features to skip.
|
||||
*/
|
||||
drawReplaySkipping_(gl, context, skippedFeaturesHash) {
|
||||
|
||||
@@ -18,7 +18,7 @@ import {ARRAY_BUFFER, ELEMENT_ARRAY_BUFFER, TRIANGLES,
|
||||
class WebGLReplay extends VectorContext {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Max extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Max extent.
|
||||
*/
|
||||
constructor(tolerance, maxExtent) {
|
||||
super();
|
||||
@@ -32,7 +32,7 @@ class WebGLReplay extends VectorContext {
|
||||
/**
|
||||
* @protected
|
||||
* @const
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../../extent.js").Extent}
|
||||
*/
|
||||
this.maxExtent = maxExtent;
|
||||
|
||||
@@ -42,25 +42,25 @@ class WebGLReplay extends VectorContext {
|
||||
* we use the "Rendering Relative to Eye" technique described in the "3D
|
||||
* Engine Design for Virtual Globes" book.
|
||||
* @protected
|
||||
* @type {module:ol/coordinate~Coordinate}
|
||||
* @type {import("../../coordinate.js").Coordinate}
|
||||
*/
|
||||
this.origin = getCenter(maxExtent);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/transform~Transform}
|
||||
* @type {import("../../transform.js").Transform}
|
||||
*/
|
||||
this.projectionMatrix_ = createTransform();
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/transform~Transform}
|
||||
* @type {import("../../transform.js").Transform}
|
||||
*/
|
||||
this.offsetRotateMatrix_ = createTransform();
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/transform~Transform}
|
||||
* @type {import("../../transform.js").Transform}
|
||||
*/
|
||||
this.offsetScaleMatrix_ = createTransform();
|
||||
|
||||
@@ -78,7 +78,7 @@ class WebGLReplay extends VectorContext {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {?module:ol/webgl/Buffer}
|
||||
* @type {?import("../../webgl/Buffer.js").default}
|
||||
*/
|
||||
this.indicesBuffer = null;
|
||||
|
||||
@@ -92,7 +92,7 @@ class WebGLReplay extends VectorContext {
|
||||
/**
|
||||
* Start index per feature (the feature).
|
||||
* @protected
|
||||
* @type {Array<module:ol/Feature|module:ol/render/Feature>}
|
||||
* @type {Array<import("../../Feature.js").default|import("../Feature.js").default>}
|
||||
*/
|
||||
this.startIndicesFeature = [];
|
||||
|
||||
@@ -104,14 +104,14 @@ class WebGLReplay extends VectorContext {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {?module:ol/webgl/Buffer}
|
||||
* @type {?import("../../webgl/Buffer.js").default}
|
||||
*/
|
||||
this.verticesBuffer = null;
|
||||
|
||||
/**
|
||||
* Optional parameter for PolygonReplay instances.
|
||||
* @protected
|
||||
* @type {module:ol/render/webgl/LineStringReplay|undefined}
|
||||
* @type {import("./LineStringReplay.js").default|undefined}
|
||||
*/
|
||||
this.lineStringReplay = undefined;
|
||||
|
||||
@@ -119,14 +119,14 @@ class WebGLReplay extends VectorContext {
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {module:ol/webgl/Context} context WebGL context.
|
||||
* @param {import("../../webgl/Context.js").default} context WebGL context.
|
||||
* @return {function()} Delete resources function.
|
||||
*/
|
||||
getDeleteResourcesFunction(context) {}
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
*/
|
||||
finish(context) {}
|
||||
|
||||
@@ -134,13 +134,13 @@ class WebGLReplay extends VectorContext {
|
||||
* @abstract
|
||||
* @protected
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {import("../../size.js").Size} size Size.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @return {module:ol/render/webgl/circlereplay/defaultshader/Locations|
|
||||
module:ol/render/webgl/linestringreplay/defaultshader/Locations|
|
||||
module:ol/render/webgl/polygonreplay/defaultshader/Locations|
|
||||
module:ol/render/webgl/texturereplay/defaultshader/Locations} Locations.
|
||||
* @return {import("./circlereplay/defaultshader/Locations.js").default|
|
||||
import("./linestringreplay/defaultshader/Locations.js").default|
|
||||
import("./polygonreplay/defaultshader/Locations.js").default|
|
||||
import("./texturereplay/defaultshader/Locations.js").default} Locations.
|
||||
*/
|
||||
setUpProgram(gl, context, size, pixelRatio) {}
|
||||
|
||||
@@ -148,10 +148,10 @@ class WebGLReplay extends VectorContext {
|
||||
* @abstract
|
||||
* @protected
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {module:ol/render/webgl/circlereplay/defaultshader/Locations|
|
||||
module:ol/render/webgl/linestringreplay/defaultshader/Locations|
|
||||
module:ol/render/webgl/polygonreplay/defaultshader/Locations|
|
||||
module:ol/render/webgl/texturereplay/defaultshader/Locations} locations Locations.
|
||||
* @param {import("./circlereplay/defaultshader/Locations.js").default|
|
||||
import("./linestringreplay/defaultshader/Locations.js").default|
|
||||
import("./polygonreplay/defaultshader/Locations.js").default|
|
||||
import("./texturereplay/defaultshader/Locations.js").default} locations Locations.
|
||||
*/
|
||||
shutDownProgram(gl, locations) {}
|
||||
|
||||
@@ -159,7 +159,7 @@ class WebGLReplay extends VectorContext {
|
||||
* @abstract
|
||||
* @protected
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
|
||||
* @param {boolean} hitDetection Hit detection mode.
|
||||
*/
|
||||
@@ -169,10 +169,10 @@ class WebGLReplay extends VectorContext {
|
||||
* @abstract
|
||||
* @protected
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
|
||||
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Hit extent: Only features intersecting this extent are checked.
|
||||
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T|undefined} featureCallback Feature callback.
|
||||
* @param {import("../../extent.js").Extent=} opt_hitExtent Hit extent: Only features intersecting this extent are checked.
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template T
|
||||
*/
|
||||
@@ -181,11 +181,11 @@ class WebGLReplay extends VectorContext {
|
||||
/**
|
||||
* @protected
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
|
||||
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T|undefined} featureCallback Feature callback.
|
||||
* @param {boolean} oneByOne Draw features one-by-one for the hit-detecion.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Hit extent: Only features intersecting this extent are checked.
|
||||
* @param {import("../../extent.js").Extent=} opt_hitExtent Hit extent: Only features intersecting this extent are checked.
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template T
|
||||
*/
|
||||
@@ -204,9 +204,9 @@ class WebGLReplay extends VectorContext {
|
||||
/**
|
||||
* @protected
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
|
||||
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T|undefined} featureCallback Feature callback.
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template T
|
||||
*/
|
||||
@@ -223,17 +223,17 @@ class WebGLReplay extends VectorContext {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {import("../../coordinate.js").Coordinate} center Center.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} rotation Rotation.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {import("../../size.js").Size} size Size.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {number} opacity Global opacity.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
|
||||
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T|undefined} featureCallback Feature callback.
|
||||
* @param {boolean} oneByOne Draw features one-by-one for the hit-detecion.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Hit extent: Only features intersecting this extent are checked.
|
||||
* @param {import("../../extent.js").Extent=} opt_hitExtent Hit extent: Only features intersecting this extent are checked.
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template T
|
||||
*/
|
||||
@@ -338,7 +338,7 @@ class WebGLReplay extends VectorContext {
|
||||
/**
|
||||
* @protected
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {number} start Start index.
|
||||
* @param {number} end End index.
|
||||
*/
|
||||
|
||||
@@ -19,9 +19,9 @@ import WebGLTextReplay from '../webgl/TextReplay.js';
|
||||
const HIT_DETECTION_SIZE = [1, 1];
|
||||
|
||||
/**
|
||||
* @type {Object<module:ol/render/ReplayType,
|
||||
* function(new: module:ol/render/webgl/Replay, number,
|
||||
* module:ol/extent~Extent)>}
|
||||
* @type {Object<import("../ReplayType.js").default,
|
||||
* function(new: import("./Replay.js").default, number,
|
||||
* import("../../extent.js").Extent)>}
|
||||
*/
|
||||
const BATCH_CONSTRUCTORS = {
|
||||
'Circle': WebGLCircleReplay,
|
||||
@@ -35,14 +35,14 @@ const BATCH_CONSTRUCTORS = {
|
||||
class WebGLReplayGroup extends ReplayGroup {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Max extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Max extent.
|
||||
* @param {number=} opt_renderBuffer Render buffer.
|
||||
*/
|
||||
constructor(tolerance, maxExtent, opt_renderBuffer) {
|
||||
super();
|
||||
|
||||
/**
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../../extent.js").Extent}
|
||||
* @private
|
||||
*/
|
||||
this.maxExtent_ = maxExtent;
|
||||
@@ -62,20 +62,20 @@ class WebGLReplayGroup extends ReplayGroup {
|
||||
/**
|
||||
* @private
|
||||
* @type {!Object<string,
|
||||
* Object<module:ol/render/ReplayType, module:ol/render/webgl/Replay>>}
|
||||
* Object<import("../ReplayType.js").default, import("./Replay.js").default>>}
|
||||
*/
|
||||
this.replaysByZIndex_ = {};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/style/Style} style Style.
|
||||
* @param {import("../../style/Style.js").default} style Style.
|
||||
* @param {boolean} group Group with previous replay.
|
||||
*/
|
||||
addDeclutter(style, group) {}
|
||||
|
||||
/**
|
||||
* @param {module:ol/webgl/Context} context WebGL context.
|
||||
* @param {import("../../webgl/Context.js").default} context WebGL context.
|
||||
* @return {function()} Delete resources function.
|
||||
*/
|
||||
getDeleteResourcesFunction(context) {
|
||||
@@ -99,7 +99,7 @@ class WebGLReplayGroup extends ReplayGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
*/
|
||||
finish(context) {
|
||||
let zKey;
|
||||
@@ -141,11 +141,11 @@ class WebGLReplayGroup extends ReplayGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {import("../../coordinate.js").Coordinate} center Center.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} rotation Rotation.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {import("../../size.js").Size} size Size.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {number} opacity Global opacity.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
|
||||
@@ -181,17 +181,17 @@ class WebGLReplayGroup extends ReplayGroup {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {import("../../coordinate.js").Coordinate} center Center.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} rotation Rotation.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {import("../../size.js").Size} size Size.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {number} opacity Global opacity.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
|
||||
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} featureCallback Feature callback.
|
||||
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T|undefined} featureCallback Feature callback.
|
||||
* @param {boolean} oneByOne Draw features one-by-one for the hit-detecion.
|
||||
* @param {module:ol/extent~Extent=} opt_hitExtent Hit extent: Only features intersecting
|
||||
* @param {import("../../extent.js").Extent=} opt_hitExtent Hit extent: Only features intersecting
|
||||
* this extent are checked.
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template T
|
||||
@@ -234,16 +234,16 @@ class WebGLReplayGroup extends ReplayGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
||||
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {import("../../coordinate.js").Coordinate} center Center.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} rotation Rotation.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {import("../../size.js").Size} size Size.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {number} opacity Global opacity.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
|
||||
* @param {function((module:ol/Feature|module:ol/render/Feature)): T|undefined} callback Feature callback.
|
||||
* @param {function((import("../../Feature.js").default|import("../Feature.js").default)): T|undefined} callback Feature callback.
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template T
|
||||
*/
|
||||
@@ -265,7 +265,7 @@ class WebGLReplayGroup extends ReplayGroup {
|
||||
|
||||
|
||||
/**
|
||||
* @type {module:ol/extent~Extent}
|
||||
* @type {import("../../extent.js").Extent}
|
||||
*/
|
||||
let hitExtent;
|
||||
if (this.renderBuffer_ !== undefined) {
|
||||
@@ -278,7 +278,7 @@ class WebGLReplayGroup extends ReplayGroup {
|
||||
coordinate, resolution, rotation, HIT_DETECTION_SIZE,
|
||||
pixelRatio, opacity, skippedFeaturesHash,
|
||||
/**
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../../Feature.js").default|import("../Feature.js").default} feature Feature.
|
||||
* @return {?} Callback result.
|
||||
*/
|
||||
function(feature) {
|
||||
@@ -295,12 +295,12 @@ class WebGLReplayGroup extends ReplayGroup {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
||||
* @param {import("../../coordinate.js").Coordinate} coordinate Coordinate.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {import("../../coordinate.js").Coordinate} center Center.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} rotation Rotation.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {import("../../size.js").Size} size Size.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {number} opacity Global opacity.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features to skip.
|
||||
@@ -325,7 +325,7 @@ class WebGLReplayGroup extends ReplayGroup {
|
||||
coordinate, resolution, rotation, HIT_DETECTION_SIZE,
|
||||
pixelRatio, opacity, skippedFeaturesHash,
|
||||
/**
|
||||
* @param {module:ol/Feature|module:ol/render/Feature} feature Feature.
|
||||
* @param {import("../../Feature.js").default|import("../Feature.js").default} feature Feature.
|
||||
* @return {boolean} Is there a feature?
|
||||
*/
|
||||
function(feature) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import WebGLBuffer from '../../webgl/Buffer.js';
|
||||
|
||||
/**
|
||||
* @typedef {Object} GlyphAtlas
|
||||
* @property {module:ol/style/AtlasManager} atlas
|
||||
* @property {import("../../style/AtlasManager.js").default} atlas
|
||||
* @property {Object<string, number>} width
|
||||
* @property {number} height
|
||||
*/
|
||||
@@ -25,7 +25,7 @@ import WebGLBuffer from '../../webgl/Buffer.js';
|
||||
class WebGLTextReplay extends WebGLTextureReplay {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Max extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Max extent.
|
||||
*/
|
||||
constructor(tolerance, maxExtent) {
|
||||
super(tolerance, maxExtent);
|
||||
@@ -50,14 +50,14 @@ class WebGLTextReplay extends WebGLTextureReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {{strokeColor: (module:ol/colorlike~ColorLike|null),
|
||||
* @type {{strokeColor: (import("../../colorlike.js").ColorLike|null),
|
||||
* lineCap: (string|undefined),
|
||||
* lineDash: Array<number>,
|
||||
* lineDashOffset: (number|undefined),
|
||||
* lineJoin: (string|undefined),
|
||||
* lineWidth: number,
|
||||
* miterLimit: (number|undefined),
|
||||
* fillColor: (module:ol/colorlike~ColorLike|null),
|
||||
* fillColor: (import("../../colorlike.js").ColorLike|null),
|
||||
* font: (string|undefined),
|
||||
* scale: (number|undefined)}}
|
||||
*/
|
||||
@@ -106,13 +106,13 @@ class WebGLTextReplay extends WebGLTextureReplay {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object<string, module:ol/render/webgl/TextReplay~GlyphAtlas>}
|
||||
* @type {Object<string, GlyphAtlas>}
|
||||
*/
|
||||
this.atlases_ = {};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {module:ol/render/webgl/TextReplay~GlyphAtlas|undefined}
|
||||
* @type {GlyphAtlas|undefined}
|
||||
*/
|
||||
this.currAtlas_ = undefined;
|
||||
|
||||
@@ -139,20 +139,20 @@ class WebGLTextReplay extends WebGLTextureReplay {
|
||||
stride = geometry.getStride();
|
||||
break;
|
||||
case GeometryType.CIRCLE:
|
||||
flatCoordinates = /** @type {module:ol/geom/Circle} */ (geometry).getCenter();
|
||||
flatCoordinates = /** @type {import("../../geom/Circle.js").default} */ (geometry).getCenter();
|
||||
break;
|
||||
case GeometryType.LINE_STRING:
|
||||
flatCoordinates = /** @type {module:ol/geom/LineString} */ (geometry).getFlatMidpoint();
|
||||
flatCoordinates = /** @type {import("../../geom/LineString.js").default} */ (geometry).getFlatMidpoint();
|
||||
break;
|
||||
case GeometryType.MULTI_LINE_STRING:
|
||||
flatCoordinates = /** @type {module:ol/geom/MultiLineString} */ (geometry).getFlatMidpoints();
|
||||
flatCoordinates = /** @type {import("../../geom/MultiLineString.js").default} */ (geometry).getFlatMidpoints();
|
||||
end = flatCoordinates.length;
|
||||
break;
|
||||
case GeometryType.POLYGON:
|
||||
flatCoordinates = /** @type {module:ol/geom/Polygon} */ (geometry).getFlatInteriorPoint();
|
||||
flatCoordinates = /** @type {import("../../geom/Polygon.js").default} */ (geometry).getFlatInteriorPoint();
|
||||
break;
|
||||
case GeometryType.MULTI_POLYGON:
|
||||
flatCoordinates = /** @type {module:ol/geom/MultiPolygon} */ (geometry).getFlatInteriorPoints();
|
||||
flatCoordinates = /** @type {import("../../geom/MultiPolygon.js").default} */ (geometry).getFlatInteriorPoints();
|
||||
end = flatCoordinates.length;
|
||||
break;
|
||||
default:
|
||||
@@ -394,7 +394,7 @@ class WebGLTextReplay extends WebGLTextureReplay {
|
||||
/**
|
||||
* @private
|
||||
* @param {Object} state Font attributes.
|
||||
* @return {module:ol/render/webgl/TextReplay~GlyphAtlas} Glyph atlas.
|
||||
* @return {GlyphAtlas} Glyph atlas.
|
||||
*/
|
||||
getAtlas_(state) {
|
||||
let params = [];
|
||||
|
||||
@@ -13,7 +13,7 @@ import {createTexture} from '../../webgl/Context.js';
|
||||
class WebGLTextureReplay extends WebGLReplay {
|
||||
/**
|
||||
* @param {number} tolerance Tolerance.
|
||||
* @param {module:ol/extent~Extent} maxExtent Max extent.
|
||||
* @param {import("../../extent.js").Extent} maxExtent Max extent.
|
||||
*/
|
||||
constructor(tolerance, maxExtent) {
|
||||
super(tolerance, maxExtent);
|
||||
@@ -62,7 +62,7 @@ class WebGLTextureReplay extends WebGLReplay {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {module:ol/render/webgl/texturereplay/defaultshader/Locations}
|
||||
* @type {import("./texturereplay/defaultshader/Locations.js").default}
|
||||
*/
|
||||
this.defaultLocations = null;
|
||||
|
||||
@@ -350,7 +350,7 @@ class WebGLTextureReplay extends WebGLReplay {
|
||||
*
|
||||
* @protected
|
||||
* @param {WebGLRenderingContext} gl gl.
|
||||
* @param {module:ol/webgl/Context} context Context.
|
||||
* @param {import("../../webgl/Context.js").default} context Context.
|
||||
* @param {Object<string, boolean>} skippedFeaturesHash Ids of features
|
||||
* to skip.
|
||||
* @param {Array<WebGLTexture>} textures Textures.
|
||||
|
||||
Reference in New Issue
Block a user