planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

91
node_modules/ol/reproj/Image.d.ts generated vendored Normal file
View File

@@ -0,0 +1,91 @@
export default ReprojImage;
export type FunctionType = (arg0: import("../extent.js").Extent, arg1: number, arg2: number) => import("../ImageBase.js").default;
/**
* @typedef {function(import("../extent.js").Extent, number, number) : import("../ImageBase.js").default} FunctionType
*/
/**
* @classdesc
* Class encapsulating single reprojected image.
* See {@link module:ol/source/Image~ImageSource}.
*/
declare class ReprojImage extends ImageBase {
/**
* @param {import("../proj/Projection.js").default} sourceProj Source projection (of the data).
* @param {import("../proj/Projection.js").default} targetProj Target projection.
* @param {import("../extent.js").Extent} targetExtent Target extent.
* @param {number} targetResolution Target resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {FunctionType} getImageFunction
* Function returning source images (extent, resolution, pixelRatio).
* @param {boolean} interpolate Use linear interpolation when resampling.
*/
constructor(sourceProj: import("../proj/Projection.js").default, targetProj: import("../proj/Projection.js").default, targetExtent: import("../extent.js").Extent, targetResolution: number, pixelRatio: number, getImageFunction: FunctionType, interpolate: boolean);
/**
* @private
* @type {import("../proj/Projection.js").default}
*/
private targetProj_;
/**
* @private
* @type {import("../extent.js").Extent}
*/
private maxSourceExtent_;
/**
* @private
* @type {!import("./Triangulation.js").default}
*/
private triangulation_;
/**
* @private
* @type {number}
*/
private targetResolution_;
/**
* @private
* @type {import("../extent.js").Extent}
*/
private targetExtent_;
/**
* @private
* @type {import("../ImageBase.js").default}
*/
private sourceImage_;
/**
* @private
* @type {number}
*/
private sourcePixelRatio_;
/**
* @private
* @type {boolean}
*/
private interpolate_;
/**
* @private
* @type {HTMLCanvasElement}
*/
private canvas_;
/**
* @private
* @type {?import("../events.js").EventsKey}
*/
private sourceListenerKey_;
/**
* @return {HTMLCanvasElement} Image.
*/
getImage(): HTMLCanvasElement;
/**
* @return {import("../proj/Projection.js").default} Projection.
*/
getProjection(): import("../proj/Projection.js").default;
/**
* @private
*/
private reproject_;
/**
* @private
*/
private unlistenSource_;
}
import ImageBase from "../ImageBase.js";
//# sourceMappingURL=Image.d.ts.map

1
node_modules/ol/reproj/Image.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../src/reproj/Image.js"],"names":[],"mappings":";kCAiBsB,OAAO,cAAc,EAAE,MAAM,QAAE,MAAM,QAAE,MAAM,KAAI,OAAO,iBAAiB,EAAE,OAAO;AADxG;;GAEG;AAEH;;;;GAIG;AACH;IACE;;;;;;;;;OASG;IACH,wBATW,OAAO,uBAAuB,EAAE,OAAO,cACvC,OAAO,uBAAuB,EAAE,OAAO,gBACvC,OAAO,cAAc,EAAE,MAAM,oBAC7B,MAAM,cACN,MAAM,oBACN,YAAY,eAEZ,OAAO,EA2GjB;IA3DC;;;OAGG;IACH,oBAA6B;IAE7B;;;OAGG;IACH,yBAAuC;IAEvC;;;OAGG;IACH,uBAAmC;IAEnC;;;OAGG;IACH,0BAAyC;IAEzC;;;OAGG;IACH,sBAAiC;IAEjC;;;OAGG;IACH,qBAA+B;IAE/B;;;OAGG;IACH,0BAAyC;IAEzC;;;OAGG;IACH,qBAA+B;IAE/B;;;OAGG;IACH,gBAAmB;IAEnB;;;OAGG;IACH,2BAA8B;IAahC;;OAEG;IACH,YAFY,iBAAiB,CAI5B;IAED;;OAEG;IACH,iBAFY,OAAO,uBAAuB,EAAE,OAAO,CAIlD;IAED;;OAEG;IACH,mBA4BC;IAkCD;;OAEG;IACH,wBAKC;CACF"}

189
node_modules/ol/reproj/Image.js generated vendored Normal file
View File

