@vaadin/bundles 23.0.9 → 23.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules_ol_ImageCanvas_js.js +121 -0
- package/node_modules_ol_ImageCanvas_js.js.map +1 -0
- package/node_modules_ol_ImageTile_js.js +177 -0
- package/node_modules_ol_ImageTile_js.js.map +1 -0
- package/node_modules_ol_TileRange_js.js +154 -0
- package/node_modules_ol_TileRange_js.js.map +1 -0
- package/node_modules_ol_VectorRenderTile_js.js +182 -0
- package/node_modules_ol_VectorRenderTile_js.js.map +1 -0
- package/node_modules_ol_VectorTile_js.js +158 -0
- package/node_modules_ol_VectorTile_js.js.map +1 -0
- package/node_modules_ol_geom_flat_geodesic_js.js +171 -0
- package/node_modules_ol_geom_flat_geodesic_js.js.map +1 -0
- package/node_modules_ol_render_js.js +131 -0
- package/node_modules_ol_render_js.js.map +1 -0
- package/node_modules_ol_structs_LRUCache_js.js +275 -0
- package/node_modules_ol_structs_LRUCache_js.js.map +1 -0
- package/node_modules_ol_style_js.js +47 -0
- package/node_modules_ol_style_js.js.map +1 -0
- package/node_modules_ol_tilecoord_js.js +115 -0
- package/node_modules_ol_tilecoord_js.js.map +1 -0
- package/package.json +146 -119
- package/vaadin-bundle.json +2571 -949
- package/vaadin.js +83552 -36675
- package/vaadin.js.map +1 -1
- package/vendors-node_modules_ol_Geolocation_js.js +379 -0
- package/vendors-node_modules_ol_Geolocation_js.js.map +1 -0
- package/vendors-node_modules_ol_TileCache_js.js +461 -0
- package/vendors-node_modules_ol_TileCache_js.js.map +1 -0
- package/vendors-node_modules_ol_Tile_js.js +330 -0
- package/vendors-node_modules_ol_Tile_js.js.map +1 -0
- package/vendors-node_modules_ol_index_js.js +874 -0
- package/vendors-node_modules_ol_index_js.js.map +1 -0
- package/vendors-node_modules_ol_layer_Graticule_js.js +1359 -0
- package/vendors-node_modules_ol_layer_Graticule_js.js.map +1 -0
- package/vendors-node_modules_ol_style_Text_js.js +509 -0
- package/vendors-node_modules_ol_style_Text_js.js.map +1 -0
- package/vendors-node_modules_rbush_index_js.js +531 -0
- package/vendors-node_modules_rbush_index_js.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_modules_ol_VectorRenderTile_js.js","mappings":";;;;;;;;;;;;;;;AAAA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AAC6B;AACoB;AACd;AACnC;AACA,aAAa,QAAQ;AACrB,cAAc,SAAS;AACvB,cAAc,0CAA0C;AACxD,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD,eAAe,kCAAkC;AACjD,eAAe,oCAAoC;AACnD,eAAe,kEAAkE;AACjF;AACA;AACA;AACA,0DAA0D,eAAe;AACzE;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD,gBAAgB,0BAA0B;AAC1C;AACA;AACA,kBAAkB,gDAAM;AACxB;AACA,iCAAiC,8DAAqB;AACtD;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD,gBAAgB,SAAS;AACzB;AACA;AACA,eAAe,gDAAM;AACrB;AACA;AACA;AACA,eAAe,oCAAoC;AACnD,gBAAgB,mBAAmB;AACnC;AACA;AACA;AACA;AACA;AACA,eAAe,oCAAoC;AACnD,gBAAgB,aAAa;AAC7B;AACA;AACA,kBAAkB,gDAAM;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,gDAAI;AACN,iEAAe,gBAAgB,EAAC;AAChC","sources":["webpack://@vaadin/bundles/./node_modules/ol/VectorRenderTile.js"],"sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/VectorRenderTile\n */\nimport Tile from './Tile.js';\nimport { createCanvasContext2D } from './dom.js';\nimport { getUid } from './util.js';\n/**\n * @typedef {Object} ReplayState\n * @property {boolean} dirty Dirty.\n * @property {null|import(\"./render.js\").OrderFunction} renderedRenderOrder RenderedRenderOrder.\n * @property {number} renderedTileRevision RenderedTileRevision.\n * @property {number} renderedResolution RenderedResolution.\n * @property {number} renderedRevision RenderedRevision.\n * @property {number} renderedTileResolution RenderedTileResolution.\n * @property {number} renderedTileZ RenderedTileZ.\n */\n/**\n * @type {Array<HTMLCanvasElement>}\n */\nvar canvasPool = [];\nvar VectorRenderTile = /** @class */ (function (_super) {\n __extends(VectorRenderTile, _super);\n /**\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {import(\"./TileState.js\").default} state State.\n * @param {import(\"./tilecoord.js\").TileCoord} urlTileCoord Wrapped tile coordinate for source urls.\n * @param {function(VectorRenderTile):Array<import(\"./VectorTile\").default>} getSourceTiles Function\n * to get source tiles for this tile.\n */\n function VectorRenderTile(tileCoord, state, urlTileCoord, getSourceTiles) {\n var _this = _super.call(this, tileCoord, state, { transition: 0 }) || this;\n /**\n * @private\n * @type {!Object<string, CanvasRenderingContext2D>}\n */\n _this.context_ = {};\n /**\n * Executor groups by layer uid. Entries are read/written by the renderer.\n * @type {Object<string, Array<import(\"./render/canvas/ExecutorGroup.js\").default>>}\n */\n _this.executorGroups = {};\n /**\n * Executor groups for decluttering, by layer uid. Entries are read/written by the renderer.\n * @type {Object<string, Array<import(\"./render/canvas/ExecutorGroup.js\").default>>}\n */\n _this.declutterExecutorGroups = {};\n /**\n * Number of loading source tiles. Read/written by the source.\n * @type {number}\n */\n _this.loadingSourceTiles = 0;\n /**\n * @type {Object<number, ImageData>}\n */\n _this.hitDetectionImageData = {};\n /**\n * @private\n * @type {!Object<string, ReplayState>}\n */\n _this.replayState_ = {};\n /**\n * @type {Array<import(\"./VectorTile.js\").default>}\n */\n _this.sourceTiles = [];\n /**\n * @type {Object<string, boolean>}\n */\n _this.errorTileKeys = {};\n /**\n * @type {number}\n */\n _this.wantedResolution;\n /**\n * @type {!function():Array<import(\"./VectorTile.js\").default>}\n */\n _this.getSourceTiles = getSourceTiles.bind(undefined, _this);\n /**\n * @type {import(\"./tilecoord.js\").TileCoord}\n */\n _this.wrappedTileCoord = urlTileCoord;\n return _this;\n }\n /**\n * @param {import(\"./layer/Layer.js\").default} layer Layer.\n * @return {CanvasRenderingContext2D} The rendering context.\n */\n VectorRenderTile.prototype.getContext = function (layer) {\n var key = getUid(layer);\n if (!(key in this.context_)) {\n this.context_[key] = createCanvasContext2D(1, 1, canvasPool);\n }\n return this.context_[key];\n };\n /**\n * @param {import(\"./layer/Layer.js\").default} layer Layer.\n * @return {boolean} Tile has a rendering context for the given layer.\n */\n VectorRenderTile.prototype.hasContext = function (layer) {\n return getUid(layer) in this.context_;\n };\n /**\n * Get the Canvas for this tile.\n * @param {import(\"./layer/Layer.js\").default} layer Layer.\n * @return {HTMLCanvasElement} Canvas.\n */\n VectorRenderTile.prototype.getImage = function (layer) {\n return this.hasContext(layer) ? this.getContext(layer).canvas : null;\n };\n /**\n * @param {import(\"./layer/Layer.js\").default} layer Layer.\n * @return {ReplayState} The replay state.\n */\n VectorRenderTile.prototype.getReplayState = function (layer) {\n var key = getUid(layer);\n if (!(key in this.replayState_)) {\n this.replayState_[key] = {\n dirty: false,\n renderedRenderOrder: null,\n renderedResolution: NaN,\n renderedRevision: -1,\n renderedTileResolution: NaN,\n renderedTileRevision: -1,\n renderedTileZ: -1,\n };\n }\n return this.replayState_[key];\n };\n /**\n * Load the tile.\n */\n VectorRenderTile.prototype.load = function () {\n this.getSourceTiles();\n };\n /**\n * Remove from the cache due to expiry\n */\n VectorRenderTile.prototype.release = function () {\n for (var key in this.context_) {\n canvasPool.push(this.context_[key].canvas);\n delete this.context_[key];\n }\n _super.prototype.release.call(this);\n };\n return VectorRenderTile;\n}(Tile));\nexport default VectorRenderTile;\n//# sourceMappingURL=VectorRenderTile.js.map"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
(self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["node_modules_ol_VectorTile_js"],{
|
|
2
|
+
|
|
3
|
+
/***/ "./node_modules/ol/VectorTile.js":
|
|
4
|
+
/*!***************************************!*\
|
|
5
|
+
!*** ./node_modules/ol/VectorTile.js ***!
|
|
6
|
+
\***************************************/
|
|
7
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
8
|
+
|
|
9
|
+
__webpack_require__.r(__webpack_exports__);
|
|
10
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11
|
+
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
12
|
+
/* harmony export */ });
|
|
13
|
+
/* harmony import */ var _Tile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Tile.js */ "./node_modules/ol/Tile.js");
|
|
14
|
+
/* harmony import */ var _TileState_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TileState.js */ "./node_modules/ol/TileState.js");
|
|
15
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
|
16
|
+
var extendStatics = function (d, b) {
|
|
17
|
+
extendStatics = Object.setPrototypeOf ||
|
|
18
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
+
return extendStatics(d, b);
|
|
21
|
+
};
|
|
22
|
+
return function (d, b) {
|
|
23
|
+
if (typeof b !== "function" && b !== null)
|
|
24
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
+
extendStatics(d, b);
|
|
26
|
+
function __() { this.constructor = d; }
|
|
27
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
/**
|
|
31
|
+
* @module ol/VectorTile
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
var VectorTile = /** @class */ (function (_super) {
|
|
36
|
+
__extends(VectorTile, _super);
|
|
37
|
+
/**
|
|
38
|
+
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
|
|
39
|
+
* @param {import("./TileState.js").default} state State.
|
|
40
|
+
* @param {string} src Data source url.
|
|
41
|
+
* @param {import("./format/Feature.js").default} format Feature format.
|
|
42
|
+
* @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function.
|
|
43
|
+
* @param {import("./Tile.js").Options} [opt_options] Tile options.
|
|
44
|
+
*/
|
|
45
|
+
function VectorTile(tileCoord, state, src, format, tileLoadFunction, opt_options) {
|
|
46
|
+
var _this = _super.call(this, tileCoord, state, opt_options) || this;
|
|
47
|
+
/**
|
|
48
|
+
* Extent of this tile; set by the source.
|
|
49
|
+
* @type {import("./extent.js").Extent}
|
|
50
|
+
*/
|
|
51
|
+
_this.extent = null;
|
|
52
|
+
/**
|
|
53
|
+
* @private
|
|
54
|
+
* @type {import("./format/Feature.js").default}
|
|
55
|
+
*/
|
|
56
|
+
_this.format_ = format;
|
|
57
|
+
/**
|
|
58
|
+
* @private
|
|
59
|
+
* @type {Array<import("./Feature.js").default>}
|
|
60
|
+
*/
|
|
61
|
+
_this.features_ = null;
|
|
62
|
+
/**
|
|
63
|
+
* @private
|
|
64
|
+
* @type {import("./featureloader.js").FeatureLoader}
|
|
65
|
+
*/
|
|
66
|
+
_this.loader_;
|
|
67
|
+
/**
|
|
68
|
+
* Feature projection of this tile; set by the source.
|
|
69
|
+
* @type {import("./proj/Projection.js").default}
|
|
70
|
+
*/
|
|
71
|
+
_this.projection = null;
|
|
72
|
+
/**
|
|
73
|
+
* Resolution of this tile; set by the source.
|
|
74
|
+
* @type {number}
|
|
75
|
+
*/
|
|
76
|
+
_this.resolution;
|
|
77
|
+
/**
|
|
78
|
+
* @private
|
|
79
|
+
* @type {import("./Tile.js").LoadFunction}
|
|
80
|
+
*/
|
|
81
|
+
_this.tileLoadFunction_ = tileLoadFunction;
|
|
82
|
+
/**
|
|
83
|
+
* @private
|
|
84
|
+
* @type {string}
|
|
85
|
+
*/
|
|
86
|
+
_this.url_ = src;
|
|
87
|
+
_this.key = src;
|
|
88
|
+
return _this;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get the feature format assigned for reading this tile's features.
|
|
92
|
+
* @return {import("./format/Feature.js").default} Feature format.
|
|
93
|
+
* @api
|
|
94
|
+
*/
|
|
95
|
+
VectorTile.prototype.getFormat = function () {
|
|
96
|
+
return this.format_;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Get the features for this tile. Geometries will be in the view projection.
|
|
100
|
+
* @return {Array<import("./Feature.js").FeatureLike>} Features.
|
|
101
|
+
* @api
|
|
102
|
+
*/
|
|
103
|
+
VectorTile.prototype.getFeatures = function () {
|
|
104
|
+
return this.features_;
|
|
105
|
+
};
|
|
106
|
+
/**
|
|
107
|
+
* Load not yet loaded URI.
|
|
108
|
+
*/
|
|
109
|
+
VectorTile.prototype.load = function () {
|
|
110
|
+
if (this.state == _TileState_js__WEBPACK_IMPORTED_MODULE_0__["default"].IDLE) {
|
|
111
|
+
this.setState(_TileState_js__WEBPACK_IMPORTED_MODULE_0__["default"].LOADING);
|
|
112
|
+
this.tileLoadFunction_(this, this.url_);
|
|
113
|
+
if (this.loader_) {
|
|
114
|
+
this.loader_(this.extent, this.resolution, this.projection);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Handler for successful tile load.
|
|
120
|
+
* @param {Array<import("./Feature.js").default>} features The loaded features.
|
|
121
|
+
* @param {import("./proj/Projection.js").default} dataProjection Data projection.
|
|
122
|
+
*/
|
|
123
|
+
VectorTile.prototype.onLoad = function (features, dataProjection) {
|
|
124
|
+
this.setFeatures(features);
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* Handler for tile load errors.
|
|
128
|
+
*/
|
|
129
|
+
VectorTile.prototype.onError = function () {
|
|
130
|
+
this.setState(_TileState_js__WEBPACK_IMPORTED_MODULE_0__["default"].ERROR);
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`.
|
|
134
|
+
* Sets the features for the tile.
|
|
135
|
+
* @param {Array<import("./Feature.js").default>} features Features.
|
|
136
|
+
* @api
|
|
137
|
+
*/
|
|
138
|
+
VectorTile.prototype.setFeatures = function (features) {
|
|
139
|
+
this.features_ = features;
|
|
140
|
+
this.setState(_TileState_js__WEBPACK_IMPORTED_MODULE_0__["default"].LOADED);
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Set the feature loader for reading this tile's features.
|
|
144
|
+
* @param {import("./featureloader.js").FeatureLoader} loader Feature loader.
|
|
145
|
+
* @api
|
|
146
|
+
*/
|
|
147
|
+
VectorTile.prototype.setLoader = function (loader) {
|
|
148
|
+
this.loader_ = loader;
|
|
149
|
+
};
|
|
150
|
+
return VectorTile;
|
|
151
|
+
}(_Tile_js__WEBPACK_IMPORTED_MODULE_1__["default"]));
|
|
152
|
+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VectorTile);
|
|
153
|
+
//# sourceMappingURL=VectorTile.js.map
|
|
154
|
+
|
|
155
|
+
/***/ })
|
|
156
|
+
|
|
157
|
+
}])
|
|
158
|
+
//# sourceMappingURL=node_modules_ol_VectorTile_js.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_modules_ol_VectorTile_js.js","mappings":";;;;;;;;;;;;;;AAAA,iBAAiB,SAAI,IAAI,SAAI;AAC7B;AACA;AACA,eAAe,gBAAgB,sCAAsC,kBAAkB;AACvF,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,CAAC;AACD;AACA;AACA;AAC6B;AACU;AACvC;AACA;AACA;AACA,eAAe,oCAAoC;AACnD,eAAe,kCAAkC;AACjD,eAAe,QAAQ;AACvB,eAAe,uCAAuC;AACtD,eAAe,kCAAkC;AACjD,eAAe,6BAA6B;AAC5C;AACA;AACA;AACA;AACA,gCAAgC;AAChC,kBAAkB;AAClB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,4CAA4C;AAC5C,kBAAkB;AAClB;AACA;AACA;AACA,oCAAoC;AACpC,kBAAkB;AAClB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,uCAAuC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,2CAA2C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,0DAAc;AACxC,0BAA0B,6DAAiB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,uCAAuC;AACtD,eAAe,wCAAwC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,2DAAe;AACrC;AACA;AACA,+BAA+B,6CAA6C;AAC5E;AACA,eAAe,uCAAuC;AACtD;AACA;AACA;AACA;AACA,sBAAsB,4DAAgB;AACtC;AACA;AACA;AACA,eAAe,4CAA4C;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC,gDAAI;AACN,iEAAe,UAAU,EAAC;AAC1B","sources":["webpack://@vaadin/bundles/./node_modules/ol/VectorTile.js"],"sourcesContent":["var __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n/**\n * @module ol/VectorTile\n */\nimport Tile from './Tile.js';\nimport TileState from './TileState.js';\nvar VectorTile = /** @class */ (function (_super) {\n __extends(VectorTile, _super);\n /**\n * @param {import(\"./tilecoord.js\").TileCoord} tileCoord Tile coordinate.\n * @param {import(\"./TileState.js\").default} state State.\n * @param {string} src Data source url.\n * @param {import(\"./format/Feature.js\").default} format Feature format.\n * @param {import(\"./Tile.js\").LoadFunction} tileLoadFunction Tile load function.\n * @param {import(\"./Tile.js\").Options} [opt_options] Tile options.\n */\n function VectorTile(tileCoord, state, src, format, tileLoadFunction, opt_options) {\n var _this = _super.call(this, tileCoord, state, opt_options) || this;\n /**\n * Extent of this tile; set by the source.\n * @type {import(\"./extent.js\").Extent}\n */\n _this.extent = null;\n /**\n * @private\n * @type {import(\"./format/Feature.js\").default}\n */\n _this.format_ = format;\n /**\n * @private\n * @type {Array<import(\"./Feature.js\").default>}\n */\n _this.features_ = null;\n /**\n * @private\n * @type {import(\"./featureloader.js\").FeatureLoader}\n */\n _this.loader_;\n /**\n * Feature projection of this tile; set by the source.\n * @type {import(\"./proj/Projection.js\").default}\n */\n _this.projection = null;\n /**\n * Resolution of this tile; set by the source.\n * @type {number}\n */\n _this.resolution;\n /**\n * @private\n * @type {import(\"./Tile.js\").LoadFunction}\n */\n _this.tileLoadFunction_ = tileLoadFunction;\n /**\n * @private\n * @type {string}\n */\n _this.url_ = src;\n _this.key = src;\n return _this;\n }\n /**\n * Get the feature format assigned for reading this tile's features.\n * @return {import(\"./format/Feature.js\").default} Feature format.\n * @api\n */\n VectorTile.prototype.getFormat = function () {\n return this.format_;\n };\n /**\n * Get the features for this tile. Geometries will be in the view projection.\n * @return {Array<import(\"./Feature.js\").FeatureLike>} Features.\n * @api\n */\n VectorTile.prototype.getFeatures = function () {\n return this.features_;\n };\n /**\n * Load not yet loaded URI.\n */\n VectorTile.prototype.load = function () {\n if (this.state == TileState.IDLE) {\n this.setState(TileState.LOADING);\n this.tileLoadFunction_(this, this.url_);\n if (this.loader_) {\n this.loader_(this.extent, this.resolution, this.projection);\n }\n }\n };\n /**\n * Handler for successful tile load.\n * @param {Array<import(\"./Feature.js\").default>} features The loaded features.\n * @param {import(\"./proj/Projection.js\").default} dataProjection Data projection.\n */\n VectorTile.prototype.onLoad = function (features, dataProjection) {\n this.setFeatures(features);\n };\n /**\n * Handler for tile load errors.\n */\n VectorTile.prototype.onError = function () {\n this.setState(TileState.ERROR);\n };\n /**\n * Function for use in an {@link module:ol/source/VectorTile~VectorTile}'s `tileLoadFunction`.\n * Sets the features for the tile.\n * @param {Array<import(\"./Feature.js\").default>} features Features.\n * @api\n */\n VectorTile.prototype.setFeatures = function (features) {\n this.features_ = features;\n this.setState(TileState.LOADED);\n };\n /**\n * Set the feature loader for reading this tile's features.\n * @param {import(\"./featureloader.js\").FeatureLoader} loader Feature loader.\n * @api\n */\n VectorTile.prototype.setLoader = function (loader) {\n this.loader_ = loader;\n };\n return VectorTile;\n}(Tile));\nexport default VectorTile;\n//# sourceMappingURL=VectorTile.js.map"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
(self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["node_modules_ol_geom_flat_geodesic_js"],{
|
|
2
|
+
|
|
3
|
+
/***/ "./node_modules/ol/geom/flat/geodesic.js":
|
|
4
|
+
/*!***********************************************!*\
|
|
5
|
+
!*** ./node_modules/ol/geom/flat/geodesic.js ***!
|
|
6
|
+
\***********************************************/
|
|
7
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
8
|
+
|
|
9
|
+
__webpack_require__.r(__webpack_exports__);
|
|
10
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11
|
+
/* harmony export */ "greatCircleArc": () => (/* binding */ greatCircleArc),
|
|
12
|
+
/* harmony export */ "meridian": () => (/* binding */ meridian),
|
|
13
|
+
/* harmony export */ "parallel": () => (/* binding */ parallel)
|
|
14
|
+
/* harmony export */ });
|
|
15
|
+
/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../proj.js */ "./node_modules/ol/proj.js");
|
|
16
|
+
/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../math.js */ "./node_modules/ol/math.js");
|
|
17
|
+
/**
|
|
18
|
+
* @module ol/geom/flat/geodesic
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @param {function(number): import("../../coordinate.js").Coordinate} interpolate Interpolate function.
|
|
24
|
+
* @param {import("../../proj.js").TransformFunction} transform Transform from longitude/latitude to
|
|
25
|
+
* projected coordinates.
|
|
26
|
+
* @param {number} squaredTolerance Squared tolerance.
|
|
27
|
+
* @return {Array<number>} Flat coordinates.
|
|
28
|
+
*/
|
|
29
|
+
function line(interpolate, transform, squaredTolerance) {
|
|
30
|
+
// FIXME reduce garbage generation
|
|
31
|
+
// FIXME optimize stack operations
|
|
32
|
+
/** @type {Array<number>} */
|
|
33
|
+
var flatCoordinates = [];
|
|
34
|
+
var geoA = interpolate(0);
|
|
35
|
+
var geoB = interpolate(1);
|
|
36
|
+
var a = transform(geoA);
|
|
37
|
+
var b = transform(geoB);
|
|
38
|
+
/** @type {Array<import("../../coordinate.js").Coordinate>} */
|
|
39
|
+
var geoStack = [geoB, geoA];
|
|
40
|
+
/** @type {Array<import("../../coordinate.js").Coordinate>} */
|
|
41
|
+
var stack = [b, a];
|
|
42
|
+
/** @type {Array<number>} */
|
|
43
|
+
var fractionStack = [1, 0];
|
|
44
|
+
/** @type {!Object<string, boolean>} */
|
|
45
|
+
var fractions = {};
|
|
46
|
+
var maxIterations = 1e5;
|
|
47
|
+
var geoM, m, fracA, fracB, fracM, key;
|
|
48
|
+
while (--maxIterations > 0 && fractionStack.length > 0) {
|
|
49
|
+
// Pop the a coordinate off the stack
|
|
50
|
+
fracA = fractionStack.pop();
|
|
51
|
+
geoA = geoStack.pop();
|
|
52
|
+
a = stack.pop();
|
|
53
|
+
// Add the a coordinate if it has not been added yet
|
|
54
|
+
key = fracA.toString();
|
|
55
|
+
if (!(key in fractions)) {
|
|
56
|
+
flatCoordinates.push(a[0], a[1]);
|
|
57
|
+
fractions[key] = true;
|
|
58
|
+
}
|
|
59
|
+
// Pop the b coordinate off the stack
|
|
60
|
+
fracB = fractionStack.pop();
|
|
61
|
+
geoB = geoStack.pop();
|
|
62
|
+
b = stack.pop();
|
|
63
|
+
// Find the m point between the a and b coordinates
|
|
64
|
+
fracM = (fracA + fracB) / 2;
|
|
65
|
+
geoM = interpolate(fracM);
|
|
66
|
+
m = transform(geoM);
|
|
67
|
+
if ((0,_math_js__WEBPACK_IMPORTED_MODULE_1__.squaredSegmentDistance)(m[0], m[1], a[0], a[1], b[0], b[1]) <
|
|
68
|
+
squaredTolerance) {
|
|
69
|
+
// If the m point is sufficiently close to the straight line, then we
|
|
70
|
+
// discard it. Just use the b coordinate and move on to the next line
|
|
71
|
+
// segment.
|
|
72
|
+
flatCoordinates.push(b[0], b[1]);
|
|
73
|
+
key = fracB.toString();
|
|
74
|
+
fractions[key] = true;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
// Otherwise, we need to subdivide the current line segment. Split it
|
|
78
|
+
// into two and push the two line segments onto the stack.
|
|
79
|
+
fractionStack.push(fracB, fracM, fracM, fracA);
|
|
80
|
+
stack.push(b, m, m, a);
|
|
81
|
+
geoStack.push(geoB, geoM, geoM, geoA);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return flatCoordinates;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Generate a great-circle arcs between two lat/lon points.
|
|
88
|
+
* @param {number} lon1 Longitude 1 in degrees.
|
|
89
|
+
* @param {number} lat1 Latitude 1 in degrees.
|
|
90
|
+
* @param {number} lon2 Longitude 2 in degrees.
|
|
91
|
+
* @param {number} lat2 Latitude 2 in degrees.
|
|
92
|
+
* @param {import("../../proj/Projection.js").default} projection Projection.
|
|
93
|
+
* @param {number} squaredTolerance Squared tolerance.
|
|
94
|
+
* @return {Array<number>} Flat coordinates.
|
|
95
|
+
*/
|
|
96
|
+
function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolerance) {
|
|
97
|
+
var geoProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.get)('EPSG:4326');
|
|
98
|
+
var cosLat1 = Math.cos((0,_math_js__WEBPACK_IMPORTED_MODULE_1__.toRadians)(lat1));
|
|
99
|
+
var sinLat1 = Math.sin((0,_math_js__WEBPACK_IMPORTED_MODULE_1__.toRadians)(lat1));
|
|
100
|
+
var cosLat2 = Math.cos((0,_math_js__WEBPACK_IMPORTED_MODULE_1__.toRadians)(lat2));
|
|
101
|
+
var sinLat2 = Math.sin((0,_math_js__WEBPACK_IMPORTED_MODULE_1__.toRadians)(lat2));
|
|
102
|
+
var cosDeltaLon = Math.cos((0,_math_js__WEBPACK_IMPORTED_MODULE_1__.toRadians)(lon2 - lon1));
|
|
103
|
+
var sinDeltaLon = Math.sin((0,_math_js__WEBPACK_IMPORTED_MODULE_1__.toRadians)(lon2 - lon1));
|
|
104
|
+
var d = sinLat1 * sinLat2 + cosLat1 * cosLat2 * cosDeltaLon;
|
|
105
|
+
return line(
|
|
106
|
+
/**
|
|
107
|
+
* @param {number} frac Fraction.
|
|
108
|
+
* @return {import("../../coordinate.js").Coordinate} Coordinate.
|
|
109
|
+
*/
|
|
110
|
+
function (frac) {
|
|
111
|
+
if (1 <= d) {
|
|
112
|
+
return [lon2, lat2];
|
|
113
|
+
}
|
|
114
|
+
var D = frac * Math.acos(d);
|
|
115
|
+
var cosD = Math.cos(D);
|
|
116
|
+
var sinD = Math.sin(D);
|
|
117
|
+
var y = sinDeltaLon * cosLat2;
|
|
118
|
+
var x = cosLat1 * sinLat2 - sinLat1 * cosLat2 * cosDeltaLon;
|
|
119
|
+
var theta = Math.atan2(y, x);
|
|
120
|
+
var lat = Math.asin(sinLat1 * cosD + cosLat1 * sinD * Math.cos(theta));
|
|
121
|
+
var lon = (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.toRadians)(lon1) +
|
|
122
|
+
Math.atan2(Math.sin(theta) * sinD * cosLat1, cosD - sinLat1 * Math.sin(lat));
|
|
123
|
+
return [(0,_math_js__WEBPACK_IMPORTED_MODULE_1__.toDegrees)(lon), (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.toDegrees)(lat)];
|
|
124
|
+
}, (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.getTransform)(geoProjection, projection), squaredTolerance);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Generate a meridian (line at constant longitude).
|
|
128
|
+
* @param {number} lon Longitude.
|
|
129
|
+
* @param {number} lat1 Latitude 1.
|
|
130
|
+
* @param {number} lat2 Latitude 2.
|
|
131
|
+
* @param {import("../../proj/Projection.js").default} projection Projection.
|
|
132
|
+
* @param {number} squaredTolerance Squared tolerance.
|
|
133
|
+
* @return {Array<number>} Flat coordinates.
|
|
134
|
+
*/
|
|
135
|
+
function meridian(lon, lat1, lat2, projection, squaredTolerance) {
|
|
136
|
+
var epsg4326Projection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.get)('EPSG:4326');
|
|
137
|
+
return line(
|
|
138
|
+
/**
|
|
139
|
+
* @param {number} frac Fraction.
|
|
140
|
+
* @return {import("../../coordinate.js").Coordinate} Coordinate.
|
|
141
|
+
*/
|
|
142
|
+
function (frac) {
|
|
143
|
+
return [lon, lat1 + (lat2 - lat1) * frac];
|
|
144
|
+
}, (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.getTransform)(epsg4326Projection, projection), squaredTolerance);
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Generate a parallel (line at constant latitude).
|
|
148
|
+
* @param {number} lat Latitude.
|
|
149
|
+
* @param {number} lon1 Longitude 1.
|
|
150
|
+
* @param {number} lon2 Longitude 2.
|
|
151
|
+
* @param {import("../../proj/Projection.js").default} projection Projection.
|
|
152
|
+
* @param {number} squaredTolerance Squared tolerance.
|
|
153
|
+
* @return {Array<number>} Flat coordinates.
|
|
154
|
+
*/
|
|
155
|
+
function parallel(lat, lon1, lon2, projection, squaredTolerance) {
|
|
156
|
+
var epsg4326Projection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.get)('EPSG:4326');
|
|
157
|
+
return line(
|
|
158
|
+
/**
|
|
159
|
+
* @param {number} frac Fraction.
|
|
160
|
+
* @return {import("../../coordinate.js").Coordinate} Coordinate.
|
|
161
|
+
*/
|
|
162
|
+
function (frac) {
|
|
163
|
+
return [lon1 + (lon2 - lon1) * frac, lat];
|
|
164
|
+
}, (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.getTransform)(epsg4326Projection, projection), squaredTolerance);
|
|
165
|
+
}
|
|
166
|
+
//# sourceMappingURL=geodesic.js.map
|
|
167
|
+
|
|
168
|
+
/***/ })
|
|
169
|
+
|
|
170
|
+
}])
|
|
171
|
+
//# sourceMappingURL=node_modules_ol_geom_flat_geodesic_js.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_modules_ol_geom_flat_geodesic_js.js","mappings":";;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACmE;AACU;AAC7E;AACA,WAAW,4DAA4D;AACvE,WAAW,2CAA2C;AACtD;AACA,WAAW,QAAQ;AACnB,YAAY,eAAe;AAC3B;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA,eAAe,iDAAiD;AAChE;AACA,eAAe,iDAAiD;AAChE;AACA,eAAe,eAAe;AAC9B;AACA,eAAe,0BAA0B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gEAAsB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,4CAA4C;AACvD,WAAW,QAAQ;AACnB,YAAY,eAAe;AAC3B;AACO;AACP,wBAAwB,6CAAa;AACrC,2BAA2B,mDAAS;AACpC,2BAA2B,mDAAS;AACpC,2BAA2B,mDAAS;AACpC,2BAA2B,mDAAS;AACpC,+BAA+B,mDAAS;AACxC,+BAA+B,mDAAS;AACxC;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,0CAA0C;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,mDAAS;AAC3B;AACA,gBAAgB,mDAAS,OAAO,mDAAS;AACzC,KAAK,EAAE,sDAAY;AACnB;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,4CAA4C;AACvD,WAAW,QAAQ;AACnB,YAAY,eAAe;AAC3B;AACO;AACP,6BAA6B,6CAAa;AAC1C;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,0CAA0C;AAC1D;AACA;AACA;AACA,KAAK,EAAE,sDAAY;AACnB;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,4CAA4C;AACvD,WAAW,QAAQ;AACnB,YAAY,eAAe;AAC3B;AACO;AACP,6BAA6B,6CAAa;AAC1C;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB,0CAA0C;AAC1D;AACA;AACA;AACA,KAAK,EAAE,sDAAY;AACnB;AACA","sources":["webpack://@vaadin/bundles/./node_modules/ol/geom/flat/geodesic.js"],"sourcesContent":["/**\n * @module ol/geom/flat/geodesic\n */\nimport { get as getProjection, getTransform } from '../../proj.js';\nimport { squaredSegmentDistance, toDegrees, toRadians } from '../../math.js';\n/**\n * @param {function(number): import(\"../../coordinate.js\").Coordinate} interpolate Interpolate function.\n * @param {import(\"../../proj.js\").TransformFunction} transform Transform from longitude/latitude to\n * projected coordinates.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Array<number>} Flat coordinates.\n */\nfunction line(interpolate, transform, squaredTolerance) {\n // FIXME reduce garbage generation\n // FIXME optimize stack operations\n /** @type {Array<number>} */\n var flatCoordinates = [];\n var geoA = interpolate(0);\n var geoB = interpolate(1);\n var a = transform(geoA);\n var b = transform(geoB);\n /** @type {Array<import(\"../../coordinate.js\").Coordinate>} */\n var geoStack = [geoB, geoA];\n /** @type {Array<import(\"../../coordinate.js\").Coordinate>} */\n var stack = [b, a];\n /** @type {Array<number>} */\n var fractionStack = [1, 0];\n /** @type {!Object<string, boolean>} */\n var fractions = {};\n var maxIterations = 1e5;\n var geoM, m, fracA, fracB, fracM, key;\n while (--maxIterations > 0 && fractionStack.length > 0) {\n // Pop the a coordinate off the stack\n fracA = fractionStack.pop();\n geoA = geoStack.pop();\n a = stack.pop();\n // Add the a coordinate if it has not been added yet\n key = fracA.toString();\n if (!(key in fractions)) {\n flatCoordinates.push(a[0], a[1]);\n fractions[key] = true;\n }\n // Pop the b coordinate off the stack\n fracB = fractionStack.pop();\n geoB = geoStack.pop();\n b = stack.pop();\n // Find the m point between the a and b coordinates\n fracM = (fracA + fracB) / 2;\n geoM = interpolate(fracM);\n m = transform(geoM);\n if (squaredSegmentDistance(m[0], m[1], a[0], a[1], b[0], b[1]) <\n squaredTolerance) {\n // If the m point is sufficiently close to the straight line, then we\n // discard it. Just use the b coordinate and move on to the next line\n // segment.\n flatCoordinates.push(b[0], b[1]);\n key = fracB.toString();\n fractions[key] = true;\n }\n else {\n // Otherwise, we need to subdivide the current line segment. Split it\n // into two and push the two line segments onto the stack.\n fractionStack.push(fracB, fracM, fracM, fracA);\n stack.push(b, m, m, a);\n geoStack.push(geoB, geoM, geoM, geoA);\n }\n }\n return flatCoordinates;\n}\n/**\n * Generate a great-circle arcs between two lat/lon points.\n * @param {number} lon1 Longitude 1 in degrees.\n * @param {number} lat1 Latitude 1 in degrees.\n * @param {number} lon2 Longitude 2 in degrees.\n * @param {number} lat2 Latitude 2 in degrees.\n * @param {import(\"../../proj/Projection.js\").default} projection Projection.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Array<number>} Flat coordinates.\n */\nexport function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolerance) {\n var geoProjection = getProjection('EPSG:4326');\n var cosLat1 = Math.cos(toRadians(lat1));\n var sinLat1 = Math.sin(toRadians(lat1));\n var cosLat2 = Math.cos(toRadians(lat2));\n var sinLat2 = Math.sin(toRadians(lat2));\n var cosDeltaLon = Math.cos(toRadians(lon2 - lon1));\n var sinDeltaLon = Math.sin(toRadians(lon2 - lon1));\n var d = sinLat1 * sinLat2 + cosLat1 * cosLat2 * cosDeltaLon;\n return line(\n /**\n * @param {number} frac Fraction.\n * @return {import(\"../../coordinate.js\").Coordinate} Coordinate.\n */\n function (frac) {\n if (1 <= d) {\n return [lon2, lat2];\n }\n var D = frac * Math.acos(d);\n var cosD = Math.cos(D);\n var sinD = Math.sin(D);\n var y = sinDeltaLon * cosLat2;\n var x = cosLat1 * sinLat2 - sinLat1 * cosLat2 * cosDeltaLon;\n var theta = Math.atan2(y, x);\n var lat = Math.asin(sinLat1 * cosD + cosLat1 * sinD * Math.cos(theta));\n var lon = toRadians(lon1) +\n Math.atan2(Math.sin(theta) * sinD * cosLat1, cosD - sinLat1 * Math.sin(lat));\n return [toDegrees(lon), toDegrees(lat)];\n }, getTransform(geoProjection, projection), squaredTolerance);\n}\n/**\n * Generate a meridian (line at constant longitude).\n * @param {number} lon Longitude.\n * @param {number} lat1 Latitude 1.\n * @param {number} lat2 Latitude 2.\n * @param {import(\"../../proj/Projection.js\").default} projection Projection.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Array<number>} Flat coordinates.\n */\nexport function meridian(lon, lat1, lat2, projection, squaredTolerance) {\n var epsg4326Projection = getProjection('EPSG:4326');\n return line(\n /**\n * @param {number} frac Fraction.\n * @return {import(\"../../coordinate.js\").Coordinate} Coordinate.\n */\n function (frac) {\n return [lon, lat1 + (lat2 - lat1) * frac];\n }, getTransform(epsg4326Projection, projection), squaredTolerance);\n}\n/**\n * Generate a parallel (line at constant latitude).\n * @param {number} lat Latitude.\n * @param {number} lon1 Longitude 1.\n * @param {number} lon2 Longitude 2.\n * @param {import(\"../../proj/Projection.js\").default} projection Projection.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Array<number>} Flat coordinates.\n */\nexport function parallel(lat, lon1, lon2, projection, squaredTolerance) {\n var epsg4326Projection = getProjection('EPSG:4326');\n return line(\n /**\n * @param {number} frac Fraction.\n * @return {import(\"../../coordinate.js\").Coordinate} Coordinate.\n */\n function (frac) {\n return [lon1 + (lon2 - lon1) * frac, lat];\n }, getTransform(epsg4326Projection, projection), squaredTolerance);\n}\n//# sourceMappingURL=geodesic.js.map"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
(self["webpackChunk_vaadin_bundles"] = self["webpackChunk_vaadin_bundles"] || []).push([["node_modules_ol_render_js"],{
|
|
2
|
+
|
|
3
|
+
/***/ "./node_modules/ol/render.js":
|
|
4
|
+
/*!***********************************!*\
|
|
5
|
+
!*** ./node_modules/ol/render.js ***!
|
|
6
|
+
\***********************************/
|
|
7
|
+
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
8
|
+
|
|
9
|
+
__webpack_require__.r(__webpack_exports__);
|
|
10
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11
|
+
/* harmony export */ "getRenderPixel": () => (/* binding */ getRenderPixel),
|
|
12
|
+
/* harmony export */ "getVectorContext": () => (/* binding */ getVectorContext),
|
|
13
|
+
/* harmony export */ "toContext": () => (/* binding */ toContext)
|
|
14
|
+
/* harmony export */ });
|
|
15
|
+
/* harmony import */ var _render_canvas_Immediate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./render/canvas/Immediate.js */ "./node_modules/ol/render/canvas/Immediate.js");
|
|
16
|
+
/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./has.js */ "./node_modules/ol/has.js");
|
|
17
|
+
/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transform.js */ "./node_modules/ol/transform.js");
|
|
18
|
+
/* harmony import */ var _renderer_vector_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./renderer/vector.js */ "./node_modules/ol/renderer/vector.js");
|
|
19
|
+
/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./proj.js */ "./node_modules/ol/proj.js");
|
|
20
|
+
/**
|
|
21
|
+
* @module ol/render
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @typedef {Object} State
|
|
30
|
+
* @property {CanvasRenderingContext2D} context Canvas context that the layer is being rendered to.
|
|
31
|
+
* @property {import("./Feature.js").FeatureLike} feature Feature.
|
|
32
|
+
* @property {import("./geom/SimpleGeometry.js").default} geometry Geometry.
|
|
33
|
+
* @property {number} pixelRatio Pixel ratio used by the layer renderer.
|
|
34
|
+
* @property {number} resolution Resolution that the render batch was created and optimized for.
|
|
35
|
+
* This is not the view's resolution that is being rendered.
|
|
36
|
+
* @property {number} rotation Rotation of the rendered layer in radians.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* A function to be used when sorting features before rendering.
|
|
40
|
+
* It takes two instances of {@link module:ol/Feature~Feature} or
|
|
41
|
+
* {@link module:ol/render/Feature~RenderFeature} and returns a `{number}`.
|
|
42
|
+
*
|
|
43
|
+
* @typedef {function(import("./Feature.js").FeatureLike, import("./Feature.js").FeatureLike):number} OrderFunction
|
|
44
|
+
*/
|
|
45
|
+
/**
|
|
46
|
+
* @typedef {Object} ToContextOptions
|
|
47
|
+
* @property {import("./size.js").Size} [size] Desired size of the canvas in css
|
|
48
|
+
* pixels. When provided, both canvas and css size will be set according to the
|
|
49
|
+
* `pixelRatio`. If not provided, the current canvas and css sizes will not be
|
|
50
|
+
* altered.
|
|
51
|
+
* @property {number} [pixelRatio=window.devicePixelRatio] Pixel ratio (canvas
|
|
52
|
+
* pixel to css pixel ratio) for the canvas.
|
|
53
|
+
*/
|
|
54
|
+
/**
|
|
55
|
+
* Binds a Canvas Immediate API to a canvas context, to allow drawing geometries
|
|
56
|
+
* to the context's canvas.
|
|
57
|
+
*
|
|
58
|
+
* The units for geometry coordinates are css pixels relative to the top left
|
|
59
|
+
* corner of the canvas element.
|
|
60
|
+
* ```js
|
|
61
|
+
* import {toContext} from 'ol/render';
|
|
62
|
+
* import Fill from 'ol/style/Fill';
|
|
63
|
+
* import Polygon from 'ol/geom/Polygon';
|
|
64
|
+
*
|
|
65
|
+
* var canvas = document.createElement('canvas');
|
|
66
|
+
* var render = toContext(canvas.getContext('2d'),
|
|
67
|
+
* { size: [100, 100] });
|
|
68
|
+
* render.setFillStrokeStyle(new Fill({ color: blue }));
|
|
69
|
+
* render.drawPolygon(
|
|
70
|
+
* new Polygon([[[0, 0], [100, 100], [100, 0], [0, 0]]]));
|
|
71
|
+
* ```
|
|
72
|
+
*
|
|
73
|
+
* @param {CanvasRenderingContext2D} context Canvas context.
|
|
74
|
+
* @param {ToContextOptions} [opt_options] Options.
|
|
75
|
+
* @return {CanvasImmediateRenderer} Canvas Immediate.
|
|
76
|
+
* @api
|
|
77
|
+
*/
|
|
78
|
+
function toContext(context, opt_options) {
|
|
79
|
+
var canvas = context.canvas;
|
|
80
|
+
var options = opt_options ? opt_options : {};
|
|
81
|
+
var pixelRatio = options.pixelRatio || _has_js__WEBPACK_IMPORTED_MODULE_1__.DEVICE_PIXEL_RATIO;
|
|
82
|
+
var size = options.size;
|
|
83
|
+
if (size) {
|
|
84
|
+
canvas.width = size[0] * pixelRatio;
|
|
85
|
+
canvas.height = size[1] * pixelRatio;
|
|
86
|
+
canvas.style.width = size[0] + 'px';
|
|
87
|
+
canvas.style.height = size[1] + 'px';
|
|
88
|
+
}
|
|
89
|
+
var extent = [0, 0, canvas.width, canvas.height];
|
|
90
|
+
var transform = (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.scale)((0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.create)(), pixelRatio, pixelRatio);
|
|
91
|
+
return new _render_canvas_Immediate_js__WEBPACK_IMPORTED_MODULE_3__["default"](context, pixelRatio, extent, transform, 0);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Gets a vector context for drawing to the event's canvas.
|
|
95
|
+
* @param {import("./render/Event.js").default} event Render event.
|
|
96
|
+
* @return {CanvasImmediateRenderer} Vector context.
|
|
97
|
+
* @api
|
|
98
|
+
*/
|
|
99
|
+
function getVectorContext(event) {
|
|
100
|
+
if (!(event.context instanceof CanvasRenderingContext2D)) {
|
|
101
|
+
throw new Error('Only works for render events from Canvas 2D layers');
|
|
102
|
+
}
|
|
103
|
+
// canvas may be at a different pixel ratio than frameState.pixelRatio
|
|
104
|
+
var canvasPixelRatio = event.inversePixelTransform[0];
|
|
105
|
+
var frameState = event.frameState;
|
|
106
|
+
var transform = (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.multiply)(event.inversePixelTransform.slice(), frameState.coordinateToPixelTransform);
|
|
107
|
+
var squaredTolerance = (0,_renderer_vector_js__WEBPACK_IMPORTED_MODULE_4__.getSquaredTolerance)(frameState.viewState.resolution, canvasPixelRatio);
|
|
108
|
+
var userTransform;
|
|
109
|
+
var userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.getUserProjection)();
|
|
110
|
+
if (userProjection) {
|
|
111
|
+
userTransform = (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.getTransformFromProjections)(userProjection, frameState.viewState.projection);
|
|
112
|
+
}
|
|
113
|
+
return new _render_canvas_Immediate_js__WEBPACK_IMPORTED_MODULE_3__["default"](event.context, canvasPixelRatio, frameState.extent, transform, frameState.viewState.rotation, squaredTolerance, userTransform);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Gets the pixel of the event's canvas context from the map viewport's CSS pixel.
|
|
117
|
+
* @param {import("./render/Event.js").default} event Render event.
|
|
118
|
+
* @param {import("./pixel.js").Pixel} pixel CSS pixel relative to the top-left
|
|
119
|
+
* corner of the map viewport.
|
|
120
|
+
* @return {import("./pixel.js").Pixel} Pixel on the event's canvas context.
|
|
121
|
+
* @api
|
|
122
|
+
*/
|
|
123
|
+
function getRenderPixel(event, pixel) {
|
|
124
|
+
return (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.apply)(event.inversePixelTransform, pixel.slice(0));
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=render.js.map
|
|
127
|
+
|
|
128
|
+
/***/ })
|
|
129
|
+
|
|
130
|
+
}])
|
|
131
|
+
//# sourceMappingURL=node_modules_ol_render_js.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_modules_ol_render_js.js","mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACmE;AACrB;AAC+F;AAClF;AACgB;AAC3E;AACA,aAAa,QAAQ;AACrB,cAAc,0BAA0B;AACxC,cAAc,oCAAoC;AAClD,cAAc,4CAA4C;AAC1D,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA,8BAA8B,iCAAiC;AAC/D,IAAI,8CAA8C,gBAAgB,OAAO;AACzE;AACA,aAAa,yFAAyF;AACtG;AACA;AACA,aAAa,QAAQ;AACrB,cAAc,0BAA0B;AACxC;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,WAAW;AACtB;AACA;AACA;AACA;AACA;AACA,SAAS,kBAAkB;AAC3B,wCAAwC,aAAa;AACrD;AACA;AACA;AACA;AACA,WAAW,0BAA0B;AACrC,WAAW,kBAAkB;AAC7B,YAAY,yBAAyB;AACrC;AACA;AACO;AACP;AACA;AACA,2CAA2C,uDAAkB;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,oDAAc,CAAC,qDAAe;AAClD,eAAe,mEAAuB;AACtC;AACA;AACA;AACA,WAAW,qCAAqC;AAChD,YAAY,yBAAyB;AACrC;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,uDAAiB;AACrC,2BAA2B,wEAAmB;AAC9C;AACA,yBAAyB,2DAAiB;AAC1C;AACA,wBAAwB,qEAA2B;AACnD;AACA,eAAe,mEAAuB;AACtC;AACA;AACA;AACA,WAAW,qCAAqC;AAChD,WAAW,4BAA4B;AACvC;AACA,YAAY,4BAA4B;AACxC;AACA;AACO;AACP,WAAW,oDAAc;AACzB;AACA","sources":["webpack://@vaadin/bundles/./node_modules/ol/render.js"],"sourcesContent":["/**\n * @module ol/render\n */\nimport CanvasImmediateRenderer from './render/canvas/Immediate.js';\nimport { DEVICE_PIXEL_RATIO } from './has.js';\nimport { apply as applyTransform, create as createTransform, multiply as multiplyTransform, scale as scaleTransform, } from './transform.js';\nimport { getSquaredTolerance } from './renderer/vector.js';\nimport { getTransformFromProjections, getUserProjection } from './proj.js';\n/**\n * @typedef {Object} State\n * @property {CanvasRenderingContext2D} context Canvas context that the layer is being rendered to.\n * @property {import(\"./Feature.js\").FeatureLike} feature Feature.\n * @property {import(\"./geom/SimpleGeometry.js\").default} geometry Geometry.\n * @property {number} pixelRatio Pixel ratio used by the layer renderer.\n * @property {number} resolution Resolution that the render batch was created and optimized for.\n * This is not the view's resolution that is being rendered.\n * @property {number} rotation Rotation of the rendered layer in radians.\n */\n/**\n * A function to be used when sorting features before rendering.\n * It takes two instances of {@link module:ol/Feature~Feature} or\n * {@link module:ol/render/Feature~RenderFeature} and returns a `{number}`.\n *\n * @typedef {function(import(\"./Feature.js\").FeatureLike, import(\"./Feature.js\").FeatureLike):number} OrderFunction\n */\n/**\n * @typedef {Object} ToContextOptions\n * @property {import(\"./size.js\").Size} [size] Desired size of the canvas in css\n * pixels. When provided, both canvas and css size will be set according to the\n * `pixelRatio`. If not provided, the current canvas and css sizes will not be\n * altered.\n * @property {number} [pixelRatio=window.devicePixelRatio] Pixel ratio (canvas\n * pixel to css pixel ratio) for the canvas.\n */\n/**\n * Binds a Canvas Immediate API to a canvas context, to allow drawing geometries\n * to the context's canvas.\n *\n * The units for geometry coordinates are css pixels relative to the top left\n * corner of the canvas element.\n * ```js\n * import {toContext} from 'ol/render';\n * import Fill from 'ol/style/Fill';\n * import Polygon from 'ol/geom/Polygon';\n *\n * var canvas = document.createElement('canvas');\n * var render = toContext(canvas.getContext('2d'),\n * { size: [100, 100] });\n * render.setFillStrokeStyle(new Fill({ color: blue }));\n * render.drawPolygon(\n * new Polygon([[[0, 0], [100, 100], [100, 0], [0, 0]]]));\n * ```\n *\n * @param {CanvasRenderingContext2D} context Canvas context.\n * @param {ToContextOptions} [opt_options] Options.\n * @return {CanvasImmediateRenderer} Canvas Immediate.\n * @api\n */\nexport function toContext(context, opt_options) {\n var canvas = context.canvas;\n var options = opt_options ? opt_options : {};\n var pixelRatio = options.pixelRatio || DEVICE_PIXEL_RATIO;\n var size = options.size;\n if (size) {\n canvas.width = size[0] * pixelRatio;\n canvas.height = size[1] * pixelRatio;\n canvas.style.width = size[0] + 'px';\n canvas.style.height = size[1] + 'px';\n }\n var extent = [0, 0, canvas.width, canvas.height];\n var transform = scaleTransform(createTransform(), pixelRatio, pixelRatio);\n return new CanvasImmediateRenderer(context, pixelRatio, extent, transform, 0);\n}\n/**\n * Gets a vector context for drawing to the event's canvas.\n * @param {import(\"./render/Event.js\").default} event Render event.\n * @return {CanvasImmediateRenderer} Vector context.\n * @api\n */\nexport function getVectorContext(event) {\n if (!(event.context instanceof CanvasRenderingContext2D)) {\n throw new Error('Only works for render events from Canvas 2D layers');\n }\n // canvas may be at a different pixel ratio than frameState.pixelRatio\n var canvasPixelRatio = event.inversePixelTransform[0];\n var frameState = event.frameState;\n var transform = multiplyTransform(event.inversePixelTransform.slice(), frameState.coordinateToPixelTransform);\n var squaredTolerance = getSquaredTolerance(frameState.viewState.resolution, canvasPixelRatio);\n var userTransform;\n var userProjection = getUserProjection();\n if (userProjection) {\n userTransform = getTransformFromProjections(userProjection, frameState.viewState.projection);\n }\n return new CanvasImmediateRenderer(event.context, canvasPixelRatio, frameState.extent, transform, frameState.viewState.rotation, squaredTolerance, userTransform);\n}\n/**\n * Gets the pixel of the event's canvas context from the map viewport's CSS pixel.\n * @param {import(\"./render/Event.js\").default} event Render event.\n * @param {import(\"./pixel.js\").Pixel} pixel CSS pixel relative to the top-left\n * corner of the map viewport.\n * @return {import(\"./pixel.js\").Pixel} Pixel on the event's canvas context.\n * @api\n */\nexport function getRenderPixel(event, pixel) {\n return applyTransform(event.inversePixelTransform, pixel.slice(0));\n}\n//# sourceMappingURL=render.js.map"],"names":[],"sourceRoot":""}
|