@@ -0,0 +1,189 @@
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
/**
* @module ol/reproj/Image
*/
import { ERROR_THRESHOLD } from './common.js';
import EventType from '../events/EventType.js';
import ImageBase from '../ImageBase.js';
import ImageState from '../ImageState.js';
import Triangulation from './Triangulation.js';
import { calculateSourceResolution, render as renderReprojected, } from '../reproj.js';
import { getCenter, getHeight, getIntersection, getWidth } from '../extent.js';
import { listen, unlistenByKey } from '../events.js';
/**
* @typedef {function(import("../extent.js").Extent, number, number) : import("../ImageBase.js").default} FunctionType
*/
/**
* @classdesc
* Class encapsulating single reprojected image.
* See {@link module:ol/source/Image~ImageSource}.
*/
var ReprojImage = /** @class */ (function (_super) {
__extends(ReprojImage, _super);
/**
* @param {import("../proj/Projection.js").default} sourceProj Source projection (of the data).
* @param {import("../proj/Projection.js").default} targetProj Target projection.
* @param {import("../extent.js").Extent} targetExtent Target extent.
* @param {number} targetResolution Target resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {FunctionType} getImageFunction
* Function returning source images (extent, resolution, pixelRatio).
* @param {boolean} interpolate Use linear interpolation when resampling.
*/
function ReprojImage(sourceProj, targetProj, targetExtent, targetResolution, pixelRatio, getImageFunction, interpolate) {
var _this = this;
var maxSourceExtent = sourceProj.getExtent();
var maxTargetExtent = targetProj.getExtent();
var limitedTargetExtent = maxTargetExtent
? getIntersection(targetExtent, maxTargetExtent)
: targetExtent;
var targetCenter = getCenter(limitedTargetExtent);
var sourceResolution = calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution);
var errorThresholdInPixels = ERROR_THRESHOLD;
var triangulation = new Triangulation(sourceProj, targetProj, limitedTargetExtent, maxSourceExtent, sourceResolution * errorThresholdInPixels, targetResolution);
var sourceExtent = triangulation.calculateSourceExtent();
var sourceImage = getImageFunction(sourceExtent, sourceResolution, pixelRatio);
var state = sourceImage ? ImageState.IDLE : ImageState.EMPTY;
var sourcePixelRatio = sourceImage ? sourceImage.getPixelRatio() : 1;
_this = _super.call(this, targetExtent, targetResolution, sourcePixelRatio, state) || this;
/**
* @private
* @type {import("../proj/Projection.js").default}
*/
_this.targetProj_ = targetProj;
/**
* @private
* @type {import("../extent.js").Extent}
*/
_this.maxSourceExtent_ = maxSourceExtent;
/**
* @private
* @type {!import("./Triangulation.js").default}
*/
_this.triangulation_ = triangulation;
/**
* @private
* @type {number}
*/
_this.targetResolution_ = targetResolution;
/**
* @private
* @type {import("../extent.js").Extent}
*/
_this.targetExtent_ = targetExtent;
/**
* @private
* @type {import("../ImageBase.js").default}
*/
_this.sourceImage_ = sourceImage;
/**
* @private
* @type {number}
*/
_this.sourcePixelRatio_ = sourcePixelRatio;
/**
* @private
* @type {boolean}
*/
_this.interpolate_ = interpolate;
/**
* @private
* @type {HTMLCanvasElement}
*/
_this.canvas_ = null;
/**
* @private
* @type {?import("../events.js").EventsKey}
*/
_this.sourceListenerKey_ = null;
return _this;
}
/**
* Clean up.
*/
ReprojImage.prototype.disposeInternal = function () {
if (this.state == ImageState.LOADING) {
this.unlistenSource_();
}
_super.prototype.disposeInternal.call(this);
};
/**
* @return {HTMLCanvasElement} Image.
*/
ReprojImage.prototype.getImage = function () {
return this.canvas_;
};
/**
* @return {import("../proj/Projection.js").default} Projection.
*/
ReprojImage.prototype.getProjection = function () {
return this.targetProj_;
};
/**
* @private
*/
ReprojImage.prototype.reproject_ = function () {
var sourceState = this.sourceImage_.getState();
if (sourceState == ImageState.LOADED) {
var width = getWidth(this.targetExtent_) / this.targetResolution_;
var height = getHeight(this.targetExtent_) / this.targetResolution_;
this.canvas_ = renderReprojected(width, height, this.sourcePixelRatio_, this.sourceImage_.getResolution(), this.maxSourceExtent_, this.targetResolution_, this.targetExtent_, this.triangulation_, [
{
extent: this.sourceImage_.getExtent(),
image: this.sourceImage_.getImage(),
},
], 0, undefined, this.interpolate_);
}
this.state = sourceState;
this.changed();
};
/**
* Load not yet loaded URI.
*/
ReprojImage.prototype.load = function () {
if (this.state == ImageState.IDLE) {
this.state = ImageState.LOADING;
this.changed();
var sourceState = this.sourceImage_.getState();
if (sourceState == ImageState.LOADED || sourceState == ImageState.ERROR) {
this.reproject_();
}
else {
this.sourceListenerKey_ = listen(this.sourceImage_, EventType.CHANGE, function (e) {
var sourceState = this.sourceImage_.getState();
if (sourceState == ImageState.LOADED ||
sourceState == ImageState.ERROR) {
this.unlistenSource_();
this.reproject_();
}
}, this);
this.sourceImage_.load();
}
}
};
/**
* @private
*/
ReprojImage.prototype.unlistenSource_ = function () {
unlistenByKey(
/** @type {!import("../events.js").EventsKey} */ (this.sourceListenerKey_));
this.sourceListenerKey_ = null;
};
return ReprojImage;
}(ImageBase));
export default ReprojImage;
//# sourceMappingURL=Image.js.map

1
node_modules/ol/reproj/Image.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../src/reproj/Image.js"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;GAEG;AACH,OAAO,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;AAE5C,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EACL,yBAAyB,EACzB,MAAM,IAAI,iBAAiB,GAC5B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAC,MAAM,EAAE,aAAa,EAAC,MAAM,cAAc,CAAC;AAEnD;;GAEG;AAEH;;;;GAIG;AACH;IAA0B,+BAAS;IACjC;;;;;;;;;OASG;IACH,qBACE,UAA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f;QACE,aAAa;QACX,gDAAgD,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAC3E,CAAC;QACF,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;IACjC,CAAC;IACH,kBAAC;AAAD,CAAC,AAxND,CAA0B,SAAS,GAwNlC;AAED,eAAe,WAAW,CAAC"}

99
node_modules/ol/reproj/Tile.d.ts generated vendored Normal file
View File

@@ -0,0 +1,99 @@
export default ReprojTile;
export type FunctionType = (arg0: number, arg1: number, arg2: number, arg3: number) => import("../Tile.js").default;
/**
* @typedef {function(number, number, number, number) : import("../Tile.js").default} FunctionType
*/
/**
* @classdesc
* Class encapsulating single reprojected tile.
* See {@link module:ol/source/TileImage~TileImage}.
*
*/
declare class ReprojTile extends Tile {
/**
* @param {import("../proj/Projection.js").default} sourceProj Source projection.
* @param {import("../tilegrid/TileGrid.js").default} sourceTileGrid Source tile grid.
* @param {import("../proj/Projection.js").default} targetProj Target projection.
* @param {import("../tilegrid/TileGrid.js").default} targetTileGrid Target tile grid.
* @param {import("../tilecoord.js").TileCoord} tileCoord Coordinate of the tile.
* @param {import("../tilecoord.js").TileCoord} wrappedTileCoord Coordinate of the tile wrapped in X.
* @param {number} pixelRatio Pixel ratio.
* @param {number} gutter Gutter of the source tiles.
* @param {FunctionType} getTileFunction
* Function returning source tiles (z, x, y, pixelRatio).
* @param {number} [opt_errorThreshold] Acceptable reprojection error (in px).
* @param {boolean} [opt_renderEdges] Render reprojection edges.
* @param {boolean} [opt_interpolate] Use linear interpolation when resampling.
*/
constructor(sourceProj: import("../proj/Projection.js").default, sourceTileGrid: import("../tilegrid/TileGrid.js").default, targetProj: import("../proj/Projection.js").default, targetTileGrid: import("../tilegrid/TileGrid.js").default, tileCoord: import("../tilecoord.js").TileCoord, wrappedTileCoord: import("../tilecoord.js").TileCoord, pixelRatio: number, gutter: number, getTileFunction: FunctionType, opt_errorThreshold?: number | undefined, opt_renderEdges?: boolean | undefined, opt_interpolate?: boolean | undefined);
/**
* @private
* @type {boolean}
*/
private renderEdges_;
/**
* @private
* @type {number}
*/
private pixelRatio_;
/**
* @private
* @type {number}
*/
private gutter_;
/**
* @private
* @type {HTMLCanvasElement}
*/
private canvas_;
/**
* @private
* @type {import("../tilegrid/TileGrid.js").default}
*/
private sourceTileGrid_;
/**
* @private
* @type {import("../tilegrid/TileGrid.js").default}
*/
private targetTileGrid_;
/**
* @private
* @type {import("../tilecoord.js").TileCoord}
*/
private wrappedTileCoord_;
/**
* @private
* @type {!Array<import("../Tile.js").default>}
*/
private sourceTiles_;
/**
* @private
* @type {?Array<import("../events.js").EventsKey>}
*/
private sourcesListenerKeys_;
/**
* @private
* @type {number}
*/
private sourceZ_;
/**
* @private
* @type {!import("./Triangulation.js").default}
*/
private triangulation_;
/**
* Get the HTML Canvas element for this tile.
* @return {HTMLCanvasElement} Canvas.
*/
getImage(): HTMLCanvasElement;
/**
* @private
*/
private reproject_;
/**
* @private
*/
private unlistenSources_;
}
import Tile from "../Tile.js";
//# sourceMappingURL=Tile.d.ts.map

1
node_modules/ol/reproj/Tile.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Tile.d.ts","sourceRoot":"","sources":["../src/reproj/Tile.js"],"names":[],"mappings":";kCAoBsB,MAAM,QAAE,MAAM,QAAE,MAAM,QAAE,MAAM,KAAI,OAAO,YAAY,EAAE,OAAO;AADpF;;GAEG;AAEH;;;;;GAKG;AACH;IACE;;;;;;;;;;;;;;OAcG;IACH,wBAdW,OAAO,uBAAuB,EAAE,OAAO,kBACvC,OAAO,yBAAyB,EAAE,OAAO,cACzC,OAAO,uBAAuB,EAAE,OAAO,kBACvC,OAAO,yBAAyB,EAAE,OAAO,aACzC,OAAO,iBAAiB,EAAE,SAAS,oBACnC,OAAO,iBAAiB,EAAE,SAAS,cACnC,MAAM,UACN,MAAM,mBACN,YAAY,yHA6LtB;IAvKC;;;OAGG;IACH,qBAA2E;IAE3E;;;OAGG;IACH,oBAA6B;IAE7B;;;OAGG;IACH,gBAAqB;IAErB;;;OAGG;IACH,gBAAmB;IAEnB;;;OAGG;IACH,wBAAqC;IAErC;;;OAGG;IACH,wBAAqC;IAErC;;;OAGG;IACH,0BAAwE;IAExE;;;OAGG;IACH,qBAAsB;IAEtB;;;OAGG;IACH,6BAAgC;IAEhC;;;OAGG;IACH,iBAAiB;IAiDjB;;;OAGG;IACH,uBAOC;IAmDH;;;OAGG;IACH,YAFY,iBAAiB,CAI5B;IAED;;OAEG;IACH,mBAgDC;IAyDD;;OAEG;IACH,yBAGC;CAaF"}

277
node_modules/ol/reproj/Tile.js generated vendored Normal file
View File

@@ -0,0 +1,277 @@
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
/**
* @module ol/reproj/Tile
*/
import { ERROR_THRESHOLD } from './common.js';
import EventType from '../events/EventType.js';
import Tile from '../Tile.js';
import TileState from '../TileState.js';
import Triangulation from './Triangulation.js';
import { calculateSourceExtentResolution, canvasPool, render as renderReprojected, } from '../reproj.js';
import { clamp } from '../math.js';
import { getArea, getIntersection } from '../extent.js';
import { listen, unlistenByKey } from '../events.js';
import { releaseCanvas } from '../dom.js';
/**
* @typedef {function(number, number, number, number) : import("../Tile.js").default} FunctionType
*/
/**
* @classdesc
* Class encapsulating single reprojected tile.
* See {@link module:ol/source/TileImage~TileImage}.
*
*/
var ReprojTile = /** @class */ (function (_super) {
__extends(ReprojTile, _super);
/**
* @param {import("../proj/Projection.js").default} sourceProj Source projection.
* @param {import("../tilegrid/TileGrid.js").default} sourceTileGrid Source tile grid.
* @param {import("../proj/Projection.js").default} targetProj Target projection.
* @param {import("../tilegrid/TileGrid.js").default} targetTileGrid Target tile grid.
* @param {import("../tilecoord.js").TileCoord} tileCoord Coordinate of the tile.
* @param {import("../tilecoord.js").TileCoord} wrappedTileCoord Coordinate of the tile wrapped in X.
* @param {number} pixelRatio Pixel ratio.
* @param {number} gutter Gutter of the source tiles.
* @param {FunctionType} getTileFunction
* Function returning source tiles (z, x, y, pixelRatio).
* @param {number} [opt_errorThreshold] Acceptable reprojection error (in px).
* @param {boolean} [opt_renderEdges] Render reprojection edges.
* @param {boolean} [opt_interpolate] Use linear interpolation when resampling.
*/
function ReprojTile(sourceProj, sourceTileGrid, targetProj, targetTileGrid, tileCoord, wrappedTileCoord, pixelRatio, gutter, getTileFunction, opt_errorThreshold, opt_renderEdges, opt_interpolate) {
var _this = _super.call(this, tileCoord, TileState.IDLE, { interpolate: !!opt_interpolate }) || this;
/**
* @private
* @type {boolean}
*/
_this.renderEdges_ = opt_renderEdges !== undefined ? opt_renderEdges : false;
/**
* @private
* @type {number}
*/
_this.pixelRatio_ = pixelRatio;
/**
* @private
* @type {number}
*/
_this.gutter_ = gutter;
/**
* @private
* @type {HTMLCanvasElement}
*/
_this.canvas_ = null;
/**
* @private
* @type {import("../tilegrid/TileGrid.js").default}
*/
_this.sourceTileGrid_ = sourceTileGrid;
/**
* @private
* @type {import("../tilegrid/TileGrid.js").default}
*/
_this.targetTileGrid_ = targetTileGrid;
/**
* @private
* @type {import("../tilecoord.js").TileCoord}
*/
_this.wrappedTileCoord_ = wrappedTileCoord ? wrappedTileCoord : tileCoord;
/**
* @private
* @type {!Array<import("../Tile.js").default>}
*/
_this.sourceTiles_ = [];
/**
* @private
* @type {?Array<import("../events.js").EventsKey>}
*/
_this.sourcesListenerKeys_ = null;
/**
* @private
* @type {number}
*/
_this.sourceZ_ = 0;
var targetExtent = targetTileGrid.getTileCoordExtent(_this.wrappedTileCoord_);
var maxTargetExtent = _this.targetTileGrid_.getExtent();
var maxSourceExtent = _this.sourceTileGrid_.getExtent();
var limitedTargetExtent = maxTargetExtent
? getIntersection(targetExtent, maxTargetExtent)
: targetExtent;
if (getArea(limitedTargetExtent) === 0) {
// Tile is completely outside range -> EMPTY
// TODO: is it actually correct that the source even creates the tile ?
_this.state = TileState.EMPTY;
return _this;
}
var sourceProjExtent = sourceProj.getExtent();
if (sourceProjExtent) {
if (!maxSourceExtent) {
maxSourceExtent = sourceProjExtent;
}
else {
maxSourceExtent = getIntersection(maxSourceExtent, sourceProjExtent);
}
}
var targetResolution = targetTileGrid.getResolution(_this.wrappedTileCoord_[0]);
var sourceResolution = calculateSourceExtentResolution(sourceProj, targetProj, limitedTargetExtent, targetResolution);
if (!isFinite(sourceResolution) || sourceResolution <= 0) {
// invalid sourceResolution -> EMPTY
// probably edges of the projections when no extent is defined
_this.state = TileState.EMPTY;
return _this;
}
var errorThresholdInPixels = opt_errorThreshold !== undefined ? opt_errorThreshold : ERROR_THRESHOLD;
/**
* @private
* @type {!import("./Triangulation.js").default}
*/
_this.triangulation_ = new Triangulation(sourceProj, targetProj, limitedTargetExtent, maxSourceExtent, sourceResolution * errorThresholdInPixels, targetResolution);
if (_this.triangulation_.getTriangles().length === 0) {
// no valid triangles -> EMPTY
_this.state = TileState.EMPTY;
return _this;
}
_this.sourceZ_ = sourceTileGrid.getZForResolution(sourceResolution);
var sourceExtent = _this.triangulation_.calculateSourceExtent();
if (maxSourceExtent) {
if (sourceProj.canWrapX()) {
sourceExtent[1] = clamp(sourceExtent[1], maxSourceExtent[1], maxSourceExtent[3]);
sourceExtent[3] = clamp(sourceExtent[3], maxSourceExtent[1], maxSourceExtent[3]);
}
else {
sourceExtent = getIntersection(sourceExtent, maxSourceExtent);
}
}
if (!getArea(sourceExtent)) {
_this.state = TileState.EMPTY;
}
else {
var sourceRange = sourceTileGrid.getTileRangeForExtentAndZ(sourceExtent, _this.sourceZ_);
for (var srcX = sourceRange.minX; srcX <= sourceRange.maxX; srcX++) {
for (var srcY = sourceRange.minY; srcY <= sourceRange.maxY; srcY++) {
var tile = getTileFunction(_this.sourceZ_, srcX, srcY, pixelRatio);
if (tile) {
_this.sourceTiles_.push(tile);
}
}
}
if (_this.sourceTiles_.length === 0) {
_this.state = TileState.EMPTY;
}
}
return _this;
}
/**
* Get the HTML Canvas element for this tile.
* @return {HTMLCanvasElement} Canvas.
*/
ReprojTile.prototype.getImage = function () {
return this.canvas_;
};
/**
* @private
*/
ReprojTile.prototype.reproject_ = function () {
var sources = [];
this.sourceTiles_.forEach(function (tile, i, arr) {
if (tile && tile.getState() == TileState.LOADED) {
sources.push({
extent: this.sourceTileGrid_.getTileCoordExtent(tile.tileCoord),
image: tile.getImage(),
});
}
}.bind(this));
this.sourceTiles_.length = 0;
if (sources.length === 0) {
this.state = TileState.ERROR;
}
else {
var z = this.wrappedTileCoord_[0];
var size = this.targetTileGrid_.getTileSize(z);
var width = typeof size === 'number' ? size : size[0];
var height = typeof size === 'number' ? size : size[1];
var targetResolution = this.targetTileGrid_.getResolution(z);
var sourceResolution = this.sourceTileGrid_.getResolution(this.sourceZ_);
var targetExtent = this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);
this.canvas_ = renderReprojected(width, height, this.pixelRatio_, sourceResolution, this.sourceTileGrid_.getExtent(), targetResolution, targetExtent, this.triangulation_, sources, this.gutter_, this.renderEdges_, this.interpolate);
this.state = TileState.LOADED;
}
this.changed();
};
/**
* Load not yet loaded URI.
*/
ReprojTile.prototype.load = function () {
if (this.state == TileState.IDLE) {
this.state = TileState.LOADING;
this.changed();
var leftToLoad_1 = 0;
this.sourcesListenerKeys_ = [];
this.sourceTiles_.forEach(function (tile, i, arr) {
var state = tile.getState();
if (state == TileState.IDLE || state == TileState.LOADING) {
leftToLoad_1++;
var sourceListenKey_1 = listen(tile, EventType.CHANGE, function (e) {
var state = tile.getState();
if (state == TileState.LOADED ||
state == TileState.ERROR ||
state == TileState.EMPTY) {
unlistenByKey(sourceListenKey_1);
leftToLoad_1--;
if (leftToLoad_1 === 0) {
this.unlistenSources_();
this.reproject_();
}
}
}, this);
this.sourcesListenerKeys_.push(sourceListenKey_1);
}
}.bind(this));
if (leftToLoad_1 === 0) {
setTimeout(this.reproject_.bind(this), 0);
}
else {
this.sourceTiles_.forEach(function (tile, i, arr) {
var state = tile.getState();
if (state == TileState.IDLE) {
tile.load();
}
});
}
}
};
/**
* @private
*/
ReprojTile.prototype.unlistenSources_ = function () {
this.sourcesListenerKeys_.forEach(unlistenByKey);
this.sourcesListenerKeys_ = null;
};
/**
* Remove from the cache due to expiry
*/
ReprojTile.prototype.release = function () {
if (this.canvas_) {
releaseCanvas(this.canvas_.getContext('2d'));
canvasPool.push(this.canvas_);
this.canvas_ = null;
}
_super.prototype.release.call(this);
};
return ReprojTile;
}(Tile));
export default ReprojTile;
//# sourceMappingURL=Tile.js.map

1
node_modules/ol/reproj/Tile.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

121
node_modules/ol/reproj/Triangulation.d.ts generated vendored Normal file
View File

@@ -0,0 +1,121 @@
export default Triangulation;
/**
* Single triangle; consists of 3 source points and 3 target points.
*/
export type Triangle = {
/**
* Source.
*/
source: Array<import("../coordinate.js").Coordinate>;
/**
* Target.
*/
target: Array<import("../coordinate.js").Coordinate>;
};
/**
* @classdesc
* Class containing triangulation of the given target extent.
* Used for determining source data and the reprojection itself.
*/
declare class Triangulation {
/**
* @param {import("../proj/Projection.js").default} sourceProj Source projection.
* @param {import("../proj/Projection.js").default} targetProj Target projection.
* @param {import("../extent.js").Extent} targetExtent Target extent to triangulate.
* @param {import("../extent.js").Extent} maxSourceExtent Maximal source extent that can be used.
* @param {number} errorThreshold Acceptable error (in source units).
* @param {?number} opt_destinationResolution The (optional) resolution of the destination.
*/
constructor(sourceProj: import("../proj/Projection.js").default, targetProj: import("../proj/Projection.js").default, targetExtent: import("../extent.js").Extent, maxSourceExtent: import("../extent.js").Extent, errorThreshold: number, opt_destinationResolution: number | null);
/**
* @type {import("../proj/Projection.js").default}
* @private
*/
private sourceProj_;
/**
* @type {import("../proj/Projection.js").default}
* @private
*/
private targetProj_;
/**
* @param {import("../coordinate.js").Coordinate} c A coordinate.
* @return {import("../coordinate.js").Coordinate} Transformed coordinate.
* @private
*/
private transformInv_;
/**
* @type {import("../extent.js").Extent}
* @private
*/
private maxSourceExtent_;
/**
* @type {number}
* @private
*/
private errorThresholdSquared_;
/**
* @type {Array<Triangle>}
* @private
*/
private triangles_;
/**
* Indicates that the triangulation crosses edge of the source projection.
* @type {boolean}
* @private
*/
private wrapsXInSource_;
/**
* @type {boolean}
* @private
*/
private canWrapXInSource_;
/**
* @type {?number}
* @private
*/
private sourceWorldWidth_;
/**
* @type {?number}
* @private
*/
private targetWorldWidth_;
/**
* Adds triangle to the triangulation.
* @param {import("../coordinate.js").Coordinate} a The target a coordinate.
* @param {import("../coordinate.js").Coordinate} b The target b coordinate.
* @param {import("../coordinate.js").Coordinate} c The target c coordinate.
* @param {import("../coordinate.js").Coordinate} aSrc The source a coordinate.
* @param {import("../coordinate.js").Coordinate} bSrc The source b coordinate.
* @param {import("../coordinate.js").Coordinate} cSrc The source c coordinate.
* @private
*/
private addTriangle_;
/**
* Adds quad (points in clock-wise order) to the triangulation
* (and reprojects the vertices) if valid.
* Performs quad subdivision if needed to increase precision.
*
* @param {import("../coordinate.js").Coordinate} a The target a coordinate.
* @param {import("../coordinate.js").Coordinate} b The target b coordinate.
* @param {import("../coordinate.js").Coordinate} c The target c coordinate.
* @param {import("../coordinate.js").Coordinate} d The target d coordinate.
* @param {import("../coordinate.js").Coordinate} aSrc The source a coordinate.
* @param {import("../coordinate.js").Coordinate} bSrc The source b coordinate.
* @param {import("../coordinate.js").Coordinate} cSrc The source c coordinate.
* @param {import("../coordinate.js").Coordinate} dSrc The source d coordinate.
* @param {number} maxSubdivision Maximal allowed subdivision of the quad.
* @private
*/
private addQuad_;
/**
* Calculates extent of the `source` coordinates from all the triangles.
*
* @return {import("../extent.js").Extent} Calculated extent.
*/
calculateSourceExtent(): import("../extent.js").Extent;
/**
* @return {Array<Triangle>} Array of the calculated triangles.
*/
getTriangles(): Array<Triangle>;
}
//# sourceMappingURL=Triangulation.d.ts.map

1
node_modules/ol/reproj/Triangulation.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Triangulation.d.ts","sourceRoot":"","sources":["../src/reproj/Triangulation.js"],"names":[],"mappings":";;;;;;;;YAqBc,MAAM,OAAO,kBAAkB,EAAE,UAAU,CAAC;;;;YAC5C,MAAM,OAAO,kBAAkB,EAAE,UAAU,CAAC;;AAsB1D;;;;GAIG;AACH;IACE;;;;;;;OAOG;IACH,wBAPW,OAAO,uBAAuB,EAAE,OAAO,cACvC,OAAO,uBAAuB,EAAE,OAAO,gBACvC,OAAO,cAAc,EAAE,MAAM,mBAC7B,OAAO,cAAc,EAAE,MAAM,kBAC7B,MAAM,6BACL,MAAM,SAuMjB;IA7LC;;;OAGG;IACH,oBAA6B;IAE7B;;;OAGG;IACH,oBAA6B;IAM7B;;;;OAIG;IACH,sBAMC;IAED;;;OAGG;IACH,yBAAuC;IAEvC;;;OAGG;IACH,+BAA6D;IAE7D;;;OAGG;IACH,mBAAoB;IAEpB;;;;OAIG;IACH,wBAA4B;IAE5B;;;OAGG;IACH,0BAIqE;IAErE;;;OAGG;IACH,0BAEQ;IAER;;;OAGG;IACH,0BAEQ;IAiHV;;;;;;;;;OASG;IACH,qBAKC;IAED;;;;;;;;;;;;;;;OAeG;IACH,iBA4LC;IAED;;;;OAIG;IACH,yBAFY,OAAO,cAAc,EAAE,MAAM,CAaxC;IAED;;OAEG;IACH,gBAFY,MAAM,QAAQ,CAAC,CAI1B;CACF"}

366
node_modules/ol/reproj/Triangulation.js generated vendored Normal file
View File

@@ -0,0 +1,366 @@
/**
* @module ol/reproj/Triangulation
*/
import { boundingExtent, createEmpty, extendCoordinate, getArea, getBottomLeft, getBottomRight, getTopLeft, getTopRight, getWidth, intersects, } from '../extent.js';
import { getTransform } from '../proj.js';
import { log2, modulo } from '../math.js';
/**
* Single triangle; consists of 3 source points and 3 target points.
* @typedef {Object} Triangle
* @property {Array<import("../coordinate.js").Coordinate>} source Source.
* @property {Array<import("../coordinate.js").Coordinate>} target Target.
*/
/**
* Maximum number of subdivision steps during raster reprojection triangulation.
* Prevents high memory usage and large number of proj4 calls (for certain
* transformations and areas). At most `2*(2^this)` triangles are created for
* each triangulated extent (tile/image).
* @type {number}
*/
var MAX_SUBDIVISION = 10;
/**
* Maximum allowed size of triangle relative to world width. When transforming
* corners of world extent between certain projections, the resulting
* triangulation seems to have zero error and no subdivision is performed. If
* the triangle width is more than this (relative to world width; 0-1),
* subdivison is forced (up to `MAX_SUBDIVISION`). Default is `0.25`.
* @type {number}
*/
var MAX_TRIANGLE_WIDTH = 0.25;
/**
* @classdesc
* Class containing triangulation of the given target extent.
* Used for determining source data and the reprojection itself.
*/
var Triangulation = /** @class */ (function () {
/**
* @param {import("../proj/Projection.js").default} sourceProj Source projection.
* @param {import("../proj/Projection.js").default} targetProj Target projection.
* @param {import("../extent.js").Extent} targetExtent Target extent to triangulate.
* @param {import("../extent.js").Extent} maxSourceExtent Maximal source extent that can be used.
* @param {number} errorThreshold Acceptable error (in source units).
* @param {?number} opt_destinationResolution The (optional) resolution of the destination.
*/
function Triangulation(sourceProj, targetProj, targetExtent, maxSourceExtent, errorThreshold, opt_destinationResolution) {
/**
* @type {import("../proj/Projection.js").default}
* @private
*/
this.sourceProj_ = sourceProj;
/**
* @type {import("../proj/Projection.js").default}
* @private
*/
this.targetProj_ = targetProj;
/** @type {!Object<string, import("../coordinate.js").Coordinate>} */
var transformInvCache = {};
var transformInv = getTransform(this.targetProj_, this.sourceProj_);
/**
* @param {import("../coordinate.js").Coordinate} c A coordinate.
* @return {import("../coordinate.js").Coordinate} Transformed coordinate.
* @private
*/
this.transformInv_ = function (c) {
var key = c[0] + '/' + c[1];
if (!transformInvCache[key]) {
transformInvCache[key] = transformInv(c);
}
return transformInvCache[key];
};
/**
* @type {import("../extent.js").Extent}
* @private
*/
this.maxSourceExtent_ = maxSourceExtent;
/**
* @type {number}
* @private
*/
this.errorThresholdSquared_ = errorThreshold * errorThreshold;
/**
* @type {Array<Triangle>}
* @private
*/
this.triangles_ = [];
/**
* Indicates that the triangulation crosses edge of the source projection.
* @type {boolean}
* @private
*/
this.wrapsXInSource_ = false;
/**
* @type {boolean}
* @private
*/
this.canWrapXInSource_ =
this.sourceProj_.canWrapX() &&
!!maxSourceExtent &&
!!this.sourceProj_.getExtent() &&
getWidth(maxSourceExtent) == getWidth(this.sourceProj_.getExtent());
/**
* @type {?number}
* @private
*/
this.sourceWorldWidth_ = this.sourceProj_.getExtent()
? getWidth(this.sourceProj_.getExtent())
: null;
/**
* @type {?number}
* @private
*/
this.targetWorldWidth_ = this.targetProj_.getExtent()
? getWidth(this.targetProj_.getExtent())
: null;
var destinationTopLeft = getTopLeft(targetExtent);
var destinationTopRight = getTopRight(targetExtent);
var destinationBottomRight = getBottomRight(targetExtent);
var destinationBottomLeft = getBottomLeft(targetExtent);
var sourceTopLeft = this.transformInv_(destinationTopLeft);
var sourceTopRight = this.transformInv_(destinationTopRight);
var sourceBottomRight = this.transformInv_(destinationBottomRight);
var sourceBottomLeft = this.transformInv_(destinationBottomLeft);
/*
* The maxSubdivision controls how many splittings of the target area can
* be done. The idea here is to do a linear mapping of the target areas
* but the actual overal reprojection (can be) extremely non-linear. The
* default value of MAX_SUBDIVISION was chosen based on mapping a 256x256
* tile size. However this function is also called to remap canvas rendered
* layers which can be much larger. This calculation increases the maxSubdivision
* value by the right factor so that each 256x256 pixel area has
* MAX_SUBDIVISION divisions.
*/
var maxSubdivision = MAX_SUBDIVISION +
(opt_destinationResolution
? Math.max(0, Math.ceil(log2(getArea(targetExtent) /
(opt_destinationResolution *
opt_destinationResolution *
256 *
256))))
: 0);
this.addQuad_(destinationTopLeft, destinationTopRight, destinationBottomRight, destinationBottomLeft, sourceTopLeft, sourceTopRight, sourceBottomRight, sourceBottomLeft, maxSubdivision);
if (this.wrapsXInSource_) {
var leftBound_1 = Infinity;
this.triangles_.forEach(function (triangle, i, arr) {
leftBound_1 = Math.min(leftBound_1, triangle.source[0][0], triangle.source[1][0], triangle.source[2][0]);
});
// Shift triangles to be as close to `leftBound` as possible
// (if the distance is more than `worldWidth / 2` it can be closer.
this.triangles_.forEach(function (triangle) {
if (Math.max(triangle.source[0][0], triangle.source[1][0], triangle.source[2][0]) -
leftBound_1 >
this.sourceWorldWidth_ / 2) {
var newTriangle = [
[triangle.source[0][0], triangle.source[0][1]],
[triangle.source[1][0], triangle.source[1][1]],
[triangle.source[2][0], triangle.source[2][1]],
];
if (newTriangle[0][0] - leftBound_1 > this.sourceWorldWidth_ / 2) {
newTriangle[0][0] -= this.sourceWorldWidth_;
}
if (newTriangle[1][0] - leftBound_1 > this.sourceWorldWidth_ / 2) {
newTriangle[1][0] -= this.sourceWorldWidth_;
}
if (newTriangle[2][0] - leftBound_1 > this.sourceWorldWidth_ / 2) {
newTriangle[2][0] -= this.sourceWorldWidth_;
}
// Rarely (if the extent contains both the dateline and prime meridian)
// the shift can in turn break some triangles.
// Detect this here and don't shift in such cases.
var minX = Math.min(newTriangle[0][0], newTriangle[1][0], newTriangle[2][0]);
var maxX = Math.max(newTriangle[0][0], newTriangle[1][0], newTriangle[2][0]);
if (maxX - minX < this.sourceWorldWidth_ / 2) {
triangle.source = newTriangle;
}
}
}.bind(this));
}
transformInvCache = {};
}
/**
* Adds triangle to the triangulation.
* @param {import("../coordinate.js").Coordinate} a The target a coordinate.
* @param {import("../coordinate.js").Coordinate} b The target b coordinate.
* @param {import("../coordinate.js").Coordinate} c The target c coordinate.
* @param {import("../coordinate.js").Coordinate} aSrc The source a coordinate.
* @param {import("../coordinate.js").Coordinate} bSrc The source b coordinate.
* @param {import("../coordinate.js").Coordinate} cSrc The source c coordinate.
* @private
*/
Triangulation.prototype.addTriangle_ = function (a, b, c, aSrc, bSrc, cSrc) {
this.triangles_.push({
source: [aSrc, bSrc, cSrc],
target: [a, b, c],
});
};
/**
* Adds quad (points in clock-wise order) to the triangulation
* (and reprojects the vertices) if valid.
* Performs quad subdivision if needed to increase precision.
*
* @param {import("../coordinate.js").Coordinate} a The target a coordinate.
* @param {import("../coordinate.js").Coordinate} b The target b coordinate.
* @param {import("../coordinate.js").Coordinate} c The target c coordinate.
* @param {import("../coordinate.js").Coordinate} d The target d coordinate.
* @param {import("../coordinate.js").Coordinate} aSrc The source a coordinate.
* @param {import("../coordinate.js").Coordinate} bSrc The source b coordinate.
* @param {import("../coordinate.js").Coordinate} cSrc The source c coordinate.
* @param {import("../coordinate.js").Coordinate} dSrc The source d coordinate.
* @param {number} maxSubdivision Maximal allowed subdivision of the quad.
* @private
*/
Triangulation.prototype.addQuad_ = function (a, b, c, d, aSrc, bSrc, cSrc, dSrc, maxSubdivision) {
var sourceQuadExtent = boundingExtent([aSrc, bSrc, cSrc, dSrc]);
var sourceCoverageX = this.sourceWorldWidth_
? getWidth(sourceQuadExtent) / this.sourceWorldWidth_
: null;
var sourceWorldWidth = /** @type {number} */ (this.sourceWorldWidth_);
// when the quad is wrapped in the source projection
// it covers most of the projection extent, but not fully
var wrapsX = this.sourceProj_.canWrapX() &&
sourceCoverageX > 0.5 &&
sourceCoverageX < 1;
var needsSubdivision = false;
if (maxSubdivision > 0) {
if (this.targetProj_.isGlobal() && this.targetWorldWidth_) {
var targetQuadExtent = boundingExtent([a, b, c, d]);
var targetCoverageX = getWidth(targetQuadExtent) / this.targetWorldWidth_;
needsSubdivision =
targetCoverageX > MAX_TRIANGLE_WIDTH || needsSubdivision;
}
if (!wrapsX && this.sourceProj_.isGlobal() && sourceCoverageX) {
needsSubdivision =
sourceCoverageX > MAX_TRIANGLE_WIDTH || needsSubdivision;
}
}
if (!needsSubdivision && this.maxSourceExtent_) {
if (isFinite(sourceQuadExtent[0]) &&
isFinite(sourceQuadExtent[1]) &&
isFinite(sourceQuadExtent[2]) &&
isFinite(sourceQuadExtent[3])) {
if (!intersects(sourceQuadExtent, this.maxSourceExtent_)) {
// whole quad outside source projection extent -> ignore
return;
}
}
}
var isNotFinite = 0;
if (!needsSubdivision) {
if (!isFinite(aSrc[0]) ||
!isFinite(aSrc[1]) ||
!isFinite(bSrc[0]) ||
!isFinite(bSrc[1]) ||
!isFinite(cSrc[0]) ||
!isFinite(cSrc[1]) ||
!isFinite(dSrc[0]) ||
!isFinite(dSrc[1])) {
if (maxSubdivision > 0) {
needsSubdivision = true;
}
else {
// It might be the case that only 1 of the points is infinite. In this case
// we can draw a single triangle with the other three points
isNotFinite =
(!isFinite(aSrc[0]) || !isFinite(aSrc[1]) ? 8 : 0) +
(!isFinite(bSrc[0]) || !isFinite(bSrc[1]) ? 4 : 0) +
(!isFinite(cSrc[0]) || !isFinite(cSrc[1]) ? 2 : 0) +
(!isFinite(dSrc[0]) || !isFinite(dSrc[1]) ? 1 : 0);
if (isNotFinite != 1 &&
isNotFinite != 2 &&
isNotFinite != 4 &&
isNotFinite != 8) {
return;
}
}
}
}
if (maxSubdivision > 0) {
if (!needsSubdivision) {
var center = [(a[0] + c[0]) / 2, (a[1] + c[1]) / 2];
var centerSrc = this.transformInv_(center);
var dx = void 0;
if (wrapsX) {
var centerSrcEstimX = (modulo(aSrc[0], sourceWorldWidth) +
modulo(cSrc[0], sourceWorldWidth)) /
2;
dx = centerSrcEstimX - modulo(centerSrc[0], sourceWorldWidth);
}
else {
dx = (aSrc[0] + cSrc[0]) / 2 - centerSrc[0];
}
var dy = (aSrc[1] + cSrc[1]) / 2 - centerSrc[1];
var centerSrcErrorSquared = dx * dx + dy * dy;
needsSubdivision = centerSrcErrorSquared > this.errorThresholdSquared_;
}
if (needsSubdivision) {
if (Math.abs(a[0] - c[0]) <= Math.abs(a[1] - c[1])) {
// split horizontally (top & bottom)
var bc = [(b[0] + c[0]) / 2, (b[1] + c[1]) / 2];
var bcSrc = this.transformInv_(bc);
var da = [(d[0] + a[0]) / 2, (d[1] + a[1]) / 2];
var daSrc = this.transformInv_(da);
this.addQuad_(a, b, bc, da, aSrc, bSrc, bcSrc, daSrc, maxSubdivision - 1);
this.addQuad_(da, bc, c, d, daSrc, bcSrc, cSrc, dSrc, maxSubdivision - 1);
}
else {
// split vertically (left & right)
var ab = [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2];
var abSrc = this.transformInv_(ab);
var cd = [(c[0] + d[0]) / 2, (c[1] + d[1]) / 2];
var cdSrc = this.transformInv_(cd);
this.addQuad_(a, ab, cd, d, aSrc, abSrc, cdSrc, dSrc, maxSubdivision - 1);
this.addQuad_(ab, b, c, cd, abSrc, bSrc, cSrc, cdSrc, maxSubdivision - 1);
}
return;
}
}
if (wrapsX) {
if (!this.canWrapXInSource_) {
return;
}
this.wrapsXInSource_ = true;
}
// Exactly zero or one of *Src is not finite
// The triangles must have the diagonal line as the first side
// This is to allow easy code in reproj.s to make it straight for broken
// browsers that can't handle diagonal clipping
if ((isNotFinite & 0xb) == 0) {
this.addTriangle_(a, c, d, aSrc, cSrc, dSrc);
}
if ((isNotFinite & 0xe) == 0) {
this.addTriangle_(a, c, b, aSrc, cSrc, bSrc);
}
if (isNotFinite) {
// Try the other two triangles
if ((isNotFinite & 0xd) == 0) {
this.addTriangle_(b, d, a, bSrc, dSrc, aSrc);
}
if ((isNotFinite & 0x7) == 0) {
this.addTriangle_(b, d, c, bSrc, dSrc, cSrc);
}
}
};
/**
* Calculates extent of the `source` coordinates from all the triangles.
*
* @return {import("../extent.js").Extent} Calculated extent.
*/
Triangulation.prototype.calculateSourceExtent = function () {
var extent = createEmpty();
this.triangles_.forEach(function (triangle, i, arr) {
var src = triangle.source;
extendCoordinate(extent, src[0]);
extendCoordinate(extent, src[1]);
extendCoordinate(extent, src[2]);
});
return extent;
};
/**
* @return {Array<Triangle>} Array of the calculated triangles.
*/
Triangulation.prototype.getTriangles = function () {
return this.triangles_;
};
return Triangulation;
}());
export default Triangulation;
//# sourceMappingURL=Triangulation.js.map

1
node_modules/ol/reproj/Triangulation.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

16
node_modules/ol/reproj/common.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* @module ol/reproj/common
*/
/**
* Default maximum allowed threshold (in pixels) for reprojection
* triangulation.
* @type {number}
*/
export const ERROR_THRESHOLD: number;
/**
* Enable automatic reprojection of raster sources. Default is `true`.
* TODO: decide if we want to expose this as a build flag or remove it
* @type {boolean}
*/
export const ENABLE_RASTER_REPROJECTION: boolean;
//# sourceMappingURL=common.d.ts.map

1
node_modules/ol/reproj/common.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/reproj/common.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,8BAFU,MAAM,CAEmB;AAEnC;;;;GAIG;AACH,yCAFU,OAAO,CAE8B"}

16
node_modules/ol/reproj/common.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
/**
* @module ol/reproj/common
*/
/**
* Default maximum allowed threshold (in pixels) for reprojection
* triangulation.
* @type {number}
*/
export var ERROR_THRESHOLD = 0.5;
/**
* Enable automatic reprojection of raster sources. Default is `true`.
* TODO: decide if we want to expose this as a build flag or remove it
* @type {boolean}
*/
export var ENABLE_RASTER_REPROJECTION = true;
//# sourceMappingURL=common.js.map

1
node_modules/ol/reproj/common.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/reproj/common.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,MAAM,CAAC,IAAM,eAAe,GAAG,GAAG,CAAC;AAEnC;;;;GAIG;AACH,MAAM,CAAC,IAAM,0BAA0B,GAAG,IAAI,CAAC"}