diff --git a/dist/index.html b/dist/index.html index f56460d..73387cd 100644 --- a/dist/index.html +++ b/dist/index.html @@ -2,7 +2,7 @@ - Using OpenLayers with Webpack + CCCamp19 map of milliways diff --git a/dist/main.js b/dist/main.js index b7f158a..34c0316 100644 --- a/dist/main.js +++ b/dist/main.js @@ -81,7 +81,7 @@ /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 91); +/******/ return __webpack_require__(__webpack_require__.s = 114); /******/ }) /************************************************************************/ /******/ ([ @@ -133,9 +133,9 @@ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return scaleFromCenter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return intersectsSegment; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return applyTransform; }); -/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); -/* harmony import */ var _extent_Corner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(53); -/* harmony import */ var _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23); +/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); +/* harmony import */ var _extent_Corner_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(66); +/* harmony import */ var _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31); /** * @module ol/extent */ @@ -939,6 +939,392 @@ function applyTransform(extent, transformFn, opt_extent) { /* 1 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return ONE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return SRC_ALPHA; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return COLOR_ATTACHMENT0; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return COLOR_BUFFER_BIT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return TRIANGLES; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "G", function() { return TRIANGLE_STRIP; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return ONE_MINUS_SRC_ALPHA; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ARRAY_BUFFER; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return ELEMENT_ARRAY_BUFFER; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return STREAM_DRAW; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return STATIC_DRAW; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return DYNAMIC_DRAW; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return CULL_FACE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return BLEND; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return STENCIL_TEST; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return DEPTH_TEST; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return SCISSOR_TEST; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return UNSIGNED_BYTE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "J", function() { return UNSIGNED_SHORT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I", function() { return UNSIGNED_INT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return FLOAT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return RGBA; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return FRAGMENT_SHADER; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "K", function() { return VERTEX_SHADER; }); +/* unused harmony export LINK_STATUS */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return LINEAR; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return TEXTURE_MAG_FILTER; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return TEXTURE_MIN_FILTER; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return TEXTURE_WRAP_S; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return TEXTURE_WRAP_T; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return TEXTURE_2D; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return TEXTURE0; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return CLAMP_TO_EDGE; }); +/* unused harmony export COMPILE_STATUS */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return FRAMEBUFFER; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "L", function() { return getContext; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return DEBUG; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return HAS; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return MAX_TEXTURE_SIZE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return EXTENSIONS; }); +/** + * @module ol/webgl + */ + + +/** + * Constants taken from goog.webgl + */ + + +/** + * @const + * @type {number} + */ +var ONE = 1; + + +/** + * @const + * @type {number} + */ +var SRC_ALPHA = 0x0302; + + +/** + * @const + * @type {number} + */ +var COLOR_ATTACHMENT0 = 0x8CE0; + + +/** + * @const + * @type {number} + */ +var COLOR_BUFFER_BIT = 0x00004000; + + +/** + * @const + * @type {number} + */ +var TRIANGLES = 0x0004; + + +/** + * @const + * @type {number} + */ +var TRIANGLE_STRIP = 0x0005; + + +/** + * @const + * @type {number} + */ +var ONE_MINUS_SRC_ALPHA = 0x0303; + + +/** + * @const + * @type {number} + */ +var ARRAY_BUFFER = 0x8892; + + +/** + * @const + * @type {number} + */ +var ELEMENT_ARRAY_BUFFER = 0x8893; + + +/** + * @const + * @type {number} + */ +var STREAM_DRAW = 0x88E0; + + +/** + * @const + * @type {number} + */ +var STATIC_DRAW = 0x88E4; + + +/** + * @const + * @type {number} + */ +var DYNAMIC_DRAW = 0x88E8; + + +/** + * @const + * @type {number} + */ +var CULL_FACE = 0x0B44; + + +/** + * @const + * @type {number} + */ +var BLEND = 0x0BE2; + + +/** + * @const + * @type {number} + */ +var STENCIL_TEST = 0x0B90; + + +/** + * @const + * @type {number} + */ +var DEPTH_TEST = 0x0B71; + + +/** + * @const + * @type {number} + */ +var SCISSOR_TEST = 0x0C11; + + +/** + * @const + * @type {number} + */ +var UNSIGNED_BYTE = 0x1401; + + +/** + * @const + * @type {number} + */ +var UNSIGNED_SHORT = 0x1403; + + +/** + * @const + * @type {number} + */ +var UNSIGNED_INT = 0x1405; + + +/** + * @const + * @type {number} + */ +var FLOAT = 0x1406; + + +/** + * @const + * @type {number} + */ +var RGBA = 0x1908; + + +/** + * @const + * @type {number} + */ +var FRAGMENT_SHADER = 0x8B30; + + +/** + * @const + * @type {number} + */ +var VERTEX_SHADER = 0x8B31; + + +/** + * @const + * @type {number} + */ +var LINK_STATUS = 0x8B82; + + +/** + * @const + * @type {number} + */ +var LINEAR = 0x2601; + + +/** + * @const + * @type {number} + */ +var TEXTURE_MAG_FILTER = 0x2800; + + +/** + * @const + * @type {number} + */ +var TEXTURE_MIN_FILTER = 0x2801; + + +/** + * @const + * @type {number} + */ +var TEXTURE_WRAP_S = 0x2802; + + +/** + * @const + * @type {number} + */ +var TEXTURE_WRAP_T = 0x2803; + + +/** + * @const + * @type {number} + */ +var TEXTURE_2D = 0x0DE1; + + +/** + * @const + * @type {number} + */ +var TEXTURE0 = 0x84C0; + + +/** + * @const + * @type {number} + */ +var CLAMP_TO_EDGE = 0x812F; + + +/** + * @const + * @type {number} + */ +var COMPILE_STATUS = 0x8B81; + + +/** + * @const + * @type {number} + */ +var FRAMEBUFFER = 0x8D40; + + +/** end of goog.webgl constants + */ + + +/** + * @const + * @type {Array} + */ +var CONTEXT_IDS = [ + 'experimental-webgl', + 'webgl', + 'webkit-3d', + 'moz-webgl' +]; + + +/** + * @param {HTMLCanvasElement} canvas Canvas. + * @param {Object=} opt_attributes Attributes. + * @return {WebGLRenderingContext} WebGL rendering context. + */ +function getContext(canvas, opt_attributes) { + var ii = CONTEXT_IDS.length; + for (var i = 0; i < ii; ++i) { + try { + var context = canvas.getContext(CONTEXT_IDS[i], opt_attributes); + if (context) { + return /** @type {!WebGLRenderingContext} */ (context); + } + } catch (e) { + // pass + } + } + return null; +} + + +/** + * Include debuggable shader sources. Default is `true`. This should be set to + * `false` for production builds. + * @type {boolean} + */ +var DEBUG = true; + + +/** + * The maximum supported WebGL texture size in pixels. If WebGL is not + * supported, the value is set to `undefined`. + * @type {number|undefined} + */ +var MAX_TEXTURE_SIZE; // value is set below + + +/** + * List of supported WebGL extensions. + * @type {Array} + */ +var EXTENSIONS; // value is set below + + +/** + * True if both OpenLayers and browser support WebGL. + * @type {boolean} + * @api + */ +var HAS = false; + +//TODO Remove side effects +if (typeof window !== 'undefined' && 'WebGLRenderingContext' in window) { + try { + var canvas = /** @type {HTMLCanvasElement} */ (document.createElement('canvas')); + var gl = getContext(canvas, {failIfMajorPerformanceCaveat: true}); + if (gl) { + HAS = true; + MAX_TEXTURE_SIZE = /** @type {number} */ (gl.getParameter(gl.MAX_TEXTURE_SIZE)); + EXTENSIONS = gl.getSupportedExtensions(); + } + } catch (e) { + // pass + } +} + + + +//# sourceMappingURL=webgl.js.map + +/***/ }), +/* 2 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return abstract; }); /* unused harmony export inherits */ @@ -1015,7 +1401,7 @@ var VERSION = '5.3.3'; //# sourceMappingURL=util.js.map /***/ }), -/* 2 */ +/* 3 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1027,7 +1413,7 @@ var VERSION = '5.3.3'; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return unlisten; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return unlistenByKey; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return unlistenAll; }); -/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); +/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); /** * @module ol/events */ @@ -1304,7 +1690,295 @@ function unlistenAll(target) { //# sourceMappingURL=events.js.map /***/ }), -/* 3 */ +/* 4 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return create; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return reset; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return multiply; }); +/* unused harmony export set */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return setFromArray; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return apply; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return rotate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return scale; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return translate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return compose; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return invert; }); +/* unused harmony export determinant */ +/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); +/** + * @module ol/transform + */ + + + +/** + * An array representing an affine 2d transformation for use with + * {@link module:ol/transform} functions. The array has 6 elements. + * @typedef {!Array} Transform + */ + + +/** + * Collection of affine 2d transformation functions. The functions work on an + * array of 6 elements. The element order is compatible with the [SVGMatrix + * interface](https://developer.mozilla.org/en-US/docs/Web/API/SVGMatrix) and is + * a subset (elements a to f) of a 3×3 matrix: + * ``` + * [ a c e ] + * [ b d f ] + * [ 0 0 1 ] + * ``` + */ + + +/** + * @private + * @type {Transform} + */ +var tmp_ = new Array(6); + + +/** + * Create an identity transform. + * @return {!Transform} Identity transform. + */ +function create() { + return [1, 0, 0, 1, 0, 0]; +} + + +/** + * Resets the given transform to an identity transform. + * @param {!Transform} transform Transform. + * @return {!Transform} Transform. + */ +function reset(transform) { + return set(transform, 1, 0, 0, 1, 0, 0); +} + + +/** + * Multiply the underlying matrices of two transforms and return the result in + * the first transform. + * @param {!Transform} transform1 Transform parameters of matrix 1. + * @param {!Transform} transform2 Transform parameters of matrix 2. + * @return {!Transform} transform1 multiplied with transform2. + */ +function multiply(transform1, transform2) { + var a1 = transform1[0]; + var b1 = transform1[1]; + var c1 = transform1[2]; + var d1 = transform1[3]; + var e1 = transform1[4]; + var f1 = transform1[5]; + var a2 = transform2[0]; + var b2 = transform2[1]; + var c2 = transform2[2]; + var d2 = transform2[3]; + var e2 = transform2[4]; + var f2 = transform2[5]; + + transform1[0] = a1 * a2 + c1 * b2; + transform1[1] = b1 * a2 + d1 * b2; + transform1[2] = a1 * c2 + c1 * d2; + transform1[3] = b1 * c2 + d1 * d2; + transform1[4] = a1 * e2 + c1 * f2 + e1; + transform1[5] = b1 * e2 + d1 * f2 + f1; + + return transform1; +} + +/** + * Set the transform components a-f on a given transform. + * @param {!Transform} transform Transform. + * @param {number} a The a component of the transform. + * @param {number} b The b component of the transform. + * @param {number} c The c component of the transform. + * @param {number} d The d component of the transform. + * @param {number} e The e component of the transform. + * @param {number} f The f component of the transform. + * @return {!Transform} Matrix with transform applied. + */ +function set(transform, a, b, c, d, e, f) { + transform[0] = a; + transform[1] = b; + transform[2] = c; + transform[3] = d; + transform[4] = e; + transform[5] = f; + return transform; +} + + +/** + * Set transform on one matrix from another matrix. + * @param {!Transform} transform1 Matrix to set transform to. + * @param {!Transform} transform2 Matrix to set transform from. + * @return {!Transform} transform1 with transform from transform2 applied. + */ +function setFromArray(transform1, transform2) { + transform1[0] = transform2[0]; + transform1[1] = transform2[1]; + transform1[2] = transform2[2]; + transform1[3] = transform2[3]; + transform1[4] = transform2[4]; + transform1[5] = transform2[5]; + return transform1; +} + + +/** + * Transforms the given coordinate with the given transform returning the + * resulting, transformed coordinate. The coordinate will be modified in-place. + * + * @param {Transform} transform The transformation. + * @param {import("./coordinate.js").Coordinate|import("./pixel.js").Pixel} coordinate The coordinate to transform. + * @return {import("./coordinate.js").Coordinate|import("./pixel.js").Pixel} return coordinate so that operations can be + * chained together. + */ +function apply(transform, coordinate) { + var x = coordinate[0]; + var y = coordinate[1]; + coordinate[0] = transform[0] * x + transform[2] * y + transform[4]; + coordinate[1] = transform[1] * x + transform[3] * y + transform[5]; + return coordinate; +} + + +/** + * Applies rotation to the given transform. + * @param {!Transform} transform Transform. + * @param {number} angle Angle in radians. + * @return {!Transform} The rotated transform. + */ +function rotate(transform, angle) { + var cos = Math.cos(angle); + var sin = Math.sin(angle); + return multiply(transform, set(tmp_, cos, sin, -sin, cos, 0, 0)); +} + + +/** + * Applies scale to a given transform. + * @param {!Transform} transform Transform. + * @param {number} x Scale factor x. + * @param {number} y Scale factor y. + * @return {!Transform} The scaled transform. + */ +function scale(transform, x, y) { + return multiply(transform, set(tmp_, x, 0, 0, y, 0, 0)); +} + + +/** + * Applies translation to the given transform. + * @param {!Transform} transform Transform. + * @param {number} dx Translation x. + * @param {number} dy Translation y. + * @return {!Transform} The translated transform. + */ +function translate(transform, dx, dy) { + return multiply(transform, set(tmp_, 1, 0, 0, 1, dx, dy)); +} + + +/** + * Creates a composite transform given an initial translation, scale, rotation, and + * final translation (in that order only, not commutative). + * @param {!Transform} transform The transform (will be modified in place). + * @param {number} dx1 Initial translation x. + * @param {number} dy1 Initial translation y. + * @param {number} sx Scale factor x. + * @param {number} sy Scale factor y. + * @param {number} angle Rotation (in counter-clockwise radians). + * @param {number} dx2 Final translation x. + * @param {number} dy2 Final translation y. + * @return {!Transform} The composite transform. + */ +function compose(transform, dx1, dy1, sx, sy, angle, dx2, dy2) { + var sin = Math.sin(angle); + var cos = Math.cos(angle); + transform[0] = sx * cos; + transform[1] = sy * sin; + transform[2] = -sx * sin; + transform[3] = sy * cos; + transform[4] = dx2 * sx * cos - dy2 * sx * sin + dx1; + transform[5] = dx2 * sy * sin + dy2 * sy * cos + dy1; + return transform; +} + + +/** + * Invert the given transform. + * @param {!Transform} transform Transform. + * @return {!Transform} Inverse of the transform. + */ +function invert(transform) { + var det = determinant(transform); + Object(_asserts_js__WEBPACK_IMPORTED_MODULE_0__[/* assert */ "a"])(det !== 0, 32); // Transformation matrix cannot be inverted + + var a = transform[0]; + var b = transform[1]; + var c = transform[2]; + var d = transform[3]; + var e = transform[4]; + var f = transform[5]; + + transform[0] = d / det; + transform[1] = -b / det; + transform[2] = -c / det; + transform[3] = a / det; + transform[4] = (c * f - d * e) / det; + transform[5] = -(a * f - b * e) / det; + + return transform; +} + + +/** + * Returns the determinant of the given matrix. + * @param {!Transform} mat Matrix. + * @return {number} Determinant. + */ +function determinant(mat) { + return mat[0] * mat[3] - mat[1] * mat[2]; +} + +//# sourceMappingURL=transform.js.map + +/***/ }), +/* 5 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * @module ol/geom/GeometryType + */ + +/** + * The geometry type. One of `'Point'`, `'LineString'`, `'LinearRing'`, + * `'Polygon'`, `'MultiPoint'`, `'MultiLineString'`, `'MultiPolygon'`, + * `'GeometryCollection'`, `'Circle'`. + * @enum {string} + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + POINT: 'Point', + LINE_STRING: 'LineString', + LINEAR_RING: 'LinearRing', + POLYGON: 'Polygon', + MULTI_POINT: 'MultiPoint', + MULTI_LINE_STRING: 'MultiLineString', + MULTI_POLYGON: 'MultiPolygon', + GEOMETRY_COLLECTION: 'GeometryCollection', + CIRCLE: 'Circle' +}); + +//# sourceMappingURL=GeometryType.js.map + +/***/ }), +/* 6 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1329,11 +2003,11 @@ function unlistenAll(target) { /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return rotateAtOffset; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return resetTransform; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return drawImage; }); -/* harmony import */ var _css_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25); -/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15); -/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9); -/* harmony import */ var _structs_LRUCache_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(61); -/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8); +/* harmony import */ var _css_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24); +/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); +/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10); +/* harmony import */ var _structs_LRUCache_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69); +/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4); /** * @module ol/render/canvas */ @@ -1715,7 +2389,7 @@ function drawImage(context, //# sourceMappingURL=canvas.js.map /***/ }), -/* 4 */ +/* 7 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1762,50 +2436,48 @@ function drawImage(context, //# sourceMappingURL=EventType.js.map /***/ }), -/* 5 */ +/* 8 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /** - * @module ol/geom/GeometryType + * @module ol/TileState */ /** - * The geometry type. One of `'Point'`, `'LineString'`, `'LinearRing'`, - * `'Polygon'`, `'MultiPoint'`, `'MultiLineString'`, `'MultiPolygon'`, - * `'GeometryCollection'`, `'Circle'`. - * @enum {string} + * @enum {number} */ /* harmony default export */ __webpack_exports__["a"] = ({ - POINT: 'Point', - LINE_STRING: 'LineString', - LINEAR_RING: 'LinearRing', - POLYGON: 'Polygon', - MULTI_POINT: 'MultiPoint', - MULTI_LINE_STRING: 'MultiLineString', - MULTI_POLYGON: 'MultiPolygon', - GEOMETRY_COLLECTION: 'GeometryCollection', - CIRCLE: 'Circle' + IDLE: 0, + LOADING: 1, + LOADED: 2, + /** + * Indicates that tile loading failed + * @type {number} + */ + ERROR: 3, + EMPTY: 4, + ABORT: 5 }); -//# sourceMappingURL=GeometryType.js.map +//# sourceMappingURL=TileState.js.map /***/ }), -/* 6 */ +/* 9 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return clamp; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return cosh; }); -/* unused harmony export roundUpToPowerOfTwo */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return squaredSegmentDistance; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return squaredDistance; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return solveLinearSystem; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return toDegrees; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return toRadians; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return roundUpToPowerOfTwo; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return squaredSegmentDistance; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return squaredDistance; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return solveLinearSystem; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return toDegrees; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return toRadians; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return modulo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return lerp; }); -/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); +/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); /** * @module ol/math */ @@ -2008,293 +2680,7 @@ function lerp(a, b, x) { //# sourceMappingURL=math.js.map /***/ }), -/* 7 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * @module ol/TileState - */ - -/** - * @enum {number} - */ -/* harmony default export */ __webpack_exports__["a"] = ({ - IDLE: 0, - LOADING: 1, - LOADED: 2, - /** - * Indicates that tile loading failed - * @type {number} - */ - ERROR: 3, - EMPTY: 4, - ABORT: 5 -}); - -//# sourceMappingURL=TileState.js.map - -/***/ }), -/* 8 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return create; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return reset; }); -/* unused harmony export multiply */ -/* unused harmony export set */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return setFromArray; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return apply; }); -/* unused harmony export rotate */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return scale; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return translate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return compose; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return invert; }); -/* unused harmony export determinant */ -/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); -/** - * @module ol/transform - */ - - - -/** - * An array representing an affine 2d transformation for use with - * {@link module:ol/transform} functions. The array has 6 elements. - * @typedef {!Array} Transform - */ - - -/** - * Collection of affine 2d transformation functions. The functions work on an - * array of 6 elements. The element order is compatible with the [SVGMatrix - * interface](https://developer.mozilla.org/en-US/docs/Web/API/SVGMatrix) and is - * a subset (elements a to f) of a 3×3 matrix: - * ``` - * [ a c e ] - * [ b d f ] - * [ 0 0 1 ] - * ``` - */ - - -/** - * @private - * @type {Transform} - */ -var tmp_ = new Array(6); - - -/** - * Create an identity transform. - * @return {!Transform} Identity transform. - */ -function create() { - return [1, 0, 0, 1, 0, 0]; -} - - -/** - * Resets the given transform to an identity transform. - * @param {!Transform} transform Transform. - * @return {!Transform} Transform. - */ -function reset(transform) { - return set(transform, 1, 0, 0, 1, 0, 0); -} - - -/** - * Multiply the underlying matrices of two transforms and return the result in - * the first transform. - * @param {!Transform} transform1 Transform parameters of matrix 1. - * @param {!Transform} transform2 Transform parameters of matrix 2. - * @return {!Transform} transform1 multiplied with transform2. - */ -function multiply(transform1, transform2) { - var a1 = transform1[0]; - var b1 = transform1[1]; - var c1 = transform1[2]; - var d1 = transform1[3]; - var e1 = transform1[4]; - var f1 = transform1[5]; - var a2 = transform2[0]; - var b2 = transform2[1]; - var c2 = transform2[2]; - var d2 = transform2[3]; - var e2 = transform2[4]; - var f2 = transform2[5]; - - transform1[0] = a1 * a2 + c1 * b2; - transform1[1] = b1 * a2 + d1 * b2; - transform1[2] = a1 * c2 + c1 * d2; - transform1[3] = b1 * c2 + d1 * d2; - transform1[4] = a1 * e2 + c1 * f2 + e1; - transform1[5] = b1 * e2 + d1 * f2 + f1; - - return transform1; -} - -/** - * Set the transform components a-f on a given transform. - * @param {!Transform} transform Transform. - * @param {number} a The a component of the transform. - * @param {number} b The b component of the transform. - * @param {number} c The c component of the transform. - * @param {number} d The d component of the transform. - * @param {number} e The e component of the transform. - * @param {number} f The f component of the transform. - * @return {!Transform} Matrix with transform applied. - */ -function set(transform, a, b, c, d, e, f) { - transform[0] = a; - transform[1] = b; - transform[2] = c; - transform[3] = d; - transform[4] = e; - transform[5] = f; - return transform; -} - - -/** - * Set transform on one matrix from another matrix. - * @param {!Transform} transform1 Matrix to set transform to. - * @param {!Transform} transform2 Matrix to set transform from. - * @return {!Transform} transform1 with transform from transform2 applied. - */ -function setFromArray(transform1, transform2) { - transform1[0] = transform2[0]; - transform1[1] = transform2[1]; - transform1[2] = transform2[2]; - transform1[3] = transform2[3]; - transform1[4] = transform2[4]; - transform1[5] = transform2[5]; - return transform1; -} - - -/** - * Transforms the given coordinate with the given transform returning the - * resulting, transformed coordinate. The coordinate will be modified in-place. - * - * @param {Transform} transform The transformation. - * @param {import("./coordinate.js").Coordinate|import("./pixel.js").Pixel} coordinate The coordinate to transform. - * @return {import("./coordinate.js").Coordinate|import("./pixel.js").Pixel} return coordinate so that operations can be - * chained together. - */ -function apply(transform, coordinate) { - var x = coordinate[0]; - var y = coordinate[1]; - coordinate[0] = transform[0] * x + transform[2] * y + transform[4]; - coordinate[1] = transform[1] * x + transform[3] * y + transform[5]; - return coordinate; -} - - -/** - * Applies rotation to the given transform. - * @param {!Transform} transform Transform. - * @param {number} angle Angle in radians. - * @return {!Transform} The rotated transform. - */ -function rotate(transform, angle) { - var cos = Math.cos(angle); - var sin = Math.sin(angle); - return multiply(transform, set(tmp_, cos, sin, -sin, cos, 0, 0)); -} - - -/** - * Applies scale to a given transform. - * @param {!Transform} transform Transform. - * @param {number} x Scale factor x. - * @param {number} y Scale factor y. - * @return {!Transform} The scaled transform. - */ -function scale(transform, x, y) { - return multiply(transform, set(tmp_, x, 0, 0, y, 0, 0)); -} - - -/** - * Applies translation to the given transform. - * @param {!Transform} transform Transform. - * @param {number} dx Translation x. - * @param {number} dy Translation y. - * @return {!Transform} The translated transform. - */ -function translate(transform, dx, dy) { - return multiply(transform, set(tmp_, 1, 0, 0, 1, dx, dy)); -} - - -/** - * Creates a composite transform given an initial translation, scale, rotation, and - * final translation (in that order only, not commutative). - * @param {!Transform} transform The transform (will be modified in place). - * @param {number} dx1 Initial translation x. - * @param {number} dy1 Initial translation y. - * @param {number} sx Scale factor x. - * @param {number} sy Scale factor y. - * @param {number} angle Rotation (in counter-clockwise radians). - * @param {number} dx2 Final translation x. - * @param {number} dy2 Final translation y. - * @return {!Transform} The composite transform. - */ -function compose(transform, dx1, dy1, sx, sy, angle, dx2, dy2) { - var sin = Math.sin(angle); - var cos = Math.cos(angle); - transform[0] = sx * cos; - transform[1] = sy * sin; - transform[2] = -sx * sin; - transform[3] = sy * cos; - transform[4] = dx2 * sx * cos - dy2 * sx * sin + dx1; - transform[5] = dx2 * sy * sin + dy2 * sy * cos + dy1; - return transform; -} - - -/** - * Invert the given transform. - * @param {!Transform} transform Transform. - * @return {!Transform} Inverse of the transform. - */ -function invert(transform) { - var det = determinant(transform); - Object(_asserts_js__WEBPACK_IMPORTED_MODULE_0__[/* assert */ "a"])(det !== 0, 32); // Transformation matrix cannot be inverted - - var a = transform[0]; - var b = transform[1]; - var c = transform[2]; - var d = transform[3]; - var e = transform[4]; - var f = transform[5]; - - transform[0] = d / det; - transform[1] = -b / det; - transform[2] = -c / det; - transform[3] = a / det; - transform[4] = (c * f - d * e) / det; - transform[5] = -(a * f - b * e) / det; - - return transform; -} - - -/** - * Returns the determinant of the given matrix. - * @param {!Transform} mat Matrix. - * @return {number} Determinant. - */ -function determinant(mat) { - return mat[0] * mat[3] - mat[1] * mat[2]; -} - -//# sourceMappingURL=transform.js.map - -/***/ }), -/* 9 */ +/* 10 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2379,30 +2765,6 @@ function isEmpty(object) { //# sourceMappingURL=obj.js.map -/***/ }), -/* 10 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return assert; }); -/* harmony import */ var _AssertionError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60); -/** - * @module ol/asserts - */ - - -/** - * @param {*} assertion Assertion we expected to be truthy. - * @param {number} errorCode Error code. - */ -function assert(assertion, errorCode) { - if (!assertion) { - throw new _AssertionError_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"](errorCode); - } -} - -//# sourceMappingURL=asserts.js.map - /***/ }), /* 11 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -2676,6 +3038,29 @@ function isSorted(arr, opt_func, opt_strict) { /* 12 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +/** + * @module ol/render/ReplayType + */ + +/** + * @enum {string} + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + CIRCLE: 'Circle', + DEFAULT: 'Default', + IMAGE: 'Image', + LINE_STRING: 'LineString', + POLYGON: 'Polygon', + TEXT: 'Text' +}); + +//# sourceMappingURL=ReplayType.js.map + +/***/ }), +/* 13 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + "use strict"; /** * @module ol/ViewHint @@ -2692,22 +3077,46 @@ function isSorted(arr, opt_func, opt_strict) { //# sourceMappingURL=ViewHint.js.map /***/ }), -/* 13 */ +/* 14 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return assert; }); +/* harmony import */ var _AssertionError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(76); +/** + * @module ol/asserts + */ + + +/** + * @param {*} assertion Assertion we expected to be truthy. + * @param {number} errorCode Error code. + */ +function assert(assertion, errorCode) { + if (!assertion) { + throw new _AssertionError_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"](errorCode); + } +} + +//# sourceMappingURL=asserts.js.map + +/***/ }), +/* 15 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXTERNAL MODULE: ./node_modules/ol/sphere.js -var sphere = __webpack_require__(59); +var sphere = __webpack_require__(74); // EXTERNAL MODULE: ./node_modules/ol/extent.js var ol_extent = __webpack_require__(0); // EXTERNAL MODULE: ./node_modules/ol/math.js -var math = __webpack_require__(6); +var math = __webpack_require__(9); // EXTERNAL MODULE: ./node_modules/ol/proj/Units.js -var Units = __webpack_require__(24); +var Units = __webpack_require__(32); // CONCATENATED MODULE: ./node_modules/ol/proj/Projection.js /** @@ -3253,7 +3662,7 @@ function add(code, projection) { //# sourceMappingURL=projections.js.map // EXTERNAL MODULE: ./node_modules/ol/obj.js -var obj = __webpack_require__(9); +var obj = __webpack_require__(10); // CONCATENATED MODULE: ./node_modules/ol/proj/transforms.js /** @@ -3345,12 +3754,12 @@ function transforms_get(sourceCode, destinationCode) { /* unused harmony export createTransformFromCoordinateTransform */ /* unused harmony export addCoordinateTransforms */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return fromLonLat; }); -/* unused harmony export toLonLat */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return toLonLat; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return equivalent; }); /* unused harmony export getTransformFromProjections */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return getTransform; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return proj_transform; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return transformExtent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return proj_transform; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return transformExtent; }); /* unused harmony export transformWithProjections */ /* unused harmony export addCommon */ /* concated harmony reexport METERS_PER_UNIT */__webpack_require__.d(__webpack_exports__, "a", function() { return Units["a" /* METERS_PER_UNIT */]; }); @@ -3869,44 +4278,7 @@ addCommon(); //# sourceMappingURL=proj.js.map /***/ }), -/* 14 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return TRUE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FALSE; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return VOID; }); -/** - * @module ol/functions - */ - -/** - * Always returns true. - * @returns {boolean} true. - */ -function TRUE() { - return true; -} - -/** - * Always returns false. - * @returns {boolean} false. - */ -function FALSE() { - return false; -} - -/** - * A reusable function, used e.g. as a default for callbacks. - * - * @return {void} Nothing. - */ -function VOID() {} - -//# sourceMappingURL=functions.js.map - -/***/ }), -/* 15 */ +/* 16 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4001,17 +4373,229 @@ function removeChildren(node) { //# sourceMappingURL=dom.js.map /***/ }), -/* 16 */ +/* 17 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return TRUE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return FALSE; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return VOID; }); +/** + * @module ol/functions + */ + +/** + * Always returns true. + * @returns {boolean} true. + */ +function TRUE() { + return true; +} + +/** + * Always returns false. + * @returns {boolean} false. + */ +function FALSE() { + return false; +} + +/** + * A reusable function, used e.g. as a default for callbacks. + * + * @return {void} Nothing. + */ +function VOID() {} + +//# sourceMappingURL=functions.js.map + +/***/ }), +/* 18 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7); +/** + * @module ol/MapBrowserEventType + */ + + +/** + * Constants for event names. + * @enum {string} + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + + /** + * A true single click with no dragging and no double click. Note that this + * event is delayed by 250 ms to ensure that it is not a double click. + * @event module:ol/MapBrowserEvent~MapBrowserEvent#singleclick + * @api + */ + SINGLECLICK: 'singleclick', + + /** + * A click with no dragging. A double click will fire two of this. + * @event module:ol/MapBrowserEvent~MapBrowserEvent#click + * @api + */ + CLICK: _events_EventType_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].CLICK, + + /** + * A true double click, with no dragging. + * @event module:ol/MapBrowserEvent~MapBrowserEvent#dblclick + * @api + */ + DBLCLICK: _events_EventType_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].DBLCLICK, + + /** + * Triggered when a pointer is dragged. + * @event module:ol/MapBrowserEvent~MapBrowserEvent#pointerdrag + * @api + */ + POINTERDRAG: 'pointerdrag', + + /** + * Triggered when a pointer is moved. Note that on touch devices this is + * triggered when the map is panned, so is not the same as mousemove. + * @event module:ol/MapBrowserEvent~MapBrowserEvent#pointermove + * @api + */ + POINTERMOVE: 'pointermove', + + POINTERDOWN: 'pointerdown', + POINTERUP: 'pointerup', + POINTEROVER: 'pointerover', + POINTEROUT: 'pointerout', + POINTERENTER: 'pointerenter', + POINTERLEAVE: 'pointerleave', + POINTERCANCEL: 'pointercancel' +}); + +//# sourceMappingURL=MapBrowserEventType.js.map + +/***/ }), +/* 19 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return FIREFOX; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return SAFARI; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return WEBKIT; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return MAC; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DEVICE_PIXEL_RATIO; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CANVAS_LINE_DASH; }); +/* unused harmony export GEOLOCATION */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return TOUCH; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return POINTER; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return MSPOINTER; }); +/** + * @module ol/has + */ + +var ua = typeof navigator !== 'undefined' ? + navigator.userAgent.toLowerCase() : ''; + +/** + * User agent string says we are dealing with Firefox as browser. + * @type {boolean} + */ +var FIREFOX = ua.indexOf('firefox') !== -1; + +/** + * User agent string says we are dealing with Safari as browser. + * @type {boolean} + */ +var SAFARI = ua.indexOf('safari') !== -1 && ua.indexOf('chrom') == -1; + +/** + * User agent string says we are dealing with a WebKit engine. + * @type {boolean} + */ +var WEBKIT = ua.indexOf('webkit') !== -1 && ua.indexOf('edge') == -1; + +/** + * User agent string says we are dealing with a Mac as platform. + * @type {boolean} + */ +var MAC = ua.indexOf('macintosh') !== -1; + + +/** + * The ratio between physical pixels and device-independent pixels + * (dips) on the device (`window.devicePixelRatio`). + * @const + * @type {number} + * @api + */ +var DEVICE_PIXEL_RATIO = window.devicePixelRatio || 1; + + +/** + * True if the browser's Canvas implementation implements {get,set}LineDash. + * @type {boolean} + */ +var CANVAS_LINE_DASH = function() { + var has = false; + try { + has = !!document.createElement('canvas').getContext('2d').setLineDash; + } catch (e) { + // pass + } + return has; +}(); + + +/** + * Is HTML5 geolocation supported in the current browser? + * @const + * @type {boolean} + * @api + */ +var GEOLOCATION = 'geolocation' in navigator; + + +/** + * True if browser supports touch events. + * @const + * @type {boolean} + * @api + */ +var TOUCH = 'ontouchstart' in window; + + +/** + * True if browser supports pointer events. + * @const + * @type {boolean} + */ +var POINTER = 'PointerEvent' in window; + + +/** + * True if browser supports ms pointer events (IE 10). + * @const + * @type {boolean} + */ +var MSPOINTER = !!(navigator.msPointerEnabled); + + + + +//# sourceMappingURL=has.js.map + +/***/ }), +/* 20 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export ObjectEvent */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getChangeEventType; }); -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(42); -/* harmony import */ var _Observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(63); -/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21); -/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9); +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(49); +/* harmony import */ var _Observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(77); +/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27); +/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10); /** * @module ol/Object */ @@ -4241,117 +4825,140 @@ function getChangeEventType(key) { //# sourceMappingURL=Object.js.map /***/ }), -/* 17 */ +/* 21 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return FIREFOX; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return SAFARI; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return WEBKIT; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return MAC; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DEVICE_PIXEL_RATIO; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CANVAS_LINE_DASH; }); -/* unused harmony export GEOLOCATION */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return TOUCH; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return POINTER; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return MSPOINTER; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return transform2D; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return rotate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return scale; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return translate; }); /** - * @module ol/has + * @module ol/geom/flat/transform */ -var ua = typeof navigator !== 'undefined' ? - navigator.userAgent.toLowerCase() : ''; - -/** - * User agent string says we are dealing with Firefox as browser. - * @type {boolean} - */ -var FIREFOX = ua.indexOf('firefox') !== -1; - -/** - * User agent string says we are dealing with Safari as browser. - * @type {boolean} - */ -var SAFARI = ua.indexOf('safari') !== -1 && ua.indexOf('chrom') == -1; - -/** - * User agent string says we are dealing with a WebKit engine. - * @type {boolean} - */ -var WEBKIT = ua.indexOf('webkit') !== -1 && ua.indexOf('edge') == -1; - -/** - * User agent string says we are dealing with a Mac as platform. - * @type {boolean} - */ -var MAC = ua.indexOf('macintosh') !== -1; - /** - * The ratio between physical pixels and device-independent pixels - * (dips) on the device (`window.devicePixelRatio`). - * @const - * @type {number} - * @api + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @param {import("../../transform.js").Transform} transform Transform. + * @param {Array=} opt_dest Destination. + * @return {Array} Transformed coordinates. */ -var DEVICE_PIXEL_RATIO = window.devicePixelRatio || 1; - - -/** - * True if the browser's Canvas implementation implements {get,set}LineDash. - * @type {boolean} - */ -var CANVAS_LINE_DASH = function() { - var has = false; - try { - has = !!document.createElement('canvas').getContext('2d').setLineDash; - } catch (e) { - // pass +function transform2D(flatCoordinates, offset, end, stride, transform, opt_dest) { + var dest = opt_dest ? opt_dest : []; + var i = 0; + for (var j = offset; j < end; j += stride) { + var x = flatCoordinates[j]; + var y = flatCoordinates[j + 1]; + dest[i++] = transform[0] * x + transform[2] * y + transform[4]; + dest[i++] = transform[1] * x + transform[3] * y + transform[5]; } - return has; -}(); + if (opt_dest && dest.length != i) { + dest.length = i; + } + return dest; +} /** - * Is HTML5 geolocation supported in the current browser? - * @const - * @type {boolean} - * @api + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @param {number} angle Angle. + * @param {Array} anchor Rotation anchor point. + * @param {Array=} opt_dest Destination. + * @return {Array} Transformed coordinates. */ -var GEOLOCATION = 'geolocation' in navigator; +function rotate(flatCoordinates, offset, end, stride, angle, anchor, opt_dest) { + var dest = opt_dest ? opt_dest : []; + var cos = Math.cos(angle); + var sin = Math.sin(angle); + var anchorX = anchor[0]; + var anchorY = anchor[1]; + var i = 0; + for (var j = offset; j < end; j += stride) { + var deltaX = flatCoordinates[j] - anchorX; + var deltaY = flatCoordinates[j + 1] - anchorY; + dest[i++] = anchorX + deltaX * cos - deltaY * sin; + dest[i++] = anchorY + deltaX * sin + deltaY * cos; + for (var k = j + 2; k < j + stride; ++k) { + dest[i++] = flatCoordinates[k]; + } + } + if (opt_dest && dest.length != i) { + dest.length = i; + } + return dest; +} /** - * True if browser supports touch events. - * @const - * @type {boolean} - * @api + * Scale the coordinates. + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @param {number} sx Scale factor in the x-direction. + * @param {number} sy Scale factor in the y-direction. + * @param {Array} anchor Scale anchor point. + * @param {Array=} opt_dest Destination. + * @return {Array} Transformed coordinates. */ -var TOUCH = 'ontouchstart' in window; +function scale(flatCoordinates, offset, end, stride, sx, sy, anchor, opt_dest) { + var dest = opt_dest ? opt_dest : []; + var anchorX = anchor[0]; + var anchorY = anchor[1]; + var i = 0; + for (var j = offset; j < end; j += stride) { + var deltaX = flatCoordinates[j] - anchorX; + var deltaY = flatCoordinates[j + 1] - anchorY; + dest[i++] = anchorX + sx * deltaX; + dest[i++] = anchorY + sy * deltaY; + for (var k = j + 2; k < j + stride; ++k) { + dest[i++] = flatCoordinates[k]; + } + } + if (opt_dest && dest.length != i) { + dest.length = i; + } + return dest; +} /** - * True if browser supports pointer events. - * @const - * @type {boolean} + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @param {number} deltaX Delta X. + * @param {number} deltaY Delta Y. + * @param {Array=} opt_dest Destination. + * @return {Array} Transformed coordinates. */ -var POINTER = 'PointerEvent' in window; +function translate(flatCoordinates, offset, end, stride, deltaX, deltaY, opt_dest) { + var dest = opt_dest ? opt_dest : []; + var i = 0; + for (var j = offset; j < end; j += stride) { + dest[i++] = flatCoordinates[j] + deltaX; + dest[i++] = flatCoordinates[j + 1] + deltaY; + for (var k = j + 2; k < j + stride; ++k) { + dest[i++] = flatCoordinates[k]; + } + } + if (opt_dest && dest.length != i) { + dest.length = i; + } + return dest; +} - -/** - * True if browser supports ms pointer events (IE 10). - * @const - * @type {boolean} - */ -var MSPOINTER = !!(navigator.msPointerEnabled); - - - - -//# sourceMappingURL=has.js.map +//# sourceMappingURL=transform.js.map /***/ }), -/* 18 */ +/* 22 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4375,7 +4982,7 @@ var MSPOINTER = !!(navigator.msPointerEnabled); //# sourceMappingURL=GeometryLayout.js.map /***/ }), -/* 19 */ +/* 23 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4398,253 +5005,10 @@ var MSPOINTER = !!(navigator.msPointerEnabled); //# sourceMappingURL=Property.js.map -/***/ }), -/* 20 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * @module ol/ImageState - */ - -/** - * @enum {number} - */ -/* harmony default export */ __webpack_exports__["a"] = ({ - IDLE: 0, - LOADING: 1, - LOADED: 2, - ERROR: 3 -}); - -//# sourceMappingURL=ImageState.js.map - -/***/ }), -/* 21 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return stopPropagation; }); -/* unused harmony export preventDefault */ -/** - * @module ol/events/Event - */ - -/** - * @classdesc - * Stripped down implementation of the W3C DOM Level 2 Event interface. - * See https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface. - * - * This implementation only provides `type` and `target` properties, and - * `stopPropagation` and `preventDefault` methods. It is meant as base class - * for higher level events defined in the library, and works with - * {@link module:ol/events/Target~Target}. - */ -var Event = function Event(type) { - - /** - * @type {boolean} - */ - this.propagationStopped; - - /** - * The event type. - * @type {string} - * @api - */ - this.type = type; - - /** - * The event target. - * @type {Object} - * @api - */ - this.target = null; -}; - -/** - * Stop event propagation. - * @api - */ -Event.prototype.preventDefault = function preventDefault () { - this.propagationStopped = true; -}; - -/** - * Stop event propagation. - * @api - */ -Event.prototype.stopPropagation = function stopPropagation () { - this.propagationStopped = true; -}; - - -/** - * @param {Event|import("./Event.js").default} evt Event - */ -function stopPropagation(evt) { - evt.stopPropagation(); -} - - -/** - * @param {Event|import("./Event.js").default} evt Event - */ -function preventDefault(evt) { - evt.preventDefault(); -} - -/* harmony default export */ __webpack_exports__["a"] = (Event); - -//# sourceMappingURL=Event.js.map - -/***/ }), -/* 22 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return easeIn; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return easeOut; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return inAndOut; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return linear; }); -/* unused harmony export upAndDown */ -/** - * @module ol/easing - */ - - -/** - * Start slow and speed up. - * @param {number} t Input between 0 and 1. - * @return {number} Output between 0 and 1. - * @api - */ -function easeIn(t) { - return Math.pow(t, 3); -} - - -/** - * Start fast and slow down. - * @param {number} t Input between 0 and 1. - * @return {number} Output between 0 and 1. - * @api - */ -function easeOut(t) { - return 1 - easeIn(1 - t); -} - - -/** - * Start slow, speed up, and then slow down again. - * @param {number} t Input between 0 and 1. - * @return {number} Output between 0 and 1. - * @api - */ -function inAndOut(t) { - return 3 * t * t - 2 * t * t * t; -} - - -/** - * Maintain a constant speed over time. - * @param {number} t Input between 0 and 1. - * @return {number} Output between 0 and 1. - * @api - */ -function linear(t) { - return t; -} - - -/** - * Start slow, speed up, and at the very end slow down again. This has the - * same general behavior as {@link module:ol/easing~inAndOut}, but the final - * slowdown is delayed. - * @param {number} t Input between 0 and 1. - * @return {number} Output between 0 and 1. - * @api - */ -function upAndDown(t) { - if (t < 0.5) { - return inAndOut(2 * t); - } else { - return 1 - inAndOut(2 * (t - 0.5)); - } -} - -//# sourceMappingURL=easing.js.map - -/***/ }), -/* 23 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * @module ol/extent/Relationship - */ - -/** - * Relationship to an extent. - * @enum {number} - */ -/* harmony default export */ __webpack_exports__["a"] = ({ - UNKNOWN: 0, - INTERSECTING: 1, - ABOVE: 2, - RIGHT: 4, - BELOW: 8, - LEFT: 16 -}); - -//# sourceMappingURL=Relationship.js.map - /***/ }), /* 24 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return METERS_PER_UNIT; }); -/** - * @module ol/proj/Units - */ - -/** - * Projection units: `'degrees'`, `'ft'`, `'m'`, `'pixels'`, `'tile-pixels'` or - * `'us-ft'`. - * @enum {string} - */ -var Units = { - DEGREES: 'degrees', - FEET: 'ft', - METERS: 'm', - PIXELS: 'pixels', - TILE_PIXELS: 'tile-pixels', - USFEET: 'us-ft' -}; - - -/** - * Meters per unit lookup table. - * @const - * @type {Object} - * @api - */ -var METERS_PER_UNIT = {}; -// use the radius of the Normal sphere -METERS_PER_UNIT[Units.DEGREES] = 2 * Math.PI * 6370997 / 360; -METERS_PER_UNIT[Units.FEET] = 0.3048; -METERS_PER_UNIT[Units.METERS] = 1; -METERS_PER_UNIT[Units.USFEET] = 1200 / 3937; - -/* harmony default export */ __webpack_exports__["b"] = (Units); - -//# sourceMappingURL=Units.js.map - -/***/ }), -/* 25 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return CLASS_HIDDEN; }); /* unused harmony export CLASS_SELECTABLE */ @@ -4741,10 +5105,600 @@ var getFontFamilies = (function() { //# sourceMappingURL=css.js.map +/***/ }), +/* 25 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ORDER; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return TEXT_ALIGN; }); +/* harmony import */ var _ReplayType_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(12); +/** + * @module ol/render/replay + */ + + + +/** + * @const + * @type {Array} + */ +var ORDER = [ + _ReplayType_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].POLYGON, + _ReplayType_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].CIRCLE, + _ReplayType_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].LINE_STRING, + _ReplayType_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].IMAGE, + _ReplayType_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].TEXT, + _ReplayType_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].DEFAULT +]; + +/** + * @const + * @enum {number} + */ +var TEXT_ALIGN = {}; +TEXT_ALIGN['left'] = 0; +TEXT_ALIGN['end'] = 0; +TEXT_ALIGN['center'] = 0.5; +TEXT_ALIGN['right'] = 1; +TEXT_ALIGN['start'] = 1; +TEXT_ALIGN['top'] = 0; +TEXT_ALIGN['middle'] = 0.5; +TEXT_ALIGN['hanging'] = 0.2; +TEXT_ALIGN['alphabetic'] = 0.8; +TEXT_ALIGN['ideographic'] = 0.8; +TEXT_ALIGN['bottom'] = 1; + +//# sourceMappingURL=replay.js.map + /***/ }), /* 26 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +/** + * @module ol/ImageState + */ + +/** + * @enum {number} + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + IDLE: 0, + LOADING: 1, + LOADED: 2, + ERROR: 3 +}); + +//# sourceMappingURL=ImageState.js.map + +/***/ }), +/* 27 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return stopPropagation; }); +/* unused harmony export preventDefault */ +/** + * @module ol/events/Event + */ + +/** + * @classdesc + * Stripped down implementation of the W3C DOM Level 2 Event interface. + * See https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface. + * + * This implementation only provides `type` and `target` properties, and + * `stopPropagation` and `preventDefault` methods. It is meant as base class + * for higher level events defined in the library, and works with + * {@link module:ol/events/Target~Target}. + */ +var Event = function Event(type) { + + /** + * @type {boolean} + */ + this.propagationStopped; + + /** + * The event type. + * @type {string} + * @api + */ + this.type = type; + + /** + * The event target. + * @type {Object} + * @api + */ + this.target = null; +}; + +/** + * Stop event propagation. + * @api + */ +Event.prototype.preventDefault = function preventDefault () { + this.propagationStopped = true; +}; + +/** + * Stop event propagation. + * @api + */ +Event.prototype.stopPropagation = function stopPropagation () { + this.propagationStopped = true; +}; + + +/** + * @param {Event|import("./Event.js").default} evt Event + */ +function stopPropagation(evt) { + evt.stopPropagation(); +} + + +/** + * @param {Event|import("./Event.js").default} evt Event + */ +function preventDefault(evt) { + evt.preventDefault(); +} + +/* harmony default export */ __webpack_exports__["a"] = (Event); + +//# sourceMappingURL=Event.js.map + +/***/ }), +/* 28 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * @module ol/LayerType + */ + +/** + * A layer type used when creating layer renderers. + * @enum {string} + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + IMAGE: 'IMAGE', + TILE: 'TILE', + VECTOR_TILE: 'VECTOR_TILE', + VECTOR: 'VECTOR' +}); + +//# sourceMappingURL=LayerType.js.map + +/***/ }), +/* 29 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return easeIn; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return easeOut; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return inAndOut; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return linear; }); +/* unused harmony export upAndDown */ +/** + * @module ol/easing + */ + + +/** + * Start slow and speed up. + * @param {number} t Input between 0 and 1. + * @return {number} Output between 0 and 1. + * @api + */ +function easeIn(t) { + return Math.pow(t, 3); +} + + +/** + * Start fast and slow down. + * @param {number} t Input between 0 and 1. + * @return {number} Output between 0 and 1. + * @api + */ +function easeOut(t) { + return 1 - easeIn(1 - t); +} + + +/** + * Start slow, speed up, and then slow down again. + * @param {number} t Input between 0 and 1. + * @return {number} Output between 0 and 1. + * @api + */ +function inAndOut(t) { + return 3 * t * t - 2 * t * t * t; +} + + +/** + * Maintain a constant speed over time. + * @param {number} t Input between 0 and 1. + * @return {number} Output between 0 and 1. + * @api + */ +function linear(t) { + return t; +} + + +/** + * Start slow, speed up, and at the very end slow down again. This has the + * same general behavior as {@link module:ol/easing~inAndOut}, but the final + * slowdown is delayed. + * @param {number} t Input between 0 and 1. + * @return {number} Output between 0 and 1. + * @api + */ +function upAndDown(t) { + if (t < 0.5) { + return inAndOut(2 * t); + } else { + return 1 - inAndOut(2 * (t - 0.5)); + } +} + +//# sourceMappingURL=easing.js.map + +/***/ }), +/* 30 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * @module ol/render/EventType + */ + +/** + * @enum {string} + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + /** + * @event module:ol/render/Event~RenderEvent#postcompose + * @api + */ + POSTCOMPOSE: 'postcompose', + /** + * @event module:ol/render/Event~RenderEvent#precompose + * @api + */ + PRECOMPOSE: 'precompose', + /** + * @event module:ol/render/Event~RenderEvent#render + * @api + */ + RENDER: 'render', + /** + * Triggered when rendering is complete, i.e. all sources and tiles have + * finished loading for the current viewport, and all tiles are faded in. + * @event module:ol/render/Event~RenderEvent#rendercomplete + * @api + */ + RENDERCOMPLETE: 'rendercomplete' +}); + +//# sourceMappingURL=EventType.js.map + +/***/ }), +/* 31 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * @module ol/extent/Relationship + */ + +/** + * Relationship to an extent. + * @enum {number} + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + UNKNOWN: 0, + INTERSECTING: 1, + ABOVE: 2, + RIGHT: 4, + BELOW: 8, + LEFT: 16 +}); + +//# sourceMappingURL=Relationship.js.map + +/***/ }), +/* 32 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return METERS_PER_UNIT; }); +/** + * @module ol/proj/Units + */ + +/** + * Projection units: `'degrees'`, `'ft'`, `'m'`, `'pixels'`, `'tile-pixels'` or + * `'us-ft'`. + * @enum {string} + */ +var Units = { + DEGREES: 'degrees', + FEET: 'ft', + METERS: 'm', + PIXELS: 'pixels', + TILE_PIXELS: 'tile-pixels', + USFEET: 'us-ft' +}; + + +/** + * Meters per unit lookup table. + * @const + * @type {Object} + * @api + */ +var METERS_PER_UNIT = {}; +// use the radius of the Normal sphere +METERS_PER_UNIT[Units.DEGREES] = 2 * Math.PI * 6370997 / 360; +METERS_PER_UNIT[Units.FEET] = 0.3048; +METERS_PER_UNIT[Units.METERS] = 1; +METERS_PER_UNIT[Units.USFEET] = 1200 / 3937; + +/* harmony default export */ __webpack_exports__["b"] = (Units); + +//# sourceMappingURL=Units.js.map + +/***/ }), +/* 33 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return asString; }); +/* unused harmony export fromString */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return asArray; }); +/* unused harmony export normalize */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return toString; }); +/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); +/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9); +/** + * @module ol/color + */ + + + + +/** + * A color represented as a short array [red, green, blue, alpha]. + * red, green, and blue should be integers in the range 0..255 inclusive. + * alpha should be a float in the range 0..1 inclusive. If no alpha value is + * given then `1` will be used. + * @typedef {Array} Color + * @api + */ + + +/** + * This RegExp matches # followed by 3, 4, 6, or 8 hex digits. + * @const + * @type {RegExp} + * @private + */ +var HEX_COLOR_RE_ = /^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i; + + +/** + * Regular expression for matching potential named color style strings. + * @const + * @type {RegExp} + * @private + */ +var NAMED_COLOR_RE_ = /^([a-z]*)$/i; + + +/** + * Return the color as an rgba string. + * @param {Color|string} color Color. + * @return {string} Rgba string. + * @api + */ +function asString(color) { + if (typeof color === 'string') { + return color; + } else { + return toString(color); + } +} + +/** + * Return named color as an rgba string. + * @param {string} color Named color. + * @return {string} Rgb string. + */ +function fromNamed(color) { + var el = document.createElement('div'); + el.style.color = color; + if (el.style.color !== '') { + document.body.appendChild(el); + var rgb = getComputedStyle(el).color; + document.body.removeChild(el); + return rgb; + } else { + return ''; + } +} + + +/** + * @param {string} s String. + * @return {Color} Color. + */ +var fromString = ( + function() { + + // We maintain a small cache of parsed strings. To provide cheap LRU-like + // semantics, whenever the cache grows too large we simply delete an + // arbitrary 25% of the entries. + + /** + * @const + * @type {number} + */ + var MAX_CACHE_SIZE = 1024; + + /** + * @type {Object} + */ + var cache = {}; + + /** + * @type {number} + */ + var cacheSize = 0; + + return ( + /** + * @param {string} s String. + * @return {Color} Color. + */ + function(s) { + var color; + if (cache.hasOwnProperty(s)) { + color = cache[s]; + } else { + if (cacheSize >= MAX_CACHE_SIZE) { + var i = 0; + for (var key in cache) { + if ((i++ & 3) === 0) { + delete cache[key]; + --cacheSize; + } + } + } + color = fromStringInternal_(s); + cache[s] = color; + ++cacheSize; + } + return color; + } + ); + + })(); + +/** + * Return the color as an array. This function maintains a cache of calculated + * arrays which means the result should not be modified. + * @param {Color|string} color Color. + * @return {Color} Color. + * @api + */ +function asArray(color) { + if (Array.isArray(color)) { + return color; + } else { + return fromString(color); + } +} + +/** + * @param {string} s String. + * @private + * @return {Color} Color. + */ +function fromStringInternal_(s) { + var r, g, b, a, color; + + if (NAMED_COLOR_RE_.exec(s)) { + s = fromNamed(s); + } + + if (HEX_COLOR_RE_.exec(s)) { // hex + var n = s.length - 1; // number of hex digits + var d; // number of digits per channel + if (n <= 4) { + d = 1; + } else { + d = 2; + } + var hasAlpha = n === 4 || n === 8; + r = parseInt(s.substr(1 + 0 * d, d), 16); + g = parseInt(s.substr(1 + 1 * d, d), 16); + b = parseInt(s.substr(1 + 2 * d, d), 16); + if (hasAlpha) { + a = parseInt(s.substr(1 + 3 * d, d), 16); + } else { + a = 255; + } + if (d == 1) { + r = (r << 4) + r; + g = (g << 4) + g; + b = (b << 4) + b; + if (hasAlpha) { + a = (a << 4) + a; + } + } + color = [r, g, b, a / 255]; + } else if (s.indexOf('rgba(') == 0) { // rgba() + color = s.slice(5, -1).split(',').map(Number); + normalize(color); + } else if (s.indexOf('rgb(') == 0) { // rgb() + color = s.slice(4, -1).split(',').map(Number); + color.push(1); + normalize(color); + } else { + Object(_asserts_js__WEBPACK_IMPORTED_MODULE_0__[/* assert */ "a"])(false, 14); // Invalid color + } + return color; +} + + +/** + * TODO this function is only used in the test, we probably shouldn't export it + * @param {Color} color Color. + * @return {Color} Clamped color. + */ +function normalize(color) { + color[0] = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__[/* clamp */ "a"])((color[0] + 0.5) | 0, 0, 255); + color[1] = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__[/* clamp */ "a"])((color[1] + 0.5) | 0, 0, 255); + color[2] = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__[/* clamp */ "a"])((color[2] + 0.5) | 0, 0, 255); + color[3] = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__[/* clamp */ "a"])(color[3], 0, 1); + return color; +} + + +/** + * @param {Color} color Color. + * @return {string} String. + */ +function toString(color) { + var r = color[0]; + if (r != (r | 0)) { + r = (r + 0.5) | 0; + } + var g = color[1]; + if (g != (g | 0)) { + g = (g + 0.5) | 0; + } + var b = color[2]; + if (b != (b | 0)) { + b = (b + 0.5) | 0; + } + var a = color[3] === undefined ? 1 : color[3]; + return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; +} + +//# sourceMappingURL=color.js.map + +/***/ }), +/* 34 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + "use strict"; /** * @module ol/CollectionEventType @@ -4771,15 +5725,782 @@ var getFontFamilies = (function() { //# sourceMappingURL=CollectionEventType.js.map /***/ }), -/* 27 */ +/* 35 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return defaultOrder; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getSquaredTolerance; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getTolerance; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return renderFeature; }); +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var _ImageState_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26); +/* harmony import */ var _geom_GeometryType_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5); +/* harmony import */ var _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12); +/** + * @module ol/renderer/vector + */ + + + + + + +/** + * Tolerance for geometry simplification in device pixels. + * @type {number} + */ +var SIMPLIFY_TOLERANCE = 0.5; + + +/** + * @const + * @type {Object} + */ +var GEOMETRY_RENDERERS = { + 'Point': renderPointGeometry, + 'LineString': renderLineStringGeometry, + 'Polygon': renderPolygonGeometry, + 'MultiPoint': renderMultiPointGeometry, + 'MultiLineString': renderMultiLineStringGeometry, + 'MultiPolygon': renderMultiPolygonGeometry, + 'GeometryCollection': renderGeometryCollectionGeometry, + 'Circle': renderCircleGeometry +}; + + +/** + * @param {import("../Feature.js").FeatureLike} feature1 Feature 1. + * @param {import("../Feature.js").FeatureLike} feature2 Feature 2. + * @return {number} Order. + */ +function defaultOrder(feature1, feature2) { + return parseInt(Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* getUid */ "c"])(feature1), 10) - parseInt(Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* getUid */ "c"])(feature2), 10); +} + + +/** + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @return {number} Squared pixel tolerance. + */ +function getSquaredTolerance(resolution, pixelRatio) { + var tolerance = getTolerance(resolution, pixelRatio); + return tolerance * tolerance; +} + + +/** + * @param {number} resolution Resolution. + * @param {number} pixelRatio Pixel ratio. + * @return {number} Pixel tolerance. + */ +function getTolerance(resolution, pixelRatio) { + return SIMPLIFY_TOLERANCE * resolution / pixelRatio; +} + + +/** + * @param {import("../render/ReplayGroup.js").default} replayGroup Replay group. + * @param {import("../geom/Circle.js").default} geometry Geometry. + * @param {import("../style/Style.js").default} style Style. + * @param {import("../Feature.js").default} feature Feature. + */ +function renderCircleGeometry(replayGroup, geometry, style, feature) { + var fillStyle = style.getFill(); + var strokeStyle = style.getStroke(); + if (fillStyle || strokeStyle) { + var circleReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].CIRCLE); + circleReplay.setFillStrokeStyle(fillStyle, strokeStyle); + circleReplay.drawCircle(geometry, feature); + } + var textStyle = style.getText(); + if (textStyle) { + var textReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].TEXT); + textReplay.setTextStyle(textStyle, replayGroup.addDeclutter(false)); + textReplay.drawText(geometry, feature); + } +} + + +/** + * @param {import("../render/ReplayGroup.js").default} replayGroup Replay group. + * @param {import("../Feature.js").FeatureLike} feature Feature. + * @param {import("../style/Style.js").default} style Style. + * @param {number} squaredTolerance Squared tolerance. + * @param {function(this: T, import("../events/Event.js").default)} listener Listener function. + * @param {T} thisArg Value to use as `this` when executing `listener`. + * @return {boolean} `true` if style is loading. + * @template T + */ +function renderFeature(replayGroup, feature, style, squaredTolerance, listener, thisArg) { + var loading = false; + var imageStyle = style.getImage(); + if (imageStyle) { + var imageState = imageStyle.getImageState(); + if (imageState == _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].LOADED || imageState == _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].ERROR) { + imageStyle.unlistenImageChange(listener, thisArg); + } else { + if (imageState == _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].IDLE) { + imageStyle.load(); + } + imageState = imageStyle.getImageState(); + imageStyle.listenImageChange(listener, thisArg); + loading = true; + } + } + renderFeatureInternal(replayGroup, feature, style, squaredTolerance); + + return loading; +} + + +/** + * @param {import("../render/ReplayGroup.js").default} replayGroup Replay group. + * @param {import("../Feature.js").FeatureLike} feature Feature. + * @param {import("../style/Style.js").default} style Style. + * @param {number} squaredTolerance Squared tolerance. + */ +function renderFeatureInternal(replayGroup, feature, style, squaredTolerance) { + var geometry = style.getGeometryFunction()(feature); + if (!geometry) { + return; + } + var simplifiedGeometry = geometry.getSimplifiedGeometry(squaredTolerance); + var renderer = style.getRenderer(); + if (renderer) { + renderGeometry(replayGroup, simplifiedGeometry, style, feature); + } else { + var geometryRenderer = GEOMETRY_RENDERERS[simplifiedGeometry.getType()]; + geometryRenderer(replayGroup, simplifiedGeometry, style, feature); + } +} + + +/** + * @param {import("../render/ReplayGroup.js").default} replayGroup Replay group. + * @param {import("../geom/Geometry.js").default|import("../render/Feature.js").default} geometry Geometry. + * @param {import("../style/Style.js").default} style Style. + * @param {import("../Feature.js").FeatureLike} feature Feature. + */ +function renderGeometry(replayGroup, geometry, style, feature) { + if (geometry.getType() == _geom_GeometryType_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].GEOMETRY_COLLECTION) { + var geometries = /** @type {import("../geom/GeometryCollection.js").default} */ (geometry).getGeometries(); + for (var i = 0, ii = geometries.length; i < ii; ++i) { + renderGeometry(replayGroup, geometries[i], style, feature); + } + return; + } + var replay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].DEFAULT); + replay.drawCustom(/** @type {import("../geom/SimpleGeometry.js").default} */ (geometry), feature, style.getRenderer()); +} + + +/** + * @param {import("../render/ReplayGroup.js").default} replayGroup Replay group. + * @param {import("../geom/GeometryCollection.js").default} geometry Geometry. + * @param {import("../style/Style.js").default} style Style. + * @param {import("../Feature.js").default} feature Feature. + */ +function renderGeometryCollectionGeometry(replayGroup, geometry, style, feature) { + var geometries = geometry.getGeometriesArray(); + var i, ii; + for (i = 0, ii = geometries.length; i < ii; ++i) { + var geometryRenderer = + GEOMETRY_RENDERERS[geometries[i].getType()]; + geometryRenderer(replayGroup, geometries[i], style, feature); + } +} + + +/** + * @param {import("../render/ReplayGroup.js").default} replayGroup Replay group. + * @param {import("../geom/LineString.js").default|import("../render/Feature.js").default} geometry Geometry. + * @param {import("../style/Style.js").default} style Style. + * @param {import("../Feature.js").FeatureLike} feature Feature. + */ +function renderLineStringGeometry(replayGroup, geometry, style, feature) { + var strokeStyle = style.getStroke(); + if (strokeStyle) { + var lineStringReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].LINE_STRING); + lineStringReplay.setFillStrokeStyle(null, strokeStyle); + lineStringReplay.drawLineString(geometry, feature); + } + var textStyle = style.getText(); + if (textStyle) { + var textReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].TEXT); + textReplay.setTextStyle(textStyle, replayGroup.addDeclutter(false)); + textReplay.drawText(geometry, feature); + } +} + + +/** + * @param {import("../render/ReplayGroup.js").default} replayGroup Replay group. + * @param {import("../geom/MultiLineString.js").default|import("../render/Feature.js").default} geometry Geometry. + * @param {import("../style/Style.js").default} style Style. + * @param {import("../Feature.js").FeatureLike} feature Feature. + */ +function renderMultiLineStringGeometry(replayGroup, geometry, style, feature) { + var strokeStyle = style.getStroke(); + if (strokeStyle) { + var lineStringReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].LINE_STRING); + lineStringReplay.setFillStrokeStyle(null, strokeStyle); + lineStringReplay.drawMultiLineString(geometry, feature); + } + var textStyle = style.getText(); + if (textStyle) { + var textReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].TEXT); + textReplay.setTextStyle(textStyle, replayGroup.addDeclutter(false)); + textReplay.drawText(geometry, feature); + } +} + + +/** + * @param {import("../render/ReplayGroup.js").default} replayGroup Replay group. + * @param {import("../geom/MultiPolygon.js").default} geometry Geometry. + * @param {import("../style/Style.js").default} style Style. + * @param {import("../Feature.js").default} feature Feature. + */ +function renderMultiPolygonGeometry(replayGroup, geometry, style, feature) { + var fillStyle = style.getFill(); + var strokeStyle = style.getStroke(); + if (strokeStyle || fillStyle) { + var polygonReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].POLYGON); + polygonReplay.setFillStrokeStyle(fillStyle, strokeStyle); + polygonReplay.drawMultiPolygon(geometry, feature); + } + var textStyle = style.getText(); + if (textStyle) { + var textReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].TEXT); + textReplay.setTextStyle(textStyle, replayGroup.addDeclutter(false)); + textReplay.drawText(geometry, feature); + } +} + + +/** + * @param {import("../render/ReplayGroup.js").default} replayGroup Replay group. + * @param {import("../geom/Point.js").default|import("../render/Feature.js").default} geometry Geometry. + * @param {import("../style/Style.js").default} style Style. + * @param {import("../Feature.js").FeatureLike} feature Feature. + */ +function renderPointGeometry(replayGroup, geometry, style, feature) { + var imageStyle = style.getImage(); + if (imageStyle) { + if (imageStyle.getImageState() != _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].LOADED) { + return; + } + var imageReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].IMAGE); + imageReplay.setImageStyle(imageStyle, replayGroup.addDeclutter(false)); + imageReplay.drawPoint(geometry, feature); + } + var textStyle = style.getText(); + if (textStyle) { + var textReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].TEXT); + textReplay.setTextStyle(textStyle, replayGroup.addDeclutter(!!imageStyle)); + textReplay.drawText(geometry, feature); + } +} + + +/** + * @param {import("../render/ReplayGroup.js").default} replayGroup Replay group. + * @param {import("../geom/MultiPoint.js").default|import("../render/Feature.js").default} geometry Geometry. + * @param {import("../style/Style.js").default} style Style. + * @param {import("../Feature.js").FeatureLike} feature Feature. + */ +function renderMultiPointGeometry(replayGroup, geometry, style, feature) { + var imageStyle = style.getImage(); + if (imageStyle) { + if (imageStyle.getImageState() != _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].LOADED) { + return; + } + var imageReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].IMAGE); + imageReplay.setImageStyle(imageStyle, replayGroup.addDeclutter(false)); + imageReplay.drawMultiPoint(geometry, feature); + } + var textStyle = style.getText(); + if (textStyle) { + var textReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].TEXT); + textReplay.setTextStyle(textStyle, replayGroup.addDeclutter(!!imageStyle)); + textReplay.drawText(geometry, feature); + } +} + + +/** + * @param {import("../render/ReplayGroup.js").default} replayGroup Replay group. + * @param {import("../geom/Polygon.js").default|import("../render/Feature.js").default} geometry Geometry. + * @param {import("../style/Style.js").default} style Style. + * @param {import("../Feature.js").FeatureLike} feature Feature. + */ +function renderPolygonGeometry(replayGroup, geometry, style, feature) { + var fillStyle = style.getFill(); + var strokeStyle = style.getStroke(); + if (fillStyle || strokeStyle) { + var polygonReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].POLYGON); + polygonReplay.setFillStrokeStyle(fillStyle, strokeStyle); + polygonReplay.drawPolygon(geometry, feature); + } + var textStyle = style.getText(); + if (textStyle) { + var textReplay = replayGroup.getReplay(style.getZIndex(), _render_ReplayType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].TEXT); + textReplay.setTextStyle(textStyle, replayGroup.addDeclutter(false)); + textReplay.drawText(geometry, feature); + } +} + +//# sourceMappingURL=vector.js.map + +/***/ }), +/* 36 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return asColorLike; }); +/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(33); +/** + * @module ol/colorlike + */ + + + +/** + * A type accepted by CanvasRenderingContext2D.fillStyle + * or CanvasRenderingContext2D.strokeStyle. + * Represents a color, pattern, or gradient. The origin for patterns and + * gradients as fill style is an increment of 512 css pixels from map coordinate + * `[0, 0]`. For seamless repeat patterns, width and height of the pattern image + * must be a factor of two (2, 4, 8, ..., 512). + * + * @typedef {string|CanvasPattern|CanvasGradient} ColorLike + * @api + */ + + +/** + * @param {import("./color.js").Color|ColorLike} color Color. + * @return {ColorLike} The color as an {@link ol/colorlike~ColorLike}. + * @api + */ +function asColorLike(color) { + if (Array.isArray(color)) { + return Object(_color_js__WEBPACK_IMPORTED_MODULE_0__[/* toString */ "c"])(color); + } else { + return color; + } +} + +//# sourceMappingURL=colorlike.js.map + +/***/ }), +/* 37 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return visibleAtResolution; }); +/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2); +/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20); +/* harmony import */ var _Base_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(78); +/* harmony import */ var _Property_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23); +/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(10); +/* harmony import */ var _render_EventType_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(30); +/* harmony import */ var _source_State_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(43); +/** + * @module ol/layer/Layer + */ + + + + + + + + + + + +/** + * @typedef {Object} Options + * @property {number} [opacity=1] Opacity (0, 1). + * @property {boolean} [visible=true] Visibility. + * @property {import("../extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be + * rendered outside of this extent. + * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers + * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed + * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()` + * method was used. + * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be + * visible. + * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will + * be visible. + * @property {import("../source/Source.js").default} [source] Source for this layer. If not provided to the constructor, + * the source can be set by calling {@link module:ol/layer/Layer#setSource layer.setSource(source)} after + * construction. + * @property {import("../PluggableMap.js").default} [map] Map. + */ + + +/** + * @typedef {Object} State + * @property {import("./Base.js").default} layer + * @property {number} opacity + * @property {SourceState} sourceState + * @property {boolean} visible + * @property {boolean} managed + * @property {import("../extent.js").Extent} [extent] + * @property {number} zIndex + * @property {number} maxResolution + * @property {number} minResolution + */ + +/** + * @classdesc + * Abstract base class; normally only used for creating subclasses and not + * instantiated in apps. + * A visual representation of raster or vector map data. + * Layers group together those properties that pertain to how the data is to be + * displayed, irrespective of the source of that data. + * + * Layers are usually added to a map with {@link module:ol/Map#addLayer}. Components + * like {@link module:ol/interaction/Select~Select} use unmanaged layers + * internally. These unmanaged layers are associated with the map using + * {@link module:ol/layer/Layer~Layer#setMap} instead. + * + * A generic `change` event is fired when the state of the source changes. + * + * @fires import("../render/Event.js").RenderEvent + */ +var Layer = /*@__PURE__*/(function (BaseLayer) { + function Layer(options) { + + var baseOptions = Object(_obj_js__WEBPACK_IMPORTED_MODULE_6__[/* assign */ "a"])({}, options); + delete baseOptions.source; + + BaseLayer.call(this, baseOptions); + + /** + * @private + * @type {?import("../events.js").EventsKey} + */ + this.mapPrecomposeKey_ = null; + + /** + * @private + * @type {?import("../events.js").EventsKey} + */ + this.mapRenderKey_ = null; + + /** + * @private + * @type {?import("../events.js").EventsKey} + */ + this.sourceChangeKey_ = null; + + if (options.map) { + this.setMap(options.map); + } + + Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* listen */ "a"])(this, + Object(_Object_js__WEBPACK_IMPORTED_MODULE_3__[/* getChangeEventType */ "b"])(_Property_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"].SOURCE), + this.handleSourcePropertyChange_, this); + + var source = options.source ? options.source : null; + this.setSource(source); + } + + if ( BaseLayer ) Layer.__proto__ = BaseLayer; + Layer.prototype = Object.create( BaseLayer && BaseLayer.prototype ); + Layer.prototype.constructor = Layer; + + /** + * @inheritDoc + */ + Layer.prototype.getLayersArray = function getLayersArray (opt_array) { + var array = opt_array ? opt_array : []; + array.push(this); + return array; + }; + + /** + * @inheritDoc + */ + Layer.prototype.getLayerStatesArray = function getLayerStatesArray (opt_states) { + var states = opt_states ? opt_states : []; + states.push(this.getLayerState()); + return states; + }; + + /** + * Get the layer source. + * @return {import("../source/Source.js").default} The layer source (or `null` if not yet set). + * @observable + * @api + */ + Layer.prototype.getSource = function getSource () { + var source = this.get(_Property_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"].SOURCE); + return ( + /** @type {import("../source/Source.js").default} */ (source) || null + ); + }; + + /** + * @inheritDoc + */ + Layer.prototype.getSourceState = function getSourceState () { + var source = this.getSource(); + return !source ? _source_State_js__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"].UNDEFINED : source.getState(); + }; + + /** + * @private + */ + Layer.prototype.handleSourceChange_ = function handleSourceChange_ () { + this.changed(); + }; + + /** + * @private + */ + Layer.prototype.handleSourcePropertyChange_ = function handleSourcePropertyChange_ () { + if (this.sourceChangeKey_) { + Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* unlistenByKey */ "e"])(this.sourceChangeKey_); + this.sourceChangeKey_ = null; + } + var source = this.getSource(); + if (source) { + this.sourceChangeKey_ = Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* listen */ "a"])(source, + _events_EventType_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].CHANGE, this.handleSourceChange_, this); + } + this.changed(); + }; + + /** + * Sets the layer to be rendered on top of other layers on a map. The map will + * not manage this layer in its layers collection, and the callback in + * {@link module:ol/Map#forEachLayerAtPixel} will receive `null` as layer. This + * is useful for temporary layers. To remove an unmanaged layer from the map, + * use `#setMap(null)`. + * + * To add the layer to a map and have it managed by the map, use + * {@link module:ol/Map#addLayer} instead. + * @param {import("../PluggableMap.js").default} map Map. + * @api + */ + Layer.prototype.setMap = function setMap (map) { + if (this.mapPrecomposeKey_) { + Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* unlistenByKey */ "e"])(this.mapPrecomposeKey_); + this.mapPrecomposeKey_ = null; + } + if (!map) { + this.changed(); + } + if (this.mapRenderKey_) { + Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* unlistenByKey */ "e"])(this.mapRenderKey_); + this.mapRenderKey_ = null; + } + if (map) { + this.mapPrecomposeKey_ = Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* listen */ "a"])(map, _render_EventType_js__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"].PRECOMPOSE, function(evt) { + var renderEvent = /** @type {import("../render/Event.js").default} */ (evt); + var layerState = this.getLayerState(); + layerState.managed = false; + if (this.getZIndex() === undefined) { + layerState.zIndex = Infinity; + } + renderEvent.frameState.layerStatesArray.push(layerState); + renderEvent.frameState.layerStates[Object(_util_js__WEBPACK_IMPORTED_MODULE_2__[/* getUid */ "c"])(this)] = layerState; + }, this); + this.mapRenderKey_ = Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* listen */ "a"])(this, _events_EventType_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].CHANGE, map.render, map); + this.changed(); + } + }; + + /** + * Set the layer source. + * @param {import("../source/Source.js").default} source The layer source. + * @observable + * @api + */ + Layer.prototype.setSource = function setSource (source) { + this.set(_Property_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"].SOURCE, source); + }; + + return Layer; +}(_Base_js__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])); + + +/** + * Return `true` if the layer is visible, and if the passed resolution is + * between the layer's minResolution and maxResolution. The comparison is + * inclusive for `minResolution` and exclusive for `maxResolution`. + * @param {State} layerState Layer state. + * @param {number} resolution Resolution. + * @return {boolean} The layer is visible at the given resolution. + */ +function visibleAtResolution(layerState, resolution) { + return layerState.visible && resolution >= layerState.minResolution && + resolution < layerState.maxResolution; +} + + +/* harmony default export */ __webpack_exports__["a"] = (Layer); + +//# sourceMappingURL=Layer.js.map + +/***/ }), +/* 38 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createOrUpdate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return getKeyZXY; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getKey; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return fromKey; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return hash; }); +/* unused harmony export quadKey */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return withinExtentAndZ; }); +/** + * @module ol/tilecoord + */ + + +/** + * An array of three numbers representing the location of a tile in a tile + * grid. The order is `z`, `x`, and `y`. `z` is the zoom level. + * @typedef {Array} TileCoord + * @api + */ + + +/** + * @param {number} z Z. + * @param {number} x X. + * @param {number} y Y. + * @param {TileCoord=} opt_tileCoord Tile coordinate. + * @return {TileCoord} Tile coordinate. + */ +function createOrUpdate(z, x, y, opt_tileCoord) { + if (opt_tileCoord !== undefined) { + opt_tileCoord[0] = z; + opt_tileCoord[1] = x; + opt_tileCoord[2] = y; + return opt_tileCoord; + } else { + return [z, x, y]; + } +} + + +/** + * @param {number} z Z. + * @param {number} x X. + * @param {number} y Y. + * @return {string} Key. + */ +function getKeyZXY(z, x, y) { + return z + '/' + x + '/' + y; +} + + +/** + * Get the key for a tile coord. + * @param {TileCoord} tileCoord The tile coord. + * @return {string} Key. + */ +function getKey(tileCoord) { + return getKeyZXY(tileCoord[0], tileCoord[1], tileCoord[2]); +} + + +/** + * Get a tile coord given a key. + * @param {string} key The tile coord key. + * @return {TileCoord} The tile coord. + */ +function fromKey(key) { + return key.split('/').map(Number); +} + + +/** + * @param {TileCoord} tileCoord Tile coord. + * @return {number} Hash. + */ +function hash(tileCoord) { + return (tileCoord[1] << tileCoord[0]) + tileCoord[2]; +} + + +/** + * @param {TileCoord} tileCoord Tile coord. + * @return {string} Quad key. + */ +function quadKey(tileCoord) { + var z = tileCoord[0]; + var digits = new Array(z); + var mask = 1 << (z - 1); + var i, charCode; + for (i = 0; i < z; ++i) { + // 48 is charCode for 0 - '0'.charCodeAt(0) + charCode = 48; + if (tileCoord[1] & mask) { + charCode += 1; + } + if (tileCoord[2] & mask) { + charCode += 2; + } + digits[i] = String.fromCharCode(charCode); + mask >>= 1; + } + return digits.join(''); +} + + +/** + * @param {TileCoord} tileCoord Tile coordinate. + * @param {!import("./tilegrid/TileGrid.js").default} tileGrid Tile grid. + * @return {boolean} Tile coordinate is within extent and zoom level range. + */ +function withinExtentAndZ(tileCoord, tileGrid) { + var z = tileCoord[0]; + var x = tileCoord[1]; + var y = tileCoord[2]; + + if (tileGrid.getMinZoom() > z || z > tileGrid.getMaxZoom()) { + return false; + } + var extent = tileGrid.getExtent(); + var tileRange; + if (!extent) { + tileRange = tileGrid.getFullTileRange(z); + } else { + tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z); + } + if (!tileRange) { + return true; + } else { + return tileRange.containsXY(x, y); + } +} + +//# sourceMappingURL=tilecoord.js.map + +/***/ }), +/* 39 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export CollectionEvent */ -/* harmony import */ var _AssertionError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(60); -/* harmony import */ var _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26); -/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16); -/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21); +/* harmony import */ var _AssertionError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(76); +/* harmony import */ var _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(34); +/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(20); +/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27); /** * @module ol/Collection */ @@ -5073,242 +6794,7 @@ var Collection = /*@__PURE__*/(function (BaseObject) { //# sourceMappingURL=Collection.js.map /***/ }), -/* 28 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return transform2D; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return rotate; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return scale; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return translate; }); -/** - * @module ol/geom/flat/transform - */ - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - * @param {import("../../transform.js").Transform} transform Transform. - * @param {Array=} opt_dest Destination. - * @return {Array} Transformed coordinates. - */ -function transform2D(flatCoordinates, offset, end, stride, transform, opt_dest) { - var dest = opt_dest ? opt_dest : []; - var i = 0; - for (var j = offset; j < end; j += stride) { - var x = flatCoordinates[j]; - var y = flatCoordinates[j + 1]; - dest[i++] = transform[0] * x + transform[2] * y + transform[4]; - dest[i++] = transform[1] * x + transform[3] * y + transform[5]; - } - if (opt_dest && dest.length != i) { - dest.length = i; - } - return dest; -} - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - * @param {number} angle Angle. - * @param {Array} anchor Rotation anchor point. - * @param {Array=} opt_dest Destination. - * @return {Array} Transformed coordinates. - */ -function rotate(flatCoordinates, offset, end, stride, angle, anchor, opt_dest) { - var dest = opt_dest ? opt_dest : []; - var cos = Math.cos(angle); - var sin = Math.sin(angle); - var anchorX = anchor[0]; - var anchorY = anchor[1]; - var i = 0; - for (var j = offset; j < end; j += stride) { - var deltaX = flatCoordinates[j] - anchorX; - var deltaY = flatCoordinates[j + 1] - anchorY; - dest[i++] = anchorX + deltaX * cos - deltaY * sin; - dest[i++] = anchorY + deltaX * sin + deltaY * cos; - for (var k = j + 2; k < j + stride; ++k) { - dest[i++] = flatCoordinates[k]; - } - } - if (opt_dest && dest.length != i) { - dest.length = i; - } - return dest; -} - - -/** - * Scale the coordinates. - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - * @param {number} sx Scale factor in the x-direction. - * @param {number} sy Scale factor in the y-direction. - * @param {Array} anchor Scale anchor point. - * @param {Array=} opt_dest Destination. - * @return {Array} Transformed coordinates. - */ -function scale(flatCoordinates, offset, end, stride, sx, sy, anchor, opt_dest) { - var dest = opt_dest ? opt_dest : []; - var anchorX = anchor[0]; - var anchorY = anchor[1]; - var i = 0; - for (var j = offset; j < end; j += stride) { - var deltaX = flatCoordinates[j] - anchorX; - var deltaY = flatCoordinates[j + 1] - anchorY; - dest[i++] = anchorX + sx * deltaX; - dest[i++] = anchorY + sy * deltaY; - for (var k = j + 2; k < j + stride; ++k) { - dest[i++] = flatCoordinates[k]; - } - } - if (opt_dest && dest.length != i) { - dest.length = i; - } - return dest; -} - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - * @param {number} deltaX Delta X. - * @param {number} deltaY Delta Y. - * @param {Array=} opt_dest Destination. - * @return {Array} Transformed coordinates. - */ -function translate(flatCoordinates, offset, end, stride, deltaX, deltaY, opt_dest) { - var dest = opt_dest ? opt_dest : []; - var i = 0; - for (var j = offset; j < end; j += stride) { - dest[i++] = flatCoordinates[j] + deltaX; - dest[i++] = flatCoordinates[j + 1] + deltaY; - for (var k = j + 2; k < j + stride; ++k) { - dest[i++] = flatCoordinates[k]; - } - } - if (opt_dest && dest.length != i) { - dest.length = i; - } - return dest; -} - -//# sourceMappingURL=transform.js.map - -/***/ }), -/* 29 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * @module ol/LayerType - */ - -/** - * A layer type used when creating layer renderers. - * @enum {string} - */ -/* harmony default export */ __webpack_exports__["a"] = ({ - IMAGE: 'IMAGE', - TILE: 'TILE', - VECTOR_TILE: 'VECTOR_TILE', - VECTOR: 'VECTOR' -}); - -//# sourceMappingURL=LayerType.js.map - -/***/ }), -/* 30 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * @module ol/render/EventType - */ - -/** - * @enum {string} - */ -/* harmony default export */ __webpack_exports__["a"] = ({ - /** - * @event module:ol/render/Event~RenderEvent#postcompose - * @api - */ - POSTCOMPOSE: 'postcompose', - /** - * @event module:ol/render/Event~RenderEvent#precompose - * @api - */ - PRECOMPOSE: 'precompose', - /** - * @event module:ol/render/Event~RenderEvent#render - * @api - */ - RENDER: 'render', - /** - * Triggered when rendering is complete, i.e. all sources and tiles have - * finished loading for the current viewport, and all tiles are faded in. - * @event module:ol/render/Event~RenderEvent#rendercomplete - * @api - */ - RENDERCOMPLETE: 'rendercomplete' -}); - -//# sourceMappingURL=EventType.js.map - -/***/ }), -/* 31 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return asColorLike; }); -/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(38); -/** - * @module ol/colorlike - */ - - - -/** - * A type accepted by CanvasRenderingContext2D.fillStyle - * or CanvasRenderingContext2D.strokeStyle. - * Represents a color, pattern, or gradient. The origin for patterns and - * gradients as fill style is an increment of 512 css pixels from map coordinate - * `[0, 0]`. For seamless repeat patterns, width and height of the pattern image - * must be a factor of two (2, 4, 8, ..., 512). - * - * @typedef {string|CanvasPattern|CanvasGradient} ColorLike - * @api - */ - - -/** - * @param {import("./color.js").Color|ColorLike} color Color. - * @return {ColorLike} The color as an {@link ol/colorlike~ColorLike}. - * @api - */ -function asColorLike(color) { - if (Array.isArray(color)) { - return Object(_color_js__WEBPACK_IMPORTED_MODULE_0__[/* toString */ "b"])(color); - } else { - return color; - } -} - -//# sourceMappingURL=colorlike.js.map - -/***/ }), -/* 32 */ +/* 40 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -5335,7 +6821,7 @@ var ENABLE_RASTER_REPROJECTION = true; //# sourceMappingURL=common.js.map /***/ }), -/* 33 */ +/* 41 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -5424,111 +6910,11 @@ function toSize(size, opt_size) { //# sourceMappingURL=size.js.map /***/ }), -/* 34 */ +/* 42 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38); -/** - * @module ol/style/Fill - */ - - - - -/** - * @typedef {Object} Options - * @property {import("../color.js").Color|import("../colorlike.js").ColorLike} [color] A color, gradient or pattern. - * See {@link module:ol/color~Color} and {@link module:ol/colorlike~ColorLike} for possible formats. - * Default null; if null, the Canvas/renderer default black will be used. - */ - - -/** - * @classdesc - * Set fill style for vector features. - * @api - */ -var Fill = function Fill(opt_options) { - - var options = opt_options || {}; - - /** - * @private - * @type {import("../color.js").Color|import("../colorlike.js").ColorLike} - */ - this.color_ = options.color !== undefined ? options.color : null; - - /** - * @private - * @type {string|undefined} - */ - this.checksum_ = undefined; -}; - -/** - * Clones the style. The color is not cloned if it is an {@link module:ol/colorlike~ColorLike}. - * @return {Fill} The cloned style. - * @api - */ -Fill.prototype.clone = function clone () { - var color = this.getColor(); - return new Fill({ - color: Array.isArray(color) ? color.slice() : color || undefined - }); -}; - -/** - * Get the fill color. - * @return {import("../color.js").Color|import("../colorlike.js").ColorLike} Color. - * @api - */ -Fill.prototype.getColor = function getColor () { - return this.color_; -}; - -/** - * Set the color. - * - * @param {import("../color.js").Color|import("../colorlike.js").ColorLike} color Color. - * @api - */ -Fill.prototype.setColor = function setColor (color) { - this.color_ = color; - this.checksum_ = undefined; -}; - -/** - * @return {string} The checksum. - */ -Fill.prototype.getChecksum = function getChecksum () { - if (this.checksum_ === undefined) { - var color = this.color_; - if (color) { - if (Array.isArray(color) || typeof color == 'string') { - this.checksum_ = 'f' + Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[/* asString */ "a"])(/** @type {import("../color.js").Color|string} */ (color)); - } else { - this.checksum_ = Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* getUid */ "c"])(this.color_); - } - } else { - this.checksum_ = 'f-'; - } - } - - return this.checksum_; -}; - -/* harmony default export */ __webpack_exports__["a"] = (Fill); - -//# sourceMappingURL=Fill.js.map - -/***/ }), -/* 35 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /** * @module ol/style/Stroke */ @@ -5814,14 +7200,136 @@ Stroke.prototype.getChecksum = function getChecksum () { //# sourceMappingURL=Stroke.js.map /***/ }), -/* 36 */ +/* 43 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var _Disposable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55); -/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); -/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14); -/* harmony import */ var _Event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21); +/** + * @module ol/source/State + */ + +/** + * @enum {string} + * State of the source, one of 'undefined', 'loading', 'ready' or 'error'. + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + UNDEFINED: 'undefined', + LOADING: 'loading', + READY: 'ready', + ERROR: 'error' +}); + +//# sourceMappingURL=State.js.map + +/***/ }), +/* 44 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(33); +/** + * @module ol/style/Fill + */ + + + + +/** + * @typedef {Object} Options + * @property {import("../color.js").Color|import("../colorlike.js").ColorLike} [color] A color, gradient or pattern. + * See {@link module:ol/color~Color} and {@link module:ol/colorlike~ColorLike} for possible formats. + * Default null; if null, the Canvas/renderer default black will be used. + */ + + +/** + * @classdesc + * Set fill style for vector features. + * @api + */ +var Fill = function Fill(opt_options) { + + var options = opt_options || {}; + + /** + * @private + * @type {import("../color.js").Color|import("../colorlike.js").ColorLike} + */ + this.color_ = options.color !== undefined ? options.color : null; + + /** + * @private + * @type {string|undefined} + */ + this.checksum_ = undefined; +}; + +/** + * Clones the style. The color is not cloned if it is an {@link module:ol/colorlike~ColorLike}. + * @return {Fill} The cloned style. + * @api + */ +Fill.prototype.clone = function clone () { + var color = this.getColor(); + return new Fill({ + color: Array.isArray(color) ? color.slice() : color || undefined + }); +}; + +/** + * Get the fill color. + * @return {import("../color.js").Color|import("../colorlike.js").ColorLike} Color. + * @api + */ +Fill.prototype.getColor = function getColor () { + return this.color_; +}; + +/** + * Set the color. + * + * @param {import("../color.js").Color|import("../colorlike.js").ColorLike} color Color. + * @api + */ +Fill.prototype.setColor = function setColor (color) { + this.color_ = color; + this.checksum_ = undefined; +}; + +/** + * @return {string} The checksum. + */ +Fill.prototype.getChecksum = function getChecksum () { + if (this.checksum_ === undefined) { + var color = this.color_; + if (color) { + if (Array.isArray(color) || typeof color == 'string') { + this.checksum_ = 'f' + Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[/* asString */ "b"])(/** @type {import("../color.js").Color|string} */ (color)); + } else { + this.checksum_ = Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* getUid */ "c"])(this.color_); + } + } else { + this.checksum_ = 'f-'; + } + } + + return this.checksum_; +}; + +/* harmony default export */ __webpack_exports__["a"] = (Fill); + +//# sourceMappingURL=Fill.js.map + +/***/ }), +/* 45 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _Disposable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(56); +/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); +/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17); +/* harmony import */ var _Event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27); /** * @module ol/events/Target */ @@ -5997,275 +7505,137 @@ var Target = /*@__PURE__*/(function (Disposable) { //# sourceMappingURL=Target.js.map /***/ }), -/* 37 */ +/* 46 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return linearRingContainsExtent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return linearRingContainsXY; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return linearRingsContainsXY; }); +/* unused harmony export linearRingssContainsXY */ +/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /** - * @module ol/source/State + * @module ol/geom/flat/contains */ -/** - * @enum {string} - * State of the source, one of 'undefined', 'loading', 'ready' or 'error'. - */ -/* harmony default export */ __webpack_exports__["a"] = ({ - UNDEFINED: 'undefined', - LOADING: 'loading', - READY: 'ready', - ERROR: 'error' -}); -//# sourceMappingURL=State.js.map + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @param {import("../../extent.js").Extent} extent Extent. + * @return {boolean} Contains extent. + */ +function linearRingContainsExtent(flatCoordinates, offset, end, stride, extent) { + var outside = Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* forEachCorner */ "t"])(extent, + /** + * @param {import("../../coordinate.js").Coordinate} coordinate Coordinate. + * @return {boolean} Contains (x, y). + */ + function(coordinate) { + return !linearRingContainsXY(flatCoordinates, offset, end, stride, coordinate[0], coordinate[1]); + }); + return !outside; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @param {number} x X. + * @param {number} y Y. + * @return {boolean} Contains (x, y). + */ +function linearRingContainsXY(flatCoordinates, offset, end, stride, x, y) { + // http://geomalgorithms.com/a03-_inclusion.html + // Copyright 2000 softSurfer, 2012 Dan Sunday + // This code may be freely used and modified for any purpose + // providing that this copyright notice is included with it. + // SoftSurfer makes no warranty for this code, and cannot be held + // liable for any real or imagined damage resulting from its use. + // Users of this code must verify correctness for their application. + var wn = 0; + var x1 = flatCoordinates[end - stride]; + var y1 = flatCoordinates[end - stride + 1]; + for (; offset < end; offset += stride) { + var x2 = flatCoordinates[offset]; + var y2 = flatCoordinates[offset + 1]; + if (y1 <= y) { + if (y2 > y && ((x2 - x1) * (y - y1)) - ((x - x1) * (y2 - y1)) > 0) { + wn++; + } + } else if (y2 <= y && ((x2 - x1) * (y - y1)) - ((x - x1) * (y2 - y1)) < 0) { + wn--; + } + x1 = x2; + y1 = y2; + } + return wn !== 0; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array} ends Ends. + * @param {number} stride Stride. + * @param {number} x X. + * @param {number} y Y. + * @return {boolean} Contains (x, y). + */ +function linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y) { + if (ends.length === 0) { + return false; + } + if (!linearRingContainsXY(flatCoordinates, offset, ends[0], stride, x, y)) { + return false; + } + for (var i = 1, ii = ends.length; i < ii; ++i) { + if (linearRingContainsXY(flatCoordinates, ends[i - 1], ends[i], stride, x, y)) { + return false; + } + } + return true; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array>} endss Endss. + * @param {number} stride Stride. + * @param {number} x X. + * @param {number} y Y. + * @return {boolean} Contains (x, y). + */ +function linearRingssContainsXY(flatCoordinates, offset, endss, stride, x, y) { + if (endss.length === 0) { + return false; + } + for (var i = 0, ii = endss.length; i < ii; ++i) { + var ends = endss[i]; + if (linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y)) { + return true; + } + offset = ends[ends.length - 1]; + } + return false; +} + +//# sourceMappingURL=contains.js.map /***/ }), -/* 38 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return asString; }); -/* unused harmony export fromString */ -/* unused harmony export asArray */ -/* unused harmony export normalize */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return toString; }); -/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); -/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); -/** - * @module ol/color - */ - - - - -/** - * A color represented as a short array [red, green, blue, alpha]. - * red, green, and blue should be integers in the range 0..255 inclusive. - * alpha should be a float in the range 0..1 inclusive. If no alpha value is - * given then `1` will be used. - * @typedef {Array} Color - * @api - */ - - -/** - * This RegExp matches # followed by 3, 4, 6, or 8 hex digits. - * @const - * @type {RegExp} - * @private - */ -var HEX_COLOR_RE_ = /^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i; - - -/** - * Regular expression for matching potential named color style strings. - * @const - * @type {RegExp} - * @private - */ -var NAMED_COLOR_RE_ = /^([a-z]*)$/i; - - -/** - * Return the color as an rgba string. - * @param {Color|string} color Color. - * @return {string} Rgba string. - * @api - */ -function asString(color) { - if (typeof color === 'string') { - return color; - } else { - return toString(color); - } -} - -/** - * Return named color as an rgba string. - * @param {string} color Named color. - * @return {string} Rgb string. - */ -function fromNamed(color) { - var el = document.createElement('div'); - el.style.color = color; - if (el.style.color !== '') { - document.body.appendChild(el); - var rgb = getComputedStyle(el).color; - document.body.removeChild(el); - return rgb; - } else { - return ''; - } -} - - -/** - * @param {string} s String. - * @return {Color} Color. - */ -var fromString = ( - function() { - - // We maintain a small cache of parsed strings. To provide cheap LRU-like - // semantics, whenever the cache grows too large we simply delete an - // arbitrary 25% of the entries. - - /** - * @const - * @type {number} - */ - var MAX_CACHE_SIZE = 1024; - - /** - * @type {Object} - */ - var cache = {}; - - /** - * @type {number} - */ - var cacheSize = 0; - - return ( - /** - * @param {string} s String. - * @return {Color} Color. - */ - function(s) { - var color; - if (cache.hasOwnProperty(s)) { - color = cache[s]; - } else { - if (cacheSize >= MAX_CACHE_SIZE) { - var i = 0; - for (var key in cache) { - if ((i++ & 3) === 0) { - delete cache[key]; - --cacheSize; - } - } - } - color = fromStringInternal_(s); - cache[s] = color; - ++cacheSize; - } - return color; - } - ); - - })(); - -/** - * Return the color as an array. This function maintains a cache of calculated - * arrays which means the result should not be modified. - * @param {Color|string} color Color. - * @return {Color} Color. - * @api - */ -function asArray(color) { - if (Array.isArray(color)) { - return color; - } else { - return fromString(color); - } -} - -/** - * @param {string} s String. - * @private - * @return {Color} Color. - */ -function fromStringInternal_(s) { - var r, g, b, a, color; - - if (NAMED_COLOR_RE_.exec(s)) { - s = fromNamed(s); - } - - if (HEX_COLOR_RE_.exec(s)) { // hex - var n = s.length - 1; // number of hex digits - var d; // number of digits per channel - if (n <= 4) { - d = 1; - } else { - d = 2; - } - var hasAlpha = n === 4 || n === 8; - r = parseInt(s.substr(1 + 0 * d, d), 16); - g = parseInt(s.substr(1 + 1 * d, d), 16); - b = parseInt(s.substr(1 + 2 * d, d), 16); - if (hasAlpha) { - a = parseInt(s.substr(1 + 3 * d, d), 16); - } else { - a = 255; - } - if (d == 1) { - r = (r << 4) + r; - g = (g << 4) + g; - b = (b << 4) + b; - if (hasAlpha) { - a = (a << 4) + a; - } - } - color = [r, g, b, a / 255]; - } else if (s.indexOf('rgba(') == 0) { // rgba() - color = s.slice(5, -1).split(',').map(Number); - normalize(color); - } else if (s.indexOf('rgb(') == 0) { // rgb() - color = s.slice(4, -1).split(',').map(Number); - color.push(1); - normalize(color); - } else { - Object(_asserts_js__WEBPACK_IMPORTED_MODULE_0__[/* assert */ "a"])(false, 14); // Invalid color - } - return color; -} - - -/** - * TODO this function is only used in the test, we probably shouldn't export it - * @param {Color} color Color. - * @return {Color} Clamped color. - */ -function normalize(color) { - color[0] = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__[/* clamp */ "a"])((color[0] + 0.5) | 0, 0, 255); - color[1] = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__[/* clamp */ "a"])((color[1] + 0.5) | 0, 0, 255); - color[2] = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__[/* clamp */ "a"])((color[2] + 0.5) | 0, 0, 255); - color[3] = Object(_math_js__WEBPACK_IMPORTED_MODULE_1__[/* clamp */ "a"])(color[3], 0, 1); - return color; -} - - -/** - * @param {Color} color Color. - * @return {string} String. - */ -function toString(color) { - var r = color[0]; - if (r != (r | 0)) { - r = (r + 0.5) | 0; - } - var g = color[1]; - if (g != (g | 0)) { - g = (g + 0.5) | 0; - } - var b = color[2]; - if (b != (b | 0)) { - b = (b + 0.5) | 0; - } - var a = color[3] === undefined ? 1 : color[3]; - return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; -} - -//# sourceMappingURL=color.js.map - -/***/ }), -/* 39 */ +/* 47 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXTERNAL MODULE: ./node_modules/ol/math.js -var math = __webpack_require__(6); +var math = __webpack_require__(9); // CONCATENATED MODULE: ./node_modules/ol/string.js /** @@ -6735,287 +8105,31 @@ function toStringXY(coordinate, opt_fractionDigits) { //# sourceMappingURL=coordinate.js.map /***/ }), -/* 40 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return visibleAtResolution; }); -/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); -/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4); -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1); -/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); -/* harmony import */ var _Base_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(69); -/* harmony import */ var _Property_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(19); -/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9); -/* harmony import */ var _render_EventType_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(30); -/* harmony import */ var _source_State_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(37); -/** - * @module ol/layer/Layer - */ - - - - - - - - - - - -/** - * @typedef {Object} Options - * @property {number} [opacity=1] Opacity (0, 1). - * @property {boolean} [visible=true] Visibility. - * @property {import("../extent.js").Extent} [extent] The bounding extent for layer rendering. The layer will not be - * rendered outside of this extent. - * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers - * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed - * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()` - * method was used. - * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be - * visible. - * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will - * be visible. - * @property {import("../source/Source.js").default} [source] Source for this layer. If not provided to the constructor, - * the source can be set by calling {@link module:ol/layer/Layer#setSource layer.setSource(source)} after - * construction. - * @property {import("../PluggableMap.js").default} [map] Map. - */ - - -/** - * @typedef {Object} State - * @property {import("./Base.js").default} layer - * @property {number} opacity - * @property {SourceState} sourceState - * @property {boolean} visible - * @property {boolean} managed - * @property {import("../extent.js").Extent} [extent] - * @property {number} zIndex - * @property {number} maxResolution - * @property {number} minResolution - */ - -/** - * @classdesc - * Abstract base class; normally only used for creating subclasses and not - * instantiated in apps. - * A visual representation of raster or vector map data. - * Layers group together those properties that pertain to how the data is to be - * displayed, irrespective of the source of that data. - * - * Layers are usually added to a map with {@link module:ol/Map#addLayer}. Components - * like {@link module:ol/interaction/Select~Select} use unmanaged layers - * internally. These unmanaged layers are associated with the map using - * {@link module:ol/layer/Layer~Layer#setMap} instead. - * - * A generic `change` event is fired when the state of the source changes. - * - * @fires import("../render/Event.js").RenderEvent - */ -var Layer = /*@__PURE__*/(function (BaseLayer) { - function Layer(options) { - - var baseOptions = Object(_obj_js__WEBPACK_IMPORTED_MODULE_6__[/* assign */ "a"])({}, options); - delete baseOptions.source; - - BaseLayer.call(this, baseOptions); - - /** - * @private - * @type {?import("../events.js").EventsKey} - */ - this.mapPrecomposeKey_ = null; - - /** - * @private - * @type {?import("../events.js").EventsKey} - */ - this.mapRenderKey_ = null; - - /** - * @private - * @type {?import("../events.js").EventsKey} - */ - this.sourceChangeKey_ = null; - - if (options.map) { - this.setMap(options.map); - } - - Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* listen */ "a"])(this, - Object(_Object_js__WEBPACK_IMPORTED_MODULE_3__[/* getChangeEventType */ "b"])(_Property_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"].SOURCE), - this.handleSourcePropertyChange_, this); - - var source = options.source ? options.source : null; - this.setSource(source); - } - - if ( BaseLayer ) Layer.__proto__ = BaseLayer; - Layer.prototype = Object.create( BaseLayer && BaseLayer.prototype ); - Layer.prototype.constructor = Layer; - - /** - * @inheritDoc - */ - Layer.prototype.getLayersArray = function getLayersArray (opt_array) { - var array = opt_array ? opt_array : []; - array.push(this); - return array; - }; - - /** - * @inheritDoc - */ - Layer.prototype.getLayerStatesArray = function getLayerStatesArray (opt_states) { - var states = opt_states ? opt_states : []; - states.push(this.getLayerState()); - return states; - }; - - /** - * Get the layer source. - * @return {import("../source/Source.js").default} The layer source (or `null` if not yet set). - * @observable - * @api - */ - Layer.prototype.getSource = function getSource () { - var source = this.get(_Property_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"].SOURCE); - return ( - /** @type {import("../source/Source.js").default} */ (source) || null - ); - }; - - /** - * @inheritDoc - */ - Layer.prototype.getSourceState = function getSourceState () { - var source = this.getSource(); - return !source ? _source_State_js__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"].UNDEFINED : source.getState(); - }; - - /** - * @private - */ - Layer.prototype.handleSourceChange_ = function handleSourceChange_ () { - this.changed(); - }; - - /** - * @private - */ - Layer.prototype.handleSourcePropertyChange_ = function handleSourcePropertyChange_ () { - if (this.sourceChangeKey_) { - Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* unlistenByKey */ "e"])(this.sourceChangeKey_); - this.sourceChangeKey_ = null; - } - var source = this.getSource(); - if (source) { - this.sourceChangeKey_ = Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* listen */ "a"])(source, - _events_EventType_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].CHANGE, this.handleSourceChange_, this); - } - this.changed(); - }; - - /** - * Sets the layer to be rendered on top of other layers on a map. The map will - * not manage this layer in its layers collection, and the callback in - * {@link module:ol/Map#forEachLayerAtPixel} will receive `null` as layer. This - * is useful for temporary layers. To remove an unmanaged layer from the map, - * use `#setMap(null)`. - * - * To add the layer to a map and have it managed by the map, use - * {@link module:ol/Map#addLayer} instead. - * @param {import("../PluggableMap.js").default} map Map. - * @api - */ - Layer.prototype.setMap = function setMap (map) { - if (this.mapPrecomposeKey_) { - Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* unlistenByKey */ "e"])(this.mapPrecomposeKey_); - this.mapPrecomposeKey_ = null; - } - if (!map) { - this.changed(); - } - if (this.mapRenderKey_) { - Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* unlistenByKey */ "e"])(this.mapRenderKey_); - this.mapRenderKey_ = null; - } - if (map) { - this.mapPrecomposeKey_ = Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* listen */ "a"])(map, _render_EventType_js__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"].PRECOMPOSE, function(evt) { - var renderEvent = /** @type {import("../render/Event.js").default} */ (evt); - var layerState = this.getLayerState(); - layerState.managed = false; - if (this.getZIndex() === undefined) { - layerState.zIndex = Infinity; - } - renderEvent.frameState.layerStatesArray.push(layerState); - renderEvent.frameState.layerStates[Object(_util_js__WEBPACK_IMPORTED_MODULE_2__[/* getUid */ "c"])(this)] = layerState; - }, this); - this.mapRenderKey_ = Object(_events_js__WEBPACK_IMPORTED_MODULE_0__[/* listen */ "a"])(this, _events_EventType_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].CHANGE, map.render, map); - this.changed(); - } - }; - - /** - * Set the layer source. - * @param {import("../source/Source.js").default} source The layer source. - * @observable - * @api - */ - Layer.prototype.setSource = function setSource (source) { - this.set(_Property_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"].SOURCE, source); - }; - - return Layer; -}(_Base_js__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])); - - -/** - * Return `true` if the layer is visible, and if the passed resolution is - * between the layer's minResolution and maxResolution. The comparison is - * inclusive for `minResolution` and exclusive for `maxResolution`. - * @param {State} layerState Layer state. - * @param {number} resolution Resolution. - * @return {boolean} The layer is visible at the given resolution. - */ -function visibleAtResolution(layerState, resolution) { - return layerState.visible && resolution >= layerState.minResolution && - resolution < layerState.maxResolution; -} - - -/* harmony default export */ __webpack_exports__["a"] = (Layer); - -//# sourceMappingURL=Layer.js.map - -/***/ }), -/* 41 */ +/* 48 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXTERNAL MODULE: ./node_modules/ol/util.js -var util = __webpack_require__(1); +var util = __webpack_require__(2); // EXTERNAL MODULE: ./node_modules/ol/extent.js var ol_extent = __webpack_require__(0); // EXTERNAL MODULE: ./node_modules/ol/Object.js -var ol_Object = __webpack_require__(16); +var ol_Object = __webpack_require__(20); // EXTERNAL MODULE: ./node_modules/ol/geom/flat/transform.js -var flat_transform = __webpack_require__(28); +var flat_transform = __webpack_require__(21); // EXTERNAL MODULE: ./node_modules/ol/proj.js + 5 modules -var proj = __webpack_require__(13); +var proj = __webpack_require__(15); // EXTERNAL MODULE: ./node_modules/ol/proj/Units.js -var Units = __webpack_require__(24); +var Units = __webpack_require__(32); // EXTERNAL MODULE: ./node_modules/ol/transform.js -var ol_transform = __webpack_require__(8); +var ol_transform = __webpack_require__(4); // CONCATENATED MODULE: ./node_modules/ol/geom/Geometry.js /** @@ -7308,10 +8422,10 @@ var Geometry_Geometry = /*@__PURE__*/(function (BaseObject) { //# sourceMappingURL=Geometry.js.map // EXTERNAL MODULE: ./node_modules/ol/geom/GeometryLayout.js -var GeometryLayout = __webpack_require__(18); +var GeometryLayout = __webpack_require__(22); // EXTERNAL MODULE: ./node_modules/ol/obj.js -var obj = __webpack_require__(9); +var obj = __webpack_require__(10); // CONCATENATED MODULE: ./node_modules/ol/geom/SimpleGeometry.js /* unused harmony export getStrideForLayout */ @@ -7642,7 +8756,7 @@ function transformGeom2D(simpleGeometry, transform, opt_dest) { //# sourceMappingURL=SimpleGeometry.js.map /***/ }), -/* 42 */ +/* 49 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -7665,7 +8779,7 @@ function transformGeom2D(simpleGeometry, transform, opt_dest) { //# sourceMappingURL=ObjectEventType.js.map /***/ }), -/* 43 */ +/* 50 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -7743,131 +8857,7 @@ function inflateMultiCoordinatesArray(flatCoordinates, offset, endss, stride, op //# sourceMappingURL=inflate.js.map /***/ }), -/* 44 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return linearRingContainsExtent; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return linearRingContainsXY; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return linearRingsContainsXY; }); -/* unused harmony export linearRingssContainsXY */ -/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); -/** - * @module ol/geom/flat/contains - */ - - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - * @param {import("../../extent.js").Extent} extent Extent. - * @return {boolean} Contains extent. - */ -function linearRingContainsExtent(flatCoordinates, offset, end, stride, extent) { - var outside = Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* forEachCorner */ "t"])(extent, - /** - * @param {import("../../coordinate.js").Coordinate} coordinate Coordinate. - * @return {boolean} Contains (x, y). - */ - function(coordinate) { - return !linearRingContainsXY(flatCoordinates, offset, end, stride, coordinate[0], coordinate[1]); - }); - return !outside; -} - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - * @param {number} x X. - * @param {number} y Y. - * @return {boolean} Contains (x, y). - */ -function linearRingContainsXY(flatCoordinates, offset, end, stride, x, y) { - // http://geomalgorithms.com/a03-_inclusion.html - // Copyright 2000 softSurfer, 2012 Dan Sunday - // This code may be freely used and modified for any purpose - // providing that this copyright notice is included with it. - // SoftSurfer makes no warranty for this code, and cannot be held - // liable for any real or imagined damage resulting from its use. - // Users of this code must verify correctness for their application. - var wn = 0; - var x1 = flatCoordinates[end - stride]; - var y1 = flatCoordinates[end - stride + 1]; - for (; offset < end; offset += stride) { - var x2 = flatCoordinates[offset]; - var y2 = flatCoordinates[offset + 1]; - if (y1 <= y) { - if (y2 > y && ((x2 - x1) * (y - y1)) - ((x - x1) * (y2 - y1)) > 0) { - wn++; - } - } else if (y2 <= y && ((x2 - x1) * (y - y1)) - ((x - x1) * (y2 - y1)) < 0) { - wn--; - } - x1 = x2; - y1 = y2; - } - return wn !== 0; -} - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {Array} ends Ends. - * @param {number} stride Stride. - * @param {number} x X. - * @param {number} y Y. - * @return {boolean} Contains (x, y). - */ -function linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y) { - if (ends.length === 0) { - return false; - } - if (!linearRingContainsXY(flatCoordinates, offset, ends[0], stride, x, y)) { - return false; - } - for (var i = 1, ii = ends.length; i < ii; ++i) { - if (linearRingContainsXY(flatCoordinates, ends[i - 1], ends[i], stride, x, y)) { - return false; - } - } - return true; -} - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {Array>} endss Endss. - * @param {number} stride Stride. - * @param {number} x X. - * @param {number} y Y. - * @return {boolean} Contains (x, y). - */ -function linearRingssContainsXY(flatCoordinates, offset, endss, stride, x, y) { - if (endss.length === 0) { - return false; - } - for (var i = 0, ii = endss.length; i < ii; ++i) { - var ends = endss[i]; - if (linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y)) { - return true; - } - offset = ends[ends.length - 1]; - } - return false; -} - -//# sourceMappingURL=contains.js.map - -/***/ }), -/* 45 */ +/* 51 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -7875,7 +8865,7 @@ function linearRingssContainsXY(flatCoordinates, offset, endss, stride, x, y) { /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return none; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createSnapToN; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return createSnapToZero; }); -/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); /** * @module ol/rotationconstraint */ @@ -7943,7 +8933,7 @@ function createSnapToN(n) { * @return {Type} Rotation constraint. */ function createSnapToZero(opt_tolerance) { - var tolerance = opt_tolerance || Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "i"])(5); + var tolerance = opt_tolerance || Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "j"])(5); return ( /** * @param {number|undefined} rotation Rotation. @@ -7966,18 +8956,197 @@ function createSnapToZero(opt_tolerance) { //# sourceMappingURL=rotationconstraint.js.map /***/ }), -/* 46 */ +/* 52 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// CONCATENATED MODULE: ./node_modules/ol/geom/flat/reverse.js +/** + * @module ol/geom/flat/reverse + */ + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + */ +function coordinates(flatCoordinates, offset, end, stride) { + while (offset < end - stride) { + for (var i = 0; i < stride; ++i) { + var tmp = flatCoordinates[offset + i]; + flatCoordinates[offset + i] = flatCoordinates[end - stride + i]; + flatCoordinates[end - stride + i] = tmp; + } + offset += stride; + end -= stride; + } +} + +//# sourceMappingURL=reverse.js.map +// CONCATENATED MODULE: ./node_modules/ol/geom/flat/orient.js +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return linearRingIsClockwise; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return linearRingIsOriented; }); +/* unused harmony export linearRingsAreOriented */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return orientLinearRings; }); +/* unused harmony export orientLinearRingsArray */ +/** + * @module ol/geom/flat/orient + */ + + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @return {boolean} Is clockwise. + */ +function linearRingIsClockwise(flatCoordinates, offset, end, stride) { + // http://tinyurl.com/clockwise-method + // https://github.com/OSGeo/gdal/blob/trunk/gdal/ogr/ogrlinearring.cpp + var edge = 0; + var x1 = flatCoordinates[end - stride]; + var y1 = flatCoordinates[end - stride + 1]; + for (; offset < end; offset += stride) { + var x2 = flatCoordinates[offset]; + var y2 = flatCoordinates[offset + 1]; + edge += (x2 - x1) * (y2 + y1); + x1 = x2; + y1 = y2; + } + return edge > 0; +} + + +/** + * Determines if linear rings are oriented. By default, left-hand orientation + * is tested (first ring must be clockwise, remaining rings counter-clockwise). + * To test for right-hand orientation, use the `opt_right` argument. + * + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array} ends Array of end indexes. + * @param {number} stride Stride. + * @param {boolean=} opt_right Test for right-hand orientation + * (counter-clockwise exterior ring and clockwise interior rings). + * @return {boolean} Rings are correctly oriented. + */ +function linearRingIsOriented(flatCoordinates, offset, ends, stride, opt_right) { + var right = opt_right !== undefined ? opt_right : false; + for (var i = 0, ii = ends.length; i < ii; ++i) { + var end = ends[i]; + var isClockwise = linearRingIsClockwise( + flatCoordinates, offset, end, stride); + if (i === 0) { + if ((right && isClockwise) || (!right && !isClockwise)) { + return false; + } + } else { + if ((right && !isClockwise) || (!right && isClockwise)) { + return false; + } + } + offset = end; + } + return true; +} + + +/** + * Determines if linear rings are oriented. By default, left-hand orientation + * is tested (first ring must be clockwise, remaining rings counter-clockwise). + * To test for right-hand orientation, use the `opt_right` argument. + * + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array>} endss Array of array of end indexes. + * @param {number} stride Stride. + * @param {boolean=} opt_right Test for right-hand orientation + * (counter-clockwise exterior ring and clockwise interior rings). + * @return {boolean} Rings are correctly oriented. + */ +function linearRingsAreOriented(flatCoordinates, offset, endss, stride, opt_right) { + for (var i = 0, ii = endss.length; i < ii; ++i) { + if (!linearRingIsOriented( + flatCoordinates, offset, endss[i], stride, opt_right)) { + return false; + } + } + return true; +} + + +/** + * Orient coordinates in a flat array of linear rings. By default, rings + * are oriented following the left-hand rule (clockwise for exterior and + * counter-clockwise for interior rings). To orient according to the + * right-hand rule, use the `opt_right` argument. + * + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array} ends Ends. + * @param {number} stride Stride. + * @param {boolean=} opt_right Follow the right-hand rule for orientation. + * @return {number} End. + */ +function orientLinearRings(flatCoordinates, offset, ends, stride, opt_right) { + var right = opt_right !== undefined ? opt_right : false; + for (var i = 0, ii = ends.length; i < ii; ++i) { + var end = ends[i]; + var isClockwise = linearRingIsClockwise( + flatCoordinates, offset, end, stride); + var reverse = i === 0 ? + (right && isClockwise) || (!right && !isClockwise) : + (right && !isClockwise) || (!right && isClockwise); + if (reverse) { + coordinates(flatCoordinates, offset, end, stride); + } + offset = end; + } + return offset; +} + + +/** + * Orient coordinates in a flat array of linear rings. By default, rings + * are oriented following the left-hand rule (clockwise for exterior and + * counter-clockwise for interior rings). To orient according to the + * right-hand rule, use the `opt_right` argument. + * + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array>} endss Array of array of end indexes. + * @param {number} stride Stride. + * @param {boolean=} opt_right Follow the right-hand rule for orientation. + * @return {number} End. + */ +function orientLinearRingsArray(flatCoordinates, offset, endss, stride, opt_right) { + for (var i = 0, ii = endss.length; i < ii; ++i) { + offset = orientLinearRings( + flatCoordinates, offset, endss[i], stride, opt_right); + } + return offset; +} + +//# sourceMappingURL=orient.js.map + +/***/ }), +/* 53 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return toFunction; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createDefaultStyle; }); /* unused harmony export createEditingStyle */ -/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); +/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); /* harmony import */ var _geom_GeometryType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); -/* harmony import */ var _Circle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(72); -/* harmony import */ var _Fill_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(34); -/* harmony import */ var _Stroke_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(35); +/* harmony import */ var _Circle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(94); +/* harmony import */ var _Fill_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(44); +/* harmony import */ var _Stroke_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(42); /** * @module ol/style/Style */ @@ -8527,7 +9696,7 @@ function defaultGeometryFunction(feature) { //# sourceMappingURL=Style.js.map /***/ }), -/* 47 */ +/* 54 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8537,7 +9706,7 @@ function defaultGeometryFunction(feature) { /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return assignClosestPoint; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return assignClosestArrayPoint; }); /* unused harmony export assignClosestMultiArrayPoint */ -/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); /** * @module ol/geom/flat/closest */ @@ -8602,7 +9771,7 @@ function maxSquaredDelta(flatCoordinates, offset, end, stride, max) { for (offset += stride; offset < end; offset += stride) { var x2 = flatCoordinates[offset]; var y2 = flatCoordinates[offset + 1]; - var squaredDelta = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* squaredDistance */ "f"])(x1, y1, x2, y2); + var squaredDelta = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* squaredDistance */ "g"])(x1, y1, x2, y2); if (squaredDelta > max) { max = squaredDelta; } @@ -8674,7 +9843,7 @@ function assignClosestPoint(flatCoordinates, offset, end, var i, squaredDistance; if (maxDelta === 0) { // All points are identical, so just test the first point. - squaredDistance = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* squaredDistance */ "f"])( + squaredDistance = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* squaredDistance */ "g"])( x, y, flatCoordinates[offset], flatCoordinates[offset + 1]); if (squaredDistance < minSquaredDistance) { for (i = 0; i < stride; ++i) { @@ -8691,7 +9860,7 @@ function assignClosestPoint(flatCoordinates, offset, end, while (index < end) { assignClosest( flatCoordinates, index - stride, index, stride, x, y, tmpPoint); - squaredDistance = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* squaredDistance */ "f"])(x, y, tmpPoint[0], tmpPoint[1]); + squaredDistance = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* squaredDistance */ "g"])(x, y, tmpPoint[0], tmpPoint[1]); if (squaredDistance < minSquaredDistance) { minSquaredDistance = squaredDistance; for (i = 0; i < stride; ++i) { @@ -8719,7 +9888,7 @@ function assignClosestPoint(flatCoordinates, offset, end, // Check the closing segment. assignClosest( flatCoordinates, end - stride, offset, stride, x, y, tmpPoint); - squaredDistance = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* squaredDistance */ "f"])(x, y, tmpPoint[0], tmpPoint[1]); + squaredDistance = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* squaredDistance */ "g"])(x, y, tmpPoint[0], tmpPoint[1]); if (squaredDistance < minSquaredDistance) { minSquaredDistance = squaredDistance; for (i = 0; i < stride; ++i) { @@ -8792,7 +9961,198 @@ function assignClosestMultiArrayPoint(flatCoordinates, offset, //# sourceMappingURL=closest.js.map /***/ }), -/* 48 */ +/* 55 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createOrUpdate; }); +/** + * @module ol/TileRange + */ + +/** + * A representation of a contiguous block of tiles. A tile range is specified + * by its min/max tile coordinates and is inclusive of coordinates. + */ +var TileRange = function TileRange(minX, maxX, minY, maxY) { + + /** + * @type {number} + */ + this.minX = minX; + + /** + * @type {number} + */ + this.maxX = maxX; + + /** + * @type {number} + */ + this.minY = minY; + + /** + * @type {number} + */ + this.maxY = maxY; + +}; + +/** + * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate. + * @return {boolean} Contains tile coordinate. + */ +TileRange.prototype.contains = function contains (tileCoord) { + return this.containsXY(tileCoord[1], tileCoord[2]); +}; + +/** + * @param {TileRange} tileRange Tile range. + * @return {boolean} Contains. + */ +TileRange.prototype.containsTileRange = function containsTileRange (tileRange) { + return this.minX <= tileRange.minX && tileRange.maxX <= this.maxX && + this.minY <= tileRange.minY && tileRange.maxY <= this.maxY; +}; + +/** + * @param {number} x Tile coordinate x. + * @param {number} y Tile coordinate y. + * @return {boolean} Contains coordinate. + */ +TileRange.prototype.containsXY = function containsXY (x, y) { + return this.minX <= x && x <= this.maxX && this.minY <= y && y <= this.maxY; +}; + +/** + * @param {TileRange} tileRange Tile range. + * @return {boolean} Equals. + */ +TileRange.prototype.equals = function equals (tileRange) { + return this.minX == tileRange.minX && this.minY == tileRange.minY && + this.maxX == tileRange.maxX && this.maxY == tileRange.maxY; +}; + +/** + * @param {TileRange} tileRange Tile range. + */ +TileRange.prototype.extend = function extend (tileRange) { + if (tileRange.minX < this.minX) { + this.minX = tileRange.minX; + } + if (tileRange.maxX > this.maxX) { + this.maxX = tileRange.maxX; + } + if (tileRange.minY < this.minY) { + this.minY = tileRange.minY; + } + if (tileRange.maxY > this.maxY) { + this.maxY = tileRange.maxY; + } +}; + +/** + * @return {number} Height. + */ +TileRange.prototype.getHeight = function getHeight () { + return this.maxY - this.minY + 1; +}; + +/** + * @return {import("./size.js").Size} Size. + */ +TileRange.prototype.getSize = function getSize () { + return [this.getWidth(), this.getHeight()]; +}; + +/** + * @return {number} Width. + */ +TileRange.prototype.getWidth = function getWidth () { + return this.maxX - this.minX + 1; +}; + +/** + * @param {TileRange} tileRange Tile range. + * @return {boolean} Intersects. + */ +TileRange.prototype.intersects = function intersects (tileRange) { + return this.minX <= tileRange.maxX && + this.maxX >= tileRange.minX && + this.minY <= tileRange.maxY && + this.maxY >= tileRange.minY; +}; + + +/** + * @param {number} minX Minimum X. + * @param {number} maxX Maximum X. + * @param {number} minY Minimum Y. + * @param {number} maxY Maximum Y. + * @param {TileRange=} tileRange TileRange. + * @return {TileRange} Tile range. + */ +function createOrUpdate(minX, maxX, minY, maxY, tileRange) { + if (tileRange !== undefined) { + tileRange.minX = minX; + tileRange.maxX = maxX; + tileRange.minY = minY; + tileRange.maxY = maxY; + return tileRange; + } else { + return new TileRange(minX, maxX, minY, maxY); + } +} + + +/* harmony default export */ __webpack_exports__["b"] = (TileRange); + +//# sourceMappingURL=TileRange.js.map + +/***/ }), +/* 56 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * @module ol/Disposable + */ + +/** + * @classdesc + * Objects that need to clean up after themselves. + */ +var Disposable = function Disposable() { + /** + * The object has already been disposed. + * @type {boolean} + * @private + */ + this.disposed_ = false; +}; + +/** + * Clean up. + */ +Disposable.prototype.dispose = function dispose () { + if (!this.disposed_) { + this.disposed_ = true; + this.disposeInternal(); + } +}; + +/** + * Extension point for disposable objects. + * @protected + */ +Disposable.prototype.disposeInternal = function disposeInternal () {}; + +/* harmony default export */ __webpack_exports__["a"] = (Disposable); + +//# sourceMappingURL=Disposable.js.map + +/***/ }), +/* 57 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8884,7 +10244,7 @@ function deflateMultiCoordinatesArray(flatCoordinates, offset, coordinatesss, st //# sourceMappingURL=deflate.js.map /***/ }), -/* 49 */ +/* 58 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -8897,7 +10257,7 @@ function deflateMultiCoordinatesArray(flatCoordinates, offset, coordinatesss, st /* unused harmony export quantize */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return quantizeArray; }); /* unused harmony export quantizeMultiArray */ -/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); /** * @module ol/geom/flat/simplify */ @@ -9001,7 +10361,7 @@ function douglasPeucker(flatCoordinates, offset, end, for (var i = first + stride; i < last; i += stride) { var x = flatCoordinates[i]; var y = flatCoordinates[i + 1]; - var squaredDistance = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* squaredSegmentDistance */ "g"])( + var squaredDistance = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* squaredSegmentDistance */ "h"])( x, y, x1, y1, x2, y2); if (squaredDistance > maxSquaredDistance) { index = i; @@ -9117,7 +10477,7 @@ function radialDistance(flatCoordinates, offset, end, for (offset += stride; offset < end; offset += stride) { x2 = flatCoordinates[offset]; y2 = flatCoordinates[offset + 1]; - if (Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* squaredDistance */ "f"])(x1, y1, x2, y2) > squaredTolerance) { + if (Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* squaredDistance */ "g"])(x1, y1, x2, y2) > squaredTolerance) { // copy point at offset simplifiedFlatCoordinates[simplifiedOffset++] = x2; simplifiedFlatCoordinates[simplifiedOffset++] = y2; @@ -9297,7 +10657,952 @@ function quantizeMultiArray( //# sourceMappingURL=simplify.js.map /***/ }), -/* 50 */ +/* 59 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * @module ol/render/VectorContext + */ + +/** + * @classdesc + * Context for drawing geometries. A vector context is available on render + * events and does not need to be constructed directly. + * @api + */ +var VectorContext = function VectorContext () {}; + +VectorContext.prototype.drawCustom = function drawCustom (geometry, feature, renderer) {}; + +/** + * Render a geometry. + * + * @param {import("../geom/Geometry.js").default} geometry The geometry to render. + */ +VectorContext.prototype.drawGeometry = function drawGeometry (geometry) {}; + +/** + * Set the rendering style. + * + * @param {import("../style/Style.js").default} style The rendering style. + */ +VectorContext.prototype.setStyle = function setStyle (style) {}; + +/** + * @param {import("../geom/Circle.js").default} circleGeometry Circle geometry. + * @param {import("../Feature.js").default} feature Feature. + */ +VectorContext.prototype.drawCircle = function drawCircle (circleGeometry, feature) {}; + +/** + * @param {import("../Feature.js").default} feature Feature. + * @param {import("../style/Style.js").default} style Style. + */ +VectorContext.prototype.drawFeature = function drawFeature (feature, style) {}; + +/** + * @param {import("../geom/GeometryCollection.js").default} geometryCollectionGeometry Geometry collection. + * @param {import("../Feature.js").default} feature Feature. + */ +VectorContext.prototype.drawGeometryCollection = function drawGeometryCollection (geometryCollectionGeometry, feature) {}; + +/** + * @param {import("../geom/LineString.js").default|import("./Feature.js").default} lineStringGeometry Line string geometry. + * @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature. + */ +VectorContext.prototype.drawLineString = function drawLineString (lineStringGeometry, feature) {}; + +/** + * @param {import("../geom/MultiLineString.js").default|import("./Feature.js").default} multiLineStringGeometry MultiLineString geometry. + * @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature. + */ +VectorContext.prototype.drawMultiLineString = function drawMultiLineString (multiLineStringGeometry, feature) {}; + +/** + * @param {import("../geom/MultiPoint.js").default|import("./Feature.js").default} multiPointGeometry MultiPoint geometry. + * @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature. + */ +VectorContext.prototype.drawMultiPoint = function drawMultiPoint (multiPointGeometry, feature) {}; + +/** + * @param {import("../geom/MultiPolygon.js").default} multiPolygonGeometry MultiPolygon geometry. + * @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature. + */ +VectorContext.prototype.drawMultiPolygon = function drawMultiPolygon (multiPolygonGeometry, feature) {}; + +/** + * @param {import("../geom/Point.js").default|import("./Feature.js").default} pointGeometry Point geometry. + * @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature. + */ +VectorContext.prototype.drawPoint = function drawPoint (pointGeometry, feature) {}; + +/** + * @param {import("../geom/Polygon.js").default|import("./Feature.js").default} polygonGeometry Polygon geometry. + * @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature. + */ +VectorContext.prototype.drawPolygon = function drawPolygon (polygonGeometry, feature) {}; + +/** + * @param {import("../geom/Geometry.js").default|import("./Feature.js").default} geometry Geometry. + * @param {import("../Feature.js").default|import("./Feature.js").default} feature Feature. + */ +VectorContext.prototype.drawText = function drawText (geometry, feature) {}; + +/** + * @param {import("../style/Fill.js").default} fillStyle Fill style. + * @param {import("../style/Stroke.js").default} strokeStyle Stroke style. + */ +VectorContext.prototype.setFillStrokeStyle = function setFillStrokeStyle (fillStyle, strokeStyle) {}; + +/** + * @param {import("../style/Image.js").default} imageStyle Image style. + * @param {import("./canvas.js").DeclutterGroup=} opt_declutterGroup Declutter. + */ +VectorContext.prototype.setImageStyle = function setImageStyle (imageStyle, opt_declutterGroup) {}; + +/** + * @param {import("../style/Text.js").default} textStyle Text style. + * @param {import("./canvas.js").DeclutterGroup=} opt_declutterGroup Declutter. + */ +VectorContext.prototype.setTextStyle = function setTextStyle (textStyle, opt_declutterGroup) {}; + +/* harmony default export */ __webpack_exports__["a"] = (VectorContext); + +//# sourceMappingURL=VectorContext.js.map + +/***/ }), +/* 60 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27); +/** + * @module ol/render/Event + */ + + + +var RenderEvent = /*@__PURE__*/(function (Event) { + function RenderEvent(type, opt_vectorContext, opt_frameState, opt_context, opt_glContext) { + + Event.call(this, type); + + /** + * For canvas, this is an instance of {@link module:ol/render/canvas/Immediate}. + * @type {import("./VectorContext.js").default|undefined} + * @api + */ + this.vectorContext = opt_vectorContext; + + /** + * An object representing the current render frame state. + * @type {import("../PluggableMap.js").FrameState|undefined} + * @api + */ + this.frameState = opt_frameState; + + /** + * Canvas context. Only available when a Canvas renderer is used, null + * otherwise. + * @type {CanvasRenderingContext2D|null|undefined} + * @api + */ + this.context = opt_context; + + /** + * WebGL context. Only available when a WebGL renderer is used, null + * otherwise. + * @type {import("../webgl/Context.js").default|null|undefined} + * @api + */ + this.glContext = opt_glContext; + + } + + if ( Event ) RenderEvent.__proto__ = Event; + RenderEvent.prototype = Object.create( Event && Event.prototype ); + RenderEvent.prototype.constructor = RenderEvent; + + return RenderEvent; +}(_events_Event_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])); + +/* harmony default export */ __webpack_exports__["a"] = (RenderEvent); + +//# sourceMappingURL=Event.js.map + +/***/ }), +/* 61 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// EXTERNAL MODULE: ./node_modules/ol/tilegrid/common.js +var common = __webpack_require__(64); + +// EXTERNAL MODULE: ./node_modules/ol/size.js +var ol_size = __webpack_require__(41); + +// EXTERNAL MODULE: ./node_modules/ol/extent.js +var ol_extent = __webpack_require__(0); + +// EXTERNAL MODULE: ./node_modules/ol/extent/Corner.js +var Corner = __webpack_require__(66); + +// EXTERNAL MODULE: ./node_modules/ol/proj.js + 5 modules +var proj = __webpack_require__(15); + +// EXTERNAL MODULE: ./node_modules/ol/proj/Units.js +var Units = __webpack_require__(32); + +// EXTERNAL MODULE: ./node_modules/ol/asserts.js +var asserts = __webpack_require__(14); + +// EXTERNAL MODULE: ./node_modules/ol/TileRange.js +var TileRange = __webpack_require__(55); + +// EXTERNAL MODULE: ./node_modules/ol/array.js +var array = __webpack_require__(11); + +// EXTERNAL MODULE: ./node_modules/ol/math.js +var math = __webpack_require__(9); + +// EXTERNAL MODULE: ./node_modules/ol/tilecoord.js +var tilecoord = __webpack_require__(38); + +// CONCATENATED MODULE: ./node_modules/ol/tilegrid/TileGrid.js +/** + * @module ol/tilegrid/TileGrid + */ + + + + + + + + + + +/** + * @private + * @type {import("../tilecoord.js").TileCoord} + */ +var tmpTileCoord = [0, 0, 0]; + + +/** + * @typedef {Object} Options + * @property {import("../extent.js").Extent} [extent] Extent for the tile grid. No tiles outside this + * extent will be requested by {@link module:ol/source/Tile} sources. When no `origin` or + * `origins` are configured, the `origin` will be set to the top-left corner of the extent. + * @property {number} [minZoom=0] Minimum zoom. + * @property {import("../coordinate.js").Coordinate} [origin] The tile grid origin, i.e. where the `x` + * and `y` axes meet (`[z, 0, 0]`). Tile coordinates increase left to right and upwards. If not + * specified, `extent` or `origins` must be provided. + * @property {Array} [origins] Tile grid origins, i.e. where + * the `x` and `y` axes meet (`[z, 0, 0]`), for each zoom level. If given, the array length + * should match the length of the `resolutions` array, i.e. each resolution can have a different + * origin. Tile coordinates increase left to right and upwards. If not specified, `extent` or + * `origin` must be provided. + * @property {!Array} resolutions Resolutions. The array index of each resolution needs + * to match the zoom level. This means that even if a `minZoom` is configured, the resolutions + * array will have a length of `maxZoom + 1`. + * @property {Array} [sizes] Sizes. + * @property {number|import("../size.js").Size} [tileSize] Tile size. + * Default is `[256, 256]`. + * @property {Array} [tileSizes] Tile sizes. If given, the array length + * should match the length of the `resolutions` array, i.e. each resolution can have a different + * tile size. + */ + + +/** + * @classdesc + * Base class for setting the grid pattern for sources accessing tiled-image + * servers. + * @api + */ +var TileGrid_TileGrid = function TileGrid(options) { + + /** + * @protected + * @type {number} + */ + this.minZoom = options.minZoom !== undefined ? options.minZoom : 0; + + /** + * @private + * @type {!Array} + */ + this.resolutions_ = options.resolutions; + Object(asserts["a" /* assert */])(Object(array["e" /* isSorted */])(this.resolutions_, function(a, b) { + return b - a; + }, true), 17); // `resolutions` must be sorted in descending order + + + // check if we've got a consistent zoom factor and origin + var zoomFactor; + if (!options.origins) { + for (var i = 0, ii = this.resolutions_.length - 1; i < ii; ++i) { + if (!zoomFactor) { + zoomFactor = this.resolutions_[i] / this.resolutions_[i + 1]; + } else { + if (this.resolutions_[i] / this.resolutions_[i + 1] !== zoomFactor) { + zoomFactor = undefined; + break; + } + } + } + } + + + /** + * @private + * @type {number|undefined} + */ + this.zoomFactor_ = zoomFactor; + + + /** + * @protected + * @type {number} + */ + this.maxZoom = this.resolutions_.length - 1; + + /** + * @private + * @type {import("../coordinate.js").Coordinate} + */ + this.origin_ = options.origin !== undefined ? options.origin : null; + + /** + * @private + * @type {Array} + */ + this.origins_ = null; + if (options.origins !== undefined) { + this.origins_ = options.origins; + Object(asserts["a" /* assert */])(this.origins_.length == this.resolutions_.length, + 20); // Number of `origins` and `resolutions` must be equal + } + + var extent = options.extent; + + if (extent !== undefined && + !this.origin_ && !this.origins_) { + this.origin_ = Object(ol_extent["C" /* getTopLeft */])(extent); + } + + Object(asserts["a" /* assert */])( + (!this.origin_ && this.origins_) || (this.origin_ && !this.origins_), + 18); // Either `origin` or `origins` must be configured, never both + + /** + * @private + * @type {Array} + */ + this.tileSizes_ = null; + if (options.tileSizes !== undefined) { + this.tileSizes_ = options.tileSizes; + Object(asserts["a" /* assert */])(this.tileSizes_.length == this.resolutions_.length, + 19); // Number of `tileSizes` and `resolutions` must be equal + } + + /** + * @private + * @type {number|import("../size.js").Size} + */ + this.tileSize_ = options.tileSize !== undefined ? + options.tileSize : + !this.tileSizes_ ? common["b" /* DEFAULT_TILE_SIZE */] : null; + Object(asserts["a" /* assert */])( + (!this.tileSize_ && this.tileSizes_) || + (this.tileSize_ && !this.tileSizes_), + 22); // Either `tileSize` or `tileSizes` must be configured, never both + + /** + * @private + * @type {import("../extent.js").Extent} + */ + this.extent_ = extent !== undefined ? extent : null; + + + /** + * @private + * @type {Array} + */ + this.fullTileRanges_ = null; + + /** + * @private + * @type {import("../size.js").Size} + */ + this.tmpSize_ = [0, 0]; + + if (options.sizes !== undefined) { + this.fullTileRanges_ = options.sizes.map(function(size, z) { + var tileRange = new TileRange["b" /* default */]( + Math.min(0, size[0]), Math.max(size[0] - 1, -1), + Math.min(0, size[1]), Math.max(size[1] - 1, -1)); + return tileRange; + }, this); + } else if (extent) { + this.calculateTileRanges_(extent); + } + +}; + +/** + * Call a function with each tile coordinate for a given extent and zoom level. + * + * @param {import("../extent.js").Extent} extent Extent. + * @param {number} zoom Integer zoom level. + * @param {function(import("../tilecoord.js").TileCoord)} callback Function called with each tile coordinate. + * @api + */ +TileGrid_TileGrid.prototype.forEachTileCoord = function forEachTileCoord (extent, zoom, callback) { + var tileRange = this.getTileRangeForExtentAndZ(extent, zoom); + for (var i = tileRange.minX, ii = tileRange.maxX; i <= ii; ++i) { + for (var j = tileRange.minY, jj = tileRange.maxY; j <= jj; ++j) { + callback([zoom, i, j]); + } + } +}; + +/** + * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. + * @param {function(this: T, number, import("../TileRange.js").default): boolean} callback Callback. + * @param {T=} opt_this The object to use as `this` in `callback`. + * @param {import("../TileRange.js").default=} opt_tileRange Temporary import("../TileRange.js").default object. + * @param {import("../extent.js").Extent=} opt_extent Temporary import("../extent.js").Extent object. + * @return {boolean} Callback succeeded. + * @template T + */ +TileGrid_TileGrid.prototype.forEachTileCoordParentTileRange = function forEachTileCoordParentTileRange (tileCoord, callback, opt_this, opt_tileRange, opt_extent) { + var tileRange, x, y; + var tileCoordExtent = null; + var z = tileCoord[0] - 1; + if (this.zoomFactor_ === 2) { + x = tileCoord[1]; + y = tileCoord[2]; + } else { + tileCoordExtent = this.getTileCoordExtent(tileCoord, opt_extent); + } + while (z >= this.minZoom) { + if (this.zoomFactor_ === 2) { + x = Math.floor(x / 2); + y = Math.floor(y / 2); + tileRange = Object(TileRange["a" /* createOrUpdate */])(x, x, y, y, opt_tileRange); + } else { + tileRange = this.getTileRangeForExtentAndZ(tileCoordExtent, z, opt_tileRange); + } + if (callback.call(opt_this, z, tileRange)) { + return true; + } + --z; + } + return false; +}; + +/** + * Get the extent for this tile grid, if it was configured. + * @return {import("../extent.js").Extent} Extent. + */ +TileGrid_TileGrid.prototype.getExtent = function getExtent () { + return this.extent_; +}; + +/** + * Get the maximum zoom level for the grid. + * @return {number} Max zoom. + * @api + */ +TileGrid_TileGrid.prototype.getMaxZoom = function getMaxZoom () { + return this.maxZoom; +}; + +/** + * Get the minimum zoom level for the grid. + * @return {number} Min zoom. + * @api + */ +TileGrid_TileGrid.prototype.getMinZoom = function getMinZoom () { + return this.minZoom; +}; + +/** + * Get the origin for the grid at the given zoom level. + * @param {number} z Integer zoom level. + * @return {import("../coordinate.js").Coordinate} Origin. + * @api + */ +TileGrid_TileGrid.prototype.getOrigin = function getOrigin (z) { + if (this.origin_) { + return this.origin_; + } else { + return this.origins_[z]; + } +}; + +/** + * Get the resolution for the given zoom level. + * @param {number} z Integer zoom level. + * @return {number} Resolution. + * @api + */ +TileGrid_TileGrid.prototype.getResolution = function getResolution (z) { + return this.resolutions_[z]; +}; + +/** + * Get the list of resolutions for the tile grid. + * @return {Array} Resolutions. + * @api + */ +TileGrid_TileGrid.prototype.getResolutions = function getResolutions () { + return this.resolutions_; +}; + +/** + * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. + * @param {import("../TileRange.js").default=} opt_tileRange Temporary import("../TileRange.js").default object. + * @param {import("../extent.js").Extent=} opt_extent Temporary import("../extent.js").Extent object. + * @return {import("../TileRange.js").default} Tile range. + */ +TileGrid_TileGrid.prototype.getTileCoordChildTileRange = function getTileCoordChildTileRange (tileCoord, opt_tileRange, opt_extent) { + if (tileCoord[0] < this.maxZoom) { + if (this.zoomFactor_ === 2) { + var minX = tileCoord[1] * 2; + var minY = tileCoord[2] * 2; + return Object(TileRange["a" /* createOrUpdate */])(minX, minX + 1, minY, minY + 1, opt_tileRange); + } + var tileCoordExtent = this.getTileCoordExtent(tileCoord, opt_extent); + return this.getTileRangeForExtentAndZ( + tileCoordExtent, tileCoord[0] + 1, opt_tileRange); + } + return null; +}; + +/** + * Get the extent for a tile range. + * @param {number} z Integer zoom level. + * @param {import("../TileRange.js").default} tileRange Tile range. + * @param {import("../extent.js").Extent=} opt_extent Temporary import("../extent.js").Extent object. + * @return {import("../extent.js").Extent} Extent. + */ +TileGrid_TileGrid.prototype.getTileRangeExtent = function getTileRangeExtent (z, tileRange, opt_extent) { + var origin = this.getOrigin(z); + var resolution = this.getResolution(z); + var tileSize = Object(ol_size["c" /* toSize */])(this.getTileSize(z), this.tmpSize_); + var minX = origin[0] + tileRange.minX * tileSize[0] * resolution; + var maxX = origin[0] + (tileRange.maxX + 1) * tileSize[0] * resolution; + var minY = origin[1] + tileRange.minY * tileSize[1] * resolution; + var maxY = origin[1] + (tileRange.maxY + 1) * tileSize[1] * resolution; + return Object(ol_extent["k" /* createOrUpdate */])(minX, minY, maxX, maxY, opt_extent); +}; + +/** + * Get a tile range for the given extent and integer zoom level. + * @param {import("../extent.js").Extent} extent Extent. + * @param {number} z Integer zoom level. + * @param {import("../TileRange.js").default=} opt_tileRange Temporary tile range object. + * @return {import("../TileRange.js").default} Tile range. + */ +TileGrid_TileGrid.prototype.getTileRangeForExtentAndZ = function getTileRangeForExtentAndZ (extent, z, opt_tileRange) { + var tileCoord = tmpTileCoord; + this.getTileCoordForXYAndZ_(extent[0], extent[1], z, false, tileCoord); + var minX = tileCoord[1]; + var minY = tileCoord[2]; + this.getTileCoordForXYAndZ_(extent[2], extent[3], z, true, tileCoord); + return Object(TileRange["a" /* createOrUpdate */])(minX, tileCoord[1], minY, tileCoord[2], opt_tileRange); +}; + +/** + * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. + * @return {import("../coordinate.js").Coordinate} Tile center. + */ +TileGrid_TileGrid.prototype.getTileCoordCenter = function getTileCoordCenter (tileCoord) { + var origin = this.getOrigin(tileCoord[0]); + var resolution = this.getResolution(tileCoord[0]); + var tileSize = Object(ol_size["c" /* toSize */])(this.getTileSize(tileCoord[0]), this.tmpSize_); + return [ + origin[0] + (tileCoord[1] + 0.5) * tileSize[0] * resolution, + origin[1] + (tileCoord[2] + 0.5) * tileSize[1] * resolution + ]; +}; + +/** + * Get the extent of a tile coordinate. + * + * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. + * @param {import("../extent.js").Extent=} opt_extent Temporary extent object. + * @return {import("../extent.js").Extent} Extent. + * @api + */ +TileGrid_TileGrid.prototype.getTileCoordExtent = function getTileCoordExtent (tileCoord, opt_extent) { + var origin = this.getOrigin(tileCoord[0]); + var resolution = this.getResolution(tileCoord[0]); + var tileSize = Object(ol_size["c" /* toSize */])(this.getTileSize(tileCoord[0]), this.tmpSize_); + var minX = origin[0] + tileCoord[1] * tileSize[0] * resolution; + var minY = origin[1] + tileCoord[2] * tileSize[1] * resolution; + var maxX = minX + tileSize[0] * resolution; + var maxY = minY + tileSize[1] * resolution; + return Object(ol_extent["k" /* createOrUpdate */])(minX, minY, maxX, maxY, opt_extent); +}; + +/** + * Get the tile coordinate for the given map coordinate and resolution.This + * method considers that coordinates that intersect tile boundaries should be + * assigned the higher tile coordinate. + * + * @param {import("../coordinate.js").Coordinate} coordinate Coordinate. + * @param {number} resolution Resolution. + * @param {import("../tilecoord.js").TileCoord=} opt_tileCoord Destination import("../tilecoord.js").TileCoord object. + * @return {import("../tilecoord.js").TileCoord} Tile coordinate. + * @api + */ +TileGrid_TileGrid.prototype.getTileCoordForCoordAndResolution = function getTileCoordForCoordAndResolution (coordinate, resolution, opt_tileCoord) { + return this.getTileCoordForXYAndResolution_( + coordinate[0], coordinate[1], resolution, false, opt_tileCoord); +}; + +/** + * Note that this method should not be called for resolutions that correspond + * to an integer zoom level.Instead call the `getTileCoordForXYAndZ_` method. + * @param {number} x X. + * @param {number} y Y. + * @param {number} resolution Resolution (for a non-integer zoom level). + * @param {boolean} reverseIntersectionPolicy Instead of letting edge + * intersections go to the higher tile coordinate, let edge intersections + * go to the lower tile coordinate. + * @param {import("../tilecoord.js").TileCoord=} opt_tileCoord Temporary import("../tilecoord.js").TileCoord object. + * @return {import("../tilecoord.js").TileCoord} Tile coordinate. + * @private + */ +TileGrid_TileGrid.prototype.getTileCoordForXYAndResolution_ = function getTileCoordForXYAndResolution_ (x, y, resolution, reverseIntersectionPolicy, opt_tileCoord) { + var z = this.getZForResolution(resolution); + var scale = resolution / this.getResolution(z); + var origin = this.getOrigin(z); + var tileSize = Object(ol_size["c" /* toSize */])(this.getTileSize(z), this.tmpSize_); + + var adjustX = reverseIntersectionPolicy ? 0.5 : 0; + var adjustY = reverseIntersectionPolicy ? 0 : 0.5; + var xFromOrigin = Math.floor((x - origin[0]) / resolution + adjustX); + var yFromOrigin = Math.floor((y - origin[1]) / resolution + adjustY); + var tileCoordX = scale * xFromOrigin / tileSize[0]; + var tileCoordY = scale * yFromOrigin / tileSize[1]; + + if (reverseIntersectionPolicy) { + tileCoordX = Math.ceil(tileCoordX) - 1; + tileCoordY = Math.ceil(tileCoordY) - 1; + } else { + tileCoordX = Math.floor(tileCoordX); + tileCoordY = Math.floor(tileCoordY); + } + + return Object(tilecoord["a" /* createOrUpdate */])(z, tileCoordX, tileCoordY, opt_tileCoord); +}; + +/** + * Although there is repetition between this method and `getTileCoordForXYAndResolution_`, + * they should have separate implementations.This method is for integer zoom + * levels.The other method should only be called for resolutions corresponding + * to non-integer zoom levels. + * @param {number} x Map x coordinate. + * @param {number} y Map y coordinate. + * @param {number} z Integer zoom level. + * @param {boolean} reverseIntersectionPolicy Instead of letting edge + * intersections go to the higher tile coordinate, let edge intersections + * go to the lower tile coordinate. + * @param {import("../tilecoord.js").TileCoord=} opt_tileCoord Temporary import("../tilecoord.js").TileCoord object. + * @return {import("../tilecoord.js").TileCoord} Tile coordinate. + * @private + */ +TileGrid_TileGrid.prototype.getTileCoordForXYAndZ_ = function getTileCoordForXYAndZ_ (x, y, z, reverseIntersectionPolicy, opt_tileCoord) { + var origin = this.getOrigin(z); + var resolution = this.getResolution(z); + var tileSize = Object(ol_size["c" /* toSize */])(this.getTileSize(z), this.tmpSize_); + + var adjustX = reverseIntersectionPolicy ? 0.5 : 0; + var adjustY = reverseIntersectionPolicy ? 0 : 0.5; + var xFromOrigin = Math.floor((x - origin[0]) / resolution + adjustX); + var yFromOrigin = Math.floor((y - origin[1]) / resolution + adjustY); + var tileCoordX = xFromOrigin / tileSize[0]; + var tileCoordY = yFromOrigin / tileSize[1]; + + if (reverseIntersectionPolicy) { + tileCoordX = Math.ceil(tileCoordX) - 1; + tileCoordY = Math.ceil(tileCoordY) - 1; + } else { + tileCoordX = Math.floor(tileCoordX); + tileCoordY = Math.floor(tileCoordY); + } + + return Object(tilecoord["a" /* createOrUpdate */])(z, tileCoordX, tileCoordY, opt_tileCoord); +}; + +/** + * Get a tile coordinate given a map coordinate and zoom level. + * @param {import("../coordinate.js").Coordinate} coordinate Coordinate. + * @param {number} z Zoom level. + * @param {import("../tilecoord.js").TileCoord=} opt_tileCoord Destination import("../tilecoord.js").TileCoord object. + * @return {import("../tilecoord.js").TileCoord} Tile coordinate. + * @api + */ +TileGrid_TileGrid.prototype.getTileCoordForCoordAndZ = function getTileCoordForCoordAndZ (coordinate, z, opt_tileCoord) { + return this.getTileCoordForXYAndZ_( + coordinate[0], coordinate[1], z, false, opt_tileCoord); +}; + +/** + * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. + * @return {number} Tile resolution. + */ +TileGrid_TileGrid.prototype.getTileCoordResolution = function getTileCoordResolution (tileCoord) { + return this.resolutions_[tileCoord[0]]; +}; + +/** + * Get the tile size for a zoom level. The type of the return value matches the + * `tileSize` or `tileSizes` that the tile grid was configured with. To always + * get an `import("../size.js").Size`, run the result through `import("../size.js").Size.toSize()`. + * @param {number} z Z. + * @return {number|import("../size.js").Size} Tile size. + * @api + */ +TileGrid_TileGrid.prototype.getTileSize = function getTileSize (z) { + if (this.tileSize_) { + return this.tileSize_; + } else { + return this.tileSizes_[z]; + } +}; + +/** + * @param {number} z Zoom level. + * @return {import("../TileRange.js").default} Extent tile range for the specified zoom level. + */ +TileGrid_TileGrid.prototype.getFullTileRange = function getFullTileRange (z) { + if (!this.fullTileRanges_) { + return null; + } else { + return this.fullTileRanges_[z]; + } +}; + +/** + * @param {number} resolution Resolution. + * @param {number=} opt_direction If 0, the nearest resolution will be used. + * If 1, the nearest lower resolution will be used. If -1, the nearest + * higher resolution will be used. Default is 0. + * @return {number} Z. + * @api + */ +TileGrid_TileGrid.prototype.getZForResolution = function getZForResolution (resolution, opt_direction) { + var z = Object(array["f" /* linearFindNearest */])(this.resolutions_, resolution, opt_direction || 0); + return Object(math["a" /* clamp */])(z, this.minZoom, this.maxZoom); +}; + +/** + * @param {!import("../extent.js").Extent} extent Extent for this tile grid. + * @private + */ +TileGrid_TileGrid.prototype.calculateTileRanges_ = function calculateTileRanges_ (extent) { + var length = this.resolutions_.length; + var fullTileRanges = new Array(length); + for (var z = this.minZoom; z < length; ++z) { + fullTileRanges[z] = this.getTileRangeForExtentAndZ(extent, z); + } + this.fullTileRanges_ = fullTileRanges; +}; + + +/* harmony default export */ var tilegrid_TileGrid = (TileGrid_TileGrid); + +//# sourceMappingURL=TileGrid.js.map +// CONCATENATED MODULE: ./node_modules/ol/tilegrid.js +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getForProjection; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return wrapX; }); +/* unused harmony export createForExtent */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createXYZ; }); +/* unused harmony export createForProjection */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return extentFromProjection; }); +/** + * @module ol/tilegrid + */ + + + + + + + + + +/** + * @param {import("./proj/Projection.js").default} projection Projection. + * @return {!TileGrid} Default tile grid for the + * passed projection. + */ +function getForProjection(projection) { + var tileGrid = projection.getDefaultTileGrid(); + if (!tileGrid) { + tileGrid = createForProjection(projection); + projection.setDefaultTileGrid(tileGrid); + } + return tileGrid; +} + + +/** + * @param {TileGrid} tileGrid Tile grid. + * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate. + * @param {import("./proj/Projection.js").default} projection Projection. + * @return {import("./tilecoord.js").TileCoord} Tile coordinate. + */ +function wrapX(tileGrid, tileCoord, projection) { + var z = tileCoord[0]; + var center = tileGrid.getTileCoordCenter(tileCoord); + var projectionExtent = extentFromProjection(projection); + if (!Object(ol_extent["f" /* containsCoordinate */])(projectionExtent, center)) { + var worldWidth = Object(ol_extent["E" /* getWidth */])(projectionExtent); + var worldsAway = Math.ceil((projectionExtent[0] - center[0]) / worldWidth); + center[0] += worldWidth * worldsAway; + return tileGrid.getTileCoordForCoordAndZ(center, z); + } else { + return tileCoord; + } +} + + +/** + * @param {import("./extent.js").Extent} extent Extent. + * @param {number=} opt_maxZoom Maximum zoom level (default is + * DEFAULT_MAX_ZOOM). + * @param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses + * DEFAULT_TILE_SIZE). + * @param {Corner=} opt_corner Extent corner (default is `'top-left'`). + * @return {!TileGrid} TileGrid instance. + */ +function createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner) { + var corner = opt_corner !== undefined ? opt_corner : Corner["a" /* default */].TOP_LEFT; + + var resolutions = resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize); + + return new tilegrid_TileGrid({ + extent: extent, + origin: Object(ol_extent["y" /* getCorner */])(extent, corner), + resolutions: resolutions, + tileSize: opt_tileSize + }); +} + + +/** + * @typedef {Object} XYZOptions + * @property {import("./extent.js").Extent} [extent] Extent for the tile grid. The origin for an XYZ tile grid is the + * top-left corner of the extent. The zero level of the grid is defined by the resolution at which one tile fits in the + * provided extent. If not provided, the extent of the EPSG:3857 projection is used. + * @property {number} [maxZoom] Maximum zoom. The default is `42`. This determines the number of levels + * in the grid set. For example, a `maxZoom` of 21 means there are 22 levels in the grid set. + * @property {number} [minZoom=0] Minimum zoom. + * @property {number|import("./size.js").Size} [tileSize=[256, 256]] Tile size in pixels. + */ + + +/** + * Creates a tile grid with a standard XYZ tiling scheme. + * @param {XYZOptions=} opt_options Tile grid options. + * @return {!TileGrid} Tile grid instance. + * @api + */ +function createXYZ(opt_options) { + /** @type {XYZOptions} */ + var xyzOptions = opt_options || {}; + + var extent = xyzOptions.extent || Object(proj["e" /* get */])('EPSG:3857').getExtent(); + + /** @type {import("./tilegrid/TileGrid.js").Options} */ + var gridOptions = { + extent: extent, + minZoom: xyzOptions.minZoom, + tileSize: xyzOptions.tileSize, + resolutions: resolutionsFromExtent( + extent, + xyzOptions.maxZoom, + xyzOptions.tileSize + ) + }; + return new tilegrid_TileGrid(gridOptions); +} + + +/** + * Create a resolutions array from an extent. A zoom factor of 2 is assumed. + * @param {import("./extent.js").Extent} extent Extent. + * @param {number=} opt_maxZoom Maximum zoom level (default is + * DEFAULT_MAX_ZOOM). + * @param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses + * DEFAULT_TILE_SIZE). + * @return {!Array} Resolutions array. + */ +function resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize) { + var maxZoom = opt_maxZoom !== undefined ? + opt_maxZoom : common["a" /* DEFAULT_MAX_ZOOM */]; + + var height = Object(ol_extent["A" /* getHeight */])(extent); + var width = Object(ol_extent["E" /* getWidth */])(extent); + + var tileSize = Object(ol_size["c" /* toSize */])(opt_tileSize !== undefined ? + opt_tileSize : common["b" /* DEFAULT_TILE_SIZE */]); + var maxResolution = Math.max( + width / tileSize[0], height / tileSize[1]); + + var length = maxZoom + 1; + var resolutions = new Array(length); + for (var z = 0; z < length; ++z) { + resolutions[z] = maxResolution / Math.pow(2, z); + } + return resolutions; +} + + +/** + * @param {import("./proj.js").ProjectionLike} projection Projection. + * @param {number=} opt_maxZoom Maximum zoom level (default is + * DEFAULT_MAX_ZOOM). + * @param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses + * DEFAULT_TILE_SIZE). + * @param {Corner=} opt_corner Extent corner (default is `'top-left'`). + * @return {!TileGrid} TileGrid instance. + */ +function createForProjection(projection, opt_maxZoom, opt_tileSize, opt_corner) { + var extent = extentFromProjection(projection); + return createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner); +} + + +/** + * Generate a tile grid extent from a projection. If the projection has an + * extent, it is used. If not, a global extent is assumed. + * @param {import("./proj.js").ProjectionLike} projection Projection. + * @return {import("./extent.js").Extent} Extent. + */ +function extentFromProjection(projection) { + projection = Object(proj["e" /* get */])(projection); + var extent = projection.getExtent(); + if (!extent) { + var half = 180 * proj["a" /* METERS_PER_UNIT */][Units["b" /* default */].DEGREES] / projection.getMetersPerUnit(); + extent = Object(ol_extent["k" /* createOrUpdate */])(-half, -half, half, half); + } + return extent; +} + +//# sourceMappingURL=tilegrid.js.map + +/***/ }), +/* 62 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -9318,7 +11623,292 @@ function quantizeMultiArray( //# sourceMappingURL=FormatType.js.map /***/ }), -/* 51 */ +/* 63 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return DROP; }); +/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); +/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10); +/** + * @module ol/structs/PriorityQueue + */ + + + + +/** + * @type {number} + */ +var DROP = Infinity; + + +/** + * @classdesc + * Priority queue. + * + * The implementation is inspired from the Closure Library's Heap class and + * Python's heapq module. + * + * See http://closure-library.googlecode.com/svn/docs/closure_goog_structs_heap.js.source.html + * and http://hg.python.org/cpython/file/2.7/Lib/heapq.py. + * + * @template T + */ +var PriorityQueue = function PriorityQueue(priorityFunction, keyFunction) { + + /** + * @type {function(T): number} + * @private + */ + this.priorityFunction_ = priorityFunction; + + /** + * @type {function(T): string} + * @private + */ + this.keyFunction_ = keyFunction; + + /** + * @type {Array} + * @private + */ + this.elements_ = []; + + /** + * @type {Array} + * @private + */ + this.priorities_ = []; + + /** + * @type {!Object} + * @private + */ + this.queuedElements_ = {}; + +}; + +/** + * FIXME empty description for jsdoc + */ +PriorityQueue.prototype.clear = function clear$1 () { + this.elements_.length = 0; + this.priorities_.length = 0; + Object(_obj_js__WEBPACK_IMPORTED_MODULE_1__[/* clear */ "b"])(this.queuedElements_); +}; + + +/** + * Remove and return the highest-priority element. O(log N). + * @return {T} Element. + */ +PriorityQueue.prototype.dequeue = function dequeue () { + var elements = this.elements_; + var priorities = this.priorities_; + var element = elements[0]; + if (elements.length == 1) { + elements.length = 0; + priorities.length = 0; + } else { + elements[0] = elements.pop(); + priorities[0] = priorities.pop(); + this.siftUp_(0); + } + var elementKey = this.keyFunction_(element); + delete this.queuedElements_[elementKey]; + return element; +}; + + +/** + * Enqueue an element. O(log N). + * @param {T} element Element. + * @return {boolean} The element was added to the queue. + */ +PriorityQueue.prototype.enqueue = function enqueue (element) { + Object(_asserts_js__WEBPACK_IMPORTED_MODULE_0__[/* assert */ "a"])(!(this.keyFunction_(element) in this.queuedElements_), + 31); // Tried to enqueue an `element` that was already added to the queue + var priority = this.priorityFunction_(element); + if (priority != DROP) { + this.elements_.push(element); + this.priorities_.push(priority); + this.queuedElements_[this.keyFunction_(element)] = true; + this.siftDown_(0, this.elements_.length - 1); + return true; + } + return false; +}; + + +/** + * @return {number} Count. + */ +PriorityQueue.prototype.getCount = function getCount () { + return this.elements_.length; +}; + + +/** + * Gets the index of the left child of the node at the given index. + * @param {number} index The index of the node to get the left child for. + * @return {number} The index of the left child. + * @private + */ +PriorityQueue.prototype.getLeftChildIndex_ = function getLeftChildIndex_ (index) { + return index * 2 + 1; +}; + + +/** + * Gets the index of the right child of the node at the given index. + * @param {number} index The index of the node to get the right child for. + * @return {number} The index of the right child. + * @private + */ +PriorityQueue.prototype.getRightChildIndex_ = function getRightChildIndex_ (index) { + return index * 2 + 2; +}; + + +/** + * Gets the index of the parent of the node at the given index. + * @param {number} index The index of the node to get the parent for. + * @return {number} The index of the parent. + * @private + */ +PriorityQueue.prototype.getParentIndex_ = function getParentIndex_ (index) { + return (index - 1) >> 1; +}; + + +/** + * Make this a heap. O(N). + * @private + */ +PriorityQueue.prototype.heapify_ = function heapify_ () { + var i; + for (i = (this.elements_.length >> 1) - 1; i >= 0; i--) { + this.siftUp_(i); + } +}; + + +/** + * @return {boolean} Is empty. + */ +PriorityQueue.prototype.isEmpty = function isEmpty () { + return this.elements_.length === 0; +}; + + +/** + * @param {string} key Key. + * @return {boolean} Is key queued. + */ +PriorityQueue.prototype.isKeyQueued = function isKeyQueued (key) { + return key in this.queuedElements_; +}; + + +/** + * @param {T} element Element. + * @return {boolean} Is queued. + */ +PriorityQueue.prototype.isQueued = function isQueued (element) { + return this.isKeyQueued(this.keyFunction_(element)); +}; + + +/** + * @param {number} index The index of the node to move down. + * @private + */ +PriorityQueue.prototype.siftUp_ = function siftUp_ (index) { + var elements = this.elements_; + var priorities = this.priorities_; + var count = elements.length; + var element = elements[index]; + var priority = priorities[index]; + var startIndex = index; + + while (index < (count >> 1)) { + var lIndex = this.getLeftChildIndex_(index); + var rIndex = this.getRightChildIndex_(index); + + var smallerChildIndex = rIndex < count && + priorities[rIndex] < priorities[lIndex] ? + rIndex : lIndex; + + elements[index] = elements[smallerChildIndex]; + priorities[index] = priorities[smallerChildIndex]; + index = smallerChildIndex; + } + + elements[index] = element; + priorities[index] = priority; + this.siftDown_(startIndex, index); +}; + + +/** + * @param {number} startIndex The index of the root. + * @param {number} index The index of the node to move up. + * @private + */ +PriorityQueue.prototype.siftDown_ = function siftDown_ (startIndex, index) { + var elements = this.elements_; + var priorities = this.priorities_; + var element = elements[index]; + var priority = priorities[index]; + + while (index > startIndex) { + var parentIndex = this.getParentIndex_(index); + if (priorities[parentIndex] > priority) { + elements[index] = elements[parentIndex]; + priorities[index] = priorities[parentIndex]; + index = parentIndex; + } else { + break; + } + } + elements[index] = element; + priorities[index] = priority; +}; + + +/** + * FIXME empty description for jsdoc + */ +PriorityQueue.prototype.reprioritize = function reprioritize () { + var priorityFunction = this.priorityFunction_; + var elements = this.elements_; + var priorities = this.priorities_; + var index = 0; + var n = elements.length; + var element, i, priority; + for (i = 0; i < n; ++i) { + element = elements[i]; + priority = priorityFunction(element); + if (priority == DROP) { + delete this.queuedElements_[this.keyFunction_(element)]; + } else { + priorities[index] = priority; + elements[index++] = element; + } + } + elements.length = index; + priorities.length = index; + this.heapify_(); +}; + + +/* harmony default export */ __webpack_exports__["b"] = (PriorityQueue); + +//# sourceMappingURL=PriorityQueue.js.map + +/***/ }), +/* 64 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -9343,7 +11933,7 @@ var DEFAULT_TILE_SIZE = 256; //# sourceMappingURL=common.js.map /***/ }), -/* 52 */ +/* 65 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -9355,89 +11945,28 @@ var array = __webpack_require__(11); var ol_extent = __webpack_require__(0); // EXTERNAL MODULE: ./node_modules/ol/geom/GeometryLayout.js -var GeometryLayout = __webpack_require__(18); +var GeometryLayout = __webpack_require__(22); // EXTERNAL MODULE: ./node_modules/ol/geom/GeometryType.js var GeometryType = __webpack_require__(5); // EXTERNAL MODULE: ./node_modules/ol/geom/SimpleGeometry.js + 1 modules -var geom_SimpleGeometry = __webpack_require__(41); +var geom_SimpleGeometry = __webpack_require__(48); -// CONCATENATED MODULE: ./node_modules/ol/geom/flat/area.js -/** - * @module ol/geom/flat/area - */ +// EXTERNAL MODULE: ./node_modules/ol/geom/flat/area.js +var flat_area = __webpack_require__(68); - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - * @return {number} Area. - */ -function area_linearRing(flatCoordinates, offset, end, stride) { - var twiceArea = 0; - var x1 = flatCoordinates[end - stride]; - var y1 = flatCoordinates[end - stride + 1]; - for (; offset < end; offset += stride) { - var x2 = flatCoordinates[offset]; - var y2 = flatCoordinates[offset + 1]; - twiceArea += y1 * x2 - x1 * y2; - x1 = x2; - y1 = y2; - } - return twiceArea / 2; -} - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {Array} ends Ends. - * @param {number} stride Stride. - * @return {number} Area. - */ -function area_linearRings(flatCoordinates, offset, ends, stride) { - var area = 0; - for (var i = 0, ii = ends.length; i < ii; ++i) { - var end = ends[i]; - area += area_linearRing(flatCoordinates, offset, end, stride); - offset = end; - } - return area; -} - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {Array>} endss Endss. - * @param {number} stride Stride. - * @return {number} Area. - */ -function linearRingss(flatCoordinates, offset, endss, stride) { - var area = 0; - for (var i = 0, ii = endss.length; i < ii; ++i) { - var ends = endss[i]; - area += area_linearRings(flatCoordinates, offset, ends, stride); - offset = ends[ends.length - 1]; - } - return area; -} - -//# sourceMappingURL=area.js.map // EXTERNAL MODULE: ./node_modules/ol/geom/flat/closest.js -var closest = __webpack_require__(47); +var closest = __webpack_require__(54); // EXTERNAL MODULE: ./node_modules/ol/geom/flat/deflate.js -var deflate = __webpack_require__(48); +var deflate = __webpack_require__(57); // EXTERNAL MODULE: ./node_modules/ol/geom/flat/inflate.js -var inflate = __webpack_require__(43); +var inflate = __webpack_require__(50); // EXTERNAL MODULE: ./node_modules/ol/geom/flat/simplify.js -var simplify = __webpack_require__(49); +var simplify = __webpack_require__(58); // CONCATENATED MODULE: ./node_modules/ol/geom/LinearRing.js /** @@ -9522,7 +12051,7 @@ var LinearRing_LinearRing = /*@__PURE__*/(function (SimpleGeometry) { * @api */ LinearRing.prototype.getArea = function getArea () { - return area_linearRing(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride); + return Object(flat_area["a" /* linearRing */])(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride); }; /** @@ -9587,13 +12116,13 @@ var LinearRing_LinearRing = /*@__PURE__*/(function (SimpleGeometry) { //# sourceMappingURL=LinearRing.js.map // EXTERNAL MODULE: ./node_modules/ol/geom/Point.js -var Point = __webpack_require__(65); +var Point = __webpack_require__(79); // EXTERNAL MODULE: ./node_modules/ol/sphere.js -var sphere = __webpack_require__(59); +var sphere = __webpack_require__(74); // EXTERNAL MODULE: ./node_modules/ol/geom/flat/contains.js -var contains = __webpack_require__(44); +var contains = __webpack_require__(46); // CONCATENATED MODULE: ./node_modules/ol/geom/flat/interiorpoint.js /** @@ -9692,177 +12221,13 @@ function getInteriorPointsOfMultiArray(flatCoordinates, offset, endss, stride, f //# sourceMappingURL=interiorpoint.js.map // EXTERNAL MODULE: ./node_modules/ol/geom/flat/intersectsextent.js -var intersectsextent = __webpack_require__(66); +var intersectsextent = __webpack_require__(80); -// CONCATENATED MODULE: ./node_modules/ol/geom/flat/reverse.js -/** - * @module ol/geom/flat/reverse - */ +// EXTERNAL MODULE: ./node_modules/ol/geom/flat/orient.js + 1 modules +var orient = __webpack_require__(52); - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - */ -function reverse_coordinates(flatCoordinates, offset, end, stride) { - while (offset < end - stride) { - for (var i = 0; i < stride; ++i) { - var tmp = flatCoordinates[offset + i]; - flatCoordinates[offset + i] = flatCoordinates[end - stride + i]; - flatCoordinates[end - stride + i] = tmp; - } - offset += stride; - end -= stride; - } -} - -//# sourceMappingURL=reverse.js.map -// CONCATENATED MODULE: ./node_modules/ol/geom/flat/orient.js -/** - * @module ol/geom/flat/orient - */ - - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - * @return {boolean} Is clockwise. - */ -function linearRingIsClockwise(flatCoordinates, offset, end, stride) { - // http://tinyurl.com/clockwise-method - // https://github.com/OSGeo/gdal/blob/trunk/gdal/ogr/ogrlinearring.cpp - var edge = 0; - var x1 = flatCoordinates[end - stride]; - var y1 = flatCoordinates[end - stride + 1]; - for (; offset < end; offset += stride) { - var x2 = flatCoordinates[offset]; - var y2 = flatCoordinates[offset + 1]; - edge += (x2 - x1) * (y2 + y1); - x1 = x2; - y1 = y2; - } - return edge > 0; -} - - -/** - * Determines if linear rings are oriented. By default, left-hand orientation - * is tested (first ring must be clockwise, remaining rings counter-clockwise). - * To test for right-hand orientation, use the `opt_right` argument. - * - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {Array} ends Array of end indexes. - * @param {number} stride Stride. - * @param {boolean=} opt_right Test for right-hand orientation - * (counter-clockwise exterior ring and clockwise interior rings). - * @return {boolean} Rings are correctly oriented. - */ -function linearRingIsOriented(flatCoordinates, offset, ends, stride, opt_right) { - var right = opt_right !== undefined ? opt_right : false; - for (var i = 0, ii = ends.length; i < ii; ++i) { - var end = ends[i]; - var isClockwise = linearRingIsClockwise( - flatCoordinates, offset, end, stride); - if (i === 0) { - if ((right && isClockwise) || (!right && !isClockwise)) { - return false; - } - } else { - if ((right && !isClockwise) || (!right && isClockwise)) { - return false; - } - } - offset = end; - } - return true; -} - - -/** - * Determines if linear rings are oriented. By default, left-hand orientation - * is tested (first ring must be clockwise, remaining rings counter-clockwise). - * To test for right-hand orientation, use the `opt_right` argument. - * - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {Array>} endss Array of array of end indexes. - * @param {number} stride Stride. - * @param {boolean=} opt_right Test for right-hand orientation - * (counter-clockwise exterior ring and clockwise interior rings). - * @return {boolean} Rings are correctly oriented. - */ -function linearRingsAreOriented(flatCoordinates, offset, endss, stride, opt_right) { - for (var i = 0, ii = endss.length; i < ii; ++i) { - if (!linearRingIsOriented( - flatCoordinates, offset, endss[i], stride, opt_right)) { - return false; - } - } - return true; -} - - -/** - * Orient coordinates in a flat array of linear rings. By default, rings - * are oriented following the left-hand rule (clockwise for exterior and - * counter-clockwise for interior rings). To orient according to the - * right-hand rule, use the `opt_right` argument. - * - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {Array} ends Ends. - * @param {number} stride Stride. - * @param {boolean=} opt_right Follow the right-hand rule for orientation. - * @return {number} End. - */ -function orientLinearRings(flatCoordinates, offset, ends, stride, opt_right) { - var right = opt_right !== undefined ? opt_right : false; - for (var i = 0, ii = ends.length; i < ii; ++i) { - var end = ends[i]; - var isClockwise = linearRingIsClockwise( - flatCoordinates, offset, end, stride); - var reverse = i === 0 ? - (right && isClockwise) || (!right && !isClockwise) : - (right && !isClockwise) || (!right && isClockwise); - if (reverse) { - reverse_coordinates(flatCoordinates, offset, end, stride); - } - offset = end; - } - return offset; -} - - -/** - * Orient coordinates in a flat array of linear rings. By default, rings - * are oriented following the left-hand rule (clockwise for exterior and - * counter-clockwise for interior rings). To orient according to the - * right-hand rule, use the `opt_right` argument. - * - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {Array>} endss Array of array of end indexes. - * @param {number} stride Stride. - * @param {boolean=} opt_right Follow the right-hand rule for orientation. - * @return {number} End. - */ -function orientLinearRingsArray(flatCoordinates, offset, endss, stride, opt_right) { - for (var i = 0, ii = endss.length; i < ii; ++i) { - offset = orientLinearRings( - flatCoordinates, offset, endss[i], stride, opt_right); - } - return offset; -} - -//# sourceMappingURL=orient.js.map // EXTERNAL MODULE: ./node_modules/ol/math.js -var math = __webpack_require__(6); +var math = __webpack_require__(9); // CONCATENATED MODULE: ./node_modules/ol/geom/Polygon.js /* unused harmony export circular */ @@ -10012,7 +12377,7 @@ var Polygon_Polygon = /*@__PURE__*/(function (SimpleGeometry) { * @api */ Polygon.prototype.getArea = function getArea () { - return area_linearRings(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride); + return Object(flat_area["b" /* linearRings */])(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride); }; /** @@ -10033,7 +12398,7 @@ var Polygon_Polygon = /*@__PURE__*/(function (SimpleGeometry) { var flatCoordinates; if (opt_right !== undefined) { flatCoordinates = this.getOrientedFlatCoordinates().slice(); - orientLinearRings( + Object(orient["c" /* orientLinearRings */])( flatCoordinates, 0, this.ends_, this.stride, opt_right); } else { flatCoordinates = this.flatCoordinates; @@ -10129,13 +12494,13 @@ var Polygon_Polygon = /*@__PURE__*/(function (SimpleGeometry) { Polygon.prototype.getOrientedFlatCoordinates = function getOrientedFlatCoordinates () { if (this.orientedRevision_ != this.getRevision()) { var flatCoordinates = this.flatCoordinates; - if (linearRingIsOriented( + if (Object(orient["b" /* linearRingIsOriented */])( flatCoordinates, 0, this.ends_, this.stride)) { this.orientedFlatCoordinates_ = flatCoordinates; } else { this.orientedFlatCoordinates_ = flatCoordinates.slice(); this.orientedFlatCoordinates_.length = - orientLinearRings( + Object(orient["c" /* orientLinearRings */])( this.orientedFlatCoordinates_, 0, this.ends_, this.stride); } this.orientedRevision_ = this.getRevision(); @@ -10294,7 +12659,7 @@ function makeRegular(polygon, center, radius, opt_angle) { //# sourceMappingURL=Polygon.js.map /***/ }), -/* 53 */ +/* 66 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -10316,198 +12681,642 @@ function makeRegular(polygon, center, radius, opt_angle) { //# sourceMappingURL=Corner.js.map /***/ }), -/* 54 */ +/* 67 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createOrUpdate; }); +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var rbush__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(70); +/* harmony import */ var rbush__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(rbush__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0); +/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10); /** - * @module ol/TileRange + * @module ol/structs/RBush */ -/** - * A representation of a contiguous block of tiles. A tile range is specified - * by its min/max tile coordinates and is inclusive of coordinates. - */ -var TileRange = function TileRange(minX, maxX, minY, maxY) { - /** - * @type {number} - */ - this.minX = minX; - /** - * @type {number} - */ - this.maxX = maxX; - - /** - * @type {number} - */ - this.minY = minY; - - /** - * @type {number} - */ - this.maxY = maxY; - -}; - -/** - * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate. - * @return {boolean} Contains tile coordinate. - */ -TileRange.prototype.contains = function contains (tileCoord) { - return this.containsXY(tileCoord[1], tileCoord[2]); -}; - -/** - * @param {TileRange} tileRange Tile range. - * @return {boolean} Contains. - */ -TileRange.prototype.containsTileRange = function containsTileRange (tileRange) { - return this.minX <= tileRange.minX && tileRange.maxX <= this.maxX && - this.minY <= tileRange.minY && tileRange.maxY <= this.maxY; -}; - -/** - * @param {number} x Tile coordinate x. - * @param {number} y Tile coordinate y. - * @return {boolean} Contains coordinate. - */ -TileRange.prototype.containsXY = function containsXY (x, y) { - return this.minX <= x && x <= this.maxX && this.minY <= y && y <= this.maxY; -}; - -/** - * @param {TileRange} tileRange Tile range. - * @return {boolean} Equals. - */ -TileRange.prototype.equals = function equals (tileRange) { - return this.minX == tileRange.minX && this.minY == tileRange.minY && - this.maxX == tileRange.maxX && this.maxY == tileRange.maxY; -}; - -/** - * @param {TileRange} tileRange Tile range. - */ -TileRange.prototype.extend = function extend (tileRange) { - if (tileRange.minX < this.minX) { - this.minX = tileRange.minX; - } - if (tileRange.maxX > this.maxX) { - this.maxX = tileRange.maxX; - } - if (tileRange.minY < this.minY) { - this.minY = tileRange.minY; - } - if (tileRange.maxY > this.maxY) { - this.maxY = tileRange.maxY; - } -}; - -/** - * @return {number} Height. - */ -TileRange.prototype.getHeight = function getHeight () { - return this.maxY - this.minY + 1; -}; - -/** - * @return {import("./size.js").Size} Size. - */ -TileRange.prototype.getSize = function getSize () { - return [this.getWidth(), this.getHeight()]; -}; - -/** - * @return {number} Width. - */ -TileRange.prototype.getWidth = function getWidth () { - return this.maxX - this.minX + 1; -}; - -/** - * @param {TileRange} tileRange Tile range. - * @return {boolean} Intersects. - */ -TileRange.prototype.intersects = function intersects (tileRange) { - return this.minX <= tileRange.maxX && - this.maxX >= tileRange.minX && - this.minY <= tileRange.maxY && - this.maxY >= tileRange.minY; -}; /** - * @param {number} minX Minimum X. - * @param {number} maxX Maximum X. - * @param {number} minY Minimum Y. - * @param {number} maxY Maximum Y. - * @param {TileRange=} tileRange TileRange. - * @return {TileRange} Tile range. - */ -function createOrUpdate(minX, maxX, minY, maxY, tileRange) { - if (tileRange !== undefined) { - tileRange.minX = minX; - tileRange.maxX = maxX; - tileRange.minY = minY; - tileRange.maxY = maxY; - return tileRange; - } else { - return new TileRange(minX, maxX, minY, maxY); - } -} - - -/* harmony default export */ __webpack_exports__["b"] = (TileRange); - -//# sourceMappingURL=TileRange.js.map - -/***/ }), -/* 55 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * @module ol/Disposable + * @typedef {Object} Entry + * @property {number} minX + * @property {number} minY + * @property {number} maxX + * @property {number} maxY + * @property {Object} [value] */ /** * @classdesc - * Objects that need to clean up after themselves. + * Wrapper around the RBush by Vladimir Agafonkin. + * See https://github.com/mourner/rbush. + * + * @template T */ -var Disposable = function Disposable() { +var RBush = function RBush(opt_maxEntries) { + /** - * The object has already been disposed. - * @type {boolean} * @private */ - this.disposed_ = false; + this.rbush_ = rbush__WEBPACK_IMPORTED_MODULE_1___default()(opt_maxEntries, undefined); + + /** + * A mapping between the objects added to this rbush wrapper + * and the objects that are actually added to the internal rbush. + * @private + * @type {Object} + */ + this.items_ = {}; + }; /** - * Clean up. + * Insert a value into the RBush. + * @param {import("../extent.js").Extent} extent Extent. + * @param {T} value Value. */ -Disposable.prototype.dispose = function dispose () { - if (!this.disposed_) { - this.disposed_ = true; - this.disposeInternal(); +RBush.prototype.insert = function insert (extent, value) { + /** @type {Entry} */ + var item = { + minX: extent[0], + minY: extent[1], + maxX: extent[2], + maxY: extent[3], + value: value + }; + + this.rbush_.insert(item); + this.items_[Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* getUid */ "c"])(value)] = item; +}; + + +/** + * Bulk-insert values into the RBush. + * @param {Array} extents Extents. + * @param {Array} values Values. + */ +RBush.prototype.load = function load (extents, values) { + var items = new Array(values.length); + for (var i = 0, l = values.length; i < l; i++) { + var extent = extents[i]; + var value = values[i]; + + /** @type {Entry} */ + var item = { + minX: extent[0], + minY: extent[1], + maxX: extent[2], + maxY: extent[3], + value: value + }; + items[i] = item; + this.items_[Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* getUid */ "c"])(value)] = item; + } + this.rbush_.load(items); +}; + + +/** + * Remove a value from the RBush. + * @param {T} value Value. + * @return {boolean} Removed. + */ +RBush.prototype.remove = function remove (value) { + var uid = Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* getUid */ "c"])(value); + + // get the object in which the value was wrapped when adding to the + // internal rbush. then use that object to do the removal. + var item = this.items_[uid]; + delete this.items_[uid]; + return this.rbush_.remove(item) !== null; +}; + + +/** + * Update the extent of a value in the RBush. + * @param {import("../extent.js").Extent} extent Extent. + * @param {T} value Value. + */ +RBush.prototype.update = function update (extent, value) { + var item = this.items_[Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* getUid */ "c"])(value)]; + var bbox = [item.minX, item.minY, item.maxX, item.maxY]; + if (!Object(_extent_js__WEBPACK_IMPORTED_MODULE_2__[/* equals */ "p"])(bbox, extent)) { + this.remove(value); + this.insert(extent, value); } }; + /** - * Extension point for disposable objects. - * @protected + * Return all values in the RBush. + * @return {Array} All. */ -Disposable.prototype.disposeInternal = function disposeInternal () {}; +RBush.prototype.getAll = function getAll () { + var items = this.rbush_.all(); + return items.map(function(item) { + return item.value; + }); +}; -/* harmony default export */ __webpack_exports__["a"] = (Disposable); -//# sourceMappingURL=Disposable.js.map +/** + * Return all values in the given extent. + * @param {import("../extent.js").Extent} extent Extent. + * @return {Array} All in extent. + */ +RBush.prototype.getInExtent = function getInExtent (extent) { + /** @type {Entry} */ + var bbox = { + minX: extent[0], + minY: extent[1], + maxX: extent[2], + maxY: extent[3] + }; + var items = this.rbush_.search(bbox); + return items.map(function(item) { + return item.value; + }); +}; + + +/** + * Calls a callback function with each value in the tree. + * If the callback returns a truthy value, this value is returned without + * checking the rest of the tree. + * @param {function(this: S, T): *} callback Callback. + * @param {S=} opt_this The object to use as `this` in `callback`. + * @return {*} Callback return value. + * @template S + */ +RBush.prototype.forEach = function forEach (callback, opt_this) { + return this.forEach_(this.getAll(), callback, opt_this); +}; + + +/** + * Calls a callback function with each value in the provided extent. + * @param {import("../extent.js").Extent} extent Extent. + * @param {function(this: S, T): *} callback Callback. + * @param {S=} opt_this The object to use as `this` in `callback`. + * @return {*} Callback return value. + * @template S + */ +RBush.prototype.forEachInExtent = function forEachInExtent (extent, callback, opt_this) { + return this.forEach_(this.getInExtent(extent), callback, opt_this); +}; + + +/** + * @param {Array} values Values. + * @param {function(this: S, T): *} callback Callback. + * @param {S=} opt_this The object to use as `this` in `callback`. + * @private + * @return {*} Callback return value. + * @template S + */ +RBush.prototype.forEach_ = function forEach_ (values, callback, opt_this) { + var result; + for (var i = 0, l = values.length; i < l; i++) { + result = callback.call(opt_this, values[i]); + if (result) { + return result; + } + } + return result; +}; + + +/** + * @return {boolean} Is empty. + */ +RBush.prototype.isEmpty = function isEmpty$1 () { + return Object(_obj_js__WEBPACK_IMPORTED_MODULE_3__[/* isEmpty */ "d"])(this.items_); +}; + + +/** + * Remove all values from the RBush. + */ +RBush.prototype.clear = function clear () { + this.rbush_.clear(); + this.items_ = {}; +}; + + +/** + * @param {import("../extent.js").Extent=} opt_extent Extent. + * @return {import("../extent.js").Extent} Extent. + */ +RBush.prototype.getExtent = function getExtent (opt_extent) { + var data = this.rbush_.toJSON(); + return Object(_extent_js__WEBPACK_IMPORTED_MODULE_2__[/* createOrUpdate */ "k"])(data.minX, data.minY, data.maxX, data.maxY, opt_extent); +}; + + +/** + * @param {RBush} rbush R-Tree. + */ +RBush.prototype.concat = function concat (rbush) { + this.rbush_.load(rbush.rbush_.all()); + for (var i in rbush.items_) { + this.items_[i] = rbush.items_[i]; + } +}; + + +/* harmony default export */ __webpack_exports__["a"] = (RBush); + +//# sourceMappingURL=RBush.js.map /***/ }), -/* 56 */ +/* 68 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return linearRing; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return linearRings; }); +/* unused harmony export linearRingss */ +/** + * @module ol/geom/flat/area + */ + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @return {number} Area. + */ +function linearRing(flatCoordinates, offset, end, stride) { + var twiceArea = 0; + var x1 = flatCoordinates[end - stride]; + var y1 = flatCoordinates[end - stride + 1]; + for (; offset < end; offset += stride) { + var x2 = flatCoordinates[offset]; + var y2 = flatCoordinates[offset + 1]; + twiceArea += y1 * x2 - x1 * y2; + x1 = x2; + y1 = y2; + } + return twiceArea / 2; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array} ends Ends. + * @param {number} stride Stride. + * @return {number} Area. + */ +function linearRings(flatCoordinates, offset, ends, stride) { + var area = 0; + for (var i = 0, ii = ends.length; i < ii; ++i) { + var end = ends[i]; + area += linearRing(flatCoordinates, offset, end, stride); + offset = end; + } + return area; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array>} endss Endss. + * @param {number} stride Stride. + * @return {number} Area. + */ +function linearRingss(flatCoordinates, offset, endss, stride) { + var area = 0; + for (var i = 0, ii = endss.length; i < ii; ++i) { + var ends = endss[i]; + area += linearRings(flatCoordinates, offset, ends, stride); + offset = ends[ends.length - 1]; + } + return area; +} + +//# sourceMappingURL=area.js.map + +/***/ }), +/* 69 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); +/* harmony import */ var _events_Target_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45); +/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7); +/** + * @module ol/structs/LRUCache + */ + + + + + + +/** + * @typedef {Object} Entry + * @property {string} key_ + * @property {Object} newer + * @property {Object} older + * @property {*} value_ + */ + + +/** + * @classdesc + * Implements a Least-Recently-Used cache where the keys do not conflict with + * Object's properties (e.g. 'hasOwnProperty' is not allowed as a key). Expiring + * items from the cache is the responsibility of the user. + * + * @fires import("../events/Event.js").Event + * @template T + */ +var LRUCache = /*@__PURE__*/(function (EventTarget) { + function LRUCache(opt_highWaterMark) { + + EventTarget.call(this); + + /** + * @type {number} + */ + this.highWaterMark = opt_highWaterMark !== undefined ? opt_highWaterMark : 2048; + + /** + * @private + * @type {number} + */ + this.count_ = 0; + + /** + * @private + * @type {!Object} + */ + this.entries_ = {}; + + /** + * @private + * @type {?Entry} + */ + this.oldest_ = null; + + /** + * @private + * @type {?Entry} + */ + this.newest_ = null; + + } + + if ( EventTarget ) LRUCache.__proto__ = EventTarget; + LRUCache.prototype = Object.create( EventTarget && EventTarget.prototype ); + LRUCache.prototype.constructor = LRUCache; + + + /** + * @return {boolean} Can expire cache. + */ + LRUCache.prototype.canExpireCache = function canExpireCache () { + return this.getCount() > this.highWaterMark; + }; + + + /** + * FIXME empty description for jsdoc + */ + LRUCache.prototype.clear = function clear () { + this.count_ = 0; + this.entries_ = {}; + this.oldest_ = null; + this.newest_ = null; + this.dispatchEvent(_events_EventType_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].CLEAR); + }; + + + /** + * @param {string} key Key. + * @return {boolean} Contains key. + */ + LRUCache.prototype.containsKey = function containsKey (key) { + return this.entries_.hasOwnProperty(key); + }; + + + /** + * @param {function(this: S, T, string, LRUCache): ?} f The function + * to call for every entry from the oldest to the newer. This function takes + * 3 arguments (the entry value, the entry key and the LRUCache object). + * The return value is ignored. + * @param {S=} opt_this The object to use as `this` in `f`. + * @template S + */ + LRUCache.prototype.forEach = function forEach (f, opt_this) { + var entry = this.oldest_; + while (entry) { + f.call(opt_this, entry.value_, entry.key_, this); + entry = entry.newer; + } + }; + + + /** + * @param {string} key Key. + * @return {T} Value. + */ + LRUCache.prototype.get = function get (key) { + var entry = this.entries_[key]; + Object(_asserts_js__WEBPACK_IMPORTED_MODULE_0__[/* assert */ "a"])(entry !== undefined, + 15); // Tried to get a value for a key that does not exist in the cache + if (entry === this.newest_) { + return entry.value_; + } else if (entry === this.oldest_) { + this.oldest_ = /** @type {Entry} */ (this.oldest_.newer); + this.oldest_.older = null; + } else { + entry.newer.older = entry.older; + entry.older.newer = entry.newer; + } + entry.newer = null; + entry.older = this.newest_; + this.newest_.newer = entry; + this.newest_ = entry; + return entry.value_; + }; + + + /** + * Remove an entry from the cache. + * @param {string} key The entry key. + * @return {T} The removed entry. + */ + LRUCache.prototype.remove = function remove (key) { + var entry = this.entries_[key]; + Object(_asserts_js__WEBPACK_IMPORTED_MODULE_0__[/* assert */ "a"])(entry !== undefined, 15); // Tried to get a value for a key that does not exist in the cache + if (entry === this.newest_) { + this.newest_ = /** @type {Entry} */ (entry.older); + if (this.newest_) { + this.newest_.newer = null; + } + } else if (entry === this.oldest_) { + this.oldest_ = /** @type {Entry} */ (entry.newer); + if (this.oldest_) { + this.oldest_.older = null; + } + } else { + entry.newer.older = entry.older; + entry.older.newer = entry.newer; + } + delete this.entries_[key]; + --this.count_; + return entry.value_; + }; + + + /** + * @return {number} Count. + */ + LRUCache.prototype.getCount = function getCount () { + return this.count_; + }; + + + /** + * @return {Array} Keys. + */ + LRUCache.prototype.getKeys = function getKeys () { + var keys = new Array(this.count_); + var i = 0; + var entry; + for (entry = this.newest_; entry; entry = entry.older) { + keys[i++] = entry.key_; + } + return keys; + }; + + + /** + * @return {Array} Values. + */ + LRUCache.prototype.getValues = function getValues () { + var values = new Array(this.count_); + var i = 0; + var entry; + for (entry = this.newest_; entry; entry = entry.older) { + values[i++] = entry.value_; + } + return values; + }; + + + /** + * @return {T} Last value. + */ + LRUCache.prototype.peekLast = function peekLast () { + return this.oldest_.value_; + }; + + + /** + * @return {string} Last key. + */ + LRUCache.prototype.peekLastKey = function peekLastKey () { + return this.oldest_.key_; + }; + + + /** + * Get the key of the newest item in the cache. Throws if the cache is empty. + * @return {string} The newest key. + */ + LRUCache.prototype.peekFirstKey = function peekFirstKey () { + return this.newest_.key_; + }; + + + /** + * @return {T} value Value. + */ + LRUCache.prototype.pop = function pop () { + var entry = this.oldest_; + delete this.entries_[entry.key_]; + if (entry.newer) { + entry.newer.older = null; + } + this.oldest_ = /** @type {Entry} */ (entry.newer); + if (!this.oldest_) { + this.newest_ = null; + } + --this.count_; + return entry.value_; + }; + + + /** + * @param {string} key Key. + * @param {T} value Value. + */ + LRUCache.prototype.replace = function replace (key, value) { + this.get(key); // update `newest_` + this.entries_[key].value_ = value; + }; + + + /** + * @param {string} key Key. + * @param {T} value Value. + */ + LRUCache.prototype.set = function set (key, value) { + Object(_asserts_js__WEBPACK_IMPORTED_MODULE_0__[/* assert */ "a"])(!(key in this.entries_), + 16); // Tried to set a value for a key that is used already + var entry = /** @type {Entry} */ ({ + key_: key, + newer: null, + older: this.newest_, + value_: value + }); + if (!this.newest_) { + this.oldest_ = entry; + } else { + this.newest_.newer = entry; + } + this.newest_ = entry; + this.entries_[key] = entry; + ++this.count_; + }; + + + /** + * Set a maximum number of entries for the cache. + * @param {number} size Cache size. + * @api + */ + LRUCache.prototype.setSize = function setSize (size) { + this.highWaterMark = size; + }; + + + /** + * Prune the cache. + */ + LRUCache.prototype.prune = function prune () { + while (this.canExpireCache()) { + this.pop(); + } + }; + + return LRUCache; +}(_events_Target_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])); + +/* harmony default export */ __webpack_exports__["a"] = (LRUCache); + +//# sourceMappingURL=LRUCache.js.map + +/***/ }), +/* 70 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -10516,7 +13325,7 @@ Disposable.prototype.disposeInternal = function disposeInternal () {}; module.exports = rbush; module.exports.default = rbush; -var quickselect = __webpack_require__(94); +var quickselect = __webpack_require__(117); function rbush(maxEntries, format) { if (!(this instanceof rbush)) return new rbush(maxEntries, format); @@ -11076,7 +13885,7 @@ function multiSelect(arr, left, right, n, compare) { /***/ }), -/* 57 */ +/* 71 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -11115,7 +13924,511 @@ function multiSelect(arr, left, right, n, compare) { //# sourceMappingURL=MapEventType.js.map /***/ }), -/* 58 */ +/* 72 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// EXTERNAL MODULE: ./node_modules/ol/util.js +var util = __webpack_require__(2); + +// EXTERNAL MODULE: ./node_modules/ol/Disposable.js +var ol_Disposable = __webpack_require__(56); + +// EXTERNAL MODULE: ./node_modules/ol/events.js +var events = __webpack_require__(3); + +// EXTERNAL MODULE: ./node_modules/ol/events/EventType.js +var EventType = __webpack_require__(7); + +// EXTERNAL MODULE: ./node_modules/ol/extent.js +var extent = __webpack_require__(0); + +// EXTERNAL MODULE: ./node_modules/ol/functions.js +var functions = __webpack_require__(17); + +// EXTERNAL MODULE: ./node_modules/ol/layer/Layer.js +var Layer = __webpack_require__(37); + +// EXTERNAL MODULE: ./node_modules/ol/color.js +var ol_color = __webpack_require__(33); + +// CONCATENATED MODULE: ./node_modules/ol/style/IconImageCache.js +/** + * @module ol/style/IconImageCache + */ + + +/** + * @classdesc + * Singleton class. Available through {@link module:ol/style/IconImageCache~shared}. + */ +var IconImageCache = function IconImageCache() { + + /** + * @type {!Object} + * @private + */ + this.cache_ = {}; + + /** + * @type {number} + * @private + */ + this.cacheSize_ = 0; + + /** + * @type {number} + * @private + */ + this.maxCacheSize_ = 32; +}; + +/** +* FIXME empty description for jsdoc +*/ +IconImageCache.prototype.clear = function clear () { + this.cache_ = {}; + this.cacheSize_ = 0; +}; + +/** +* FIXME empty description for jsdoc +*/ +IconImageCache.prototype.expire = function expire () { + if (this.cacheSize_ > this.maxCacheSize_) { + var i = 0; + for (var key in this.cache_) { + var iconImage = this.cache_[key]; + if ((i++ & 3) === 0 && !iconImage.hasListener()) { + delete this.cache_[key]; + --this.cacheSize_; + } + } + } +}; + +/** +* @param {string} src Src. +* @param {?string} crossOrigin Cross origin. +* @param {import("../color.js").Color} color Color. +* @return {import("./IconImage.js").default} Icon image. +*/ +IconImageCache.prototype.get = function get (src, crossOrigin, color) { + var key = getKey(src, crossOrigin, color); + return key in this.cache_ ? this.cache_[key] : null; +}; + +/** +* @param {string} src Src. +* @param {?string} crossOrigin Cross origin. +* @param {import("../color.js").Color} color Color. +* @param {import("./IconImage.js").default} iconImage Icon image. +*/ +IconImageCache.prototype.set = function set (src, crossOrigin, color, iconImage) { + var key = getKey(src, crossOrigin, color); + this.cache_[key] = iconImage; + ++this.cacheSize_; +}; + +/** +* Set the cache size of the icon cache. Default is `32`. Change this value when +* your map uses more than 32 different icon images and you are not caching icon +* styles on the application level. +* @param {number} maxCacheSize Cache max size. +* @api +*/ +IconImageCache.prototype.setSize = function setSize (maxCacheSize) { + this.maxCacheSize_ = maxCacheSize; + this.expire(); +}; + + +/** + * @param {string} src Src. + * @param {?string} crossOrigin Cross origin. + * @param {import("../color.js").Color} color Color. + * @return {string} Cache key. + */ +function getKey(src, crossOrigin, color) { + var colorString = color ? Object(ol_color["b" /* asString */])(color) : 'null'; + return crossOrigin + ':' + src + ':' + colorString; +} + + +/* harmony default export */ var style_IconImageCache = (IconImageCache); + + +/** + * The {@link module:ol/style/IconImageCache~IconImageCache} for + * {@link module:ol/style/Icon~Icon} images. + * @api + */ +var shared = new IconImageCache(); + +//# sourceMappingURL=IconImageCache.js.map +// EXTERNAL MODULE: ./node_modules/ol/transform.js +var transform = __webpack_require__(4); + +// CONCATENATED MODULE: ./node_modules/ol/renderer/Map.js +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return sortByZIndex; }); +/** + * @module ol/renderer/Map + */ + + + + + + + + + + +/** + * @abstract + */ +var Map_MapRenderer = /*@__PURE__*/(function (Disposable) { + function MapRenderer(map) { + Disposable.call(this); + + /** + * @private + * @type {import("../PluggableMap.js").default} + */ + this.map_ = map; + + /** + * @private + * @type {!Object} + */ + this.layerRenderers_ = {}; + + /** + * @private + * @type {Object} + */ + this.layerRendererListeners_ = {}; + + /** + * @private + * @type {Array} + */ + this.layerRendererConstructors_ = []; + + } + + if ( Disposable ) MapRenderer.__proto__ = Disposable; + MapRenderer.prototype = Object.create( Disposable && Disposable.prototype ); + MapRenderer.prototype.constructor = MapRenderer; + + /** + * @abstract + * @param {import("../render/EventType.js").default} type Event type. + * @param {import("../PluggableMap.js").FrameState} frameState Frame state. + */ + MapRenderer.prototype.dispatchRenderEvent = function dispatchRenderEvent (type, frameState) { + Object(util["b" /* abstract */])(); + }; + + /** + * Register layer renderer constructors. + * @param {Array} constructors Layer renderers. + */ + MapRenderer.prototype.registerLayerRenderers = function registerLayerRenderers (constructors) { + this.layerRendererConstructors_.push.apply(this.layerRendererConstructors_, constructors); + }; + + /** + * @param {import("../PluggableMap.js").FrameState} frameState FrameState. + * @protected + */ + MapRenderer.prototype.calculateMatrices2D = function calculateMatrices2D (frameState) { + var viewState = frameState.viewState; + var coordinateToPixelTransform = frameState.coordinateToPixelTransform; + var pixelToCoordinateTransform = frameState.pixelToCoordinateTransform; + + Object(transform["b" /* compose */])(coordinateToPixelTransform, + frameState.size[0] / 2, frameState.size[1] / 2, + 1 / viewState.resolution, -1 / viewState.resolution, + -viewState.rotation, + -viewState.center[0], -viewState.center[1]); + + Object(transform["d" /* invert */])( + Object(transform["i" /* setFromArray */])(pixelToCoordinateTransform, coordinateToPixelTransform)); + }; + + /** + * Removes all layer renderers. + */ + MapRenderer.prototype.removeLayerRenderers = function removeLayerRenderers () { + for (var key in this.layerRenderers_) { + this.removeLayerRendererByKey_(key).dispose(); + } + }; + + /** + * @param {import("../coordinate.js").Coordinate} coordinate Coordinate. + * @param {import("../PluggableMap.js").FrameState} frameState FrameState. + * @param {number} hitTolerance Hit tolerance in pixels. + * @param {function(this: S, import("../Feature.js").FeatureLike, + * import("../layer/Layer.js").default): T} callback Feature callback. + * @param {S} thisArg Value to use as `this` when executing `callback`. + * @param {function(this: U, import("../layer/Layer.js").default): boolean} layerFilter Layer filter + * function, only layers which are visible and for which this function + * returns `true` will be tested for features. By default, all visible + * layers will be tested. + * @param {U} thisArg2 Value to use as `this` when executing `layerFilter`. + * @return {T|undefined} Callback result. + * @template S,T,U + */ + MapRenderer.prototype.forEachFeatureAtCoordinate = function forEachFeatureAtCoordinate ( + coordinate, + frameState, + hitTolerance, + callback, + thisArg, + layerFilter, + thisArg2 + ) { + var result; + var viewState = frameState.viewState; + var viewResolution = viewState.resolution; + + /** + * @param {import("../Feature.js").FeatureLike} feature Feature. + * @param {import("../layer/Layer.js").default} layer Layer. + * @return {?} Callback result. + */ + function forEachFeatureAtCoordinate(feature, layer) { + var managed = frameState.layerStates[Object(util["c" /* getUid */])(layer)].managed; + if (!(Object(util["c" /* getUid */])(feature) in frameState.skippedFeatureUids && !managed)) { + return callback.call(thisArg, feature, managed ? layer : null); + } + } + + var projection = viewState.projection; + + var translatedCoordinate = coordinate; + if (projection.canWrapX()) { + var projectionExtent = projection.getExtent(); + var worldWidth = Object(extent["E" /* getWidth */])(projectionExtent); + var x = coordinate[0]; + if (x < projectionExtent[0] || x > projectionExtent[2]) { + var worldsAway = Math.ceil((projectionExtent[0] - x) / worldWidth); + translatedCoordinate = [x + worldWidth * worldsAway, coordinate[1]]; + } + } + + var layerStates = frameState.layerStatesArray; + var numLayers = layerStates.length; + var i; + for (i = numLayers - 1; i >= 0; --i) { + var layerState = layerStates[i]; + var layer = layerState.layer; + if (Object(Layer["b" /* visibleAtResolution */])(layerState, viewResolution) && layerFilter.call(thisArg2, layer)) { + var layerRenderer = this.getLayerRenderer(layer); + var source = /** @type {import("../layer/Layer.js").default} */ (layer).getSource(); + if (source) { + result = layerRenderer.forEachFeatureAtCoordinate( + source.getWrapX() ? translatedCoordinate : coordinate, + frameState, hitTolerance, forEachFeatureAtCoordinate); + } + if (result) { + return result; + } + } + } + return undefined; + }; + + /** + * @abstract + * @param {import("../pixel.js").Pixel} pixel Pixel. + * @param {import("../PluggableMap.js").FrameState} frameState FrameState. + * @param {number} hitTolerance Hit tolerance in pixels. + * @param {function(this: S, import("../layer/Layer.js").default, (Uint8ClampedArray|Uint8Array)): T} callback Layer + * callback. + * @param {S} thisArg Value to use as `this` when executing `callback`. + * @param {function(this: U, import("../layer/Layer.js").default): boolean} layerFilter Layer filter + * function, only layers which are visible and for which this function + * returns `true` will be tested for features. By default, all visible + * layers will be tested. + * @param {U} thisArg2 Value to use as `this` when executing `layerFilter`. + * @return {T|undefined} Callback result. + * @template S,T,U + */ + MapRenderer.prototype.forEachLayerAtPixel = function forEachLayerAtPixel (pixel, frameState, hitTolerance, callback, thisArg, layerFilter, thisArg2) { + return Object(util["b" /* abstract */])(); + }; + + /** + * @param {import("../coordinate.js").Coordinate} coordinate Coordinate. + * @param {import("../PluggableMap.js").FrameState} frameState FrameState. + * @param {number} hitTolerance Hit tolerance in pixels. + * @param {function(this: U, import("../layer/Layer.js").default): boolean} layerFilter Layer filter + * function, only layers which are visible and for which this function + * returns `true` will be tested for features. By default, all visible + * layers will be tested. + * @param {U} thisArg Value to use as `this` when executing `layerFilter`. + * @return {boolean} Is there a feature at the given coordinate? + * @template U + */ + MapRenderer.prototype.hasFeatureAtCoordinate = function hasFeatureAtCoordinate (coordinate, frameState, hitTolerance, layerFilter, thisArg) { + var hasFeature = this.forEachFeatureAtCoordinate( + coordinate, frameState, hitTolerance, functions["b" /* TRUE */], this, layerFilter, thisArg); + + return hasFeature !== undefined; + }; + + /** + * @param {import("../layer/Base.js").default} layer Layer. + * @protected + * @return {import("./Layer.js").default} Layer renderer. + */ + MapRenderer.prototype.getLayerRenderer = function getLayerRenderer (layer) { + var layerKey = Object(util["c" /* getUid */])(layer); + if (layerKey in this.layerRenderers_) { + return this.layerRenderers_[layerKey]; + } else { + var renderer; + for (var i = 0, ii = this.layerRendererConstructors_.length; i < ii; ++i) { + var candidate = this.layerRendererConstructors_[i]; + if (candidate['handles'](layer)) { + renderer = candidate['create'](this, layer); + break; + } + } + if (renderer) { + this.layerRenderers_[layerKey] = renderer; + this.layerRendererListeners_[layerKey] = Object(events["a" /* listen */])(renderer, + EventType["a" /* default */].CHANGE, this.handleLayerRendererChange_, this); + } else { + throw new Error('Unable to create renderer for layer: ' + layer.getType()); + } + return renderer; + } + }; + + /** + * @param {string} layerKey Layer key. + * @protected + * @return {import("./Layer.js").default} Layer renderer. + */ + MapRenderer.prototype.getLayerRendererByKey = function getLayerRendererByKey (layerKey) { + return this.layerRenderers_[layerKey]; + }; + + /** + * @protected + * @return {Object} Layer renderers. + */ + MapRenderer.prototype.getLayerRenderers = function getLayerRenderers () { + return this.layerRenderers_; + }; + + /** + * @return {import("../PluggableMap.js").default} Map. + */ + MapRenderer.prototype.getMap = function getMap () { + return this.map_; + }; + + /** + * Handle changes in a layer renderer. + * @private + */ + MapRenderer.prototype.handleLayerRendererChange_ = function handleLayerRendererChange_ () { + this.map_.render(); + }; + + /** + * @param {string} layerKey Layer key. + * @return {import("./Layer.js").default} Layer renderer. + * @private + */ + MapRenderer.prototype.removeLayerRendererByKey_ = function removeLayerRendererByKey_ (layerKey) { + var layerRenderer = this.layerRenderers_[layerKey]; + delete this.layerRenderers_[layerKey]; + + Object(events["e" /* unlistenByKey */])(this.layerRendererListeners_[layerKey]); + delete this.layerRendererListeners_[layerKey]; + + return layerRenderer; + }; + + /** + * @param {import("../PluggableMap.js").default} map Map. + * @param {import("../PluggableMap.js").FrameState} frameState Frame state. + * @private + */ + MapRenderer.prototype.removeUnusedLayerRenderers_ = function removeUnusedLayerRenderers_ (map, frameState) { + for (var layerKey in this.layerRenderers_) { + if (!frameState || !(layerKey in frameState.layerStates)) { + this.removeLayerRendererByKey_(layerKey).dispose(); + } + } + }; + + /** + * Render. + * @abstract + * @param {?import("../PluggableMap.js").FrameState} frameState Frame state. + */ + MapRenderer.prototype.renderFrame = function renderFrame (frameState) { + Object(util["b" /* abstract */])(); + }; + + /** + * @param {import("../PluggableMap.js").FrameState} frameState Frame state. + * @protected + */ + MapRenderer.prototype.scheduleExpireIconCache = function scheduleExpireIconCache (frameState) { + frameState.postRenderFunctions.push(/** @type {import("../PluggableMap.js").PostRenderFunction} */ (expireIconCache)); + }; + + /** + * @param {!import("../PluggableMap.js").FrameState} frameState Frame state. + * @protected + */ + MapRenderer.prototype.scheduleRemoveUnusedLayerRenderers = function scheduleRemoveUnusedLayerRenderers (frameState) { + for (var layerKey in this.layerRenderers_) { + if (!(layerKey in frameState.layerStates)) { + frameState.postRenderFunctions.push( + /** @type {import("../PluggableMap.js").PostRenderFunction} */ (this.removeUnusedLayerRenderers_.bind(this)) + ); + return; + } + } + }; + + return MapRenderer; +}(ol_Disposable["a" /* default */])); + + +/** + * @param {import("../PluggableMap.js").default} map Map. + * @param {import("../PluggableMap.js").FrameState} frameState Frame state. + */ +function expireIconCache(map, frameState) { + shared.expire(); +} + + +/** + * @param {import("../layer/Layer.js").State} state1 First layer state. + * @param {import("../layer/Layer.js").State} state2 Second layer state. + * @return {number} The zIndex difference. + */ +function sortByZIndex(state1, state2) { + return state1.zIndex - state2.zIndex; +} +/* harmony default export */ var Map = __webpack_exports__["a"] = (Map_MapRenderer); + +//# sourceMappingURL=Map.js.map + +/***/ }), +/* 73 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -11185,7 +14498,7 @@ function tile(tileGrid) { //# sourceMappingURL=loadingstrategy.js.map /***/ }), -/* 59 */ +/* 74 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -11194,7 +14507,7 @@ function tile(tileGrid) { /* unused harmony export getLength */ /* unused harmony export getArea */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return offset; }); -/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6); +/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); /* harmony import */ var _geom_GeometryType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); /** * @license @@ -11241,10 +14554,10 @@ var DEFAULT_RADIUS = 6371008.8; */ function getDistance(c1, c2, opt_radius) { var radius = opt_radius || DEFAULT_RADIUS; - var lat1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "i"])(c1[1]); - var lat2 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "i"])(c2[1]); + var lat1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "j"])(c1[1]); + var lat2 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "j"])(c2[1]); var deltaLatBy2 = (lat2 - lat1) / 2; - var deltaLonBy2 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "i"])(c2[0] - c1[0]) / 2; + var deltaLonBy2 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "j"])(c2[0] - c1[0]) / 2; var a = Math.sin(deltaLatBy2) * Math.sin(deltaLatBy2) + Math.sin(deltaLonBy2) * Math.sin(deltaLonBy2) * Math.cos(lat1) * Math.cos(lat2); @@ -11355,9 +14668,9 @@ function getAreaInternal(coordinates, radius) { for (var i = 0; i < len; i++) { var x2 = coordinates[i][0]; var y2 = coordinates[i][1]; - area += Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "i"])(x2 - x1) * - (2 + Math.sin(Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "i"])(y1)) + - Math.sin(Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "i"])(y2))); + area += Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "j"])(x2 - x1) * + (2 + Math.sin(Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "j"])(y1)) + + Math.sin(Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "j"])(y2))); x1 = x2; y1 = y2; } @@ -11440,8 +14753,8 @@ function getArea(geometry, opt_options) { */ function offset(c1, distance, bearing, opt_radius) { var radius = opt_radius || DEFAULT_RADIUS; - var lat1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "i"])(c1[1]); - var lon1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "i"])(c1[0]); + var lat1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "j"])(c1[1]); + var lon1 = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "j"])(c1[0]); var dByR = distance / radius; var lat = Math.asin( Math.sin(lat1) * Math.cos(dByR) + @@ -11449,17 +14762,374 @@ function offset(c1, distance, bearing, opt_radius) { var lon = lon1 + Math.atan2( Math.sin(bearing) * Math.sin(dByR) * Math.cos(lat1), Math.cos(dByR) - Math.sin(lat1) * Math.sin(lat)); - return [Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toDegrees */ "h"])(lon), Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toDegrees */ "h"])(lat)]; + return [Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toDegrees */ "i"])(lon), Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toDegrees */ "i"])(lat)]; } //# sourceMappingURL=sphere.js.map /***/ }), -/* 60 */ +/* 75 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TileSourceEvent; }); +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var _TileCache_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(84); +/* harmony import */ var _TileState_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8); +/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27); +/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(15); +/* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(41); +/* harmony import */ var _Source_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(85); +/* harmony import */ var _tilecoord_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(38); +/* harmony import */ var _tilegrid_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(61); +/** + * @module ol/source/Tile + */ + + + + + + + + + + +/** + * @typedef {Object} Options + * @property {import("./Source.js").AttributionLike} [attributions] + * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible. + * @property {number} [cacheSize] + * @property {boolean} [opaque] + * @property {number} [tilePixelRatio] + * @property {import("../proj.js").ProjectionLike} [projection] + * @property {import("./State.js").default} [state] + * @property {import("../tilegrid/TileGrid.js").default} [tileGrid] + * @property {boolean} [wrapX=true] + * @property {number} [transition] + * @property {string} [key] + */ + + +/** + * @classdesc + * Abstract base class; normally only used for creating subclasses and not + * instantiated in apps. + * Base class for sources providing images divided into a tile grid. + * @abstract + * @api + */ +var TileSource = /*@__PURE__*/(function (Source) { + function TileSource(options) { + + Source.call(this, { + attributions: options.attributions, + attributionsCollapsible: options.attributionsCollapsible, + projection: options.projection, + state: options.state, + wrapX: options.wrapX + }); + + /** + * @private + * @type {boolean} + */ + this.opaque_ = options.opaque !== undefined ? options.opaque : false; + + /** + * @private + * @type {number} + */ + this.tilePixelRatio_ = options.tilePixelRatio !== undefined ? + options.tilePixelRatio : 1; + + /** + * @protected + * @type {import("../tilegrid/TileGrid.js").default} + */ + this.tileGrid = options.tileGrid !== undefined ? options.tileGrid : null; + + /** + * @protected + * @type {import("../TileCache.js").default} + */ + this.tileCache = new _TileCache_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"](options.cacheSize); + + /** + * @protected + * @type {import("../size.js").Size} + */ + this.tmpSize = [0, 0]; + + /** + * @private + * @type {string} + */ + this.key_ = options.key || ''; + + /** + * @protected + * @type {import("../Tile.js").Options} + */ + this.tileOptions = {transition: options.transition}; + + } + + if ( Source ) TileSource.__proto__ = Source; + TileSource.prototype = Object.create( Source && Source.prototype ); + TileSource.prototype.constructor = TileSource; + + /** + * @return {boolean} Can expire cache. + */ + TileSource.prototype.canExpireCache = function canExpireCache () { + return this.tileCache.canExpireCache(); + }; + + /** + * @param {import("../proj/Projection.js").default} projection Projection. + * @param {!Object} usedTiles Used tiles. + */ + TileSource.prototype.expireCache = function expireCache (projection, usedTiles) { + var tileCache = this.getTileCacheForProjection(projection); + if (tileCache) { + tileCache.expireCache(usedTiles); + } + }; + + /** + * @param {import("../proj/Projection.js").default} projection Projection. + * @param {number} z Zoom level. + * @param {import("../TileRange.js").default} tileRange Tile range. + * @param {function(import("../Tile.js").default):(boolean|void)} callback Called with each + * loaded tile. If the callback returns `false`, the tile will not be + * considered loaded. + * @return {boolean} The tile range is fully covered with loaded tiles. + */ + TileSource.prototype.forEachLoadedTile = function forEachLoadedTile (projection, z, tileRange, callback) { + var tileCache = this.getTileCacheForProjection(projection); + if (!tileCache) { + return false; + } + + var covered = true; + var tile, tileCoordKey, loaded; + for (var x = tileRange.minX; x <= tileRange.maxX; ++x) { + for (var y = tileRange.minY; y <= tileRange.maxY; ++y) { + tileCoordKey = Object(_tilecoord_js__WEBPACK_IMPORTED_MODULE_7__[/* getKeyZXY */ "d"])(z, x, y); + loaded = false; + if (tileCache.containsKey(tileCoordKey)) { + tile = /** @type {!import("../Tile.js").default} */ (tileCache.get(tileCoordKey)); + loaded = tile.getState() === _TileState_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].LOADED; + if (loaded) { + loaded = (callback(tile) !== false); + } + } + if (!loaded) { + covered = false; + } + } + } + return covered; + }; + + /** + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {number} Gutter. + */ + TileSource.prototype.getGutterForProjection = function getGutterForProjection (projection) { + return 0; + }; + + /** + * Return the key to be used for all tiles in the source. + * @return {string} The key for all tiles. + * @protected + */ + TileSource.prototype.getKey = function getKey () { + return this.key_; + }; + + /** + * Set the value to be used as the key for all tiles in the source. + * @param {string} key The key for tiles. + * @protected + */ + TileSource.prototype.setKey = function setKey (key) { + if (this.key_ !== key) { + this.key_ = key; + this.changed(); + } + }; + + /** + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {boolean} Opaque. + */ + TileSource.prototype.getOpaque = function getOpaque (projection) { + return this.opaque_; + }; + + /** + * @inheritDoc + */ + TileSource.prototype.getResolutions = function getResolutions () { + return this.tileGrid.getResolutions(); + }; + + /** + * @abstract + * @param {number} z Tile coordinate z. + * @param {number} x Tile coordinate x. + * @param {number} y Tile coordinate y. + * @param {number} pixelRatio Pixel ratio. + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {!import("../Tile.js").default} Tile. + */ + TileSource.prototype.getTile = function getTile (z, x, y, pixelRatio, projection) { + return Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* abstract */ "b"])(); + }; + + /** + * Return the tile grid of the tile source. + * @return {import("../tilegrid/TileGrid.js").default} Tile grid. + * @api + */ + TileSource.prototype.getTileGrid = function getTileGrid () { + return this.tileGrid; + }; + + /** + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {!import("../tilegrid/TileGrid.js").default} Tile grid. + */ + TileSource.prototype.getTileGridForProjection = function getTileGridForProjection$1 (projection) { + if (!this.tileGrid) { + return Object(_tilegrid_js__WEBPACK_IMPORTED_MODULE_8__[/* getForProjection */ "c"])(projection); + } else { + return this.tileGrid; + } + }; + + /** + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {import("../TileCache.js").default} Tile cache. + * @protected + */ + TileSource.prototype.getTileCacheForProjection = function getTileCacheForProjection (projection) { + var thisProj = this.getProjection(); + if (thisProj && !Object(_proj_js__WEBPACK_IMPORTED_MODULE_4__[/* equivalent */ "c"])(thisProj, projection)) { + return null; + } else { + return this.tileCache; + } + }; + + /** + * Get the tile pixel ratio for this source. Subclasses may override this + * method, which is meant to return a supported pixel ratio that matches the + * provided `pixelRatio` as close as possible. + * @param {number} pixelRatio Pixel ratio. + * @return {number} Tile pixel ratio. + */ + TileSource.prototype.getTilePixelRatio = function getTilePixelRatio (pixelRatio) { + return this.tilePixelRatio_; + }; + + /** + * @param {number} z Z. + * @param {number} pixelRatio Pixel ratio. + * @param {import("../proj/Projection.js").default} projection Projection. + * @return {import("../size.js").Size} Tile size. + */ + TileSource.prototype.getTilePixelSize = function getTilePixelSize (z, pixelRatio, projection) { + var tileGrid = this.getTileGridForProjection(projection); + var tilePixelRatio = this.getTilePixelRatio(pixelRatio); + var tileSize = Object(_size_js__WEBPACK_IMPORTED_MODULE_5__[/* toSize */ "c"])(tileGrid.getTileSize(z), this.tmpSize); + if (tilePixelRatio == 1) { + return tileSize; + } else { + return Object(_size_js__WEBPACK_IMPORTED_MODULE_5__[/* scale */ "b"])(tileSize, tilePixelRatio, this.tmpSize); + } + }; + + /** + * Returns a tile coordinate wrapped around the x-axis. When the tile coordinate + * is outside the resolution and extent range of the tile grid, `null` will be + * returned. + * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. + * @param {import("../proj/Projection.js").default=} opt_projection Projection. + * @return {import("../tilecoord.js").TileCoord} Tile coordinate to be passed to the tileUrlFunction or + * null if no tile URL should be created for the passed `tileCoord`. + */ + TileSource.prototype.getTileCoordForTileUrlFunction = function getTileCoordForTileUrlFunction (tileCoord, opt_projection) { + var projection = opt_projection !== undefined ? + opt_projection : this.getProjection(); + var tileGrid = this.getTileGridForProjection(projection); + if (this.getWrapX() && projection.isGlobal()) { + tileCoord = Object(_tilegrid_js__WEBPACK_IMPORTED_MODULE_8__[/* wrapX */ "d"])(tileGrid, tileCoord, projection); + } + return Object(_tilecoord_js__WEBPACK_IMPORTED_MODULE_7__[/* withinExtentAndZ */ "f"])(tileCoord, tileGrid) ? tileCoord : null; + }; + + /** + * @inheritDoc + */ + TileSource.prototype.refresh = function refresh () { + this.tileCache.clear(); + this.changed(); + }; + + /** + * Marks a tile coord as being used, without triggering a load. + * @abstract + * @param {number} z Tile coordinate z. + * @param {number} x Tile coordinate x. + * @param {number} y Tile coordinate y. + * @param {import("../proj/Projection.js").default} projection Projection. + */ + TileSource.prototype.useTile = function useTile (z, x, y, projection) {}; + + return TileSource; +}(_Source_js__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])); + + +/** + * @classdesc + * Events emitted by {@link module:ol/source/Tile~TileSource} instances are instances of this + * type. + */ +var TileSourceEvent = /*@__PURE__*/(function (Event) { + function TileSourceEvent(type, tile) { + + Event.call(this, type); + + /** + * The tile related to the event. + * @type {import("../Tile.js").default} + * @api + */ + this.tile = tile; + + } + + if ( Event ) TileSourceEvent.__proto__ = Event; + TileSourceEvent.prototype = Object.create( Event && Event.prototype ); + TileSourceEvent.prototype.constructor = TileSourceEvent; + + return TileSourceEvent; +}(_events_Event_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])); + +/* harmony default export */ __webpack_exports__["b"] = (TileSource); + +//# sourceMappingURL=Tile.js.map + +/***/ }), +/* 76 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); /** * @module ol/AssertionError */ @@ -11509,351 +15179,14 @@ var AssertionError = /*@__PURE__*/(function (Error) { //# sourceMappingURL=AssertionError.js.map /***/ }), -/* 61 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10); -/* harmony import */ var _events_Target_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36); -/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4); -/** - * @module ol/structs/LRUCache - */ - - - - - - -/** - * @typedef {Object} Entry - * @property {string} key_ - * @property {Object} newer - * @property {Object} older - * @property {*} value_ - */ - - -/** - * @classdesc - * Implements a Least-Recently-Used cache where the keys do not conflict with - * Object's properties (e.g. 'hasOwnProperty' is not allowed as a key). Expiring - * items from the cache is the responsibility of the user. - * - * @fires import("../events/Event.js").Event - * @template T - */ -var LRUCache = /*@__PURE__*/(function (EventTarget) { - function LRUCache(opt_highWaterMark) { - - EventTarget.call(this); - - /** - * @type {number} - */ - this.highWaterMark = opt_highWaterMark !== undefined ? opt_highWaterMark : 2048; - - /** - * @private - * @type {number} - */ - this.count_ = 0; - - /** - * @private - * @type {!Object} - */ - this.entries_ = {}; - - /** - * @private - * @type {?Entry} - */ - this.oldest_ = null; - - /** - * @private - * @type {?Entry} - */ - this.newest_ = null; - - } - - if ( EventTarget ) LRUCache.__proto__ = EventTarget; - LRUCache.prototype = Object.create( EventTarget && EventTarget.prototype ); - LRUCache.prototype.constructor = LRUCache; - - - /** - * @return {boolean} Can expire cache. - */ - LRUCache.prototype.canExpireCache = function canExpireCache () { - return this.getCount() > this.highWaterMark; - }; - - - /** - * FIXME empty description for jsdoc - */ - LRUCache.prototype.clear = function clear () { - this.count_ = 0; - this.entries_ = {}; - this.oldest_ = null; - this.newest_ = null; - this.dispatchEvent(_events_EventType_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].CLEAR); - }; - - - /** - * @param {string} key Key. - * @return {boolean} Contains key. - */ - LRUCache.prototype.containsKey = function containsKey (key) { - return this.entries_.hasOwnProperty(key); - }; - - - /** - * @param {function(this: S, T, string, LRUCache): ?} f The function - * to call for every entry from the oldest to the newer. This function takes - * 3 arguments (the entry value, the entry key and the LRUCache object). - * The return value is ignored. - * @param {S=} opt_this The object to use as `this` in `f`. - * @template S - */ - LRUCache.prototype.forEach = function forEach (f, opt_this) { - var entry = this.oldest_; - while (entry) { - f.call(opt_this, entry.value_, entry.key_, this); - entry = entry.newer; - } - }; - - - /** - * @param {string} key Key. - * @return {T} Value. - */ - LRUCache.prototype.get = function get (key) { - var entry = this.entries_[key]; - Object(_asserts_js__WEBPACK_IMPORTED_MODULE_0__[/* assert */ "a"])(entry !== undefined, - 15); // Tried to get a value for a key that does not exist in the cache - if (entry === this.newest_) { - return entry.value_; - } else if (entry === this.oldest_) { - this.oldest_ = /** @type {Entry} */ (this.oldest_.newer); - this.oldest_.older = null; - } else { - entry.newer.older = entry.older; - entry.older.newer = entry.newer; - } - entry.newer = null; - entry.older = this.newest_; - this.newest_.newer = entry; - this.newest_ = entry; - return entry.value_; - }; - - - /** - * Remove an entry from the cache. - * @param {string} key The entry key. - * @return {T} The removed entry. - */ - LRUCache.prototype.remove = function remove (key) { - var entry = this.entries_[key]; - Object(_asserts_js__WEBPACK_IMPORTED_MODULE_0__[/* assert */ "a"])(entry !== undefined, 15); // Tried to get a value for a key that does not exist in the cache - if (entry === this.newest_) { - this.newest_ = /** @type {Entry} */ (entry.older); - if (this.newest_) { - this.newest_.newer = null; - } - } else if (entry === this.oldest_) { - this.oldest_ = /** @type {Entry} */ (entry.newer); - if (this.oldest_) { - this.oldest_.older = null; - } - } else { - entry.newer.older = entry.older; - entry.older.newer = entry.newer; - } - delete this.entries_[key]; - --this.count_; - return entry.value_; - }; - - - /** - * @return {number} Count. - */ - LRUCache.prototype.getCount = function getCount () { - return this.count_; - }; - - - /** - * @return {Array} Keys. - */ - LRUCache.prototype.getKeys = function getKeys () { - var keys = new Array(this.count_); - var i = 0; - var entry; - for (entry = this.newest_; entry; entry = entry.older) { - keys[i++] = entry.key_; - } - return keys; - }; - - - /** - * @return {Array} Values. - */ - LRUCache.prototype.getValues = function getValues () { - var values = new Array(this.count_); - var i = 0; - var entry; - for (entry = this.newest_; entry; entry = entry.older) { - values[i++] = entry.value_; - } - return values; - }; - - - /** - * @return {T} Last value. - */ - LRUCache.prototype.peekLast = function peekLast () { - return this.oldest_.value_; - }; - - - /** - * @return {string} Last key. - */ - LRUCache.prototype.peekLastKey = function peekLastKey () { - return this.oldest_.key_; - }; - - - /** - * Get the key of the newest item in the cache. Throws if the cache is empty. - * @return {string} The newest key. - */ - LRUCache.prototype.peekFirstKey = function peekFirstKey () { - return this.newest_.key_; - }; - - - /** - * @return {T} value Value. - */ - LRUCache.prototype.pop = function pop () { - var entry = this.oldest_; - delete this.entries_[entry.key_]; - if (entry.newer) { - entry.newer.older = null; - } - this.oldest_ = /** @type {Entry} */ (entry.newer); - if (!this.oldest_) { - this.newest_ = null; - } - --this.count_; - return entry.value_; - }; - - - /** - * @param {string} key Key. - * @param {T} value Value. - */ - LRUCache.prototype.replace = function replace (key, value) { - this.get(key); // update `newest_` - this.entries_[key].value_ = value; - }; - - - /** - * @param {string} key Key. - * @param {T} value Value. - */ - LRUCache.prototype.set = function set (key, value) { - Object(_asserts_js__WEBPACK_IMPORTED_MODULE_0__[/* assert */ "a"])(!(key in this.entries_), - 16); // Tried to set a value for a key that is used already - var entry = /** @type {Entry} */ ({ - key_: key, - newer: null, - older: this.newest_, - value_: value - }); - if (!this.newest_) { - this.oldest_ = entry; - } else { - this.newest_.newer = entry; - } - this.newest_ = entry; - this.entries_[key] = entry; - ++this.count_; - }; - - - /** - * Set a maximum number of entries for the cache. - * @param {number} size Cache size. - * @api - */ - LRUCache.prototype.setSize = function setSize (size) { - this.highWaterMark = size; - }; - - - /** - * Prune the cache. - */ - LRUCache.prototype.prune = function prune () { - while (this.canExpireCache()) { - this.pop(); - } - }; - - return LRUCache; -}(_events_Target_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])); - -/* harmony default export */ __webpack_exports__["a"] = (LRUCache); - -//# sourceMappingURL=LRUCache.js.map - -/***/ }), -/* 62 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/** - * @module ol/style/TextPlacement - */ - -/** - * Text placement. One of `'point'`, `'line'`. Default is `'point'`. Note that - * `'line'` requires the underlying geometry to be a {@link module:ol/geom/LineString~LineString}, - * {@link module:ol/geom/Polygon~Polygon}, {@link module:ol/geom/MultiLineString~MultiLineString} or - * {@link module:ol/geom/MultiPolygon~MultiPolygon}. - * @enum {string} - */ -/* harmony default export */ __webpack_exports__["a"] = ({ - POINT: 'point', - LINE: 'line' -}); - -//# sourceMappingURL=TextPlacement.js.map - -/***/ }), -/* 63 */ +/* 77 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export unByKey */ -/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); -/* harmony import */ var _events_Target_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(36); -/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4); +/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony import */ var _events_Target_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45); +/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7); /** * @module ol/Observable */ @@ -11995,606 +15328,15 @@ function unByKey(key) { //# sourceMappingURL=Observable.js.map /***/ }), -/* 64 */ +/* 78 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); -/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13); -/* harmony import */ var _State_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37); -/** - * @module ol/source/Source - */ - - - - - - -/** - * A function that returns a string or an array of strings representing source - * attributions. - * - * @typedef {function(import("../PluggableMap.js").FrameState): (string|Array)} Attribution - */ - - -/** - * A type that can be used to provide attribution information for data sources. - * - * It represents either - * * a simple string (e.g. `'© Acme Inc.'`) - * * an array of simple strings (e.g. `['© Acme Inc.', '© Bacme Inc.']`) - * * a function that returns a string or array of strings (`{@link module:ol/source/Source~Attribution}`) - * - * @typedef {string|Array|Attribution} AttributionLike - */ - - -/** - * @typedef {Object} Options - * @property {AttributionLike} [attributions] - * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible. - * @property {import("../proj.js").ProjectionLike} projection - * @property {SourceState} [state='ready'] - * @property {boolean} [wrapX=false] - */ - - -/** - * @classdesc - * Abstract base class; normally only used for creating subclasses and not - * instantiated in apps. - * Base class for {@link module:ol/layer/Layer~Layer} sources. - * - * A generic `change` event is triggered when the state of the source changes. - * @abstract - * @api - */ -var Source = /*@__PURE__*/(function (BaseObject) { - function Source(options) { - - BaseObject.call(this); - - /** - * @private - * @type {import("../proj/Projection.js").default} - */ - this.projection_ = Object(_proj_js__WEBPACK_IMPORTED_MODULE_2__[/* get */ "e"])(options.projection); - - /** - * @private - * @type {?Attribution} - */ - this.attributions_ = adaptAttributions(options.attributions); - - /** - * @private - * @type {boolean} - */ - this.attributionsCollapsible_ = options.attributionsCollapsible !== undefined ? - options.attributionsCollapsible : true; - - /** - * This source is currently loading data. Sources that defer loading to the - * map's tile queue never set this to `true`. - * @type {boolean} - */ - this.loading = false; - - /** - * @private - * @type {SourceState} - */ - this.state_ = options.state !== undefined ? - options.state : _State_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].READY; - - /** - * @private - * @type {boolean} - */ - this.wrapX_ = options.wrapX !== undefined ? options.wrapX : false; - - } - - if ( BaseObject ) Source.__proto__ = BaseObject; - Source.prototype = Object.create( BaseObject && BaseObject.prototype ); - Source.prototype.constructor = Source; - - /** - * Get the attribution function for the source. - * @return {?Attribution} Attribution function. - */ - Source.prototype.getAttributions = function getAttributions () { - return this.attributions_; - }; - - /** - * @return {boolean} Aattributions are collapsible. - */ - Source.prototype.getAttributionsCollapsible = function getAttributionsCollapsible () { - return this.attributionsCollapsible_; - }; - - /** - * Get the projection of the source. - * @return {import("../proj/Projection.js").default} Projection. - * @api - */ - Source.prototype.getProjection = function getProjection () { - return this.projection_; - }; - - /** - * @abstract - * @return {Array|undefined} Resolutions. - */ - Source.prototype.getResolutions = function getResolutions () { - return Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* abstract */ "b"])(); - }; - - /** - * Get the state of the source, see {@link module:ol/source/State~State} for possible states. - * @return {SourceState} State. - * @api - */ - Source.prototype.getState = function getState () { - return this.state_; - }; - - /** - * @return {boolean|undefined} Wrap X. - */ - Source.prototype.getWrapX = function getWrapX () { - return this.wrapX_; - }; - - /** - * Refreshes the source and finally dispatches a 'change' event. - * @api - */ - Source.prototype.refresh = function refresh () { - this.changed(); - }; - - /** - * Set the attributions of the source. - * @param {AttributionLike|undefined} attributions Attributions. - * Can be passed as `string`, `Array`, `{@link module:ol/source/Source~Attribution}`, - * or `undefined`. - * @api - */ - Source.prototype.setAttributions = function setAttributions (attributions) { - this.attributions_ = adaptAttributions(attributions); - this.changed(); - }; - - /** - * Set the state of the source. - * @param {SourceState} state State. - * @protected - */ - Source.prototype.setState = function setState (state) { - this.state_ = state; - this.changed(); - }; - - return Source; -}(_Object_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])); - - -/** - * Turns the attributions option into an attributions function. - * @param {AttributionLike|undefined} attributionLike The attribution option. - * @return {?Attribution} An attribution function (or null). - */ -function adaptAttributions(attributionLike) { - if (!attributionLike) { - return null; - } - if (Array.isArray(attributionLike)) { - return function(frameState) { - return attributionLike; - }; - } - - if (typeof attributionLike === 'function') { - return attributionLike; - } - - return function(frameState) { - return [attributionLike]; - }; -} - - -/* harmony default export */ __webpack_exports__["a"] = (Source); - -//# sourceMappingURL=Source.js.map - -/***/ }), -/* 65 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); -/* harmony import */ var _GeometryType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); -/* harmony import */ var _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41); -/* harmony import */ var _flat_deflate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(48); -/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6); -/** - * @module ol/geom/Point - */ - - - - - - -/** - * @classdesc - * Point geometry. - * - * @api - */ -var Point = /*@__PURE__*/(function (SimpleGeometry) { - function Point(coordinates, opt_layout) { - SimpleGeometry.call(this); - this.setCoordinates(coordinates, opt_layout); - } - - if ( SimpleGeometry ) Point.__proto__ = SimpleGeometry; - Point.prototype = Object.create( SimpleGeometry && SimpleGeometry.prototype ); - Point.prototype.constructor = Point; - - /** - * Make a complete copy of the geometry. - * @return {!Point} Clone. - * @override - * @api - */ - Point.prototype.clone = function clone () { - var point = new Point(this.flatCoordinates.slice(), this.layout); - return point; - }; - - /** - * @inheritDoc - */ - Point.prototype.closestPointXY = function closestPointXY (x, y, closestPoint, minSquaredDistance) { - var flatCoordinates = this.flatCoordinates; - var squaredDistance = Object(_math_js__WEBPACK_IMPORTED_MODULE_4__[/* squaredDistance */ "f"])(x, y, flatCoordinates[0], flatCoordinates[1]); - if (squaredDistance < minSquaredDistance) { - var stride = this.stride; - for (var i = 0; i < stride; ++i) { - closestPoint[i] = flatCoordinates[i]; - } - closestPoint.length = stride; - return squaredDistance; - } else { - return minSquaredDistance; - } - }; - - /** - * Return the coordinate of the point. - * @return {import("../coordinate.js").Coordinate} Coordinates. - * @override - * @api - */ - Point.prototype.getCoordinates = function getCoordinates () { - return !this.flatCoordinates ? [] : this.flatCoordinates.slice(); - }; - - /** - * @inheritDoc - */ - Point.prototype.computeExtent = function computeExtent (extent) { - return Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* createOrUpdateFromCoordinate */ "m"])(this.flatCoordinates, extent); - }; - - /** - * @inheritDoc - * @api - */ - Point.prototype.getType = function getType () { - return _GeometryType_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].POINT; - }; - - /** - * @inheritDoc - * @api - */ - Point.prototype.intersectsExtent = function intersectsExtent (extent) { - return Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* containsXY */ "h"])(extent, this.flatCoordinates[0], this.flatCoordinates[1]); - }; - - /** - * @inheritDoc - * @api - */ - Point.prototype.setCoordinates = function setCoordinates (coordinates, opt_layout) { - this.setLayout(opt_layout, coordinates, 0); - if (!this.flatCoordinates) { - this.flatCoordinates = []; - } - this.flatCoordinates.length = Object(_flat_deflate_js__WEBPACK_IMPORTED_MODULE_3__[/* deflateCoordinate */ "a"])( - this.flatCoordinates, 0, coordinates, this.stride); - this.changed(); - }; - - return Point; -}(_SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])); - - -/* harmony default export */ __webpack_exports__["a"] = (Point); - -//# sourceMappingURL=Point.js.map - -/***/ }), -/* 66 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return intersectsLineString; }); -/* unused harmony export intersectsLineStringArray */ -/* unused harmony export intersectsLinearRing */ -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return intersectsLinearRingArray; }); -/* unused harmony export intersectsLinearRingMultiArray */ -/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); -/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(44); -/* harmony import */ var _segments_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(67); -/** - * @module ol/geom/flat/intersectsextent - */ - - - - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - * @param {import("../../extent.js").Extent} extent Extent. - * @return {boolean} True if the geometry and the extent intersect. - */ -function intersectsLineString(flatCoordinates, offset, end, stride, extent) { - var coordinatesExtent = Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* extendFlatCoordinates */ "s"])( - Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* createEmpty */ "j"])(), flatCoordinates, offset, end, stride); - if (!Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* intersects */ "F"])(extent, coordinatesExtent)) { - return false; - } - if (Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* containsExtent */ "g"])(extent, coordinatesExtent)) { - return true; - } - if (coordinatesExtent[0] >= extent[0] && - coordinatesExtent[2] <= extent[2]) { - return true; - } - if (coordinatesExtent[1] >= extent[1] && - coordinatesExtent[3] <= extent[3]) { - return true; - } - return Object(_segments_js__WEBPACK_IMPORTED_MODULE_2__[/* forEach */ "a"])(flatCoordinates, offset, end, stride, - /** - * @param {import("../../coordinate.js").Coordinate} point1 Start point. - * @param {import("../../coordinate.js").Coordinate} point2 End point. - * @return {boolean} `true` if the segment and the extent intersect, - * `false` otherwise. - */ - function(point1, point2) { - return Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* intersectsSegment */ "G"])(extent, point1, point2); - }); -} - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {Array} ends Ends. - * @param {number} stride Stride. - * @param {import("../../extent.js").Extent} extent Extent. - * @return {boolean} True if the geometry and the extent intersect. - */ -function intersectsLineStringArray(flatCoordinates, offset, ends, stride, extent) { - for (var i = 0, ii = ends.length; i < ii; ++i) { - if (intersectsLineString( - flatCoordinates, offset, ends[i], stride, extent)) { - return true; - } - offset = ends[i]; - } - return false; -} - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - * @param {import("../../extent.js").Extent} extent Extent. - * @return {boolean} True if the geometry and the extent intersect. - */ -function intersectsLinearRing(flatCoordinates, offset, end, stride, extent) { - if (intersectsLineString( - flatCoordinates, offset, end, stride, extent)) { - return true; - } - if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* linearRingContainsXY */ "b"])(flatCoordinates, offset, end, stride, extent[0], extent[1])) { - return true; - } - if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* linearRingContainsXY */ "b"])(flatCoordinates, offset, end, stride, extent[0], extent[3])) { - return true; - } - if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* linearRingContainsXY */ "b"])(flatCoordinates, offset, end, stride, extent[2], extent[1])) { - return true; - } - if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* linearRingContainsXY */ "b"])(flatCoordinates, offset, end, stride, extent[2], extent[3])) { - return true; - } - return false; -} - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {Array} ends Ends. - * @param {number} stride Stride. - * @param {import("../../extent.js").Extent} extent Extent. - * @return {boolean} True if the geometry and the extent intersect. - */ -function intersectsLinearRingArray(flatCoordinates, offset, ends, stride, extent) { - if (!intersectsLinearRing( - flatCoordinates, offset, ends[0], stride, extent)) { - return false; - } - if (ends.length === 1) { - return true; - } - for (var i = 1, ii = ends.length; i < ii; ++i) { - if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* linearRingContainsExtent */ "a"])(flatCoordinates, ends[i - 1], ends[i], stride, extent)) { - if (!intersectsLineString(flatCoordinates, ends[i - 1], ends[i], stride, extent)) { - return false; - } - } - } - return true; -} - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {Array>} endss Endss. - * @param {number} stride Stride. - * @param {import("../../extent.js").Extent} extent Extent. - * @return {boolean} True if the geometry and the extent intersect. - */ -function intersectsLinearRingMultiArray(flatCoordinates, offset, endss, stride, extent) { - for (var i = 0, ii = endss.length; i < ii; ++i) { - var ends = endss[i]; - if (intersectsLinearRingArray( - flatCoordinates, offset, ends, stride, extent)) { - return true; - } - offset = ends[ends.length - 1]; - } - return false; -} - -//# sourceMappingURL=intersectsextent.js.map - -/***/ }), -/* 67 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return forEach; }); -/** - * @module ol/geom/flat/segments - */ - - -/** - * This function calls `callback` for each segment of the flat coordinates - * array. If the callback returns a truthy value the function returns that - * value immediately. Otherwise the function returns `false`. - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - * @param {function(this: S, import("../../coordinate.js").Coordinate, import("../../coordinate.js").Coordinate): T} callback Function - * called for each segment. - * @param {S=} opt_this The object to be used as the value of 'this' - * within callback. - * @return {T|boolean} Value. - * @template T,S - */ -function forEach(flatCoordinates, offset, end, stride, callback, opt_this) { - var point1 = [flatCoordinates[offset], flatCoordinates[offset + 1]]; - var point2 = []; - var ret; - for (; (offset + stride) < end; offset += stride) { - point2[0] = flatCoordinates[offset + stride]; - point2[1] = flatCoordinates[offset + stride + 1]; - ret = callback.call(opt_this, point1, point2); - if (ret) { - return ret; - } - point1[0] = point2[0]; - point1[1] = point2[1]; - } - return false; -} - -//# sourceMappingURL=segments.js.map - -/***/ }), -/* 68 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return lineStringLength; }); -/* unused harmony export linearRingLength */ -/** - * @module ol/geom/flat/length - */ - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - * @return {number} Length. - */ -function lineStringLength(flatCoordinates, offset, end, stride) { - var x1 = flatCoordinates[offset]; - var y1 = flatCoordinates[offset + 1]; - var length = 0; - for (var i = offset + stride; i < end; i += stride) { - var x2 = flatCoordinates[i]; - var y2 = flatCoordinates[i + 1]; - length += Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); - x1 = x2; - y1 = y2; - } - return length; -} - - -/** - * @param {Array} flatCoordinates Flat coordinates. - * @param {number} offset Offset. - * @param {number} end End. - * @param {number} stride Stride. - * @return {number} Perimeter. - */ -function linearRingLength(flatCoordinates, offset, end, stride) { - var perimeter = lineStringLength(flatCoordinates, offset, end, stride); - var dx = flatCoordinates[end - stride] - flatCoordinates[offset]; - var dy = flatCoordinates[end - stride + 1] - flatCoordinates[offset + 1]; - perimeter += Math.sqrt(dx * dx + dy * dy); - return perimeter; -} - -//# sourceMappingURL=length.js.map - -/***/ }), -/* 69 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); -/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); -/* harmony import */ var _Property_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(19); -/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6); -/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9); +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20); +/* harmony import */ var _Property_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23); +/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9); +/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(10); /** * @module ol/layer/Base */ @@ -12864,1861 +15606,381 @@ var BaseLayer = /*@__PURE__*/(function (BaseObject) { //# sourceMappingURL=Base.js.map /***/ }), -/* 70 */ +/* 79 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); +/* harmony import */ var _GeometryType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); +/* harmony import */ var _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(48); +/* harmony import */ var _flat_deflate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57); +/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9); /** - * @module ol/layer/VectorRenderType - */ - -/** - * @enum {string} - * Render mode for vector layers: - * * `'image'`: Vector layers are rendered as images. Great performance, but - * point symbols and texts are always rotated with the view and pixels are - * scaled during zoom animations. - * * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering - * even during animations, but slower performance. - * @api - */ -/* harmony default export */ __webpack_exports__["a"] = ({ - IMAGE: 'image', - VECTOR: 'vector' -}); - -//# sourceMappingURL=VectorRenderType.js.map - -/***/ }), -/* 71 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; - -// EXTERNAL MODULE: ./node_modules/ol/tilegrid/common.js -var common = __webpack_require__(51); - -// EXTERNAL MODULE: ./node_modules/ol/util.js -var util = __webpack_require__(1); - -// EXTERNAL MODULE: ./node_modules/ol/functions.js -var functions = __webpack_require__(14); - -// EXTERNAL MODULE: ./node_modules/ol/math.js -var math = __webpack_require__(6); - -// CONCATENATED MODULE: ./node_modules/ol/centerconstraint.js -/** - * @module ol/centerconstraint - */ - - - -/** - * @typedef {function((import("./coordinate.js").Coordinate|undefined)): (import("./coordinate.js").Coordinate|undefined)} Type - */ - - -/** - * @param {import("./extent.js").Extent} extent Extent. - * @return {Type} The constraint. - */ -function createExtent(extent) { - return ( - /** - * @param {import("./coordinate.js").Coordinate=} center Center. - * @return {import("./coordinate.js").Coordinate|undefined} Center. - */ - function(center) { - if (center) { - return [ - Object(math["a" /* clamp */])(center[0], extent[0], extent[2]), - Object(math["a" /* clamp */])(center[1], extent[1], extent[3]) - ]; - } else { - return undefined; - } - } - ); -} - - -/** - * @param {import("./coordinate.js").Coordinate=} center Center. - * @return {import("./coordinate.js").Coordinate|undefined} Center. - */ -function none(center) { - return center; -} - -//# sourceMappingURL=centerconstraint.js.map -// EXTERNAL MODULE: ./node_modules/ol/Object.js -var ol_Object = __webpack_require__(16); - -// EXTERNAL MODULE: ./node_modules/ol/array.js -var array = __webpack_require__(11); - -// CONCATENATED MODULE: ./node_modules/ol/resolutionconstraint.js -/** - * @module ol/resolutionconstraint + * @module ol/geom/Point */ -/** - * @typedef {function((number|undefined), number, number): (number|undefined)} Type - */ - - -/** - * @param {Array} resolutions Resolutions. - * @return {Type} Zoom function. - */ -function createSnapToResolutions(resolutions) { - return ( - /** - * @param {number|undefined} resolution Resolution. - * @param {number} delta Delta. - * @param {number} direction Direction. - * @return {number|undefined} Resolution. - */ - function(resolution, delta, direction) { - if (resolution !== undefined) { - var z = Object(array["f" /* linearFindNearest */])(resolutions, resolution, direction); - z = Object(math["a" /* clamp */])(z + delta, 0, resolutions.length - 1); - var index = Math.floor(z); - if (z != index && index < resolutions.length - 1) { - var power = resolutions[index] / resolutions[index + 1]; - return resolutions[index] / Math.pow(power, z - index); - } else { - return resolutions[index]; - } - } else { - return undefined; - } - } - ); -} - - -/** - * @param {number} power Power. - * @param {number} maxResolution Maximum resolution. - * @param {number=} opt_maxLevel Maximum level. - * @return {Type} Zoom function. - */ -function createSnapToPower(power, maxResolution, opt_maxLevel) { - return ( - /** - * @param {number|undefined} resolution Resolution. - * @param {number} delta Delta. - * @param {number} direction Direction. - * @return {number|undefined} Resolution. - */ - function(resolution, delta, direction) { - if (resolution !== undefined) { - var offset = -direction / 2 + 0.5; - var oldLevel = Math.floor( - Math.log(maxResolution / resolution) / Math.log(power) + offset); - var newLevel = Math.max(oldLevel + delta, 0); - if (opt_maxLevel !== undefined) { - newLevel = Math.min(newLevel, opt_maxLevel); - } - return maxResolution / Math.pow(power, newLevel); - } else { - return undefined; - } - }); -} - -//# sourceMappingURL=resolutionconstraint.js.map -// EXTERNAL MODULE: ./node_modules/ol/rotationconstraint.js -var rotationconstraint = __webpack_require__(45); - -// EXTERNAL MODULE: ./node_modules/ol/ViewHint.js -var ViewHint = __webpack_require__(12); - -// CONCATENATED MODULE: ./node_modules/ol/ViewProperty.js -/** - * @module ol/ViewProperty - */ - -/** - * @enum {string} - */ -/* harmony default export */ var ViewProperty = ({ - CENTER: 'center', - RESOLUTION: 'resolution', - ROTATION: 'rotation' -}); - -//# sourceMappingURL=ViewProperty.js.map -// EXTERNAL MODULE: ./node_modules/ol/asserts.js -var asserts = __webpack_require__(10); - -// EXTERNAL MODULE: ./node_modules/ol/coordinate.js + 1 modules -var coordinate = __webpack_require__(39); - -// EXTERNAL MODULE: ./node_modules/ol/easing.js -var easing = __webpack_require__(22); - -// EXTERNAL MODULE: ./node_modules/ol/extent.js -var ol_extent = __webpack_require__(0); - -// EXTERNAL MODULE: ./node_modules/ol/geom/GeometryType.js -var GeometryType = __webpack_require__(5); - -// EXTERNAL MODULE: ./node_modules/ol/geom/Polygon.js + 5 modules -var Polygon = __webpack_require__(52); - -// EXTERNAL MODULE: ./node_modules/ol/obj.js -var obj = __webpack_require__(9); - -// EXTERNAL MODULE: ./node_modules/ol/proj.js + 5 modules -var proj = __webpack_require__(13); - -// EXTERNAL MODULE: ./node_modules/ol/proj/Units.js -var Units = __webpack_require__(24); - -// CONCATENATED MODULE: ./node_modules/ol/View.js -/* unused harmony export createCenterConstraint */ -/* unused harmony export createResolutionConstraint */ -/* unused harmony export createRotationConstraint */ -/* unused harmony export isNoopAnimation */ -/** - * @module ol/View - */ - - - - - - - - - - - - - - - - - - - - - - -/** - * An animation configuration - * - * @typedef {Object} Animation - * @property {import("./coordinate.js").Coordinate} [sourceCenter] - * @property {import("./coordinate.js").Coordinate} [targetCenter] - * @property {number} [sourceResolution] - * @property {number} [targetResolution] - * @property {number} [sourceRotation] - * @property {number} [targetRotation] - * @property {import("./coordinate.js").Coordinate} [anchor] - * @property {number} start - * @property {number} duration - * @property {boolean} complete - * @property {function(number):number} easing - * @property {function(boolean)} callback - */ - - -/** - * @typedef {Object} Constraints - * @property {import("./centerconstraint.js").Type} center - * @property {import("./resolutionconstraint.js").Type} resolution - * @property {import("./rotationconstraint.js").Type} rotation - */ - - -/** - * @typedef {Object} FitOptions - * @property {import("./size.js").Size} [size] The size in pixels of the box to fit - * the extent into. Default is the current size of the first map in the DOM that - * uses this view, or `[100, 100]` if no such map is found. - * @property {!Array} [padding=[0, 0, 0, 0]] Padding (in pixels) to be - * cleared inside the view. Values in the array are top, right, bottom and left - * padding. - * @property {boolean} [constrainResolution=true] Constrain the resolution. - * @property {boolean} [nearest=false] If `constrainResolution` is `true`, get - * the nearest extent instead of the closest that actually fits the view. - * @property {number} [minResolution=0] Minimum resolution that we zoom to. - * @property {number} [maxZoom] Maximum zoom level that we zoom to. If - * `minResolution` is given, this property is ignored. - * @property {number} [duration] The duration of the animation in milliseconds. - * By default, there is no animation to the target extent. - * @property {function(number):number} [easing] The easing function used during - * the animation (defaults to {@link module:ol/easing~inAndOut}). - * The function will be called for each frame with a number representing a - * fraction of the animation's duration. The function should return a number - * between 0 and 1 representing the progress toward the destination state. - * @property {function(boolean)} [callback] Function called when the view is in - * its final position. The callback will be called with `true` if the animation - * series completed on its own or `false` if it was cancelled. - */ - - -/** - * @typedef {Object} ViewOptions - * @property {import("./coordinate.js").Coordinate} [center] The initial center for - * the view. The coordinate system for the center is specified with the - * `projection` option. Layer sources will not be fetched if this is not set, - * but the center can be set later with {@link #setCenter}. - * @property {boolean|number} [constrainRotation=true] Rotation constraint. - * `false` means no constraint. `true` means no constraint, but snap to zero - * near zero. A number constrains the rotation to that number of values. For - * example, `4` will constrain the rotation to 0, 90, 180, and 270 degrees. - * @property {boolean} [enableRotation=true] Enable rotation. - * If `false`, a rotation constraint that always sets the rotation to zero is - * used. The `constrainRotation` option has no effect if `enableRotation` is - * `false`. - * @property {import("./extent.js").Extent} [extent] The extent that constrains the - * center, in other words, center cannot be set outside this extent. - * @property {number} [maxResolution] The maximum resolution used to determine - * the resolution constraint. It is used together with `minResolution` (or - * `maxZoom`) and `zoomFactor`. If unspecified it is calculated in such a way - * that the projection's validity extent fits in a 256x256 px tile. If the - * projection is Spherical Mercator (the default) then `maxResolution` defaults - * to `40075016.68557849 / 256 = 156543.03392804097`. - * @property {number} [minResolution] The minimum resolution used to determine - * the resolution constraint. It is used together with `maxResolution` (or - * `minZoom`) and `zoomFactor`. If unspecified it is calculated assuming 29 - * zoom levels (with a factor of 2). If the projection is Spherical Mercator - * (the default) then `minResolution` defaults to - * `40075016.68557849 / 256 / Math.pow(2, 28) = 0.0005831682455839253`. - * @property {number} [maxZoom=28] The maximum zoom level used to determine the - * resolution constraint. It is used together with `minZoom` (or - * `maxResolution`) and `zoomFactor`. Note that if `minResolution` is also - * provided, it is given precedence over `maxZoom`. - * @property {number} [minZoom=0] The minimum zoom level used to determine the - * resolution constraint. It is used together with `maxZoom` (or - * `minResolution`) and `zoomFactor`. Note that if `maxResolution` is also - * provided, it is given precedence over `minZoom`. - * @property {import("./proj.js").ProjectionLike} [projection='EPSG:3857'] The - * projection. The default is Spherical Mercator. - * @property {number} [resolution] The initial resolution for the view. The - * units are `projection` units per pixel (e.g. meters per pixel). An - * alternative to setting this is to set `zoom`. Layer sources will not be - * fetched if neither this nor `zoom` are defined, but they can be set later - * with {@link #setZoom} or {@link #setResolution}. - * @property {Array} [resolutions] Resolutions to determine the - * resolution constraint. If set the `maxResolution`, `minResolution`, - * `minZoom`, `maxZoom`, and `zoomFactor` options are ignored. - * @property {number} [rotation=0] The initial rotation for the view in radians - * (positive rotation clockwise, 0 means North). - * @property {number} [zoom] Only used if `resolution` is not defined. Zoom - * level used to calculate the initial resolution for the view. The initial - * resolution is determined using the {@link #constrainResolution} method. - * @property {number} [zoomFactor=2] The zoom factor used to determine the - * resolution constraint. - */ - - -/** - * @typedef {Object} AnimationOptions - * @property {import("./coordinate.js").Coordinate} [center] The center of the view at the end of - * the animation. - * @property {number} [zoom] The zoom level of the view at the end of the - * animation. This takes precedence over `resolution`. - * @property {number} [resolution] The resolution of the view at the end - * of the animation. If `zoom` is also provided, this option will be ignored. - * @property {number} [rotation] The rotation of the view at the end of - * the animation. - * @property {import("./coordinate.js").Coordinate} [anchor] Optional anchor to remained fixed - * during a rotation or resolution animation. - * @property {number} [duration=1000] The duration of the animation in milliseconds. - * @property {function(number):number} [easing] The easing function used - * during the animation (defaults to {@link module:ol/easing~inAndOut}). - * The function will be called for each frame with a number representing a - * fraction of the animation's duration. The function should return a number - * between 0 and 1 representing the progress toward the destination state. - */ - - -/** - * @typedef {Object} State - * @property {import("./coordinate.js").Coordinate} center - * @property {import("./proj/Projection.js").default} projection - * @property {number} resolution - * @property {number} rotation - * @property {number} zoom - */ - - -/** - * Default min zoom level for the map view. - * @type {number} - */ -var DEFAULT_MIN_ZOOM = 0; /** * @classdesc - * A View object represents a simple 2D view of the map. + * Point geometry. * - * This is the object to act upon to change the center, resolution, - * and rotation of the map. - * - * ### The view states - * - * An View is determined by three states: `center`, `resolution`, - * and `rotation`. Each state has a corresponding getter and setter, e.g. - * `getCenter` and `setCenter` for the `center` state. - * - * An View has a `projection`. The projection determines the - * coordinate system of the center, and its units determine the units of the - * resolution (projection units per pixel). The default projection is - * Spherical Mercator (EPSG:3857). - * - * ### The constraints - * - * `setCenter`, `setResolution` and `setRotation` can be used to change the - * states of the view. Any value can be passed to the setters. And the value - * that is passed to a setter will effectively be the value set in the view, - * and returned by the corresponding getter. - * - * But a View object also has a *resolution constraint*, a - * *rotation constraint* and a *center constraint*. - * - * As said above, no constraints are applied when the setters are used to set - * new states for the view. Applying constraints is done explicitly through - * the use of the `constrain*` functions (`constrainResolution` and - * `constrainRotation` and `constrainCenter`). - * - * The main users of the constraints are the interactions and the - * controls. For example, double-clicking on the map changes the view to - * the "next" resolution. And releasing the fingers after pinch-zooming - * snaps to the closest resolution (with an animation). - * - * The *resolution constraint* snaps to specific resolutions. It is - * determined by the following options: `resolutions`, `maxResolution`, - * `maxZoom`, and `zoomFactor`. If `resolutions` is set, the other three - * options are ignored. See documentation for each option for more - * information. - * - * The *rotation constraint* snaps to specific angles. It is determined - * by the following options: `enableRotation` and `constrainRotation`. - * By default the rotation value is snapped to zero when approaching the - * horizontal. - * - * The *center constraint* is determined by the `extent` option. By - * default the center is not constrained at all. - * - * @api + * @api */ -var View_View = /*@__PURE__*/(function (BaseObject) { - function View(opt_options) { - BaseObject.call(this); - - var options = Object(obj["a" /* assign */])({}, opt_options); - - /** - * @private - * @type {Array} - */ - this.hints_ = [0, 0]; - - /** - * @private - * @type {Array>} - */ - this.animations_ = []; - - /** - * @private - * @type {number|undefined} - */ - this.updateAnimationKey_; - - this.updateAnimations_ = this.updateAnimations_.bind(this); - - /** - * @private - * @const - * @type {import("./proj/Projection.js").default} - */ - this.projection_ = Object(proj["b" /* createProjection */])(options.projection, 'EPSG:3857'); - - this.applyOptions_(options); +var Point = /*@__PURE__*/(function (SimpleGeometry) { + function Point(coordinates, opt_layout) { + SimpleGeometry.call(this); + this.setCoordinates(coordinates, opt_layout); } - if ( BaseObject ) View.__proto__ = BaseObject; - View.prototype = Object.create( BaseObject && BaseObject.prototype ); - View.prototype.constructor = View; + if ( SimpleGeometry ) Point.__proto__ = SimpleGeometry; + Point.prototype = Object.create( SimpleGeometry && SimpleGeometry.prototype ); + Point.prototype.constructor = Point; /** - * Set up the view with the given options. - * @param {ViewOptions} options View options. + * Make a complete copy of the geometry. + * @return {!Point} Clone. + * @override + * @api */ - View.prototype.applyOptions_ = function applyOptions_ (options) { - - /** - * @type {Object} - */ - var properties = {}; - properties[ViewProperty.CENTER] = options.center !== undefined ? - options.center : null; - - var resolutionConstraintInfo = createResolutionConstraint(options); - - /** - * @private - * @type {number} - */ - this.maxResolution_ = resolutionConstraintInfo.maxResolution; - - /** - * @private - * @type {number} - */ - this.minResolution_ = resolutionConstraintInfo.minResolution; - - /** - * @private - * @type {number} - */ - this.zoomFactor_ = resolutionConstraintInfo.zoomFactor; - - /** - * @private - * @type {Array|undefined} - */ - this.resolutions_ = options.resolutions; - - /** - * @private - * @type {number} - */ - this.minZoom_ = resolutionConstraintInfo.minZoom; - - var centerConstraint = createCenterConstraint(options); - var resolutionConstraint = resolutionConstraintInfo.constraint; - var rotationConstraint = createRotationConstraint(options); - - /** - * @private - * @type {Constraints} - */ - this.constraints_ = { - center: centerConstraint, - resolution: resolutionConstraint, - rotation: rotationConstraint - }; - - if (options.resolution !== undefined) { - properties[ViewProperty.RESOLUTION] = options.resolution; - } else if (options.zoom !== undefined) { - properties[ViewProperty.RESOLUTION] = this.constrainResolution( - this.maxResolution_, options.zoom - this.minZoom_); - - if (this.resolutions_) { // in case map zoom is out of min/max zoom range - properties[ViewProperty.RESOLUTION] = Object(math["a" /* clamp */])( - Number(this.getResolution() || properties[ViewProperty.RESOLUTION]), - this.minResolution_, this.maxResolution_); - } - } - properties[ViewProperty.ROTATION] = options.rotation !== undefined ? options.rotation : 0; - this.setProperties(properties); - - /** - * @private - * @type {ViewOptions} - */ - this.options_ = options; - + Point.prototype.clone = function clone () { + var point = new Point(this.flatCoordinates.slice(), this.layout); + return point; }; /** - * Get an updated version of the view options used to construct the view. The - * current resolution (or zoom), center, and rotation are applied to any stored - * options. The provided options can be used to apply new min/max zoom or - * resolution limits. - * @param {ViewOptions} newOptions New options to be applied. - * @return {ViewOptions} New options updated with the current view state. + * @inheritDoc */ - View.prototype.getUpdatedOptions_ = function getUpdatedOptions_ (newOptions) { - var options = Object(obj["a" /* assign */])({}, this.options_); - - // preserve resolution (or zoom) - if (options.resolution !== undefined) { - options.resolution = this.getResolution(); + Point.prototype.closestPointXY = function closestPointXY (x, y, closestPoint, minSquaredDistance) { + var flatCoordinates = this.flatCoordinates; + var squaredDistance = Object(_math_js__WEBPACK_IMPORTED_MODULE_4__[/* squaredDistance */ "g"])(x, y, flatCoordinates[0], flatCoordinates[1]); + if (squaredDistance < minSquaredDistance) { + var stride = this.stride; + for (var i = 0; i < stride; ++i) { + closestPoint[i] = flatCoordinates[i]; + } + closestPoint.length = stride; + return squaredDistance; } else { - options.zoom = this.getZoom(); - } - - // preserve center - options.center = this.getCenter(); - - // preserve rotation - options.rotation = this.getRotation(); - - return Object(obj["a" /* assign */])({}, options, newOptions); - }; - - /** - * Animate the view. The view's center, zoom (or resolution), and rotation - * can be animated for smooth transitions between view states. For example, - * to animate the view to a new zoom level: - * - * view.animate({zoom: view.getZoom() + 1}); - * - * By default, the animation lasts one second and uses in-and-out easing. You - * can customize this behavior by including `duration` (in milliseconds) and - * `easing` options (see {@link module:ol/easing}). - * - * To chain together multiple animations, call the method with multiple - * animation objects. For example, to first zoom and then pan: - * - * view.animate({zoom: 10}, {center: [0, 0]}); - * - * If you provide a function as the last argument to the animate method, it - * will get called at the end of an animation series. The callback will be - * called with `true` if the animation series completed on its own or `false` - * if it was cancelled. - * - * Animations are cancelled by user interactions (e.g. dragging the map) or by - * calling `view.setCenter()`, `view.setResolution()`, or `view.setRotation()` - * (or another method that calls one of these). - * - * @param {...(AnimationOptions|function(boolean))} var_args Animation - * options. Multiple animations can be run in series by passing multiple - * options objects. To run multiple animations in parallel, call the method - * multiple times. An optional callback can be provided as a final - * argument. The callback will be called with a boolean indicating whether - * the animation completed without being cancelled. - * @api - */ - View.prototype.animate = function animate (var_args) { - var arguments$1 = arguments; - - var animationCount = arguments.length; - var callback; - if (animationCount > 1 && typeof arguments[animationCount - 1] === 'function') { - callback = arguments[animationCount - 1]; - --animationCount; - } - if (!this.isDef()) { - // if view properties are not yet set, shortcut to the final state - var state = arguments[animationCount - 1]; - if (state.center) { - this.setCenter(state.center); - } - if (state.zoom !== undefined) { - this.setZoom(state.zoom); - } - if (state.rotation !== undefined) { - this.setRotation(state.rotation); - } - if (callback) { - animationCallback(callback, true); - } - return; - } - var start = Date.now(); - var center = this.getCenter().slice(); - var resolution = this.getResolution(); - var rotation = this.getRotation(); - var series = []; - for (var i = 0; i < animationCount; ++i) { - var options = /** @type {AnimationOptions} */ (arguments$1[i]); - - var animation = /** @type {Animation} */ ({ - start: start, - complete: false, - anchor: options.anchor, - duration: options.duration !== undefined ? options.duration : 1000, - easing: options.easing || easing["c" /* inAndOut */] - }); - - if (options.center) { - animation.sourceCenter = center; - animation.targetCenter = options.center; - center = animation.targetCenter; - } - - if (options.zoom !== undefined) { - animation.sourceResolution = resolution; - animation.targetResolution = this.constrainResolution( - this.maxResolution_, options.zoom - this.minZoom_, 0); - resolution = animation.targetResolution; - } else if (options.resolution) { - animation.sourceResolution = resolution; - animation.targetResolution = options.resolution; - resolution = animation.targetResolution; - } - - if (options.rotation !== undefined) { - animation.sourceRotation = rotation; - var delta = Object(math["d" /* modulo */])(options.rotation - rotation + Math.PI, 2 * Math.PI) - Math.PI; - animation.targetRotation = rotation + delta; - rotation = animation.targetRotation; - } - - animation.callback = callback; - - // check if animation is a no-op - if (isNoopAnimation(animation)) { - animation.complete = true; - // we still push it onto the series for callback handling - } else { - start += animation.duration; - } - series.push(animation); - } - this.animations_.push(series); - this.setHint(ViewHint["a" /* default */].ANIMATING, 1); - this.updateAnimations_(); - }; - - /** - * Determine if the view is being animated. - * @return {boolean} The view is being animated. - * @api - */ - View.prototype.getAnimating = function getAnimating () { - return this.hints_[ViewHint["a" /* default */].ANIMATING] > 0; - }; - - /** - * Determine if the user is interacting with the view, such as panning or zooming. - * @return {boolean} The view is being interacted with. - * @api - */ - View.prototype.getInteracting = function getInteracting () { - return this.hints_[ViewHint["a" /* default */].INTERACTING] > 0; - }; - - /** - * Cancel any ongoing animations. - * @api - */ - View.prototype.cancelAnimations = function cancelAnimations () { - this.setHint(ViewHint["a" /* default */].ANIMATING, -this.hints_[ViewHint["a" /* default */].ANIMATING]); - for (var i = 0, ii = this.animations_.length; i < ii; ++i) { - var series = this.animations_[i]; - if (series[0].callback) { - animationCallback(series[0].callback, false); - } - } - this.animations_.length = 0; - }; - - /** - * Update all animations. - */ - View.prototype.updateAnimations_ = function updateAnimations_ () { - if (this.updateAnimationKey_ !== undefined) { - cancelAnimationFrame(this.updateAnimationKey_); - this.updateAnimationKey_ = undefined; - } - if (!this.getAnimating()) { - return; - } - var now = Date.now(); - var more = false; - for (var i = this.animations_.length - 1; i >= 0; --i) { - var series = this.animations_[i]; - var seriesComplete = true; - for (var j = 0, jj = series.length; j < jj; ++j) { - var animation = series[j]; - if (animation.complete) { - continue; - } - var elapsed = now - animation.start; - var fraction = animation.duration > 0 ? elapsed / animation.duration : 1; - if (fraction >= 1) { - animation.complete = true; - fraction = 1; - } else { - seriesComplete = false; - } - var progress = animation.easing(fraction); - if (animation.sourceCenter) { - var x0 = animation.sourceCenter[0]; - var y0 = animation.sourceCenter[1]; - var x1 = animation.targetCenter[0]; - var y1 = animation.targetCenter[1]; - var x = x0 + progress * (x1 - x0); - var y = y0 + progress * (y1 - y0); - this.set(ViewProperty.CENTER, [x, y]); - } - if (animation.sourceResolution && animation.targetResolution) { - var resolution = progress === 1 ? - animation.targetResolution : - animation.sourceResolution + progress * (animation.targetResolution - animation.sourceResolution); - if (animation.anchor) { - this.set(ViewProperty.CENTER, - this.calculateCenterZoom(resolution, animation.anchor)); - } - this.set(ViewProperty.RESOLUTION, resolution); - } - if (animation.sourceRotation !== undefined && animation.targetRotation !== undefined) { - var rotation = progress === 1 ? - Object(math["d" /* modulo */])(animation.targetRotation + Math.PI, 2 * Math.PI) - Math.PI : - animation.sourceRotation + progress * (animation.targetRotation - animation.sourceRotation); - if (animation.anchor) { - this.set(ViewProperty.CENTER, - this.calculateCenterRotate(rotation, animation.anchor)); - } - this.set(ViewProperty.ROTATION, rotation); - } - more = true; - if (!animation.complete) { - break; - } - } - if (seriesComplete) { - this.animations_[i] = null; - this.setHint(ViewHint["a" /* default */].ANIMATING, -1); - var callback = series[0].callback; - if (callback) { - animationCallback(callback, true); - } - } - } - // prune completed series - this.animations_ = this.animations_.filter(Boolean); - if (more && this.updateAnimationKey_ === undefined) { - this.updateAnimationKey_ = requestAnimationFrame(this.updateAnimations_); + return minSquaredDistance; } }; /** - * @param {number} rotation Target rotation. - * @param {import("./coordinate.js").Coordinate} anchor Rotation anchor. - * @return {import("./coordinate.js").Coordinate|undefined} Center for rotation and anchor. + * Return the coordinate of the point. + * @return {import("../coordinate.js").Coordinate} Coordinates. + * @override + * @api */ - View.prototype.calculateCenterRotate = function calculateCenterRotate (rotation, anchor) { - var center; - var currentCenter = this.getCenter(); - if (currentCenter !== undefined) { - center = [currentCenter[0] - anchor[0], currentCenter[1] - anchor[1]]; - Object(coordinate["c" /* rotate */])(center, rotation - this.getRotation()); - Object(coordinate["a" /* add */])(center, anchor); + Point.prototype.getCoordinates = function getCoordinates () { + return !this.flatCoordinates ? [] : this.flatCoordinates.slice(); + }; + + /** + * @inheritDoc + */ + Point.prototype.computeExtent = function computeExtent (extent) { + return Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* createOrUpdateFromCoordinate */ "m"])(this.flatCoordinates, extent); + }; + + /** + * @inheritDoc + * @api + */ + Point.prototype.getType = function getType () { + return _GeometryType_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].POINT; + }; + + /** + * @inheritDoc + * @api + */ + Point.prototype.intersectsExtent = function intersectsExtent (extent) { + return Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* containsXY */ "h"])(extent, this.flatCoordinates[0], this.flatCoordinates[1]); + }; + + /** + * @inheritDoc + * @api + */ + Point.prototype.setCoordinates = function setCoordinates (coordinates, opt_layout) { + this.setLayout(opt_layout, coordinates, 0); + if (!this.flatCoordinates) { + this.flatCoordinates = []; } - return center; - }; - - /** - * @param {number} resolution Target resolution. - * @param {import("./coordinate.js").Coordinate} anchor Zoom anchor. - * @return {import("./coordinate.js").Coordinate|undefined} Center for resolution and anchor. - */ - View.prototype.calculateCenterZoom = function calculateCenterZoom (resolution, anchor) { - var center; - var currentCenter = this.getCenter(); - var currentResolution = this.getResolution(); - if (currentCenter !== undefined && currentResolution !== undefined) { - var x = anchor[0] - resolution * (anchor[0] - currentCenter[0]) / currentResolution; - var y = anchor[1] - resolution * (anchor[1] - currentCenter[1]) / currentResolution; - center = [x, y]; - } - return center; - }; - - /** - * @private - * @return {import("./size.js").Size} Viewport size or `[100, 100]` when no viewport is found. - */ - View.prototype.getSizeFromViewport_ = function getSizeFromViewport_ () { - var size = [100, 100]; - var selector = '.ol-viewport[data-view="' + Object(util["c" /* getUid */])(this) + '"]'; - var element = document.querySelector(selector); - if (element) { - var metrics = getComputedStyle(element); - size[0] = parseInt(metrics.width, 10); - size[1] = parseInt(metrics.height, 10); - } - return size; - }; - - /** - * Get the constrained center of this view. - * @param {import("./coordinate.js").Coordinate|undefined} center Center. - * @return {import("./coordinate.js").Coordinate|undefined} Constrained center. - * @api - */ - View.prototype.constrainCenter = function constrainCenter (center) { - return this.constraints_.center(center); - }; - - /** - * Get the constrained resolution of this view. - * @param {number|undefined} resolution Resolution. - * @param {number=} opt_delta Delta. Default is `0`. - * @param {number=} opt_direction Direction. Default is `0`. - * @return {number|undefined} Constrained resolution. - * @api - */ - View.prototype.constrainResolution = function constrainResolution (resolution, opt_delta, opt_direction) { - var delta = opt_delta || 0; - var direction = opt_direction || 0; - return this.constraints_.resolution(resolution, delta, direction); - }; - - /** - * Get the constrained rotation of this view. - * @param {number|undefined} rotation Rotation. - * @param {number=} opt_delta Delta. Default is `0`. - * @return {number|undefined} Constrained rotation. - * @api - */ - View.prototype.constrainRotation = function constrainRotation (rotation, opt_delta) { - var delta = opt_delta || 0; - return this.constraints_.rotation(rotation, delta); - }; - - /** - * Get the view center. - * @return {import("./coordinate.js").Coordinate|undefined} The center of the view. - * @observable - * @api - */ - View.prototype.getCenter = function getCenter () { - return ( - /** @type {import("./coordinate.js").Coordinate|undefined} */ (this.get(ViewProperty.CENTER)) - ); - }; - - /** - * @return {Constraints} Constraints. - */ - View.prototype.getConstraints = function getConstraints () { - return this.constraints_; - }; - - /** - * @param {Array=} opt_hints Destination array. - * @return {Array} Hint. - */ - View.prototype.getHints = function getHints (opt_hints) { - if (opt_hints !== undefined) { - opt_hints[0] = this.hints_[0]; - opt_hints[1] = this.hints_[1]; - return opt_hints; - } else { - return this.hints_.slice(); - } - }; - - /** - * Calculate the extent for the current view state and the passed size. - * The size is the pixel dimensions of the box into which the calculated extent - * should fit. In most cases you want to get the extent of the entire map, - * that is `map.getSize()`. - * @param {import("./size.js").Size=} opt_size Box pixel size. If not provided, the size of the - * first map that uses this view will be used. - * @return {import("./extent.js").Extent} Extent. - * @api - */ - View.prototype.calculateExtent = function calculateExtent (opt_size) { - var size = opt_size || this.getSizeFromViewport_(); - var center = /** @type {!import("./coordinate.js").Coordinate} */ (this.getCenter()); - Object(asserts["a" /* assert */])(center, 1); // The view center is not defined - var resolution = /** @type {!number} */ (this.getResolution()); - Object(asserts["a" /* assert */])(resolution !== undefined, 2); // The view resolution is not defined - var rotation = /** @type {!number} */ (this.getRotation()); - Object(asserts["a" /* assert */])(rotation !== undefined, 3); // The view rotation is not defined - - return Object(ol_extent["z" /* getForViewAndSize */])(center, resolution, rotation, size); - }; - - /** - * Get the maximum resolution of the view. - * @return {number} The maximum resolution of the view. - * @api - */ - View.prototype.getMaxResolution = function getMaxResolution () { - return this.maxResolution_; - }; - - /** - * Get the minimum resolution of the view. - * @return {number} The minimum resolution of the view. - * @api - */ - View.prototype.getMinResolution = function getMinResolution () { - return this.minResolution_; - }; - - /** - * Get the maximum zoom level for the view. - * @return {number} The maximum zoom level. - * @api - */ - View.prototype.getMaxZoom = function getMaxZoom () { - return /** @type {number} */ (this.getZoomForResolution(this.minResolution_)); - }; - - /** - * Set a new maximum zoom level for the view. - * @param {number} zoom The maximum zoom level. - * @api - */ - View.prototype.setMaxZoom = function setMaxZoom (zoom) { - this.applyOptions_(this.getUpdatedOptions_({maxZoom: zoom})); - }; - - /** - * Get the minimum zoom level for the view. - * @return {number} The minimum zoom level. - * @api - */ - View.prototype.getMinZoom = function getMinZoom () { - return /** @type {number} */ (this.getZoomForResolution(this.maxResolution_)); - }; - - /** - * Set a new minimum zoom level for the view. - * @param {number} zoom The minimum zoom level. - * @api - */ - View.prototype.setMinZoom = function setMinZoom (zoom) { - this.applyOptions_(this.getUpdatedOptions_({minZoom: zoom})); - }; - - /** - * Get the view projection. - * @return {import("./proj/Projection.js").default} The projection of the view. - * @api - */ - View.prototype.getProjection = function getProjection () { - return this.projection_; - }; - - /** - * Get the view resolution. - * @return {number|undefined} The resolution of the view. - * @observable - * @api - */ - View.prototype.getResolution = function getResolution () { - return /** @type {number|undefined} */ (this.get(ViewProperty.RESOLUTION)); - }; - - /** - * Get the resolutions for the view. This returns the array of resolutions - * passed to the constructor of the View, or undefined if none were given. - * @return {Array|undefined} The resolutions of the view. - * @api - */ - View.prototype.getResolutions = function getResolutions () { - return this.resolutions_; - }; - - /** - * Get the resolution for a provided extent (in map units) and size (in pixels). - * @param {import("./extent.js").Extent} extent Extent. - * @param {import("./size.js").Size=} opt_size Box pixel size. - * @return {number} The resolution at which the provided extent will render at - * the given size. - * @api - */ - View.prototype.getResolutionForExtent = function getResolutionForExtent (extent, opt_size) { - var size = opt_size || this.getSizeFromViewport_(); - var xResolution = Object(ol_extent["E" /* getWidth */])(extent) / size[0]; - var yResolution = Object(ol_extent["A" /* getHeight */])(extent) / size[1]; - return Math.max(xResolution, yResolution); - }; - - /** - * Return a function that returns a value between 0 and 1 for a - * resolution. Exponential scaling is assumed. - * @param {number=} opt_power Power. - * @return {function(number): number} Resolution for value function. - */ - View.prototype.getResolutionForValueFunction = function getResolutionForValueFunction (opt_power) { - var power = opt_power || 2; - var maxResolution = this.maxResolution_; - var minResolution = this.minResolution_; - var max = Math.log(maxResolution / minResolution) / Math.log(power); - return ( - /** - * @param {number} value Value. - * @return {number} Resolution. - */ - function(value) { - var resolution = maxResolution / Math.pow(power, value * max); - return resolution; - }); - }; - - /** - * Get the view rotation. - * @return {number} The rotation of the view in radians. - * @observable - * @api - */ - View.prototype.getRotation = function getRotation () { - return /** @type {number} */ (this.get(ViewProperty.ROTATION)); - }; - - /** - * Return a function that returns a resolution for a value between - * 0 and 1. Exponential scaling is assumed. - * @param {number=} opt_power Power. - * @return {function(number): number} Value for resolution function. - */ - View.prototype.getValueForResolutionFunction = function getValueForResolutionFunction (opt_power) { - var power = opt_power || 2; - var maxResolution = this.maxResolution_; - var minResolution = this.minResolution_; - var max = Math.log(maxResolution / minResolution) / Math.log(power); - return ( - /** - * @param {number} resolution Resolution. - * @return {number} Value. - */ - function(resolution) { - var value = (Math.log(maxResolution / resolution) / Math.log(power)) / max; - return value; - }); - }; - - /** - * @param {number} pixelRatio Pixel ratio for center rounding. - * @return {State} View state. - */ - View.prototype.getState = function getState (pixelRatio) { - var center = /** @type {import("./coordinate.js").Coordinate} */ (this.getCenter()); - var projection = this.getProjection(); - var resolution = /** @type {number} */ (this.getResolution()); - var pixelResolution = resolution / pixelRatio; - var rotation = this.getRotation(); - return ( - /** @type {State} */ ({ - center: [ - Math.round(center[0] / pixelResolution) * pixelResolution, - Math.round(center[1] / pixelResolution) * pixelResolution - ], - projection: projection !== undefined ? projection : null, - resolution: resolution, - rotation: rotation, - zoom: this.getZoom() - }) - ); - }; - - /** - * Get the current zoom level. If you configured your view with a resolutions - * array (this is rare), this method may return non-integer zoom levels (so - * the zoom level is not safe to use as an index into a resolutions array). - * @return {number|undefined} Zoom. - * @api - */ - View.prototype.getZoom = function getZoom () { - var zoom; - var resolution = this.getResolution(); - if (resolution !== undefined) { - zoom = this.getZoomForResolution(resolution); - } - return zoom; - }; - - /** - * Get the zoom level for a resolution. - * @param {number} resolution The resolution. - * @return {number|undefined} The zoom level for the provided resolution. - * @api - */ - View.prototype.getZoomForResolution = function getZoomForResolution (resolution) { - var offset = this.minZoom_ || 0; - var max, zoomFactor; - if (this.resolutions_) { - var nearest = Object(array["f" /* linearFindNearest */])(this.resolutions_, resolution, 1); - offset = nearest; - max = this.resolutions_[nearest]; - if (nearest == this.resolutions_.length - 1) { - zoomFactor = 2; - } else { - zoomFactor = max / this.resolutions_[nearest + 1]; - } - } else { - max = this.maxResolution_; - zoomFactor = this.zoomFactor_; - } - return offset + Math.log(max / resolution) / Math.log(zoomFactor); - }; - - /** - * Get the resolution for a zoom level. - * @param {number} zoom Zoom level. - * @return {number} The view resolution for the provided zoom level. - * @api - */ - View.prototype.getResolutionForZoom = function getResolutionForZoom (zoom) { - return /** @type {number} */ (this.constrainResolution( - this.maxResolution_, zoom - this.minZoom_, 0)); - }; - - /** - * Fit the given geometry or extent based on the given map size and border. - * The size is pixel dimensions of the box to fit the extent into. - * In most cases you will want to use the map size, that is `map.getSize()`. - * Takes care of the map angle. - * @param {import("./geom/SimpleGeometry.js").default|import("./extent.js").Extent} geometryOrExtent The geometry or - * extent to fit the view to. - * @param {FitOptions=} opt_options Options. - * @api - */ - View.prototype.fit = function fit (geometryOrExtent, opt_options) { - var options = opt_options || {}; - var size = options.size; - if (!size) { - size = this.getSizeFromViewport_(); - } - /** @type {import("./geom/SimpleGeometry.js").default} */ - var geometry; - Object(asserts["a" /* assert */])(Array.isArray(geometryOrExtent) || typeof /** @type {?} */ (geometryOrExtent).getSimplifiedGeometry === 'function', - 24); // Invalid extent or geometry provided as `geometry` - if (Array.isArray(geometryOrExtent)) { - Object(asserts["a" /* assert */])(!Object(ol_extent["H" /* isEmpty */])(geometryOrExtent), - 25); // Cannot fit empty extent provided as `geometry` - geometry = Object(Polygon["b" /* fromExtent */])(geometryOrExtent); - } else if (geometryOrExtent.getType() === GeometryType["a" /* default */].CIRCLE) { - geometryOrExtent = geometryOrExtent.getExtent(); - geometry = Object(Polygon["b" /* fromExtent */])(geometryOrExtent); - geometry.rotate(this.getRotation(), Object(ol_extent["x" /* getCenter */])(geometryOrExtent)); - } else { - geometry = geometryOrExtent; - } - - var padding = options.padding !== undefined ? options.padding : [0, 0, 0, 0]; - var constrainResolution = options.constrainResolution !== undefined ? - options.constrainResolution : true; - var nearest = options.nearest !== undefined ? options.nearest : false; - var minResolution; - if (options.minResolution !== undefined) { - minResolution = options.minResolution; - } else if (options.maxZoom !== undefined) { - minResolution = this.constrainResolution( - this.maxResolution_, options.maxZoom - this.minZoom_, 0); - } else { - minResolution = 0; - } - var coords = geometry.getFlatCoordinates(); - - // calculate rotated extent - var rotation = this.getRotation(); - var cosAngle = Math.cos(-rotation); - var sinAngle = Math.sin(-rotation); - var minRotX = +Infinity; - var minRotY = +Infinity; - var maxRotX = -Infinity; - var maxRotY = -Infinity; - var stride = geometry.getStride(); - for (var i = 0, ii = coords.length; i < ii; i += stride) { - var rotX = coords[i] * cosAngle - coords[i + 1] * sinAngle; - var rotY = coords[i] * sinAngle + coords[i + 1] * cosAngle; - minRotX = Math.min(minRotX, rotX); - minRotY = Math.min(minRotY, rotY); - maxRotX = Math.max(maxRotX, rotX); - maxRotY = Math.max(maxRotY, rotY); - } - - // calculate resolution - var resolution = this.getResolutionForExtent( - [minRotX, minRotY, maxRotX, maxRotY], - [size[0] - padding[1] - padding[3], size[1] - padding[0] - padding[2]]); - resolution = isNaN(resolution) ? minResolution : - Math.max(resolution, minResolution); - if (constrainResolution) { - var constrainedResolution = this.constrainResolution(resolution, 0, 0); - if (!nearest && constrainedResolution < resolution) { - constrainedResolution = this.constrainResolution( - constrainedResolution, -1, 0); - } - resolution = constrainedResolution; - } - - // calculate center - sinAngle = -sinAngle; // go back to original rotation - var centerRotX = (minRotX + maxRotX) / 2; - var centerRotY = (minRotY + maxRotY) / 2; - centerRotX += (padding[1] - padding[3]) / 2 * resolution; - centerRotY += (padding[0] - padding[2]) / 2 * resolution; - var centerX = centerRotX * cosAngle - centerRotY * sinAngle; - var centerY = centerRotY * cosAngle + centerRotX * sinAngle; - var center = [centerX, centerY]; - var callback = options.callback ? options.callback : functions["c" /* VOID */]; - - if (options.duration !== undefined) { - this.animate({ - resolution: resolution, - center: center, - duration: options.duration, - easing: options.easing - }, callback); - } else { - this.setResolution(resolution); - this.setCenter(center); - animationCallback(callback, true); - } - }; - - /** - * Center on coordinate and view position. - * @param {import("./coordinate.js").Coordinate} coordinate Coordinate. - * @param {import("./size.js").Size} size Box pixel size. - * @param {import("./pixel.js").Pixel} position Position on the view to center on. - * @api - */ - View.prototype.centerOn = function centerOn (coordinate, size, position) { - // calculate rotated position - var rotation = this.getRotation(); - var cosAngle = Math.cos(-rotation); - var sinAngle = Math.sin(-rotation); - var rotX = coordinate[0] * cosAngle - coordinate[1] * sinAngle; - var rotY = coordinate[1] * cosAngle + coordinate[0] * sinAngle; - var resolution = this.getResolution(); - rotX += (size[0] / 2 - position[0]) * resolution; - rotY += (position[1] - size[1] / 2) * resolution; - - // go back to original angle - sinAngle = -sinAngle; // go back to original rotation - var centerX = rotX * cosAngle - rotY * sinAngle; - var centerY = rotY * cosAngle + rotX * sinAngle; - - this.setCenter([centerX, centerY]); - }; - - /** - * @return {boolean} Is defined. - */ - View.prototype.isDef = function isDef () { - return !!this.getCenter() && this.getResolution() !== undefined; - }; - - /** - * Rotate the view around a given coordinate. - * @param {number} rotation New rotation value for the view. - * @param {import("./coordinate.js").Coordinate=} opt_anchor The rotation center. - * @api - */ - View.prototype.rotate = function rotate (rotation, opt_anchor) { - if (opt_anchor !== undefined) { - var center = this.calculateCenterRotate(rotation, opt_anchor); - this.setCenter(center); - } - this.setRotation(rotation); - }; - - /** - * Set the center of the current view. - * @param {import("./coordinate.js").Coordinate|undefined} center The center of the view. - * @observable - * @api - */ - View.prototype.setCenter = function setCenter (center) { - this.set(ViewProperty.CENTER, center); - if (this.getAnimating()) { - this.cancelAnimations(); - } - }; - - /** - * @param {ViewHint} hint Hint. - * @param {number} delta Delta. - * @return {number} New value. - */ - View.prototype.setHint = function setHint (hint, delta) { - this.hints_[hint] += delta; + this.flatCoordinates.length = Object(_flat_deflate_js__WEBPACK_IMPORTED_MODULE_3__[/* deflateCoordinate */ "a"])( + this.flatCoordinates, 0, coordinates, this.stride); this.changed(); - return this.hints_[hint]; }; - /** - * Set the resolution for this view. - * @param {number|undefined} resolution The resolution of the view. - * @observable - * @api - */ - View.prototype.setResolution = function setResolution (resolution) { - this.set(ViewProperty.RESOLUTION, resolution); - if (this.getAnimating()) { - this.cancelAnimations(); - } - }; + return Point; +}(_SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])); + + +/* harmony default export */ __webpack_exports__["a"] = (Point); + +//# sourceMappingURL=Point.js.map + +/***/ }), +/* 80 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return intersectsLineString; }); +/* unused harmony export intersectsLineStringArray */ +/* unused harmony export intersectsLinearRing */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return intersectsLinearRingArray; }); +/* unused harmony export intersectsLinearRingMultiArray */ +/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); +/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(46); +/* harmony import */ var _segments_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81); +/** + * @module ol/geom/flat/intersectsextent + */ - /** - * Set the rotation for this view. - * @param {number} rotation The rotation of the view in radians. - * @observable - * @api - */ - View.prototype.setRotation = function setRotation (rotation) { - this.set(ViewProperty.ROTATION, rotation); - if (this.getAnimating()) { - this.cancelAnimations(); - } - }; - /** - * Zoom to a specific zoom level. - * @param {number} zoom Zoom level. - * @api - */ - View.prototype.setZoom = function setZoom (zoom) { - this.setResolution(this.getResolutionForZoom(zoom)); - }; - return View; -}(ol_Object["a" /* default */])); /** - * @param {Function} callback Callback. - * @param {*} returnValue Return value. + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @param {import("../../extent.js").Extent} extent Extent. + * @return {boolean} True if the geometry and the extent intersect. */ -function animationCallback(callback, returnValue) { - setTimeout(function() { - callback(returnValue); - }, 0); -} - - -/** - * @param {ViewOptions} options View options. - * @return {import("./centerconstraint.js").Type} The constraint. - */ -function createCenterConstraint(options) { - if (options.extent !== undefined) { - return createExtent(options.extent); - } else { - return none; +function intersectsLineString(flatCoordinates, offset, end, stride, extent) { + var coordinatesExtent = Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* extendFlatCoordinates */ "s"])( + Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* createEmpty */ "j"])(), flatCoordinates, offset, end, stride); + if (!Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* intersects */ "F"])(extent, coordinatesExtent)) { + return false; } + if (Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* containsExtent */ "g"])(extent, coordinatesExtent)) { + return true; + } + if (coordinatesExtent[0] >= extent[0] && + coordinatesExtent[2] <= extent[2]) { + return true; + } + if (coordinatesExtent[1] >= extent[1] && + coordinatesExtent[3] <= extent[3]) { + return true; + } + return Object(_segments_js__WEBPACK_IMPORTED_MODULE_2__[/* forEach */ "a"])(flatCoordinates, offset, end, stride, + /** + * @param {import("../../coordinate.js").Coordinate} point1 Start point. + * @param {import("../../coordinate.js").Coordinate} point2 End point. + * @return {boolean} `true` if the segment and the extent intersect, + * `false` otherwise. + */ + function(point1, point2) { + return Object(_extent_js__WEBPACK_IMPORTED_MODULE_0__[/* intersectsSegment */ "G"])(extent, point1, point2); + }); } /** - * @param {ViewOptions} options View options. - * @return {{constraint: import("./resolutionconstraint.js").Type, maxResolution: number, - * minResolution: number, minZoom: number, zoomFactor: number}} The constraint. + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array} ends Ends. + * @param {number} stride Stride. + * @param {import("../../extent.js").Extent} extent Extent. + * @return {boolean} True if the geometry and the extent intersect. */ -function createResolutionConstraint(options) { - var resolutionConstraint; - var maxResolution; - var minResolution; - - // TODO: move these to be ol constants - // see https://github.com/openlayers/openlayers/issues/2076 - var defaultMaxZoom = 28; - var defaultZoomFactor = 2; - - var minZoom = options.minZoom !== undefined ? - options.minZoom : DEFAULT_MIN_ZOOM; - - var maxZoom = options.maxZoom !== undefined ? - options.maxZoom : defaultMaxZoom; - - var zoomFactor = options.zoomFactor !== undefined ? - options.zoomFactor : defaultZoomFactor; - - if (options.resolutions !== undefined) { - var resolutions = options.resolutions; - maxResolution = resolutions[minZoom]; - minResolution = resolutions[maxZoom] !== undefined ? - resolutions[maxZoom] : resolutions[resolutions.length - 1]; - resolutionConstraint = createSnapToResolutions( - resolutions); - } else { - // calculate the default min and max resolution - var projection = Object(proj["b" /* createProjection */])(options.projection, 'EPSG:3857'); - var extent = projection.getExtent(); - var size = !extent ? - // use an extent that can fit the whole world if need be - 360 * proj["a" /* METERS_PER_UNIT */][Units["b" /* default */].DEGREES] / - projection.getMetersPerUnit() : - Math.max(Object(ol_extent["E" /* getWidth */])(extent), Object(ol_extent["A" /* getHeight */])(extent)); - - var defaultMaxResolution = size / common["b" /* DEFAULT_TILE_SIZE */] / Math.pow( - defaultZoomFactor, DEFAULT_MIN_ZOOM); - - var defaultMinResolution = defaultMaxResolution / Math.pow( - defaultZoomFactor, defaultMaxZoom - DEFAULT_MIN_ZOOM); - - // user provided maxResolution takes precedence - maxResolution = options.maxResolution; - if (maxResolution !== undefined) { - minZoom = 0; - } else { - maxResolution = defaultMaxResolution / Math.pow(zoomFactor, minZoom); +function intersectsLineStringArray(flatCoordinates, offset, ends, stride, extent) { + for (var i = 0, ii = ends.length; i < ii; ++i) { + if (intersectsLineString( + flatCoordinates, offset, ends[i], stride, extent)) { + return true; } + offset = ends[i]; + } + return false; +} - // user provided minResolution takes precedence - minResolution = options.minResolution; - if (minResolution === undefined) { - if (options.maxZoom !== undefined) { - if (options.maxResolution !== undefined) { - minResolution = maxResolution / Math.pow(zoomFactor, maxZoom); - } else { - minResolution = defaultMaxResolution / Math.pow(zoomFactor, maxZoom); - } - } else { - minResolution = defaultMinResolution; + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @param {import("../../extent.js").Extent} extent Extent. + * @return {boolean} True if the geometry and the extent intersect. + */ +function intersectsLinearRing(flatCoordinates, offset, end, stride, extent) { + if (intersectsLineString( + flatCoordinates, offset, end, stride, extent)) { + return true; + } + if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* linearRingContainsXY */ "b"])(flatCoordinates, offset, end, stride, extent[0], extent[1])) { + return true; + } + if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* linearRingContainsXY */ "b"])(flatCoordinates, offset, end, stride, extent[0], extent[3])) { + return true; + } + if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* linearRingContainsXY */ "b"])(flatCoordinates, offset, end, stride, extent[2], extent[1])) { + return true; + } + if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* linearRingContainsXY */ "b"])(flatCoordinates, offset, end, stride, extent[2], extent[3])) { + return true; + } + return false; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array} ends Ends. + * @param {number} stride Stride. + * @param {import("../../extent.js").Extent} extent Extent. + * @return {boolean} True if the geometry and the extent intersect. + */ +function intersectsLinearRingArray(flatCoordinates, offset, ends, stride, extent) { + if (!intersectsLinearRing( + flatCoordinates, offset, ends[0], stride, extent)) { + return false; + } + if (ends.length === 1) { + return true; + } + for (var i = 1, ii = ends.length; i < ii; ++i) { + if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* linearRingContainsExtent */ "a"])(flatCoordinates, ends[i - 1], ends[i], stride, extent)) { + if (!intersectsLineString(flatCoordinates, ends[i - 1], ends[i], stride, extent)) { + return false; } } - - // given discrete zoom levels, minResolution may be different than provided - maxZoom = minZoom + Math.floor( - Math.log(maxResolution / minResolution) / Math.log(zoomFactor)); - minResolution = maxResolution / Math.pow(zoomFactor, maxZoom - minZoom); - - resolutionConstraint = createSnapToPower( - zoomFactor, maxResolution, maxZoom - minZoom); - } - return {constraint: resolutionConstraint, maxResolution: maxResolution, - minResolution: minResolution, minZoom: minZoom, zoomFactor: zoomFactor}; -} - - -/** - * @param {ViewOptions} options View options. - * @return {import("./rotationconstraint.js").Type} Rotation constraint. - */ -function createRotationConstraint(options) { - var enableRotation = options.enableRotation !== undefined ? - options.enableRotation : true; - if (enableRotation) { - var constrainRotation = options.constrainRotation; - if (constrainRotation === undefined || constrainRotation === true) { - return Object(rotationconstraint["b" /* createSnapToZero */])(); - } else if (constrainRotation === false) { - return rotationconstraint["d" /* none */]; - } else if (typeof constrainRotation === 'number') { - return Object(rotationconstraint["a" /* createSnapToN */])(constrainRotation); - } else { - return rotationconstraint["d" /* none */]; - } - } else { - return rotationconstraint["c" /* disable */]; - } -} - - -/** - * Determine if an animation involves no view change. - * @param {Animation} animation The animation. - * @return {boolean} The animation involves no view change. - */ -function isNoopAnimation(animation) { - if (animation.sourceCenter && animation.targetCenter) { - if (!Object(coordinate["b" /* equals */])(animation.sourceCenter, animation.targetCenter)) { - return false; - } - } - if (animation.sourceResolution !== animation.targetResolution) { - return false; - } - if (animation.sourceRotation !== animation.targetRotation) { - return false; } return true; } -/* harmony default export */ var ol_View = __webpack_exports__["a"] = (View_View); -//# sourceMappingURL=View.js.map +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array>} endss Endss. + * @param {number} stride Stride. + * @param {import("../../extent.js").Extent} extent Extent. + * @return {boolean} True if the geometry and the extent intersect. + */ +function intersectsLinearRingMultiArray(flatCoordinates, offset, endss, stride, extent) { + for (var i = 0, ii = endss.length; i < ii; ++i) { + var ends = endss[i]; + if (intersectsLinearRingArray( + flatCoordinates, offset, ends, stride, extent)) { + return true; + } + offset = ends[ends.length - 1]; + } + return false; +} + +//# sourceMappingURL=intersectsextent.js.map /***/ }), -/* 72 */ +/* 81 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; - -// EXTERNAL MODULE: ./node_modules/ol/color.js -var ol_color = __webpack_require__(38); - -// EXTERNAL MODULE: ./node_modules/ol/colorlike.js -var colorlike = __webpack_require__(31); - -// EXTERNAL MODULE: ./node_modules/ol/dom.js -var dom = __webpack_require__(15); - -// EXTERNAL MODULE: ./node_modules/ol/has.js -var has = __webpack_require__(17); - -// EXTERNAL MODULE: ./node_modules/ol/ImageState.js -var ImageState = __webpack_require__(20); - -// EXTERNAL MODULE: ./node_modules/ol/render/canvas.js -var canvas = __webpack_require__(3); - -// EXTERNAL MODULE: ./node_modules/ol/util.js -var util = __webpack_require__(1); - -// CONCATENATED MODULE: ./node_modules/ol/style/Image.js +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return forEach; }); /** - * @module ol/style/Image - */ - - - -/** - * @typedef {Object} Options - * @property {number} opacity - * @property {boolean} rotateWithView - * @property {number} rotation - * @property {number} scale + * @module ol/geom/flat/segments */ /** - * @classdesc - * A base class used for creating subclasses and not instantiated in - * apps. Base class for {@link module:ol/style/Icon~Icon}, {@link module:ol/style/Circle~CircleStyle} and - * {@link module:ol/style/RegularShape~RegularShape}. - * @abstract - * @api + * This function calls `callback` for each segment of the flat coordinates + * array. If the callback returns a truthy value the function returns that + * value immediately. Otherwise the function returns `false`. + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @param {function(this: S, import("../../coordinate.js").Coordinate, import("../../coordinate.js").Coordinate): T} callback Function + * called for each segment. + * @param {S=} opt_this The object to be used as the value of 'this' + * within callback. + * @return {T|boolean} Value. + * @template T,S */ -var Image_ImageStyle = function ImageStyle(options) { - - /** - * @private - * @type {number} - */ - this.opacity_ = options.opacity; - - /** - * @private - * @type {boolean} - */ - this.rotateWithView_ = options.rotateWithView; - - /** - * @private - * @type {number} - */ - this.rotation_ = options.rotation; - - /** - * @private - * @type {number} - */ - this.scale_ = options.scale; - -}; - -/** - * Clones the style. - * @return {ImageStyle} The cloned style. - * @api - */ -Image_ImageStyle.prototype.clone = function clone () { - return new Image_ImageStyle({ - opacity: this.getOpacity(), - scale: this.getScale(), - rotation: this.getRotation(), - rotateWithView: this.getRotateWithView() - }); -}; - -/** - * Get the symbolizer opacity. - * @return {number} Opacity. - * @api - */ -Image_ImageStyle.prototype.getOpacity = function getOpacity () { - return this.opacity_; -}; - -/** - * Determine whether the symbolizer rotates with the map. - * @return {boolean} Rotate with map. - * @api - */ -Image_ImageStyle.prototype.getRotateWithView = function getRotateWithView () { - return this.rotateWithView_; -}; - -/** - * Get the symoblizer rotation. - * @return {number} Rotation. - * @api - */ -Image_ImageStyle.prototype.getRotation = function getRotation () { - return this.rotation_; -}; - -/** - * Get the symbolizer scale. - * @return {number} Scale. - * @api - */ -Image_ImageStyle.prototype.getScale = function getScale () { - return this.scale_; -}; - -/** - * This method is deprecated and always returns false. - * @return {boolean} false. - * @deprecated - * @api - */ -Image_ImageStyle.prototype.getSnapToPixel = function getSnapToPixel () { +function forEach(flatCoordinates, offset, end, stride, callback, opt_this) { + var point1 = [flatCoordinates[offset], flatCoordinates[offset + 1]]; + var point2 = []; + var ret; + for (; (offset + stride) < end; offset += stride) { + point2[0] = flatCoordinates[offset + stride]; + point2[1] = flatCoordinates[offset + stride + 1]; + ret = callback.call(opt_this, point1, point2); + if (ret) { + return ret; + } + point1[0] = point2[0]; + point1[1] = point2[1]; + } return false; -}; +} + +//# sourceMappingURL=segments.js.map + +/***/ }), +/* 82 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/** + * @module ol/render/ReplayGroup + */ + /** - * Get the anchor point in pixels. The anchor determines the center point for the - * symbolizer. - * @abstract - * @return {Array} Anchor. + * Base class for replay groups. */ -Image_ImageStyle.prototype.getAnchor = function getAnchor () { - return Object(util["b" /* abstract */])(); -}; +var ReplayGroup = function ReplayGroup () {}; -/** - * Get the image element for the symbolizer. - * @abstract - * @param {number} pixelRatio Pixel ratio. - * @return {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} Image element. - */ -Image_ImageStyle.prototype.getImage = function getImage (pixelRatio) { - return Object(util["b" /* abstract */])(); +ReplayGroup.prototype.getReplay = function getReplay (zIndex, replayType) { + return Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* abstract */ "b"])(); }; /** * @abstract - * @param {number} pixelRatio Pixel ratio. - * @return {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} Image element. + * @return {boolean} Is empty. */ -Image_ImageStyle.prototype.getHitDetectionImage = function getHitDetectionImage (pixelRatio) { - return Object(util["b" /* abstract */])(); +ReplayGroup.prototype.isEmpty = function isEmpty () { + return Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* abstract */ "b"])(); }; /** * @abstract - * @return {import("../ImageState.js").default} Image state. + * @param {boolean} group Group with previous replay + * @return {Array<*>} The resulting instruction group */ -Image_ImageStyle.prototype.getImageState = function getImageState () { - return Object(util["b" /* abstract */])(); +ReplayGroup.prototype.addDeclutter = function addDeclutter (group) { + return Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* abstract */ "b"])(); }; -/** - * @abstract - * @return {import("../size.js").Size} Image size. - */ -Image_ImageStyle.prototype.getImageSize = function getImageSize () { - return Object(util["b" /* abstract */])(); -}; +/* harmony default export */ __webpack_exports__["a"] = (ReplayGroup); -/** - * @abstract - * @return {import("../size.js").Size} Size of the hit-detection image. - */ -Image_ImageStyle.prototype.getHitDetectionImageSize = function getHitDetectionImageSize () { - return Object(util["b" /* abstract */])(); -}; +//# sourceMappingURL=ReplayGroup.js.map -/** - * Get the origin of the symbolizer. - * @abstract - * @return {Array} Origin. - */ -Image_ImageStyle.prototype.getOrigin = function getOrigin () { - return Object(util["b" /* abstract */])(); -}; +/***/ }), +/* 83 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var _ImageState_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(26); +/* harmony import */ var _Observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(77); +/* harmony import */ var _TileState_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8); +/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3); +/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7); +/* harmony import */ var _source_State_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(43); /** - * Get the size of the symbolizer (in pixels). - * @abstract - * @return {import("../size.js").Size} Size. - */ -Image_ImageStyle.prototype.getSize = function getSize () { - return Object(util["b" /* abstract */])(); -}; - -/** - * Set the opacity. - * - * @param {number} opacity Opacity. - * @api - */ -Image_ImageStyle.prototype.setOpacity = function setOpacity (opacity) { - this.opacity_ = opacity; -}; - -/** - * Set whether to rotate the style with the view. - * - * @param {boolean} rotateWithView Rotate with map. - * @api - */ -Image_ImageStyle.prototype.setRotateWithView = function setRotateWithView (rotateWithView) { - this.rotateWithView_ = rotateWithView; -}; - -/** - * Set the rotation. - * - * @param {number} rotation Rotation. - * @api - */ -Image_ImageStyle.prototype.setRotation = function setRotation (rotation) { - this.rotation_ = rotation; -}; -/** - * Set the scale. - * - * @param {number} scale Scale. - * @api - */ -Image_ImageStyle.prototype.setScale = function setScale (scale) { - this.scale_ = scale; -}; - -/** - * This method is deprecated and does nothing. - * @param {boolean} snapToPixel Snap to pixel? - * @deprecated - * @api - */ -Image_ImageStyle.prototype.setSnapToPixel = function setSnapToPixel (snapToPixel) {}; - -/** - * @abstract - * @param {function(this: T, import("../events/Event.js").default)} listener Listener function. - * @param {T} thisArg Value to use as `this` when executing `listener`. - * @return {import("../events.js").EventsKey|undefined} Listener key. - * @template T - */ -Image_ImageStyle.prototype.listenImageChange = function listenImageChange (listener, thisArg) { - return Object(util["b" /* abstract */])(); -}; - -/** - * Load not yet loaded URI. - * @abstract - */ -Image_ImageStyle.prototype.load = function load () { - Object(util["b" /* abstract */])(); -}; - -/** - * @abstract - * @param {function(this: T, import("../events/Event.js").default)} listener Listener function. - * @param {T} thisArg Value to use as `this` when executing `listener`. - * @template T - */ -Image_ImageStyle.prototype.unlistenImageChange = function unlistenImageChange (listener, thisArg) { - Object(util["b" /* abstract */])(); -}; - -/* harmony default export */ var Image = (Image_ImageStyle); - -//# sourceMappingURL=Image.js.map -// CONCATENATED MODULE: ./node_modules/ol/style/RegularShape.js -/** - * @module ol/style/RegularShape + * @module ol/renderer/Layer */ @@ -14728,691 +15990,716 @@ Image_ImageStyle.prototype.unlistenImageChange = function unlistenImageChange (l +var LayerRenderer = /*@__PURE__*/(function (Observable) { + function LayerRenderer(layer) { - -/** - * Specify radius for regular polygons, or radius1 and radius2 for stars. - * @typedef {Object} Options - * @property {import("./Fill.js").default} [fill] Fill style. - * @property {number} points Number of points for stars and regular polygons. In case of a polygon, the number of points - * is the number of sides. - * @property {number} [radius] Radius of a regular polygon. - * @property {number} [radius1] Outer radius of a star. - * @property {number} [radius2] Inner radius of a star. - * @property {number} [angle=0] Shape's angle in radians. A value of 0 will have one of the shape's point facing up. - * @property {import("./Stroke.js").default} [stroke] Stroke style. - * @property {number} [rotation=0] Rotation in radians (positive rotation clockwise). - * @property {boolean} [rotateWithView=false] Whether to rotate the shape with the view. - * @property {import("./AtlasManager.js").default} [atlasManager] The atlas manager to use for this symbol. When - * using WebGL it is recommended to use an atlas manager to avoid texture switching. If an atlas manager is given, the - * symbol is added to an atlas. By default no atlas manager is used. - */ - - -/** - * @typedef {Object} RenderOptions - * @property {import("../colorlike.js").ColorLike} [strokeStyle] - * @property {number} strokeWidth - * @property {number} size - * @property {string} lineCap - * @property {Array} lineDash - * @property {number} lineDashOffset - * @property {string} lineJoin - * @property {number} miterLimit - */ - - -/** - * @classdesc - * Set regular shape style for vector features. The resulting shape will be - * a regular polygon when `radius` is provided, or a star when `radius1` and - * `radius2` are provided. - * @api - */ -var RegularShape_RegularShape = /*@__PURE__*/(function (ImageStyle) { - function RegularShape(options) { - /** - * @type {boolean} - */ - var rotateWithView = options.rotateWithView !== undefined ? - options.rotateWithView : false; - - ImageStyle.call(this, { - opacity: 1, - rotateWithView: rotateWithView, - rotation: options.rotation !== undefined ? options.rotation : 0, - scale: 1 - }); + Observable.call(this); /** * @private - * @type {Array} + * @type {import("../layer/Layer.js").default} */ - this.checksums_ = null; - - /** - * @private - * @type {HTMLCanvasElement} - */ - this.canvas_ = null; - - /** - * @private - * @type {HTMLCanvasElement} - */ - this.hitDetectionCanvas_ = null; - - /** - * @private - * @type {import("./Fill.js").default} - */ - this.fill_ = options.fill !== undefined ? options.fill : null; - - /** - * @private - * @type {Array} - */ - this.origin_ = [0, 0]; - - /** - * @private - * @type {number} - */ - this.points_ = options.points; - - /** - * @protected - * @type {number} - */ - this.radius_ = /** @type {number} */ (options.radius !== undefined ? - options.radius : options.radius1); - - /** - * @private - * @type {number|undefined} - */ - this.radius2_ = options.radius2; - - /** - * @private - * @type {number} - */ - this.angle_ = options.angle !== undefined ? options.angle : 0; - - /** - * @private - * @type {import("./Stroke.js").default} - */ - this.stroke_ = options.stroke !== undefined ? options.stroke : null; - - /** - * @private - * @type {Array} - */ - this.anchor_ = null; - - /** - * @private - * @type {import("../size.js").Size} - */ - this.size_ = null; - - /** - * @private - * @type {import("../size.js").Size} - */ - this.imageSize_ = null; - - /** - * @private - * @type {import("../size.js").Size} - */ - this.hitDetectionImageSize_ = null; - - /** - * @protected - * @type {import("./AtlasManager.js").default|undefined} - */ - this.atlasManager_ = options.atlasManager; - - this.render_(this.atlasManager_); + this.layer_ = layer; } - if ( ImageStyle ) RegularShape.__proto__ = ImageStyle; - RegularShape.prototype = Object.create( ImageStyle && ImageStyle.prototype ); - RegularShape.prototype.constructor = RegularShape; + if ( Observable ) LayerRenderer.__proto__ = Observable; + LayerRenderer.prototype = Object.create( Observable && Observable.prototype ); + LayerRenderer.prototype.constructor = LayerRenderer; /** - * Clones the style. If an atlasmanager was provided to the original style it will be used in the cloned style, too. - * @return {RegularShape} The cloned style. - * @api + * Create a function that adds loaded tiles to the tile lookup. + * @param {import("../source/Tile.js").default} source Tile source. + * @param {import("../proj/Projection.js").default} projection Projection of the tiles. + * @param {Object>} tiles Lookup of loaded tiles by zoom level. + * @return {function(number, import("../TileRange.js").default):boolean} A function that can be + * called with a zoom level and a tile range to add loaded tiles to the lookup. + * @protected */ - RegularShape.prototype.clone = function clone () { - var style = new RegularShape({ - fill: this.getFill() ? this.getFill().clone() : undefined, - points: this.getPoints(), - radius: this.getRadius(), - radius2: this.getRadius2(), - angle: this.getAngle(), - stroke: this.getStroke() ? this.getStroke().clone() : undefined, - rotation: this.getRotation(), - rotateWithView: this.getRotateWithView(), - atlasManager: this.atlasManager_ - }); - style.setOpacity(this.getOpacity()); - style.setScale(this.getScale()); - return style; + LayerRenderer.prototype.createLoadedTileFinder = function createLoadedTileFinder (source, projection, tiles) { + return ( + /** + * @param {number} zoom Zoom level. + * @param {import("../TileRange.js").default} tileRange Tile range. + * @return {boolean} The tile range is fully loaded. + */ + function(zoom, tileRange) { + /** + * @param {import("../Tile.js").default} tile Tile. + */ + function callback(tile) { + if (!tiles[zoom]) { + tiles[zoom] = {}; + } + tiles[zoom][tile.tileCoord.toString()] = tile; + } + return source.forEachLoadedTile(projection, zoom, tileRange, callback); + } + ); }; /** - * @inheritDoc - * @api + * @abstract + * @param {import("../coordinate.js").Coordinate} coordinate Coordinate. + * @param {import("../PluggableMap.js").FrameState} frameState Frame state. + * @param {number} hitTolerance Hit tolerance in pixels. + * @param {function(import("../Feature.js").FeatureLike, import("../layer/Layer.js").default): T} callback Feature callback. + * @return {T|void} Callback result. + * @template T */ - RegularShape.prototype.getAnchor = function getAnchor () { - return this.anchor_; + LayerRenderer.prototype.forEachFeatureAtCoordinate = function forEachFeatureAtCoordinate (coordinate, frameState, hitTolerance, callback) {}; + + /** + * @return {import("../layer/Layer.js").default} Layer. + */ + LayerRenderer.prototype.getLayer = function getLayer () { + return this.layer_; }; /** - * Get the angle used in generating the shape. - * @return {number} Shape's rotation in radians. - * @api + * Handle changes in image state. + * @param {import("../events/Event.js").default} event Image change event. + * @private */ - RegularShape.prototype.getAngle = function getAngle () { - return this.angle_; + LayerRenderer.prototype.handleImageChange_ = function handleImageChange_ (event) { + var image = /** @type {import("../Image.js").default} */ (event.target); + if (image.getState() === _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].LOADED) { + this.renderIfReadyAndVisible(); + } }; /** - * Get the fill style for the shape. - * @return {import("./Fill.js").default} Fill style. - * @api + * @param {import("../coordinate.js").Coordinate} coordinate Coordinate. + * @param {import("../PluggableMap.js").FrameState} frameState Frame state. + * @return {boolean} Is there a feature at the given coordinate? */ - RegularShape.prototype.getFill = function getFill () { - return this.fill_; + LayerRenderer.prototype.hasFeatureAtCoordinate = function hasFeatureAtCoordinate (coordinate, frameState) { + return false; }; /** - * @inheritDoc + * Load the image if not already loaded, and register the image change + * listener if needed. + * @param {import("../ImageBase.js").default} image Image. + * @return {boolean} `true` if the image is already loaded, `false` otherwise. + * @protected */ - RegularShape.prototype.getHitDetectionImage = function getHitDetectionImage (pixelRatio) { - return this.hitDetectionCanvas_; + LayerRenderer.prototype.loadImage = function loadImage (image) { + var imageState = image.getState(); + if (imageState != _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].LOADED && imageState != _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].ERROR) { + Object(_events_js__WEBPACK_IMPORTED_MODULE_4__[/* listen */ "a"])(image, _events_EventType_js__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"].CHANGE, this.handleImageChange_, this); + } + if (imageState == _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].IDLE) { + image.load(); + imageState = image.getState(); + } + return imageState == _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].LOADED; }; - /** - * @inheritDoc - * @api - */ - RegularShape.prototype.getImage = function getImage (pixelRatio) { - return this.canvas_; - }; - - /** - * @inheritDoc - */ - RegularShape.prototype.getImageSize = function getImageSize () { - return this.imageSize_; - }; - - /** - * @inheritDoc - */ - RegularShape.prototype.getHitDetectionImageSize = function getHitDetectionImageSize () { - return this.hitDetectionImageSize_; - }; - - /** - * @inheritDoc - */ - RegularShape.prototype.getImageState = function getImageState () { - return ImageState["a" /* default */].LOADED; - }; - - /** - * @inheritDoc - * @api - */ - RegularShape.prototype.getOrigin = function getOrigin () { - return this.origin_; - }; - - /** - * Get the number of points for generating the shape. - * @return {number} Number of points for stars and regular polygons. - * @api - */ - RegularShape.prototype.getPoints = function getPoints () { - return this.points_; - }; - - /** - * Get the (primary) radius for the shape. - * @return {number} Radius. - * @api - */ - RegularShape.prototype.getRadius = function getRadius () { - return this.radius_; - }; - - /** - * Get the secondary radius for the shape. - * @return {number|undefined} Radius2. - * @api - */ - RegularShape.prototype.getRadius2 = function getRadius2 () { - return this.radius2_; - }; - - /** - * @inheritDoc - * @api - */ - RegularShape.prototype.getSize = function getSize () { - return this.size_; - }; - - /** - * Get the stroke style for the shape. - * @return {import("./Stroke.js").default} Stroke style. - * @api - */ - RegularShape.prototype.getStroke = function getStroke () { - return this.stroke_; - }; - - /** - * @inheritDoc - */ - RegularShape.prototype.listenImageChange = function listenImageChange (listener, thisArg) { - return undefined; - }; - - /** - * @inheritDoc - */ - RegularShape.prototype.load = function load () {}; - - /** - * @inheritDoc - */ - RegularShape.prototype.unlistenImageChange = function unlistenImageChange (listener, thisArg) {}; - /** * @protected - * @param {import("./AtlasManager.js").default|undefined} atlasManager An atlas manager. */ - RegularShape.prototype.render_ = function render_ (atlasManager) { - var imageSize; - var lineCap = ''; - var lineJoin = ''; - var miterLimit = 0; - var lineDash = null; - var lineDashOffset = 0; - var strokeStyle; - var strokeWidth = 0; - - if (this.stroke_) { - strokeStyle = this.stroke_.getColor(); - if (strokeStyle === null) { - strokeStyle = canvas["k" /* defaultStrokeStyle */]; - } - strokeStyle = Object(colorlike["a" /* asColorLike */])(strokeStyle); - strokeWidth = this.stroke_.getWidth(); - if (strokeWidth === undefined) { - strokeWidth = canvas["h" /* defaultLineWidth */]; - } - lineDash = this.stroke_.getLineDash(); - lineDashOffset = this.stroke_.getLineDashOffset(); - if (!has["a" /* CANVAS_LINE_DASH */]) { - lineDash = null; - lineDashOffset = 0; - } - lineJoin = this.stroke_.getLineJoin(); - if (lineJoin === undefined) { - lineJoin = canvas["g" /* defaultLineJoin */]; - } - lineCap = this.stroke_.getLineCap(); - if (lineCap === undefined) { - lineCap = canvas["d" /* defaultLineCap */]; - } - miterLimit = this.stroke_.getMiterLimit(); - if (miterLimit === undefined) { - miterLimit = canvas["i" /* defaultMiterLimit */]; - } + LayerRenderer.prototype.renderIfReadyAndVisible = function renderIfReadyAndVisible () { + var layer = this.getLayer(); + if (layer.getVisible() && layer.getSourceState() == _source_State_js__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"].READY) { + this.changed(); } + }; - var size = 2 * (this.radius_ + strokeWidth) + 1; + /** + * @param {import("../PluggableMap.js").FrameState} frameState Frame state. + * @param {import("../source/Tile.js").default} tileSource Tile source. + * @protected + */ + LayerRenderer.prototype.scheduleExpireCache = function scheduleExpireCache (frameState, tileSource) { + if (tileSource.canExpireCache()) { + /** + * @param {import("../source/Tile.js").default} tileSource Tile source. + * @param {import("../PluggableMap.js").default} map Map. + * @param {import("../PluggableMap.js").FrameState} frameState Frame state. + */ + var postRenderFunction = function(tileSource, map, frameState) { + var tileSourceKey = Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* getUid */ "c"])(tileSource); + if (tileSourceKey in frameState.usedTiles) { + tileSource.expireCache(frameState.viewState.projection, + frameState.usedTiles[tileSourceKey]); + } + }.bind(null, tileSource); - /** @type {RenderOptions} */ - var renderOptions = { - strokeStyle: strokeStyle, - strokeWidth: strokeWidth, - size: size, - lineCap: lineCap, - lineDash: lineDash, - lineDashOffset: lineDashOffset, - lineJoin: lineJoin, - miterLimit: miterLimit - }; + frameState.postRenderFunctions.push( + /** @type {import("../PluggableMap.js").PostRenderFunction} */ (postRenderFunction) + ); + } + }; - if (atlasManager === undefined) { - // no atlas manager is used, create a new canvas - var context = Object(dom["a" /* createCanvasContext2D */])(size, size); - this.canvas_ = context.canvas; - - // canvas.width and height are rounded to the closest integer - size = this.canvas_.width; - imageSize = size; - - this.draw_(renderOptions, context, 0, 0); - - this.createHitDetectionCanvas_(renderOptions); - } else { - // an atlas manager is used, add the symbol to an atlas - size = Math.round(size); - - var hasCustomHitDetectionImage = !this.fill_; - var renderHitDetectionCallback; - if (hasCustomHitDetectionImage) { - // render the hit-detection image into a separate atlas image - renderHitDetectionCallback = - this.drawHitDetectionCanvas_.bind(this, renderOptions); - } - - var id = this.getChecksum(); - var info = atlasManager.add( - id, size, size, this.draw_.bind(this, renderOptions), - renderHitDetectionCallback); - - this.canvas_ = info.image; - this.origin_ = [info.offsetX, info.offsetY]; - imageSize = info.image.width; - - if (hasCustomHitDetectionImage) { - this.hitDetectionCanvas_ = info.hitImage; - this.hitDetectionImageSize_ = - [info.hitImage.width, info.hitImage.height]; + /** + * @param {!Object>} usedTiles Used tiles. + * @param {import("../source/Tile.js").default} tileSource Tile source. + * @param {number} z Z. + * @param {import("../TileRange.js").default} tileRange Tile range. + * @protected + */ + LayerRenderer.prototype.updateUsedTiles = function updateUsedTiles (usedTiles, tileSource, z, tileRange) { + // FIXME should we use tilesToDrawByZ instead? + var tileSourceKey = Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* getUid */ "c"])(tileSource); + var zKey = z.toString(); + if (tileSourceKey in usedTiles) { + if (zKey in usedTiles[tileSourceKey]) { + usedTiles[tileSourceKey][zKey].extend(tileRange); } else { - this.hitDetectionCanvas_ = this.canvas_; - this.hitDetectionImageSize_ = [imageSize, imageSize]; + usedTiles[tileSourceKey][zKey] = tileRange; } - } - - this.anchor_ = [size / 2, size / 2]; - this.size_ = [size, size]; - this.imageSize_ = [imageSize, imageSize]; - }; - - /** - * @private - * @param {RenderOptions} renderOptions Render options. - * @param {CanvasRenderingContext2D} context The rendering context. - * @param {number} x The origin for the symbol (x). - * @param {number} y The origin for the symbol (y). - */ - RegularShape.prototype.draw_ = function draw_ (renderOptions, context, x, y) { - var i, angle0, radiusC; - // reset transform - context.setTransform(1, 0, 0, 1, 0, 0); - - // then move to (x, y) - context.translate(x, y); - - context.beginPath(); - - var points = this.points_; - if (points === Infinity) { - context.arc( - renderOptions.size / 2, renderOptions.size / 2, - this.radius_, 0, 2 * Math.PI, true); } else { - var radius2 = (this.radius2_ !== undefined) ? this.radius2_ - : this.radius_; - if (radius2 !== this.radius_) { - points = 2 * points; - } - for (i = 0; i <= points; i++) { - angle0 = i * 2 * Math.PI / points - Math.PI / 2 + this.angle_; - radiusC = i % 2 === 0 ? this.radius_ : radius2; - context.lineTo(renderOptions.size / 2 + radiusC * Math.cos(angle0), - renderOptions.size / 2 + radiusC * Math.sin(angle0)); - } + usedTiles[tileSourceKey] = {}; + usedTiles[tileSourceKey][zKey] = tileRange; } - - - if (this.fill_) { - var color = this.fill_.getColor(); - if (color === null) { - color = canvas["b" /* defaultFillStyle */]; - } - context.fillStyle = Object(colorlike["a" /* asColorLike */])(color); - context.fill(); - } - if (this.stroke_) { - context.strokeStyle = renderOptions.strokeStyle; - context.lineWidth = renderOptions.strokeWidth; - if (renderOptions.lineDash) { - context.setLineDash(renderOptions.lineDash); - context.lineDashOffset = renderOptions.lineDashOffset; - } - context.lineCap = /** @type {CanvasLineCap} */ (renderOptions.lineCap); - context.lineJoin = /** @type {CanvasLineJoin} */ (renderOptions.lineJoin); - context.miterLimit = renderOptions.miterLimit; - context.stroke(); - } - context.closePath(); }; /** - * @private - * @param {RenderOptions} renderOptions Render options. + * Manage tile pyramid. + * This function performs a number of functions related to the tiles at the + * current zoom and lower zoom levels: + * - registers idle tiles in frameState.wantedTiles so that they are not + * discarded by the tile queue + * - enqueues missing tiles + * @param {import("../PluggableMap.js").FrameState} frameState Frame state. + * @param {import("../source/Tile.js").default} tileSource Tile source. + * @param {import("../tilegrid/TileGrid.js").default} tileGrid Tile grid. + * @param {number} pixelRatio Pixel ratio. + * @param {import("../proj/Projection.js").default} projection Projection. + * @param {import("../extent.js").Extent} extent Extent. + * @param {number} currentZ Current Z. + * @param {number} preload Load low resolution tiles up to 'preload' levels. + * @param {function(this: T, import("../Tile.js").default)=} opt_tileCallback Tile callback. + * @param {T=} opt_this Object to use as `this` in `opt_tileCallback`. + * @protected + * @template T */ - RegularShape.prototype.createHitDetectionCanvas_ = function createHitDetectionCanvas_ (renderOptions) { - this.hitDetectionImageSize_ = [renderOptions.size, renderOptions.size]; - if (this.fill_) { - this.hitDetectionCanvas_ = this.canvas_; + LayerRenderer.prototype.manageTilePyramid = function manageTilePyramid ( + frameState, + tileSource, + tileGrid, + pixelRatio, + projection, + extent, + currentZ, + preload, + opt_tileCallback, + opt_this + ) { + var tileSourceKey = Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* getUid */ "c"])(tileSource); + if (!(tileSourceKey in frameState.wantedTiles)) { + frameState.wantedTiles[tileSourceKey] = {}; + } + var wantedTiles = frameState.wantedTiles[tileSourceKey]; + var tileQueue = frameState.tileQueue; + var minZoom = tileGrid.getMinZoom(); + var tile, tileRange, tileResolution, x, y, z; + for (z = minZoom; z <= currentZ; ++z) { + tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z, tileRange); + tileResolution = tileGrid.getResolution(z); + for (x = tileRange.minX; x <= tileRange.maxX; ++x) { + for (y = tileRange.minY; y <= tileRange.maxY; ++y) { + if (currentZ - z <= preload) { + tile = tileSource.getTile(z, x, y, pixelRatio, projection); + if (tile.getState() == _TileState_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].IDLE) { + wantedTiles[tile.getKey()] = true; + if (!tileQueue.isKeyQueued(tile.getKey())) { + tileQueue.enqueue([tile, tileSourceKey, + tileGrid.getTileCoordCenter(tile.tileCoord), tileResolution]); + } + } + if (opt_tileCallback !== undefined) { + opt_tileCallback.call(opt_this, tile); + } + } else { + tileSource.useTile(z, x, y, projection); + } + } + } + } + }; + + return LayerRenderer; +}(_Observable_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])); + +/* harmony default export */ __webpack_exports__["a"] = (LayerRenderer); + +//# sourceMappingURL=Layer.js.map + +/***/ }), +/* 84 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _structs_LRUCache_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(69); +/* harmony import */ var _tilecoord_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(38); +/** + * @module ol/TileCache + */ + + + +var TileCache = /*@__PURE__*/(function (LRUCache) { + function TileCache(opt_highWaterMark) { + + LRUCache.call(this, opt_highWaterMark); + + } + + if ( LRUCache ) TileCache.__proto__ = LRUCache; + TileCache.prototype = Object.create( LRUCache && LRUCache.prototype ); + TileCache.prototype.constructor = TileCache; + + /** + * @param {!Object} usedTiles Used tiles. + */ + TileCache.prototype.expireCache = function expireCache (usedTiles) { + while (this.canExpireCache()) { + var tile = this.peekLast(); + var zKey = tile.tileCoord[0].toString(); + if (zKey in usedTiles && usedTiles[zKey].contains(tile.tileCoord)) { + break; + } else { + this.pop().dispose(); + } + } + }; + + /** + * Prune all tiles from the cache that don't have the same z as the newest tile. + */ + TileCache.prototype.pruneExceptNewestZ = function pruneExceptNewestZ () { + if (this.getCount() === 0) { return; } - - // if no fill style is set, create an extra hit-detection image with a - // default fill style - var context = Object(dom["a" /* createCanvasContext2D */])(renderOptions.size, renderOptions.size); - this.hitDetectionCanvas_ = context.canvas; - - this.drawHitDetectionCanvas_(renderOptions, context, 0, 0); + var key = this.peekFirstKey(); + var tileCoord = Object(_tilecoord_js__WEBPACK_IMPORTED_MODULE_1__[/* fromKey */ "b"])(key); + var z = tileCoord[0]; + this.forEach(function(tile) { + if (tile.tileCoord[0] !== z) { + this.remove(Object(_tilecoord_js__WEBPACK_IMPORTED_MODULE_1__[/* getKey */ "c"])(tile.tileCoord)); + tile.dispose(); + } + }, this); }; - /** - * @private - * @param {RenderOptions} renderOptions Render options. - * @param {CanvasRenderingContext2D} context The context. - * @param {number} x The origin for the symbol (x). - * @param {number} y The origin for the symbol (y). - */ - RegularShape.prototype.drawHitDetectionCanvas_ = function drawHitDetectionCanvas_ (renderOptions, context, x, y) { - // reset transform - context.setTransform(1, 0, 0, 1, 0, 0); - - // then move to (x, y) - context.translate(x, y); - - context.beginPath(); - - var points = this.points_; - if (points === Infinity) { - context.arc( - renderOptions.size / 2, renderOptions.size / 2, - this.radius_, 0, 2 * Math.PI, true); - } else { - var radius2 = (this.radius2_ !== undefined) ? this.radius2_ - : this.radius_; - if (radius2 !== this.radius_) { - points = 2 * points; - } - var i, radiusC, angle0; - for (i = 0; i <= points; i++) { - angle0 = i * 2 * Math.PI / points - Math.PI / 2 + this.angle_; - radiusC = i % 2 === 0 ? this.radius_ : radius2; - context.lineTo(renderOptions.size / 2 + radiusC * Math.cos(angle0), - renderOptions.size / 2 + radiusC * Math.sin(angle0)); - } - } - - context.fillStyle = Object(ol_color["a" /* asString */])(canvas["b" /* defaultFillStyle */]); - context.fill(); - if (this.stroke_) { - context.strokeStyle = renderOptions.strokeStyle; - context.lineWidth = renderOptions.strokeWidth; - if (renderOptions.lineDash) { - context.setLineDash(renderOptions.lineDash); - context.lineDashOffset = renderOptions.lineDashOffset; - } - context.stroke(); - } - context.closePath(); - }; - - /** - * @return {string} The checksum. - */ - RegularShape.prototype.getChecksum = function getChecksum () { - var strokeChecksum = this.stroke_ ? - this.stroke_.getChecksum() : '-'; - var fillChecksum = this.fill_ ? - this.fill_.getChecksum() : '-'; - - var recalculate = !this.checksums_ || - (strokeChecksum != this.checksums_[1] || - fillChecksum != this.checksums_[2] || - this.radius_ != this.checksums_[3] || - this.radius2_ != this.checksums_[4] || - this.angle_ != this.checksums_[5] || - this.points_ != this.checksums_[6]); - - if (recalculate) { - var checksum = 'r' + strokeChecksum + fillChecksum + - (this.radius_ !== undefined ? this.radius_.toString() : '-') + - (this.radius2_ !== undefined ? this.radius2_.toString() : '-') + - (this.angle_ !== undefined ? this.angle_.toString() : '-') + - (this.points_ !== undefined ? this.points_.toString() : '-'); - this.checksums_ = [checksum, strokeChecksum, fillChecksum, - this.radius_, this.radius2_, this.angle_, this.points_]; - } - - return /** @type {string} */ (this.checksums_[0]); - }; - - return RegularShape; -}(Image)); + return TileCache; +}(_structs_LRUCache_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])); -/* harmony default export */ var style_RegularShape = (RegularShape_RegularShape); +/* harmony default export */ __webpack_exports__["a"] = (TileCache); -//# sourceMappingURL=RegularShape.js.map -// CONCATENATED MODULE: ./node_modules/ol/style/Circle.js +//# sourceMappingURL=TileCache.js.map + +/***/ }), +/* 85 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20); +/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15); +/* harmony import */ var _State_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(43); /** - * @module ol/style/Circle + * @module ol/source/Source */ + + +/** + * A function that returns a string or an array of strings representing source + * attributions. + * + * @typedef {function(import("../PluggableMap.js").FrameState): (string|Array)} Attribution + */ + + +/** + * A type that can be used to provide attribution information for data sources. + * + * It represents either + * * a simple string (e.g. `'© Acme Inc.'`) + * * an array of simple strings (e.g. `['© Acme Inc.', '© Bacme Inc.']`) + * * a function that returns a string or array of strings (`{@link module:ol/source/Source~Attribution}`) + * + * @typedef {string|Array|Attribution} AttributionLike + */ + + /** * @typedef {Object} Options - * @property {import("./Fill.js").default} [fill] Fill style. - * @property {number} radius Circle radius. - * @property {import("./Stroke.js").default} [stroke] Stroke style. - * @property {import("./AtlasManager.js").default} [atlasManager] The atlas manager to use for this circle. - * When using WebGL it is recommended to use an atlas manager to avoid texture switching. If an atlas manager is given, - * the circle is added to an atlas. By default no atlas manager is used. + * @property {AttributionLike} [attributions] + * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible. + * @property {import("../proj.js").ProjectionLike} projection + * @property {SourceState} [state='ready'] + * @property {boolean} [wrapX=false] */ /** * @classdesc - * Set circle style for vector features. + * Abstract base class; normally only used for creating subclasses and not + * instantiated in apps. + * Base class for {@link module:ol/layer/Layer~Layer} sources. + * + * A generic `change` event is triggered when the state of the source changes. + * @abstract * @api */ -var CircleStyle = /*@__PURE__*/(function (RegularShape) { - function CircleStyle(opt_options) { +var Source = /*@__PURE__*/(function (BaseObject) { + function Source(options) { - var options = opt_options || /** @type {Options} */ ({}); + BaseObject.call(this); - RegularShape.call(this, { - points: Infinity, - fill: options.fill, - radius: options.radius, - stroke: options.stroke, - atlasManager: options.atlasManager - }); + /** + * @private + * @type {import("../proj/Projection.js").default} + */ + this.projection_ = Object(_proj_js__WEBPACK_IMPORTED_MODULE_2__[/* get */ "e"])(options.projection); + + /** + * @private + * @type {?Attribution} + */ + this.attributions_ = adaptAttributions(options.attributions); + + /** + * @private + * @type {boolean} + */ + this.attributionsCollapsible_ = options.attributionsCollapsible !== undefined ? + options.attributionsCollapsible : true; + + /** + * This source is currently loading data. Sources that defer loading to the + * map's tile queue never set this to `true`. + * @type {boolean} + */ + this.loading = false; + + /** + * @private + * @type {SourceState} + */ + this.state_ = options.state !== undefined ? + options.state : _State_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].READY; + + /** + * @private + * @type {boolean} + */ + this.wrapX_ = options.wrapX !== undefined ? options.wrapX : false; } - if ( RegularShape ) CircleStyle.__proto__ = RegularShape; - CircleStyle.prototype = Object.create( RegularShape && RegularShape.prototype ); - CircleStyle.prototype.constructor = CircleStyle; + if ( BaseObject ) Source.__proto__ = BaseObject; + Source.prototype = Object.create( BaseObject && BaseObject.prototype ); + Source.prototype.constructor = Source; /** - * Clones the style. If an atlasmanager was provided to the original style it will be used in the cloned style, too. - * @return {CircleStyle} The cloned style. - * @override - * @api - */ - CircleStyle.prototype.clone = function clone () { - var style = new CircleStyle({ - fill: this.getFill() ? this.getFill().clone() : undefined, - stroke: this.getStroke() ? this.getStroke().clone() : undefined, - radius: this.getRadius(), - atlasManager: this.atlasManager_ - }); - style.setOpacity(this.getOpacity()); - style.setScale(this.getScale()); - return style; + * Get the attribution function for the source. + * @return {?Attribution} Attribution function. + */ + Source.prototype.getAttributions = function getAttributions () { + return this.attributions_; }; /** - * Set the circle radius. - * - * @param {number} radius Circle radius. - * @api - */ - CircleStyle.prototype.setRadius = function setRadius (radius) { - this.radius_ = radius; - this.render_(this.atlasManager_); + * @return {boolean} Aattributions are collapsible. + */ + Source.prototype.getAttributionsCollapsible = function getAttributionsCollapsible () { + return this.attributionsCollapsible_; }; - return CircleStyle; -}(style_RegularShape)); + /** + * Get the projection of the source. + * @return {import("../proj/Projection.js").default} Projection. + * @api + */ + Source.prototype.getProjection = function getProjection () { + return this.projection_; + }; + + /** + * @abstract + * @return {Array|undefined} Resolutions. + */ + Source.prototype.getResolutions = function getResolutions () { + return Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* abstract */ "b"])(); + }; + + /** + * Get the state of the source, see {@link module:ol/source/State~State} for possible states. + * @return {SourceState} State. + * @api + */ + Source.prototype.getState = function getState () { + return this.state_; + }; + + /** + * @return {boolean|undefined} Wrap X. + */ + Source.prototype.getWrapX = function getWrapX () { + return this.wrapX_; + }; + + /** + * Refreshes the source and finally dispatches a 'change' event. + * @api + */ + Source.prototype.refresh = function refresh () { + this.changed(); + }; + + /** + * Set the attributions of the source. + * @param {AttributionLike|undefined} attributions Attributions. + * Can be passed as `string`, `Array`, `{@link module:ol/source/Source~Attribution}`, + * or `undefined`. + * @api + */ + Source.prototype.setAttributions = function setAttributions (attributions) { + this.attributions_ = adaptAttributions(attributions); + this.changed(); + }; + + /** + * Set the state of the source. + * @param {SourceState} state State. + * @protected + */ + Source.prototype.setState = function setState (state) { + this.state_ = state; + this.changed(); + }; + + return Source; +}(_Object_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])); -/* harmony default export */ var Circle = __webpack_exports__["a"] = (CircleStyle); +/** + * Turns the attributions option into an attributions function. + * @param {AttributionLike|undefined} attributionLike The attribution option. + * @return {?Attribution} An attribution function (or null). + */ +function adaptAttributions(attributionLike) { + if (!attributionLike) { + return null; + } + if (Array.isArray(attributionLike)) { + return function(frameState) { + return attributionLike; + }; + } -//# sourceMappingURL=Circle.js.map + if (typeof attributionLike === 'function') { + return attributionLike; + } + + return function(frameState) { + return [attributionLike]; + }; +} + + +/* harmony default export */ __webpack_exports__["a"] = (Source); + +//# sourceMappingURL=Source.js.map /***/ }), -/* 73 */ +/* 86 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony import */ var _Tile_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(87); +/* harmony import */ var _TileState_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8); +/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16); +/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3); +/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7); +/** + * @module ol/ImageTile + */ -// EXTERNAL MODULE: ./node_modules/ol/reproj/common.js -var common = __webpack_require__(32); -// EXTERNAL MODULE: ./node_modules/ol/util.js -var util = __webpack_require__(1); -// EXTERNAL MODULE: ./node_modules/ol/TileState.js -var TileState = __webpack_require__(7); -// EXTERNAL MODULE: ./node_modules/ol/easing.js -var easing = __webpack_require__(22); -// EXTERNAL MODULE: ./node_modules/ol/events/Target.js -var Target = __webpack_require__(36); -// EXTERNAL MODULE: ./node_modules/ol/events/EventType.js -var EventType = __webpack_require__(4); -// CONCATENATED MODULE: ./node_modules/ol/Tile.js +var ImageTile = /*@__PURE__*/(function (Tile) { + function ImageTile(tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) { + + Tile.call(this, tileCoord, state, opt_options); + + /** + * @private + * @type {?string} + */ + this.crossOrigin_ = crossOrigin; + + /** + * Image URI + * + * @private + * @type {string} + */ + this.src_ = src; + + /** + * @private + * @type {HTMLImageElement|HTMLCanvasElement} + */ + this.image_ = new Image(); + if (crossOrigin !== null) { + this.image_.crossOrigin = crossOrigin; + } + + /** + * @private + * @type {Array} + */ + this.imageListenerKeys_ = null; + + /** + * @private + * @type {import("./Tile.js").LoadFunction} + */ + this.tileLoadFunction_ = tileLoadFunction; + + } + + if ( Tile ) ImageTile.__proto__ = Tile; + ImageTile.prototype = Object.create( Tile && Tile.prototype ); + ImageTile.prototype.constructor = ImageTile; + + /** + * @inheritDoc + */ + ImageTile.prototype.disposeInternal = function disposeInternal () { + if (this.state == _TileState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].LOADING) { + this.unlistenImage_(); + this.image_ = getBlankImage(); + } + if (this.interimTile) { + this.interimTile.dispose(); + } + this.state = _TileState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].ABORT; + this.changed(); + Tile.prototype.disposeInternal.call(this); + }; + + /** + * Get the HTML image element for this tile (may be a Canvas, Image, or Video). + * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image. + * @api + */ + ImageTile.prototype.getImage = function getImage () { + return this.image_; + }; + + /** + * @inheritDoc + */ + ImageTile.prototype.getKey = function getKey () { + return this.src_; + }; + + /** + * Tracks loading or read errors. + * + * @private + */ + ImageTile.prototype.handleImageError_ = function handleImageError_ () { + this.state = _TileState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].ERROR; + this.unlistenImage_(); + this.image_ = getBlankImage(); + this.changed(); + }; + + /** + * Tracks successful image load. + * + * @private + */ + ImageTile.prototype.handleImageLoad_ = function handleImageLoad_ () { + var image = /** @type {HTMLImageElement} */ (this.image_); + if (image.naturalWidth && image.naturalHeight) { + this.state = _TileState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].LOADED; + } else { + this.state = _TileState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].EMPTY; + } + this.unlistenImage_(); + this.changed(); + }; + + /** + * @inheritDoc + * @api + */ + ImageTile.prototype.load = function load () { + if (this.state == _TileState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].ERROR) { + this.state = _TileState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].IDLE; + this.image_ = new Image(); + if (this.crossOrigin_ !== null) { + this.image_.crossOrigin = this.crossOrigin_; + } + } + if (this.state == _TileState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].IDLE) { + this.state = _TileState_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].LOADING; + this.changed(); + this.imageListenerKeys_ = [ + Object(_events_js__WEBPACK_IMPORTED_MODULE_3__[/* listenOnce */ "b"])(this.image_, _events_EventType_js__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"].ERROR, + this.handleImageError_, this), + Object(_events_js__WEBPACK_IMPORTED_MODULE_3__[/* listenOnce */ "b"])(this.image_, _events_EventType_js__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"].LOAD, + this.handleImageLoad_, this) + ]; + this.tileLoadFunction_(this, this.src_); + } + }; + + /** + * Discards event handlers which listen for load completion or errors. + * + * @private + */ + ImageTile.prototype.unlistenImage_ = function unlistenImage_ () { + this.imageListenerKeys_.forEach(_events_js__WEBPACK_IMPORTED_MODULE_3__[/* unlistenByKey */ "e"]); + this.imageListenerKeys_ = null; + }; + + return ImageTile; +}(_Tile_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])); + + +/** + * Get a 1-pixel blank image. + * @return {HTMLCanvasElement} Blank image. + */ +function getBlankImage() { + var ctx = Object(_dom_js__WEBPACK_IMPORTED_MODULE_2__[/* createCanvasContext2D */ "a"])(1, 1); + ctx.fillStyle = 'rgba(0,0,0,0)'; + ctx.fillRect(0, 0, 1, 1); + return ctx.canvas; +} + +/* harmony default export */ __webpack_exports__["a"] = (ImageTile); + +//# sourceMappingURL=ImageTile.js.map + +/***/ }), +/* 87 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _TileState_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); +/* harmony import */ var _easing_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(29); +/* harmony import */ var _events_Target_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(45); +/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7); /** * @module ol/Tile */ @@ -15489,7 +16776,7 @@ var EventType = __webpack_require__(4); * * @abstract */ -var Tile_Tile = /*@__PURE__*/(function (EventTarget) { +var Tile = /*@__PURE__*/(function (EventTarget) { function Tile(tileCoord, state, opt_options) { EventTarget.call(this); @@ -15545,7 +16832,7 @@ var Tile_Tile = /*@__PURE__*/(function (EventTarget) { * @protected */ Tile.prototype.changed = function changed () { - this.dispatchEvent(EventType["a" /* default */].CHANGE); + this.dispatchEvent(_events_EventType_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"].CHANGE); }; /** @@ -15573,7 +16860,7 @@ var Tile_Tile = /*@__PURE__*/(function (EventTarget) { // of the list (all those tiles correspond to older requests and will be // cleaned up by refreshInterimChain) do { - if (tile.getState() == TileState["a" /* default */].LOADED) { + if (tile.getState() == _TileState_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].LOADED) { return tile; } tile = tile.interimTile; @@ -15596,17 +16883,17 @@ var Tile_Tile = /*@__PURE__*/(function (EventTarget) { var prev = /** @type {Tile} */ (this); do { - if (tile.getState() == TileState["a" /* default */].LOADED) { + if (tile.getState() == _TileState_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].LOADED) { //we have a loaded tile, we can discard the rest of the list //we would could abort any LOADING tile request //older than this tile (i.e. any LOADING tile following this entry in the chain) tile.interimTile = null; break; - } else if (tile.getState() == TileState["a" /* default */].LOADING) { + } else if (tile.getState() == _TileState_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].LOADING) { //keep this LOADING tile any loaded tiles later in the chain are //older than this tile, so we're still interested in the request prev = tile; - } else if (tile.getState() == TileState["a" /* default */].IDLE) { + } else if (tile.getState() == _TileState_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"].IDLE) { //the head of the list is the most current tile, we don't need //to start any other requests for this chain prev.interimTile = tile.interimTile; @@ -15678,7 +16965,7 @@ var Tile_Tile = /*@__PURE__*/(function (EventTarget) { if (delta >= this.transition_) { return 1; } - return Object(easing["a" /* easeIn */])(delta / this.transition_); + return Object(_easing_js__WEBPACK_IMPORTED_MODULE_1__[/* easeIn */ "a"])(delta / this.transition_); }; /** @@ -15706,387 +16993,272 @@ var Tile_Tile = /*@__PURE__*/(function (EventTarget) { }; return Tile; -}(Target["a" /* default */])); +}(_events_Target_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])); -/* harmony default export */ var ol_Tile = (Tile_Tile); +/* harmony default export */ __webpack_exports__["a"] = (Tile); //# sourceMappingURL=Tile.js.map -// EXTERNAL MODULE: ./node_modules/ol/dom.js -var dom = __webpack_require__(15); -// EXTERNAL MODULE: ./node_modules/ol/events.js -var events = __webpack_require__(2); +/***/ }), +/* 88 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -// CONCATENATED MODULE: ./node_modules/ol/ImageTile.js +"use strict"; /** - * @module ol/ImageTile + * @module ol/layer/VectorRenderType */ - - - - - - -var ImageTile_ImageTile = /*@__PURE__*/(function (Tile) { - function ImageTile(tileCoord, state, src, crossOrigin, tileLoadFunction, opt_options) { - - Tile.call(this, tileCoord, state, opt_options); - - /** - * @private - * @type {?string} - */ - this.crossOrigin_ = crossOrigin; - - /** - * Image URI - * - * @private - * @type {string} - */ - this.src_ = src; - - /** - * @private - * @type {HTMLImageElement|HTMLCanvasElement} - */ - this.image_ = new Image(); - if (crossOrigin !== null) { - this.image_.crossOrigin = crossOrigin; - } - - /** - * @private - * @type {Array} - */ - this.imageListenerKeys_ = null; - - /** - * @private - * @type {import("./Tile.js").LoadFunction} - */ - this.tileLoadFunction_ = tileLoadFunction; - - } - - if ( Tile ) ImageTile.__proto__ = Tile; - ImageTile.prototype = Object.create( Tile && Tile.prototype ); - ImageTile.prototype.constructor = ImageTile; - - /** - * @inheritDoc - */ - ImageTile.prototype.disposeInternal = function disposeInternal () { - if (this.state == TileState["a" /* default */].LOADING) { - this.unlistenImage_(); - this.image_ = getBlankImage(); - } - if (this.interimTile) { - this.interimTile.dispose(); - } - this.state = TileState["a" /* default */].ABORT; - this.changed(); - Tile.prototype.disposeInternal.call(this); - }; - - /** - * Get the HTML image element for this tile (may be a Canvas, Image, or Video). - * @return {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} Image. - * @api - */ - ImageTile.prototype.getImage = function getImage () { - return this.image_; - }; - - /** - * @inheritDoc - */ - ImageTile.prototype.getKey = function getKey () { - return this.src_; - }; - - /** - * Tracks loading or read errors. - * - * @private - */ - ImageTile.prototype.handleImageError_ = function handleImageError_ () { - this.state = TileState["a" /* default */].ERROR; - this.unlistenImage_(); - this.image_ = getBlankImage(); - this.changed(); - }; - - /** - * Tracks successful image load. - * - * @private - */ - ImageTile.prototype.handleImageLoad_ = function handleImageLoad_ () { - var image = /** @type {HTMLImageElement} */ (this.image_); - if (image.naturalWidth && image.naturalHeight) { - this.state = TileState["a" /* default */].LOADED; - } else { - this.state = TileState["a" /* default */].EMPTY; - } - this.unlistenImage_(); - this.changed(); - }; - - /** - * @inheritDoc - * @api - */ - ImageTile.prototype.load = function load () { - if (this.state == TileState["a" /* default */].ERROR) { - this.state = TileState["a" /* default */].IDLE; - this.image_ = new Image(); - if (this.crossOrigin_ !== null) { - this.image_.crossOrigin = this.crossOrigin_; - } - } - if (this.state == TileState["a" /* default */].IDLE) { - this.state = TileState["a" /* default */].LOADING; - this.changed(); - this.imageListenerKeys_ = [ - Object(events["b" /* listenOnce */])(this.image_, EventType["a" /* default */].ERROR, - this.handleImageError_, this), - Object(events["b" /* listenOnce */])(this.image_, EventType["a" /* default */].LOAD, - this.handleImageLoad_, this) - ]; - this.tileLoadFunction_(this, this.src_); - } - }; - - /** - * Discards event handlers which listen for load completion or errors. - * - * @private - */ - ImageTile.prototype.unlistenImage_ = function unlistenImage_ () { - this.imageListenerKeys_.forEach(events["e" /* unlistenByKey */]); - this.imageListenerKeys_ = null; - }; - - return ImageTile; -}(ol_Tile)); - - /** - * Get a 1-pixel blank image. - * @return {HTMLCanvasElement} Blank image. - */ -function getBlankImage() { - var ctx = Object(dom["a" /* createCanvasContext2D */])(1, 1); - ctx.fillStyle = 'rgba(0,0,0,0)'; - ctx.fillRect(0, 0, 1, 1); - return ctx.canvas; -} - -/* harmony default export */ var ol_ImageTile = (ImageTile_ImageTile); - -//# sourceMappingURL=ImageTile.js.map -// EXTERNAL MODULE: ./node_modules/ol/structs/LRUCache.js -var structs_LRUCache = __webpack_require__(61); - -// CONCATENATED MODULE: ./node_modules/ol/tilecoord.js -/** - * @module ol/tilecoord - */ - - -/** - * An array of three numbers representing the location of a tile in a tile - * grid. The order is `z`, `x`, and `y`. `z` is the zoom level. - * @typedef {Array} TileCoord + * @enum {string} + * Render mode for vector layers: + * * `'image'`: Vector layers are rendered as images. Great performance, but + * point symbols and texts are always rotated with the view and pixels are + * scaled during zoom animations. + * * `'vector'`: Vector layers are rendered as vectors. Most accurate rendering + * even during animations, but slower performance. * @api */ +/* harmony default export */ __webpack_exports__["a"] = ({ + IMAGE: 'image', + VECTOR: 'vector' +}); + +//# sourceMappingURL=VectorRenderType.js.map + +/***/ }), +/* 89 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return lineStringLength; }); +/* unused harmony export linearRingLength */ +/** + * @module ol/geom/flat/length + */ /** - * @param {number} z Z. + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @return {number} Length. + */ +function lineStringLength(flatCoordinates, offset, end, stride) { + var x1 = flatCoordinates[offset]; + var y1 = flatCoordinates[offset + 1]; + var length = 0; + for (var i = offset + stride; i < end; i += stride) { + var x2 = flatCoordinates[i]; + var y2 = flatCoordinates[i + 1]; + length += Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); + x1 = x2; + y1 = y2; + } + return length; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @return {number} Perimeter. + */ +function linearRingLength(flatCoordinates, offset, end, stride) { + var perimeter = lineStringLength(flatCoordinates, offset, end, stride); + var dx = flatCoordinates[end - stride] - flatCoordinates[offset]; + var dy = flatCoordinates[end - stride + 1] - flatCoordinates[offset + 1]; + perimeter += Math.sqrt(dx * dx + dy * dy); + return perimeter; +} + +//# sourceMappingURL=length.js.map + +/***/ }), +/* 90 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * @module ol/style/TextPlacement + */ + +/** + * Text placement. One of `'point'`, `'line'`. Default is `'point'`. Note that + * `'line'` requires the underlying geometry to be a {@link module:ol/geom/LineString~LineString}, + * {@link module:ol/geom/Polygon~Polygon}, {@link module:ol/geom/MultiLineString~MultiLineString} or + * {@link module:ol/geom/MultiPolygon~MultiPolygon}. + * @enum {string} + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + POINT: 'point', + LINE: 'line' +}); + +//# sourceMappingURL=TextPlacement.js.map + +/***/ }), +/* 91 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// EXTERNAL MODULE: ./node_modules/ol/Collection.js +var Collection = __webpack_require__(39); + +// CONCATENATED MODULE: ./node_modules/ol/Kinetic.js +/** + * @module ol/Kinetic + */ + +/** + * @classdesc + * Implementation of inertial deceleration for map movement. + * + * @api + */ +var Kinetic = function Kinetic(decay, minVelocity, delay) { + + /** + * @private + * @type {number} + */ + this.decay_ = decay; + + /** + * @private + * @type {number} + */ + this.minVelocity_ = minVelocity; + + /** + * @private + * @type {number} + */ + this.delay_ = delay; + + /** + * @private + * @type {Array} + */ + this.points_ = []; + + /** + * @private + * @type {number} + */ + this.angle_ = 0; + + /** + * @private + * @type {number} + */ + this.initialVelocity_ = 0; +}; + +/** + * FIXME empty description for jsdoc + */ +Kinetic.prototype.begin = function begin () { + this.points_.length = 0; + this.angle_ = 0; + this.initialVelocity_ = 0; +}; + +/** * @param {number} x X. * @param {number} y Y. - * @param {TileCoord=} opt_tileCoord Tile coordinate. - * @return {TileCoord} Tile coordinate. */ -function createOrUpdate(z, x, y, opt_tileCoord) { - if (opt_tileCoord !== undefined) { - opt_tileCoord[0] = z; - opt_tileCoord[1] = x; - opt_tileCoord[2] = y; - return opt_tileCoord; - } else { - return [z, x, y]; - } -} - +Kinetic.prototype.update = function update (x, y) { + this.points_.push(x, y, Date.now()); +}; /** - * @param {number} z Z. - * @param {number} x X. - * @param {number} y Y. - * @return {string} Key. + * @return {boolean} Whether we should do kinetic animation. */ -function getKeyZXY(z, x, y) { - return z + '/' + x + '/' + y; -} - - -/** - * Get the key for a tile coord. - * @param {TileCoord} tileCoord The tile coord. - * @return {string} Key. - */ -function getKey(tileCoord) { - return getKeyZXY(tileCoord[0], tileCoord[1], tileCoord[2]); -} - - -/** - * Get a tile coord given a key. - * @param {string} key The tile coord key. - * @return {TileCoord} The tile coord. - */ -function fromKey(key) { - return key.split('/').map(Number); -} - - -/** - * @param {TileCoord} tileCoord Tile coord. - * @return {number} Hash. - */ -function hash(tileCoord) { - return (tileCoord[1] << tileCoord[0]) + tileCoord[2]; -} - - -/** - * @param {TileCoord} tileCoord Tile coord. - * @return {string} Quad key. - */ -function quadKey(tileCoord) { - var z = tileCoord[0]; - var digits = new Array(z); - var mask = 1 << (z - 1); - var i, charCode; - for (i = 0; i < z; ++i) { - // 48 is charCode for 0 - '0'.charCodeAt(0) - charCode = 48; - if (tileCoord[1] & mask) { - charCode += 1; - } - if (tileCoord[2] & mask) { - charCode += 2; - } - digits[i] = String.fromCharCode(charCode); - mask >>= 1; - } - return digits.join(''); -} - - -/** - * @param {TileCoord} tileCoord Tile coordinate. - * @param {!import("./tilegrid/TileGrid.js").default} tileGrid Tile grid. - * @return {boolean} Tile coordinate is within extent and zoom level range. - */ -function withinExtentAndZ(tileCoord, tileGrid) { - var z = tileCoord[0]; - var x = tileCoord[1]; - var y = tileCoord[2]; - - if (tileGrid.getMinZoom() > z || z > tileGrid.getMaxZoom()) { +Kinetic.prototype.end = function end () { + if (this.points_.length < 6) { + // at least 2 points are required (i.e. there must be at least 6 elements + // in the array) return false; } - var extent = tileGrid.getExtent(); - var tileRange; - if (!extent) { - tileRange = tileGrid.getFullTileRange(z); - } else { - tileRange = tileGrid.getTileRangeForExtentAndZ(extent, z); + var delay = Date.now() - this.delay_; + var lastIndex = this.points_.length - 3; + if (this.points_[lastIndex + 2] < delay) { + // the last tracked point is too old, which means that the user stopped + // panning before releasing the map + return false; } - if (!tileRange) { - return true; - } else { - return tileRange.containsXY(x, y); - } -} -//# sourceMappingURL=tilecoord.js.map -// CONCATENATED MODULE: ./node_modules/ol/TileCache.js + // get the first point which still falls into the delay time + var firstIndex = lastIndex - 3; + while (firstIndex > 0 && this.points_[firstIndex + 2] > delay) { + firstIndex -= 3; + } + + var duration = this.points_[lastIndex + 2] - this.points_[firstIndex + 2]; + // we don't want a duration of 0 (divide by zero) + // we also make sure the user panned for a duration of at least one frame + // (1/60s) to compute sane displacement values + if (duration < 1000 / 60) { + return false; + } + + var dx = this.points_[lastIndex] - this.points_[firstIndex]; + var dy = this.points_[lastIndex + 1] - this.points_[firstIndex + 1]; + this.angle_ = Math.atan2(dy, dx); + this.initialVelocity_ = Math.sqrt(dx * dx + dy * dy) / duration; + return this.initialVelocity_ > this.minVelocity_; +}; + /** - * @module ol/TileCache + * @return {number} Total distance travelled (pixels). + */ +Kinetic.prototype.getDistance = function getDistance () { + return (this.minVelocity_ - this.initialVelocity_) / this.decay_; +}; + +/** + * @return {number} Angle of the kinetic panning animation (radians). + */ +Kinetic.prototype.getAngle = function getAngle () { + return this.angle_; +}; + +/* harmony default export */ var ol_Kinetic = (Kinetic); + +//# sourceMappingURL=Kinetic.js.map +// EXTERNAL MODULE: ./node_modules/ol/MapBrowserEventType.js +var MapBrowserEventType = __webpack_require__(18); + +// EXTERNAL MODULE: ./node_modules/ol/Object.js +var ol_Object = __webpack_require__(20); + +// EXTERNAL MODULE: ./node_modules/ol/easing.js +var easing = __webpack_require__(29); + +// CONCATENATED MODULE: ./node_modules/ol/interaction/Property.js +/** + * @module ol/interaction/Property */ +/** + * @enum {string} + */ +/* harmony default export */ var Property = ({ + ACTIVE: 'active' +}); - -var TileCache_TileCache = /*@__PURE__*/(function (LRUCache) { - function TileCache(opt_highWaterMark) { - - LRUCache.call(this, opt_highWaterMark); - - } - - if ( LRUCache ) TileCache.__proto__ = LRUCache; - TileCache.prototype = Object.create( LRUCache && LRUCache.prototype ); - TileCache.prototype.constructor = TileCache; - - /** - * @param {!Object} usedTiles Used tiles. - */ - TileCache.prototype.expireCache = function expireCache (usedTiles) { - while (this.canExpireCache()) { - var tile = this.peekLast(); - var zKey = tile.tileCoord[0].toString(); - if (zKey in usedTiles && usedTiles[zKey].contains(tile.tileCoord)) { - break; - } else { - this.pop().dispose(); - } - } - }; - - /** - * Prune all tiles from the cache that don't have the same z as the newest tile. - */ - TileCache.prototype.pruneExceptNewestZ = function pruneExceptNewestZ () { - if (this.getCount() === 0) { - return; - } - var key = this.peekFirstKey(); - var tileCoord = fromKey(key); - var z = tileCoord[0]; - this.forEach(function(tile) { - if (tile.tileCoord[0] !== z) { - this.remove(getKey(tile.tileCoord)); - tile.dispose(); - } - }, this); - }; - - return TileCache; -}(structs_LRUCache["a" /* default */])); - - -/* harmony default export */ var ol_TileCache = (TileCache_TileCache); - -//# sourceMappingURL=TileCache.js.map -// EXTERNAL MODULE: ./node_modules/ol/proj.js + 5 modules -var ol_proj = __webpack_require__(13); - -// EXTERNAL MODULE: ./node_modules/ol/extent.js -var ol_extent = __webpack_require__(0); - +//# sourceMappingURL=Property.js.map // EXTERNAL MODULE: ./node_modules/ol/math.js -var math = __webpack_require__(6); +var math = __webpack_require__(9); -// CONCATENATED MODULE: ./node_modules/ol/reproj.js +// CONCATENATED MODULE: ./node_modules/ol/interaction/Interaction.js /** - * @module ol/reproj + * @module ol/interaction/Interaction */ @@ -16095,1811 +17267,13 @@ var math = __webpack_require__(6); /** - * Calculates ideal resolution to use from the source in order to achieve - * pixel mapping as close as possible to 1:1 during reprojection. - * The resolution is calculated regardless of what resolutions - * are actually available in the dataset (TileGrid, Image, ...). - * - * @param {import("./proj/Projection.js").default} sourceProj Source projection. - * @param {import("./proj/Projection.js").default} targetProj Target projection. - * @param {import("./coordinate.js").Coordinate} targetCenter Target center. - * @param {number} targetResolution Target resolution. - * @return {number} The best resolution to use. Can be +-Infinity, NaN or 0. - */ -function calculateSourceResolution(sourceProj, targetProj, - targetCenter, targetResolution) { - - var sourceCenter = Object(ol_proj["h" /* transform */])(targetCenter, targetProj, sourceProj); - - // calculate the ideal resolution of the source data - var sourceResolution = Object(ol_proj["f" /* getPointResolution */])(targetProj, targetResolution, targetCenter); - - var targetMetersPerUnit = targetProj.getMetersPerUnit(); - if (targetMetersPerUnit !== undefined) { - sourceResolution *= targetMetersPerUnit; - } - var sourceMetersPerUnit = sourceProj.getMetersPerUnit(); - if (sourceMetersPerUnit !== undefined) { - sourceResolution /= sourceMetersPerUnit; - } - - // Based on the projection properties, the point resolution at the specified - // coordinates may be slightly different. We need to reverse-compensate this - // in order to achieve optimal results. - - var sourceExtent = sourceProj.getExtent(); - if (!sourceExtent || Object(ol_extent["f" /* containsCoordinate */])(sourceExtent, sourceCenter)) { - var compensationFactor = Object(ol_proj["f" /* getPointResolution */])(sourceProj, sourceResolution, sourceCenter) / - sourceResolution; - if (isFinite(compensationFactor) && compensationFactor > 0) { - sourceResolution /= compensationFactor; - } - } - - return sourceResolution; -} - - -/** - * Enlarge the clipping triangle point by 1 pixel to ensure the edges overlap - * in order to mask gaps caused by antialiasing. - * - * @param {number} centroidX Centroid of the triangle (x coordinate in pixels). - * @param {number} centroidY Centroid of the triangle (y coordinate in pixels). - * @param {number} x X coordinate of the point (in pixels). - * @param {number} y Y coordinate of the point (in pixels). - * @return {import("./coordinate.js").Coordinate} New point 1 px farther from the centroid. - */ -function enlargeClipPoint(centroidX, centroidY, x, y) { - var dX = x - centroidX; - var dY = y - centroidY; - var distance = Math.sqrt(dX * dX + dY * dY); - return [Math.round(x + dX / distance), Math.round(y + dY / distance)]; -} - - -/** - * Renders the source data into new canvas based on the triangulation. - * - * @param {number} width Width of the canvas. - * @param {number} height Height of the canvas. - * @param {number} pixelRatio Pixel ratio. - * @param {number} sourceResolution Source resolution. - * @param {import("./extent.js").Extent} sourceExtent Extent of the data source. - * @param {number} targetResolution Target resolution. - * @param {import("./extent.js").Extent} targetExtent Target extent. - * @param {import("./reproj/Triangulation.js").default} triangulation - * Calculated triangulation. - * @param {Array<{extent: import("./extent.js").Extent, - * image: (HTMLCanvasElement|HTMLImageElement|HTMLVideoElement)}>} sources - * Array of sources. - * @param {number} gutter Gutter of the sources. - * @param {boolean=} opt_renderEdges Render reprojection edges. - * @return {HTMLCanvasElement} Canvas with reprojected data. - */ -function reproj_render(width, height, pixelRatio, - sourceResolution, sourceExtent, targetResolution, targetExtent, - triangulation, sources, gutter, opt_renderEdges) { - - var context = Object(dom["a" /* createCanvasContext2D */])(Math.round(pixelRatio * width), - Math.round(pixelRatio * height)); - - if (sources.length === 0) { - return context.canvas; - } - - context.scale(pixelRatio, pixelRatio); - - var sourceDataExtent = Object(ol_extent["j" /* createEmpty */])(); - sources.forEach(function(src, i, arr) { - Object(ol_extent["q" /* extend */])(sourceDataExtent, src.extent); - }); - - var canvasWidthInUnits = Object(ol_extent["E" /* getWidth */])(sourceDataExtent); - var canvasHeightInUnits = Object(ol_extent["A" /* getHeight */])(sourceDataExtent); - var stitchContext = Object(dom["a" /* createCanvasContext2D */])( - Math.round(pixelRatio * canvasWidthInUnits / sourceResolution), - Math.round(pixelRatio * canvasHeightInUnits / sourceResolution)); - - var stitchScale = pixelRatio / sourceResolution; - - sources.forEach(function(src, i, arr) { - var xPos = src.extent[0] - sourceDataExtent[0]; - var yPos = -(src.extent[3] - sourceDataExtent[3]); - var srcWidth = Object(ol_extent["E" /* getWidth */])(src.extent); - var srcHeight = Object(ol_extent["A" /* getHeight */])(src.extent); - - stitchContext.drawImage( - src.image, - gutter, gutter, - src.image.width - 2 * gutter, src.image.height - 2 * gutter, - xPos * stitchScale, yPos * stitchScale, - srcWidth * stitchScale, srcHeight * stitchScale); - }); - - var targetTopLeft = Object(ol_extent["C" /* getTopLeft */])(targetExtent); - - triangulation.getTriangles().forEach(function(triangle, i, arr) { - /* Calculate affine transform (src -> dst) - * Resulting matrix can be used to transform coordinate - * from `sourceProjection` to destination pixels. - * - * To optimize number of context calls and increase numerical stability, - * we also do the following operations: - * trans(-topLeftExtentCorner), scale(1 / targetResolution), scale(1, -1) - * here before solving the linear system so [ui, vi] are pixel coordinates. - * - * Src points: xi, yi - * Dst points: ui, vi - * Affine coefficients: aij - * - * | x0 y0 1 0 0 0 | |a00| |u0| - * | x1 y1 1 0 0 0 | |a01| |u1| - * | x2 y2 1 0 0 0 | x |a02| = |u2| - * | 0 0 0 x0 y0 1 | |a10| |v0| - * | 0 0 0 x1 y1 1 | |a11| |v1| - * | 0 0 0 x2 y2 1 | |a12| |v2| - */ - var source = triangle.source; - var target = triangle.target; - var x0 = source[0][0], y0 = source[0][1]; - var x1 = source[1][0], y1 = source[1][1]; - var x2 = source[2][0], y2 = source[2][1]; - var u0 = (target[0][0] - targetTopLeft[0]) / targetResolution; - var v0 = -(target[0][1] - targetTopLeft[1]) / targetResolution; - var u1 = (target[1][0] - targetTopLeft[0]) / targetResolution; - var v1 = -(target[1][1] - targetTopLeft[1]) / targetResolution; - var u2 = (target[2][0] - targetTopLeft[0]) / targetResolution; - var v2 = -(target[2][1] - targetTopLeft[1]) / targetResolution; - - // Shift all the source points to improve numerical stability - // of all the subsequent calculations. The [x0, y0] is used here. - // This is also used to simplify the linear system. - var sourceNumericalShiftX = x0; - var sourceNumericalShiftY = y0; - x0 = 0; - y0 = 0; - x1 -= sourceNumericalShiftX; - y1 -= sourceNumericalShiftY; - x2 -= sourceNumericalShiftX; - y2 -= sourceNumericalShiftY; - - var augmentedMatrix = [ - [x1, y1, 0, 0, u1 - u0], - [x2, y2, 0, 0, u2 - u0], - [0, 0, x1, y1, v1 - v0], - [0, 0, x2, y2, v2 - v0] - ]; - var affineCoefs = Object(math["e" /* solveLinearSystem */])(augmentedMatrix); - if (!affineCoefs) { - return; - } - - context.save(); - context.beginPath(); - var centroidX = (u0 + u1 + u2) / 3; - var centroidY = (v0 + v1 + v2) / 3; - var p0 = enlargeClipPoint(centroidX, centroidY, u0, v0); - var p1 = enlargeClipPoint(centroidX, centroidY, u1, v1); - var p2 = enlargeClipPoint(centroidX, centroidY, u2, v2); - - context.moveTo(p1[0], p1[1]); - context.lineTo(p0[0], p0[1]); - context.lineTo(p2[0], p2[1]); - context.clip(); - - context.transform( - affineCoefs[0], affineCoefs[2], affineCoefs[1], affineCoefs[3], u0, v0); - - context.translate(sourceDataExtent[0] - sourceNumericalShiftX, - sourceDataExtent[3] - sourceNumericalShiftY); - - context.scale(sourceResolution / pixelRatio, - -sourceResolution / pixelRatio); - - context.drawImage(stitchContext.canvas, 0, 0); - context.restore(); - }); - - if (opt_renderEdges) { - context.save(); - - context.strokeStyle = 'black'; - context.lineWidth = 1; - - triangulation.getTriangles().forEach(function(triangle, i, arr) { - var target = triangle.target; - var u0 = (target[0][0] - targetTopLeft[0]) / targetResolution; - var v0 = -(target[0][1] - targetTopLeft[1]) / targetResolution; - var u1 = (target[1][0] - targetTopLeft[0]) / targetResolution; - var v1 = -(target[1][1] - targetTopLeft[1]) / targetResolution; - var u2 = (target[2][0] - targetTopLeft[0]) / targetResolution; - var v2 = -(target[2][1] - targetTopLeft[1]) / targetResolution; - - context.beginPath(); - context.moveTo(u1, v1); - context.lineTo(u0, v0); - context.lineTo(u2, v2); - context.closePath(); - context.stroke(); - }); - - context.restore(); - } - return context.canvas; -} - -//# sourceMappingURL=reproj.js.map -// CONCATENATED MODULE: ./node_modules/ol/reproj/Triangulation.js -/** - * @module ol/reproj/Triangulation - */ - - - - - -/** - * Single triangle; consists of 3 source points and 3 target points. - * @typedef {Object} Triangle - * @property {Array} source - * @property {Array} 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_Triangulation = function Triangulation(sourceProj, targetProj, targetExtent, maxSourceExtent, errorThreshold) { - - /** - * @type {import("../proj/Projection.js").default} - * @private - */ - this.sourceProj_ = sourceProj; - - /** - * @type {import("../proj/Projection.js").default} - * @private - */ - this.targetProj_ = targetProj; - - /** @type {!Object} */ - var transformInvCache = {}; - var transformInv = Object(ol_proj["g" /* 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} - * @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() && - (Object(ol_extent["E" /* getWidth */])(maxSourceExtent) == Object(ol_extent["E" /* getWidth */])(this.sourceProj_.getExtent())); - - /** - * @type {?number} - * @private - */ - this.sourceWorldWidth_ = this.sourceProj_.getExtent() ? - Object(ol_extent["E" /* getWidth */])(this.sourceProj_.getExtent()) : null; - - /** - * @type {?number} - * @private - */ - this.targetWorldWidth_ = this.targetProj_.getExtent() ? - Object(ol_extent["E" /* getWidth */])(this.targetProj_.getExtent()) : null; - - var destinationTopLeft = Object(ol_extent["C" /* getTopLeft */])(targetExtent); - var destinationTopRight = Object(ol_extent["D" /* getTopRight */])(targetExtent); - var destinationBottomRight = Object(ol_extent["w" /* getBottomRight */])(targetExtent); - var destinationBottomLeft = Object(ol_extent["v" /* getBottomLeft */])(targetExtent); - var sourceTopLeft = this.transformInv_(destinationTopLeft); - var sourceTopRight = this.transformInv_(destinationTopRight); - var sourceBottomRight = this.transformInv_(destinationBottomRight); - var sourceBottomLeft = this.transformInv_(destinationBottomLeft); - - this.addQuad_( - destinationTopLeft, destinationTopRight, - destinationBottomRight, destinationBottomLeft, - sourceTopLeft, sourceTopRight, sourceBottomRight, sourceBottomLeft, - MAX_SUBDIVISION); - - if (this.wrapsXInSource_) { - var leftBound = Infinity; - this.triangles_.forEach(function(triangle, i, arr) { - leftBound = Math.min(leftBound, - 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 > 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) > this.sourceWorldWidth_ / 2) { - newTriangle[0][0] -= this.sourceWorldWidth_; - } - if ((newTriangle[1][0] - leftBound) > this.sourceWorldWidth_ / 2) { - newTriangle[1][0] -= this.sourceWorldWidth_; - } - if ((newTriangle[2][0] - leftBound) > 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_Triangulation.prototype.addTriangle_ = function addTriangle_ (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_Triangulation.prototype.addQuad_ = function addQuad_ (a, b, c, d, aSrc, bSrc, cSrc, dSrc, maxSubdivision) { - - var sourceQuadExtent = Object(ol_extent["b" /* boundingExtent */])([aSrc, bSrc, cSrc, dSrc]); - var sourceCoverageX = this.sourceWorldWidth_ ? - Object(ol_extent["E" /* 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 = Object(ol_extent["b" /* boundingExtent */])([a, b, c, d]); - var targetCoverageX = Object(ol_extent["E" /* 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 (!Object(ol_extent["F" /* intersects */])(sourceQuadExtent, this.maxSourceExtent_)) { - // whole quad outside source projection extent -> ignore - return; - } - } - - 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 { - 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; - if (wrapsX) { - var centerSrcEstimX = - (Object(math["d" /* modulo */])(aSrc[0], sourceWorldWidth) + - Object(math["d" /* modulo */])(cSrc[0], sourceWorldWidth)) / 2; - dx = centerSrcEstimX - - Object(math["d" /* 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; - } - - this.addTriangle_(a, c, d, aSrc, cSrc, dSrc); - this.addTriangle_(a, b, c, aSrc, bSrc, cSrc); -}; - -/** - * Calculates extent of the 'source' coordinates from all the triangles. - * - * @return {import("../extent.js").Extent} Calculated extent. - */ -Triangulation_Triangulation.prototype.calculateSourceExtent = function calculateSourceExtent () { - var extent = Object(ol_extent["j" /* createEmpty */])(); - - this.triangles_.forEach(function(triangle, i, arr) { - var src = triangle.source; - Object(ol_extent["r" /* extendCoordinate */])(extent, src[0]); - Object(ol_extent["r" /* extendCoordinate */])(extent, src[1]); - Object(ol_extent["r" /* extendCoordinate */])(extent, src[2]); - }); - - return extent; -}; - -/** - * @return {Array} Array of the calculated triangles. - */ -Triangulation_Triangulation.prototype.getTriangles = function getTriangles () { - return this.triangles_; -}; - -/* harmony default export */ var reproj_Triangulation = (Triangulation_Triangulation); - -//# sourceMappingURL=Triangulation.js.map -// CONCATENATED MODULE: ./node_modules/ol/reproj/Tile.js -/** - * @module ol/reproj/Tile - */ - - - - - - - - - - - - -/** - * @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 Tile_ReprojTile = /*@__PURE__*/(function (Tile) { - function ReprojTile( - sourceProj, - sourceTileGrid, - targetProj, - targetTileGrid, - tileCoord, - wrappedTileCoord, - pixelRatio, - gutter, - getTileFunction, - opt_errorThreshold, - opt_renderEdges - ) { - Tile.call(this, tileCoord, TileState["a" /* default */].IDLE); - - /** - * @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} - */ - this.sourceTiles_ = []; - - /** - * @private - * @type {Array} - */ - 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 ? - Object(ol_extent["B" /* getIntersection */])(targetExtent, maxTargetExtent) : targetExtent; - - if (Object(ol_extent["u" /* getArea */])(limitedTargetExtent) === 0) { - // Tile is completely outside range -> EMPTY - // TODO: is it actually correct that the source even creates the tile ? - this.state = TileState["a" /* default */].EMPTY; - return; - } - - var sourceProjExtent = sourceProj.getExtent(); - if (sourceProjExtent) { - if (!maxSourceExtent) { - maxSourceExtent = sourceProjExtent; - } else { - maxSourceExtent = Object(ol_extent["B" /* getIntersection */])(maxSourceExtent, sourceProjExtent); - } - } - - var targetResolution = targetTileGrid.getResolution( - this.wrappedTileCoord_[0]); - - var targetCenter = Object(ol_extent["x" /* getCenter */])(limitedTargetExtent); - var sourceResolution = calculateSourceResolution( - sourceProj, targetProj, targetCenter, targetResolution); - - if (!isFinite(sourceResolution) || sourceResolution <= 0) { - // invalid sourceResolution -> EMPTY - // probably edges of the projections when no extent is defined - this.state = TileState["a" /* default */].EMPTY; - return; - } - - var errorThresholdInPixels = opt_errorThreshold !== undefined ? - opt_errorThreshold : common["b" /* ERROR_THRESHOLD */]; - - /** - * @private - * @type {!import("./Triangulation.js").default} - */ - this.triangulation_ = new reproj_Triangulation( - sourceProj, targetProj, limitedTargetExtent, maxSourceExtent, - sourceResolution * errorThresholdInPixels); - - if (this.triangulation_.getTriangles().length === 0) { - // no valid triangles -> EMPTY - this.state = TileState["a" /* default */].EMPTY; - return; - } - - this.sourceZ_ = sourceTileGrid.getZForResolution(sourceResolution); - var sourceExtent = this.triangulation_.calculateSourceExtent(); - - if (maxSourceExtent) { - if (sourceProj.canWrapX()) { - sourceExtent[1] = Object(math["a" /* clamp */])( - sourceExtent[1], maxSourceExtent[1], maxSourceExtent[3]); - sourceExtent[3] = Object(math["a" /* clamp */])( - sourceExtent[3], maxSourceExtent[1], maxSourceExtent[3]); - } else { - sourceExtent = Object(ol_extent["B" /* getIntersection */])(sourceExtent, maxSourceExtent); - } - } - - if (!Object(ol_extent["u" /* getArea */])(sourceExtent)) { - this.state = TileState["a" /* default */].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["a" /* default */].EMPTY; - } - } - } - - if ( Tile ) ReprojTile.__proto__ = Tile; - ReprojTile.prototype = Object.create( Tile && Tile.prototype ); - ReprojTile.prototype.constructor = ReprojTile; - - /** - * @inheritDoc - */ - ReprojTile.prototype.disposeInternal = function disposeInternal () { - if (this.state == TileState["a" /* default */].LOADING) { - this.unlistenSources_(); - } - Tile.prototype.disposeInternal.call(this); - }; - - /** - * Get the HTML Canvas element for this tile. - * @return {HTMLCanvasElement} Canvas. - */ - ReprojTile.prototype.getImage = function getImage () { - return this.canvas_; - }; - - /** - * @private - */ - ReprojTile.prototype.reproject_ = function reproject_ () { - var sources = []; - this.sourceTiles_.forEach(function(tile, i, arr) { - if (tile && tile.getState() == TileState["a" /* default */].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["a" /* default */].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_ = reproj_render(width, height, this.pixelRatio_, - sourceResolution, this.sourceTileGrid_.getExtent(), - targetResolution, targetExtent, this.triangulation_, sources, - this.gutter_, this.renderEdges_); - - this.state = TileState["a" /* default */].LOADED; - } - this.changed(); - }; - - /** - * @inheritDoc - */ - ReprojTile.prototype.load = function load () { - if (this.state == TileState["a" /* default */].IDLE) { - this.state = TileState["a" /* default */].LOADING; - this.changed(); - - var leftToLoad = 0; - - this.sourcesListenerKeys_ = []; - this.sourceTiles_.forEach(function(tile, i, arr) { - var state = tile.getState(); - if (state == TileState["a" /* default */].IDLE || state == TileState["a" /* default */].LOADING) { - leftToLoad++; - - var sourceListenKey = Object(events["a" /* listen */])(tile, EventType["a" /* default */].CHANGE, - function(e) { - var state = tile.getState(); - if (state == TileState["a" /* default */].LOADED || - state == TileState["a" /* default */].ERROR || - state == TileState["a" /* default */].EMPTY) { - Object(events["e" /* unlistenByKey */])(sourceListenKey); - leftToLoad--; - if (leftToLoad === 0) { - this.unlistenSources_(); - this.reproject_(); - } - } - }, this); - this.sourcesListenerKeys_.push(sourceListenKey); - } - }.bind(this)); - - this.sourceTiles_.forEach(function(tile, i, arr) { - var state = tile.getState(); - if (state == TileState["a" /* default */].IDLE) { - tile.load(); - } - }); - - if (leftToLoad === 0) { - setTimeout(this.reproject_.bind(this), 0); - } - } - }; - - /** - * @private - */ - ReprojTile.prototype.unlistenSources_ = function unlistenSources_ () { - this.sourcesListenerKeys_.forEach(events["e" /* unlistenByKey */]); - this.sourcesListenerKeys_ = null; - }; - - return ReprojTile; -}(ol_Tile)); - - -/* harmony default export */ var reproj_Tile = (Tile_ReprojTile); - -//# sourceMappingURL=Tile.js.map -// EXTERNAL MODULE: ./node_modules/ol/asserts.js -var asserts = __webpack_require__(10); - -// CONCATENATED MODULE: ./node_modules/ol/tileurlfunction.js -/** - * @module ol/tileurlfunction - */ - - - - - -/** - * @param {string} template Template. - * @param {import("./tilegrid/TileGrid.js").default} tileGrid Tile grid. - * @return {import("./Tile.js").UrlFunction} Tile URL function. - */ -function createFromTemplate(template, tileGrid) { - var zRegEx = /\{z\}/g; - var xRegEx = /\{x\}/g; - var yRegEx = /\{y\}/g; - var dashYRegEx = /\{-y\}/g; - return ( - /** - * @param {import("./tilecoord.js").TileCoord} tileCoord Tile Coordinate. - * @param {number} pixelRatio Pixel ratio. - * @param {import("./proj/Projection.js").default} projection Projection. - * @return {string|undefined} Tile URL. - */ - function(tileCoord, pixelRatio, projection) { - if (!tileCoord) { - return undefined; - } else { - return template.replace(zRegEx, tileCoord[0].toString()) - .replace(xRegEx, tileCoord[1].toString()) - .replace(yRegEx, function() { - var y = -tileCoord[2] - 1; - return y.toString(); - }) - .replace(dashYRegEx, function() { - var z = tileCoord[0]; - var range = tileGrid.getFullTileRange(z); - Object(asserts["a" /* assert */])(range, 55); // The {-y} placeholder requires a tile grid with extent - var y = range.getHeight() + tileCoord[2]; - return y.toString(); - }); - } - } - ); -} - - -/** - * @param {Array} templates Templates. - * @param {import("./tilegrid/TileGrid.js").default} tileGrid Tile grid. - * @return {import("./Tile.js").UrlFunction} Tile URL function. - */ -function createFromTemplates(templates, tileGrid) { - var len = templates.length; - var tileUrlFunctions = new Array(len); - for (var i = 0; i < len; ++i) { - tileUrlFunctions[i] = createFromTemplate(templates[i], tileGrid); - } - return createFromTileUrlFunctions(tileUrlFunctions); -} - - -/** - * @param {Array} tileUrlFunctions Tile URL Functions. - * @return {import("./Tile.js").UrlFunction} Tile URL function. - */ -function createFromTileUrlFunctions(tileUrlFunctions) { - if (tileUrlFunctions.length === 1) { - return tileUrlFunctions[0]; - } - return ( - /** - * @param {import("./tilecoord.js").TileCoord} tileCoord Tile Coordinate. - * @param {number} pixelRatio Pixel ratio. - * @param {import("./proj/Projection.js").default} projection Projection. - * @return {string|undefined} Tile URL. - */ - function(tileCoord, pixelRatio, projection) { - if (!tileCoord) { - return undefined; - } else { - var h = hash(tileCoord); - var index = Object(math["d" /* modulo */])(h, tileUrlFunctions.length); - return tileUrlFunctions[index](tileCoord, pixelRatio, projection); - } - } - ); -} - - -/** - * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate. - * @param {number} pixelRatio Pixel ratio. - * @param {import("./proj/Projection.js").default} projection Projection. - * @return {string|undefined} Tile URL. - */ -function nullTileUrlFunction(tileCoord, pixelRatio, projection) { - return undefined; -} - - -/** - * @param {string} url URL. - * @return {Array} Array of urls. - */ -function expandUrl(url) { - var urls = []; - var match = /\{([a-z])-([a-z])\}/.exec(url); - if (match) { - // char range - var startCharCode = match[1].charCodeAt(0); - var stopCharCode = match[2].charCodeAt(0); - var charCode; - for (charCode = startCharCode; charCode <= stopCharCode; ++charCode) { - urls.push(url.replace(match[0], String.fromCharCode(charCode))); - } - return urls; - } - match = match = /\{(\d+)-(\d+)\}/.exec(url); - if (match) { - // number range - var stop = parseInt(match[2], 10); - for (var i = parseInt(match[1], 10); i <= stop; i++) { - urls.push(url.replace(match[0], i.toString())); - } - return urls; - } - urls.push(url); - return urls; -} - -//# sourceMappingURL=tileurlfunction.js.map -// EXTERNAL MODULE: ./node_modules/ol/events/Event.js -var Event = __webpack_require__(21); - -// EXTERNAL MODULE: ./node_modules/ol/size.js -var ol_size = __webpack_require__(33); - -// EXTERNAL MODULE: ./node_modules/ol/source/Source.js -var source_Source = __webpack_require__(64); - -// EXTERNAL MODULE: ./node_modules/ol/tilegrid/common.js -var tilegrid_common = __webpack_require__(51); - -// EXTERNAL MODULE: ./node_modules/ol/extent/Corner.js -var Corner = __webpack_require__(53); - -// EXTERNAL MODULE: ./node_modules/ol/proj/Units.js -var Units = __webpack_require__(24); - -// EXTERNAL MODULE: ./node_modules/ol/TileRange.js -var TileRange = __webpack_require__(54); - -// EXTERNAL MODULE: ./node_modules/ol/array.js -var array = __webpack_require__(11); - -// CONCATENATED MODULE: ./node_modules/ol/tilegrid/TileGrid.js -/** - * @module ol/tilegrid/TileGrid - */ - - - - - - - - - - -/** - * @private - * @type {import("../tilecoord.js").TileCoord} - */ -var tmpTileCoord = [0, 0, 0]; - - -/** - * @typedef {Object} Options - * @property {import("../extent.js").Extent} [extent] Extent for the tile grid. No tiles outside this - * extent will be requested by {@link module:ol/source/Tile} sources. When no `origin` or - * `origins` are configured, the `origin` will be set to the top-left corner of the extent. - * @property {number} [minZoom=0] Minimum zoom. - * @property {import("../coordinate.js").Coordinate} [origin] The tile grid origin, i.e. where the `x` - * and `y` axes meet (`[z, 0, 0]`). Tile coordinates increase left to right and upwards. If not - * specified, `extent` or `origins` must be provided. - * @property {Array} [origins] Tile grid origins, i.e. where - * the `x` and `y` axes meet (`[z, 0, 0]`), for each zoom level. If given, the array length - * should match the length of the `resolutions` array, i.e. each resolution can have a different - * origin. Tile coordinates increase left to right and upwards. If not specified, `extent` or - * `origin` must be provided. - * @property {!Array} resolutions Resolutions. The array index of each resolution needs - * to match the zoom level. This means that even if a `minZoom` is configured, the resolutions - * array will have a length of `maxZoom + 1`. - * @property {Array} [sizes] Sizes. - * @property {number|import("../size.js").Size} [tileSize] Tile size. - * Default is `[256, 256]`. - * @property {Array} [tileSizes] Tile sizes. If given, the array length - * should match the length of the `resolutions` array, i.e. each resolution can have a different - * tile size. - */ - - -/** - * @classdesc - * Base class for setting the grid pattern for sources accessing tiled-image - * servers. - * @api - */ -var TileGrid_TileGrid = function TileGrid(options) { - - /** - * @protected - * @type {number} - */ - this.minZoom = options.minZoom !== undefined ? options.minZoom : 0; - - /** - * @private - * @type {!Array} - */ - this.resolutions_ = options.resolutions; - Object(asserts["a" /* assert */])(Object(array["e" /* isSorted */])(this.resolutions_, function(a, b) { - return b - a; - }, true), 17); // `resolutions` must be sorted in descending order - - - // check if we've got a consistent zoom factor and origin - var zoomFactor; - if (!options.origins) { - for (var i = 0, ii = this.resolutions_.length - 1; i < ii; ++i) { - if (!zoomFactor) { - zoomFactor = this.resolutions_[i] / this.resolutions_[i + 1]; - } else { - if (this.resolutions_[i] / this.resolutions_[i + 1] !== zoomFactor) { - zoomFactor = undefined; - break; - } - } - } - } - - - /** - * @private - * @type {number|undefined} - */ - this.zoomFactor_ = zoomFactor; - - - /** - * @protected - * @type {number} - */ - this.maxZoom = this.resolutions_.length - 1; - - /** - * @private - * @type {import("../coordinate.js").Coordinate} - */ - this.origin_ = options.origin !== undefined ? options.origin : null; - - /** - * @private - * @type {Array} - */ - this.origins_ = null; - if (options.origins !== undefined) { - this.origins_ = options.origins; - Object(asserts["a" /* assert */])(this.origins_.length == this.resolutions_.length, - 20); // Number of `origins` and `resolutions` must be equal - } - - var extent = options.extent; - - if (extent !== undefined && - !this.origin_ && !this.origins_) { - this.origin_ = Object(ol_extent["C" /* getTopLeft */])(extent); - } - - Object(asserts["a" /* assert */])( - (!this.origin_ && this.origins_) || (this.origin_ && !this.origins_), - 18); // Either `origin` or `origins` must be configured, never both - - /** - * @private - * @type {Array} - */ - this.tileSizes_ = null; - if (options.tileSizes !== undefined) { - this.tileSizes_ = options.tileSizes; - Object(asserts["a" /* assert */])(this.tileSizes_.length == this.resolutions_.length, - 19); // Number of `tileSizes` and `resolutions` must be equal - } - - /** - * @private - * @type {number|import("../size.js").Size} - */ - this.tileSize_ = options.tileSize !== undefined ? - options.tileSize : - !this.tileSizes_ ? tilegrid_common["b" /* DEFAULT_TILE_SIZE */] : null; - Object(asserts["a" /* assert */])( - (!this.tileSize_ && this.tileSizes_) || - (this.tileSize_ && !this.tileSizes_), - 22); // Either `tileSize` or `tileSizes` must be configured, never both - - /** - * @private - * @type {import("../extent.js").Extent} - */ - this.extent_ = extent !== undefined ? extent : null; - - - /** - * @private - * @type {Array} - */ - this.fullTileRanges_ = null; - - /** - * @private - * @type {import("../size.js").Size} - */ - this.tmpSize_ = [0, 0]; - - if (options.sizes !== undefined) { - this.fullTileRanges_ = options.sizes.map(function(size, z) { - var tileRange = new TileRange["b" /* default */]( - Math.min(0, size[0]), Math.max(size[0] - 1, -1), - Math.min(0, size[1]), Math.max(size[1] - 1, -1)); - return tileRange; - }, this); - } else if (extent) { - this.calculateTileRanges_(extent); - } - -}; - -/** - * Call a function with each tile coordinate for a given extent and zoom level. - * - * @param {import("../extent.js").Extent} extent Extent. - * @param {number} zoom Integer zoom level. - * @param {function(import("../tilecoord.js").TileCoord)} callback Function called with each tile coordinate. - * @api - */ -TileGrid_TileGrid.prototype.forEachTileCoord = function forEachTileCoord (extent, zoom, callback) { - var tileRange = this.getTileRangeForExtentAndZ(extent, zoom); - for (var i = tileRange.minX, ii = tileRange.maxX; i <= ii; ++i) { - for (var j = tileRange.minY, jj = tileRange.maxY; j <= jj; ++j) { - callback([zoom, i, j]); - } - } -}; - -/** - * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. - * @param {function(this: T, number, import("../TileRange.js").default): boolean} callback Callback. - * @param {T=} opt_this The object to use as `this` in `callback`. - * @param {import("../TileRange.js").default=} opt_tileRange Temporary import("../TileRange.js").default object. - * @param {import("../extent.js").Extent=} opt_extent Temporary import("../extent.js").Extent object. - * @return {boolean} Callback succeeded. - * @template T - */ -TileGrid_TileGrid.prototype.forEachTileCoordParentTileRange = function forEachTileCoordParentTileRange (tileCoord, callback, opt_this, opt_tileRange, opt_extent) { - var tileRange, x, y; - var tileCoordExtent = null; - var z = tileCoord[0] - 1; - if (this.zoomFactor_ === 2) { - x = tileCoord[1]; - y = tileCoord[2]; - } else { - tileCoordExtent = this.getTileCoordExtent(tileCoord, opt_extent); - } - while (z >= this.minZoom) { - if (this.zoomFactor_ === 2) { - x = Math.floor(x / 2); - y = Math.floor(y / 2); - tileRange = Object(TileRange["a" /* createOrUpdate */])(x, x, y, y, opt_tileRange); - } else { - tileRange = this.getTileRangeForExtentAndZ(tileCoordExtent, z, opt_tileRange); - } - if (callback.call(opt_this, z, tileRange)) { - return true; - } - --z; - } - return false; -}; - -/** - * Get the extent for this tile grid, if it was configured. - * @return {import("../extent.js").Extent} Extent. - */ -TileGrid_TileGrid.prototype.getExtent = function getExtent () { - return this.extent_; -}; - -/** - * Get the maximum zoom level for the grid. - * @return {number} Max zoom. - * @api - */ -TileGrid_TileGrid.prototype.getMaxZoom = function getMaxZoom () { - return this.maxZoom; -}; - -/** - * Get the minimum zoom level for the grid. - * @return {number} Min zoom. - * @api - */ -TileGrid_TileGrid.prototype.getMinZoom = function getMinZoom () { - return this.minZoom; -}; - -/** - * Get the origin for the grid at the given zoom level. - * @param {number} z Integer zoom level. - * @return {import("../coordinate.js").Coordinate} Origin. - * @api - */ -TileGrid_TileGrid.prototype.getOrigin = function getOrigin (z) { - if (this.origin_) { - return this.origin_; - } else { - return this.origins_[z]; - } -}; - -/** - * Get the resolution for the given zoom level. - * @param {number} z Integer zoom level. - * @return {number} Resolution. - * @api - */ -TileGrid_TileGrid.prototype.getResolution = function getResolution (z) { - return this.resolutions_[z]; -}; - -/** - * Get the list of resolutions for the tile grid. - * @return {Array} Resolutions. - * @api - */ -TileGrid_TileGrid.prototype.getResolutions = function getResolutions () { - return this.resolutions_; -}; - -/** - * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. - * @param {import("../TileRange.js").default=} opt_tileRange Temporary import("../TileRange.js").default object. - * @param {import("../extent.js").Extent=} opt_extent Temporary import("../extent.js").Extent object. - * @return {import("../TileRange.js").default} Tile range. - */ -TileGrid_TileGrid.prototype.getTileCoordChildTileRange = function getTileCoordChildTileRange (tileCoord, opt_tileRange, opt_extent) { - if (tileCoord[0] < this.maxZoom) { - if (this.zoomFactor_ === 2) { - var minX = tileCoord[1] * 2; - var minY = tileCoord[2] * 2; - return Object(TileRange["a" /* createOrUpdate */])(minX, minX + 1, minY, minY + 1, opt_tileRange); - } - var tileCoordExtent = this.getTileCoordExtent(tileCoord, opt_extent); - return this.getTileRangeForExtentAndZ( - tileCoordExtent, tileCoord[0] + 1, opt_tileRange); - } - return null; -}; - -/** - * Get the extent for a tile range. - * @param {number} z Integer zoom level. - * @param {import("../TileRange.js").default} tileRange Tile range. - * @param {import("../extent.js").Extent=} opt_extent Temporary import("../extent.js").Extent object. - * @return {import("../extent.js").Extent} Extent. - */ -TileGrid_TileGrid.prototype.getTileRangeExtent = function getTileRangeExtent (z, tileRange, opt_extent) { - var origin = this.getOrigin(z); - var resolution = this.getResolution(z); - var tileSize = Object(ol_size["c" /* toSize */])(this.getTileSize(z), this.tmpSize_); - var minX = origin[0] + tileRange.minX * tileSize[0] * resolution; - var maxX = origin[0] + (tileRange.maxX + 1) * tileSize[0] * resolution; - var minY = origin[1] + tileRange.minY * tileSize[1] * resolution; - var maxY = origin[1] + (tileRange.maxY + 1) * tileSize[1] * resolution; - return Object(ol_extent["k" /* createOrUpdate */])(minX, minY, maxX, maxY, opt_extent); -}; - -/** - * Get a tile range for the given extent and integer zoom level. - * @param {import("../extent.js").Extent} extent Extent. - * @param {number} z Integer zoom level. - * @param {import("../TileRange.js").default=} opt_tileRange Temporary tile range object. - * @return {import("../TileRange.js").default} Tile range. - */ -TileGrid_TileGrid.prototype.getTileRangeForExtentAndZ = function getTileRangeForExtentAndZ (extent, z, opt_tileRange) { - var tileCoord = tmpTileCoord; - this.getTileCoordForXYAndZ_(extent[0], extent[1], z, false, tileCoord); - var minX = tileCoord[1]; - var minY = tileCoord[2]; - this.getTileCoordForXYAndZ_(extent[2], extent[3], z, true, tileCoord); - return Object(TileRange["a" /* createOrUpdate */])(minX, tileCoord[1], minY, tileCoord[2], opt_tileRange); -}; - -/** - * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. - * @return {import("../coordinate.js").Coordinate} Tile center. - */ -TileGrid_TileGrid.prototype.getTileCoordCenter = function getTileCoordCenter (tileCoord) { - var origin = this.getOrigin(tileCoord[0]); - var resolution = this.getResolution(tileCoord[0]); - var tileSize = Object(ol_size["c" /* toSize */])(this.getTileSize(tileCoord[0]), this.tmpSize_); - return [ - origin[0] + (tileCoord[1] + 0.5) * tileSize[0] * resolution, - origin[1] + (tileCoord[2] + 0.5) * tileSize[1] * resolution - ]; -}; - -/** - * Get the extent of a tile coordinate. - * - * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. - * @param {import("../extent.js").Extent=} opt_extent Temporary extent object. - * @return {import("../extent.js").Extent} Extent. - * @api - */ -TileGrid_TileGrid.prototype.getTileCoordExtent = function getTileCoordExtent (tileCoord, opt_extent) { - var origin = this.getOrigin(tileCoord[0]); - var resolution = this.getResolution(tileCoord[0]); - var tileSize = Object(ol_size["c" /* toSize */])(this.getTileSize(tileCoord[0]), this.tmpSize_); - var minX = origin[0] + tileCoord[1] * tileSize[0] * resolution; - var minY = origin[1] + tileCoord[2] * tileSize[1] * resolution; - var maxX = minX + tileSize[0] * resolution; - var maxY = minY + tileSize[1] * resolution; - return Object(ol_extent["k" /* createOrUpdate */])(minX, minY, maxX, maxY, opt_extent); -}; - -/** - * Get the tile coordinate for the given map coordinate and resolution.This - * method considers that coordinates that intersect tile boundaries should be - * assigned the higher tile coordinate. - * - * @param {import("../coordinate.js").Coordinate} coordinate Coordinate. - * @param {number} resolution Resolution. - * @param {import("../tilecoord.js").TileCoord=} opt_tileCoord Destination import("../tilecoord.js").TileCoord object. - * @return {import("../tilecoord.js").TileCoord} Tile coordinate. - * @api - */ -TileGrid_TileGrid.prototype.getTileCoordForCoordAndResolution = function getTileCoordForCoordAndResolution (coordinate, resolution, opt_tileCoord) { - return this.getTileCoordForXYAndResolution_( - coordinate[0], coordinate[1], resolution, false, opt_tileCoord); -}; - -/** - * Note that this method should not be called for resolutions that correspond - * to an integer zoom level.Instead call the `getTileCoordForXYAndZ_` method. - * @param {number} x X. - * @param {number} y Y. - * @param {number} resolution Resolution (for a non-integer zoom level). - * @param {boolean} reverseIntersectionPolicy Instead of letting edge - * intersections go to the higher tile coordinate, let edge intersections - * go to the lower tile coordinate. - * @param {import("../tilecoord.js").TileCoord=} opt_tileCoord Temporary import("../tilecoord.js").TileCoord object. - * @return {import("../tilecoord.js").TileCoord} Tile coordinate. - * @private - */ -TileGrid_TileGrid.prototype.getTileCoordForXYAndResolution_ = function getTileCoordForXYAndResolution_ (x, y, resolution, reverseIntersectionPolicy, opt_tileCoord) { - var z = this.getZForResolution(resolution); - var scale = resolution / this.getResolution(z); - var origin = this.getOrigin(z); - var tileSize = Object(ol_size["c" /* toSize */])(this.getTileSize(z), this.tmpSize_); - - var adjustX = reverseIntersectionPolicy ? 0.5 : 0; - var adjustY = reverseIntersectionPolicy ? 0 : 0.5; - var xFromOrigin = Math.floor((x - origin[0]) / resolution + adjustX); - var yFromOrigin = Math.floor((y - origin[1]) / resolution + adjustY); - var tileCoordX = scale * xFromOrigin / tileSize[0]; - var tileCoordY = scale * yFromOrigin / tileSize[1]; - - if (reverseIntersectionPolicy) { - tileCoordX = Math.ceil(tileCoordX) - 1; - tileCoordY = Math.ceil(tileCoordY) - 1; - } else { - tileCoordX = Math.floor(tileCoordX); - tileCoordY = Math.floor(tileCoordY); - } - - return createOrUpdate(z, tileCoordX, tileCoordY, opt_tileCoord); -}; - -/** - * Although there is repetition between this method and `getTileCoordForXYAndResolution_`, - * they should have separate implementations.This method is for integer zoom - * levels.The other method should only be called for resolutions corresponding - * to non-integer zoom levels. - * @param {number} x Map x coordinate. - * @param {number} y Map y coordinate. - * @param {number} z Integer zoom level. - * @param {boolean} reverseIntersectionPolicy Instead of letting edge - * intersections go to the higher tile coordinate, let edge intersections - * go to the lower tile coordinate. - * @param {import("../tilecoord.js").TileCoord=} opt_tileCoord Temporary import("../tilecoord.js").TileCoord object. - * @return {import("../tilecoord.js").TileCoord} Tile coordinate. - * @private - */ -TileGrid_TileGrid.prototype.getTileCoordForXYAndZ_ = function getTileCoordForXYAndZ_ (x, y, z, reverseIntersectionPolicy, opt_tileCoord) { - var origin = this.getOrigin(z); - var resolution = this.getResolution(z); - var tileSize = Object(ol_size["c" /* toSize */])(this.getTileSize(z), this.tmpSize_); - - var adjustX = reverseIntersectionPolicy ? 0.5 : 0; - var adjustY = reverseIntersectionPolicy ? 0 : 0.5; - var xFromOrigin = Math.floor((x - origin[0]) / resolution + adjustX); - var yFromOrigin = Math.floor((y - origin[1]) / resolution + adjustY); - var tileCoordX = xFromOrigin / tileSize[0]; - var tileCoordY = yFromOrigin / tileSize[1]; - - if (reverseIntersectionPolicy) { - tileCoordX = Math.ceil(tileCoordX) - 1; - tileCoordY = Math.ceil(tileCoordY) - 1; - } else { - tileCoordX = Math.floor(tileCoordX); - tileCoordY = Math.floor(tileCoordY); - } - - return createOrUpdate(z, tileCoordX, tileCoordY, opt_tileCoord); -}; - -/** - * Get a tile coordinate given a map coordinate and zoom level. - * @param {import("../coordinate.js").Coordinate} coordinate Coordinate. - * @param {number} z Zoom level. - * @param {import("../tilecoord.js").TileCoord=} opt_tileCoord Destination import("../tilecoord.js").TileCoord object. - * @return {import("../tilecoord.js").TileCoord} Tile coordinate. - * @api - */ -TileGrid_TileGrid.prototype.getTileCoordForCoordAndZ = function getTileCoordForCoordAndZ (coordinate, z, opt_tileCoord) { - return this.getTileCoordForXYAndZ_( - coordinate[0], coordinate[1], z, false, opt_tileCoord); -}; - -/** - * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. - * @return {number} Tile resolution. - */ -TileGrid_TileGrid.prototype.getTileCoordResolution = function getTileCoordResolution (tileCoord) { - return this.resolutions_[tileCoord[0]]; -}; - -/** - * Get the tile size for a zoom level. The type of the return value matches the - * `tileSize` or `tileSizes` that the tile grid was configured with. To always - * get an `import("../size.js").Size`, run the result through `import("../size.js").Size.toSize()`. - * @param {number} z Z. - * @return {number|import("../size.js").Size} Tile size. - * @api - */ -TileGrid_TileGrid.prototype.getTileSize = function getTileSize (z) { - if (this.tileSize_) { - return this.tileSize_; - } else { - return this.tileSizes_[z]; - } -}; - -/** - * @param {number} z Zoom level. - * @return {import("../TileRange.js").default} Extent tile range for the specified zoom level. - */ -TileGrid_TileGrid.prototype.getFullTileRange = function getFullTileRange (z) { - if (!this.fullTileRanges_) { - return null; - } else { - return this.fullTileRanges_[z]; - } -}; - -/** - * @param {number} resolution Resolution. - * @param {number=} opt_direction If 0, the nearest resolution will be used. - * If 1, the nearest lower resolution will be used. If -1, the nearest - * higher resolution will be used. Default is 0. - * @return {number} Z. - * @api - */ -TileGrid_TileGrid.prototype.getZForResolution = function getZForResolution (resolution, opt_direction) { - var z = Object(array["f" /* linearFindNearest */])(this.resolutions_, resolution, opt_direction || 0); - return Object(math["a" /* clamp */])(z, this.minZoom, this.maxZoom); -}; - -/** - * @param {!import("../extent.js").Extent} extent Extent for this tile grid. - * @private - */ -TileGrid_TileGrid.prototype.calculateTileRanges_ = function calculateTileRanges_ (extent) { - var length = this.resolutions_.length; - var fullTileRanges = new Array(length); - for (var z = this.minZoom; z < length; ++z) { - fullTileRanges[z] = this.getTileRangeForExtentAndZ(extent, z); - } - this.fullTileRanges_ = fullTileRanges; -}; - - -/* harmony default export */ var tilegrid_TileGrid = (TileGrid_TileGrid); - -//# sourceMappingURL=TileGrid.js.map -// CONCATENATED MODULE: ./node_modules/ol/tilegrid.js -/** - * @module ol/tilegrid - */ - - - - - - - - - -/** - * @param {import("./proj/Projection.js").default} projection Projection. - * @return {!TileGrid} Default tile grid for the - * passed projection. - */ -function getForProjection(projection) { - var tileGrid = projection.getDefaultTileGrid(); - if (!tileGrid) { - tileGrid = createForProjection(projection); - projection.setDefaultTileGrid(tileGrid); - } - return tileGrid; -} - - -/** - * @param {TileGrid} tileGrid Tile grid. - * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate. - * @param {import("./proj/Projection.js").default} projection Projection. - * @return {import("./tilecoord.js").TileCoord} Tile coordinate. - */ -function wrapX(tileGrid, tileCoord, projection) { - var z = tileCoord[0]; - var center = tileGrid.getTileCoordCenter(tileCoord); - var projectionExtent = extentFromProjection(projection); - if (!Object(ol_extent["f" /* containsCoordinate */])(projectionExtent, center)) { - var worldWidth = Object(ol_extent["E" /* getWidth */])(projectionExtent); - var worldsAway = Math.ceil((projectionExtent[0] - center[0]) / worldWidth); - center[0] += worldWidth * worldsAway; - return tileGrid.getTileCoordForCoordAndZ(center, z); - } else { - return tileCoord; - } -} - - -/** - * @param {import("./extent.js").Extent} extent Extent. - * @param {number=} opt_maxZoom Maximum zoom level (default is - * DEFAULT_MAX_ZOOM). - * @param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses - * DEFAULT_TILE_SIZE). - * @param {Corner=} opt_corner Extent corner (default is `'top-left'`). - * @return {!TileGrid} TileGrid instance. - */ -function createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner) { - var corner = opt_corner !== undefined ? opt_corner : Corner["a" /* default */].TOP_LEFT; - - var resolutions = resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize); - - return new tilegrid_TileGrid({ - extent: extent, - origin: Object(ol_extent["y" /* getCorner */])(extent, corner), - resolutions: resolutions, - tileSize: opt_tileSize - }); -} - - -/** - * @typedef {Object} XYZOptions - * @property {import("./extent.js").Extent} [extent] Extent for the tile grid. The origin for an XYZ tile grid is the - * top-left corner of the extent. The zero level of the grid is defined by the resolution at which one tile fits in the - * provided extent. If not provided, the extent of the EPSG:3857 projection is used. - * @property {number} [maxZoom] Maximum zoom. The default is `42`. This determines the number of levels - * in the grid set. For example, a `maxZoom` of 21 means there are 22 levels in the grid set. - * @property {number} [minZoom=0] Minimum zoom. - * @property {number|import("./size.js").Size} [tileSize=[256, 256]] Tile size in pixels. - */ - - -/** - * Creates a tile grid with a standard XYZ tiling scheme. - * @param {XYZOptions=} opt_options Tile grid options. - * @return {!TileGrid} Tile grid instance. - * @api - */ -function createXYZ(opt_options) { - /** @type {XYZOptions} */ - var xyzOptions = opt_options || {}; - - var extent = xyzOptions.extent || Object(ol_proj["e" /* get */])('EPSG:3857').getExtent(); - - /** @type {import("./tilegrid/TileGrid.js").Options} */ - var gridOptions = { - extent: extent, - minZoom: xyzOptions.minZoom, - tileSize: xyzOptions.tileSize, - resolutions: resolutionsFromExtent( - extent, - xyzOptions.maxZoom, - xyzOptions.tileSize - ) - }; - return new tilegrid_TileGrid(gridOptions); -} - - -/** - * Create a resolutions array from an extent. A zoom factor of 2 is assumed. - * @param {import("./extent.js").Extent} extent Extent. - * @param {number=} opt_maxZoom Maximum zoom level (default is - * DEFAULT_MAX_ZOOM). - * @param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses - * DEFAULT_TILE_SIZE). - * @return {!Array} Resolutions array. - */ -function resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize) { - var maxZoom = opt_maxZoom !== undefined ? - opt_maxZoom : tilegrid_common["a" /* DEFAULT_MAX_ZOOM */]; - - var height = Object(ol_extent["A" /* getHeight */])(extent); - var width = Object(ol_extent["E" /* getWidth */])(extent); - - var tileSize = Object(ol_size["c" /* toSize */])(opt_tileSize !== undefined ? - opt_tileSize : tilegrid_common["b" /* DEFAULT_TILE_SIZE */]); - var maxResolution = Math.max( - width / tileSize[0], height / tileSize[1]); - - var length = maxZoom + 1; - var resolutions = new Array(length); - for (var z = 0; z < length; ++z) { - resolutions[z] = maxResolution / Math.pow(2, z); - } - return resolutions; -} - - -/** - * @param {import("./proj.js").ProjectionLike} projection Projection. - * @param {number=} opt_maxZoom Maximum zoom level (default is - * DEFAULT_MAX_ZOOM). - * @param {number|import("./size.js").Size=} opt_tileSize Tile size (default uses - * DEFAULT_TILE_SIZE). - * @param {Corner=} opt_corner Extent corner (default is `'top-left'`). - * @return {!TileGrid} TileGrid instance. - */ -function createForProjection(projection, opt_maxZoom, opt_tileSize, opt_corner) { - var extent = extentFromProjection(projection); - return createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner); -} - - -/** - * Generate a tile grid extent from a projection. If the projection has an - * extent, it is used. If not, a global extent is assumed. - * @param {import("./proj.js").ProjectionLike} projection Projection. - * @return {import("./extent.js").Extent} Extent. - */ -function extentFromProjection(projection) { - projection = Object(ol_proj["e" /* get */])(projection); - var extent = projection.getExtent(); - if (!extent) { - var half = 180 * ol_proj["a" /* METERS_PER_UNIT */][Units["b" /* default */].DEGREES] / projection.getMetersPerUnit(); - extent = Object(ol_extent["k" /* createOrUpdate */])(-half, -half, half, half); - } - return extent; -} - -//# sourceMappingURL=tilegrid.js.map -// CONCATENATED MODULE: ./node_modules/ol/source/Tile.js -/** - * @module ol/source/Tile - */ - - - - - - - - - - -/** - * @typedef {Object} Options - * @property {import("./Source.js").AttributionLike} [attributions] - * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible. - * @property {number} [cacheSize] - * @property {boolean} [opaque] - * @property {number} [tilePixelRatio] - * @property {import("../proj.js").ProjectionLike} [projection] - * @property {import("./State.js").default} [state] - * @property {import("../tilegrid/TileGrid.js").default} [tileGrid] - * @property {boolean} [wrapX=true] - * @property {number} [transition] - * @property {string} [key] + * Object literal with config options for interactions. + * @typedef {Object} InteractionOptions + * @property {function(import("../MapBrowserEvent.js").default):boolean} handleEvent + * Method called by the map to notify the interaction that a browser event was + * dispatched to the map. If the function returns a falsy value, propagation of + * the event to other interactions in the map's interactions chain will be + * prevented (this includes functions with no explicit return). */ @@ -17907,353 +17281,820 @@ function extentFromProjection(projection) { * @classdesc * Abstract base class; normally only used for creating subclasses and not * instantiated in apps. - * Base class for sources providing images divided into a tile grid. - * @abstract + * User actions that change the state of the map. Some are similar to controls, + * but are not associated with a DOM element. + * For example, {@link module:ol/interaction/KeyboardZoom~KeyboardZoom} is + * functionally the same as {@link module:ol/control/Zoom~Zoom}, but triggered + * by a keyboard event not a button element event. + * Although interactions do not have a DOM element, some of them do render + * vectors and so are visible on the screen. * @api */ -var Tile_TileSource = /*@__PURE__*/(function (Source) { - function TileSource(options) { +var Interaction_Interaction = /*@__PURE__*/(function (BaseObject) { + function Interaction(options) { + BaseObject.call(this); - Source.call(this, { - attributions: options.attributions, - attributionsCollapsible: options.attributionsCollapsible, - projection: options.projection, - state: options.state, - wrapX: options.wrapX - }); + if (options.handleEvent) { + this.handleEvent = options.handleEvent; + } /** * @private - * @type {boolean} + * @type {import("../PluggableMap.js").default} */ - this.opaque_ = options.opaque !== undefined ? options.opaque : false; + this.map_ = null; + + this.setActive(true); + } + + if ( BaseObject ) Interaction.__proto__ = BaseObject; + Interaction.prototype = Object.create( BaseObject && BaseObject.prototype ); + Interaction.prototype.constructor = Interaction; + + /** + * Return whether the interaction is currently active. + * @return {boolean} `true` if the interaction is active, `false` otherwise. + * @observable + * @api + */ + Interaction.prototype.getActive = function getActive () { + return /** @type {boolean} */ (this.get(Property.ACTIVE)); + }; + + /** + * Get the map associated with this interaction. + * @return {import("../PluggableMap.js").default} Map. + * @api + */ + Interaction.prototype.getMap = function getMap () { + return this.map_; + }; + + /** + * Handles the {@link module:ol/MapBrowserEvent map browser event}. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} `false` to stop event propagation. + * @api + */ + Interaction.prototype.handleEvent = function handleEvent (mapBrowserEvent) { + return true; + }; + + /** + * Activate or deactivate the interaction. + * @param {boolean} active Active. + * @observable + * @api + */ + Interaction.prototype.setActive = function setActive (active) { + this.set(Property.ACTIVE, active); + }; + + /** + * Remove the interaction from its current map and attach it to the new map. + * Subclasses may set up event handlers to get notified about changes to + * the map here. + * @param {import("../PluggableMap.js").default} map Map. + */ + Interaction.prototype.setMap = function setMap (map) { + this.map_ = map; + }; + + return Interaction; +}(ol_Object["a" /* default */])); + + +/** + * @param {import("../View.js").default} view View. + * @param {import("../coordinate.js").Coordinate} delta Delta. + * @param {number=} opt_duration Duration. + */ +function pan(view, delta, opt_duration) { + var currentCenter = view.getCenter(); + if (currentCenter) { + var center = view.constrainCenter( + [currentCenter[0] + delta[0], currentCenter[1] + delta[1]]); + if (opt_duration) { + view.animate({ + duration: opt_duration, + easing: easing["d" /* linear */], + center: center + }); + } else { + view.setCenter(center); + } + } +} + + +/** + * @param {import("../View.js").default} view View. + * @param {number|undefined} rotation Rotation. + * @param {import("../coordinate.js").Coordinate=} opt_anchor Anchor coordinate. + * @param {number=} opt_duration Duration. + */ +function rotate(view, rotation, opt_anchor, opt_duration) { + rotation = view.constrainRotation(rotation, 0); + rotateWithoutConstraints(view, rotation, opt_anchor, opt_duration); +} + + +/** + * @param {import("../View.js").default} view View. + * @param {number|undefined} rotation Rotation. + * @param {import("../coordinate.js").Coordinate=} opt_anchor Anchor coordinate. + * @param {number=} opt_duration Duration. + */ +function rotateWithoutConstraints(view, rotation, opt_anchor, opt_duration) { + if (rotation !== undefined) { + var currentRotation = view.getRotation(); + var currentCenter = view.getCenter(); + if (currentRotation !== undefined && currentCenter && opt_duration > 0) { + view.animate({ + rotation: rotation, + anchor: opt_anchor, + duration: opt_duration, + easing: easing["b" /* easeOut */] + }); + } else { + view.rotate(rotation, opt_anchor); + } + } +} + + +/** + * @param {import("../View.js").default} view View. + * @param {number|undefined} resolution Resolution to go to. + * @param {import("../coordinate.js").Coordinate=} opt_anchor Anchor coordinate. + * @param {number=} opt_duration Duration. + * @param {number=} opt_direction Zooming direction; > 0 indicates + * zooming out, in which case the constraints system will select + * the largest nearest resolution; < 0 indicates zooming in, in + * which case the constraints system will select the smallest + * nearest resolution; == 0 indicates that the zooming direction + * is unknown/not relevant, in which case the constraints system + * will select the nearest resolution. If not defined 0 is + * assumed. + */ +function zoom(view, resolution, opt_anchor, opt_duration, opt_direction) { + resolution = view.constrainResolution(resolution, 0, opt_direction); + zoomWithoutConstraints(view, resolution, opt_anchor, opt_duration); +} + + +/** + * @param {import("../View.js").default} view View. + * @param {number} delta Delta from previous zoom level. + * @param {import("../coordinate.js").Coordinate=} opt_anchor Anchor coordinate. + * @param {number=} opt_duration Duration. + */ +function zoomByDelta(view, delta, opt_anchor, opt_duration) { + var currentResolution = view.getResolution(); + var resolution = view.constrainResolution(currentResolution, delta, 0); + + if (resolution !== undefined) { + var resolutions = view.getResolutions(); + resolution = Object(math["a" /* clamp */])( + resolution, + view.getMinResolution() || resolutions[resolutions.length - 1], + view.getMaxResolution() || resolutions[0]); + } + + // If we have a constraint on center, we need to change the anchor so that the + // new center is within the extent. We first calculate the new center, apply + // the constraint to it, and then calculate back the anchor + if (opt_anchor && resolution !== undefined && resolution !== currentResolution) { + var currentCenter = view.getCenter(); + var center = view.calculateCenterZoom(resolution, opt_anchor); + center = view.constrainCenter(center); + + opt_anchor = [ + (resolution * currentCenter[0] - currentResolution * center[0]) / + (resolution - currentResolution), + (resolution * currentCenter[1] - currentResolution * center[1]) / + (resolution - currentResolution) + ]; + } + + zoomWithoutConstraints(view, resolution, opt_anchor, opt_duration); +} + + +/** + * @param {import("../View.js").default} view View. + * @param {number|undefined} resolution Resolution to go to. + * @param {import("../coordinate.js").Coordinate=} opt_anchor Anchor coordinate. + * @param {number=} opt_duration Duration. + */ +function zoomWithoutConstraints(view, resolution, opt_anchor, opt_duration) { + if (resolution) { + var currentResolution = view.getResolution(); + var currentCenter = view.getCenter(); + if (currentResolution !== undefined && currentCenter && + resolution !== currentResolution && opt_duration) { + view.animate({ + resolution: resolution, + anchor: opt_anchor, + duration: opt_duration, + easing: easing["b" /* easeOut */] + }); + } else { + if (opt_anchor) { + var center = view.calculateCenterZoom(resolution, opt_anchor); + view.setCenter(center); + } + view.setResolution(resolution); + } + } +} + +/* harmony default export */ var interaction_Interaction = (Interaction_Interaction); + +//# sourceMappingURL=Interaction.js.map +// CONCATENATED MODULE: ./node_modules/ol/interaction/DoubleClickZoom.js +/** + * @module ol/interaction/DoubleClickZoom + */ + + + + +/** + * @typedef {Object} Options + * @property {number} [duration=250] Animation duration in milliseconds. + * @property {number} [delta=1] The zoom delta applied on each double click. + */ + + +/** + * @classdesc + * Allows the user to zoom by double-clicking on the map. + * @api + */ +var DoubleClickZoom = /*@__PURE__*/(function (Interaction) { + function DoubleClickZoom(opt_options) { + Interaction.call(this, { + handleEvent: DoubleClickZoom_handleEvent + }); + + var options = opt_options ? opt_options : {}; /** * @private * @type {number} */ - this.tilePixelRatio_ = options.tilePixelRatio !== undefined ? - options.tilePixelRatio : 1; - - /** - * @protected - * @type {import("../tilegrid/TileGrid.js").default} - */ - this.tileGrid = options.tileGrid !== undefined ? options.tileGrid : null; - - /** - * @protected - * @type {import("../TileCache.js").default} - */ - this.tileCache = new ol_TileCache(options.cacheSize); - - /** - * @protected - * @type {import("../size.js").Size} - */ - this.tmpSize = [0, 0]; + this.delta_ = options.delta ? options.delta : 1; /** * @private - * @type {string} + * @type {number} */ - this.key_ = options.key || ''; - - /** - * @protected - * @type {import("../Tile.js").Options} - */ - this.tileOptions = {transition: options.transition}; + this.duration_ = options.duration !== undefined ? options.duration : 250; } - if ( Source ) TileSource.__proto__ = Source; - TileSource.prototype = Object.create( Source && Source.prototype ); - TileSource.prototype.constructor = TileSource; + if ( Interaction ) DoubleClickZoom.__proto__ = Interaction; + DoubleClickZoom.prototype = Object.create( Interaction && Interaction.prototype ); + DoubleClickZoom.prototype.constructor = DoubleClickZoom; - /** - * @return {boolean} Can expire cache. - */ - TileSource.prototype.canExpireCache = function canExpireCache () { - return this.tileCache.canExpireCache(); - }; + return DoubleClickZoom; +}(interaction_Interaction)); - /** - * @param {import("../proj/Projection.js").default} projection Projection. - * @param {!Object} usedTiles Used tiles. - */ - TileSource.prototype.expireCache = function expireCache (projection, usedTiles) { - var tileCache = this.getTileCacheForProjection(projection); - if (tileCache) { - tileCache.expireCache(usedTiles); - } - }; - /** - * @param {import("../proj/Projection.js").default} projection Projection. - * @param {number} z Zoom level. - * @param {import("../TileRange.js").default} tileRange Tile range. - * @param {function(import("../Tile.js").default):(boolean|void)} callback Called with each - * loaded tile. If the callback returns `false`, the tile will not be - * considered loaded. - * @return {boolean} The tile range is fully covered with loaded tiles. - */ - TileSource.prototype.forEachLoadedTile = function forEachLoadedTile (projection, z, tileRange, callback) { - var tileCache = this.getTileCacheForProjection(projection); - if (!tileCache) { - return false; - } +/** + * Handles the {@link module:ol/MapBrowserEvent map browser event} (if it was a + * doubleclick) and eventually zooms the map. + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} `false` to stop event propagation. + * @this {DoubleClickZoom} + */ +function DoubleClickZoom_handleEvent(mapBrowserEvent) { + var stopEvent = false; + if (mapBrowserEvent.type == MapBrowserEventType["a" /* default */].DBLCLICK) { + var browserEvent = /** @type {MouseEvent} */ (mapBrowserEvent.originalEvent); + var map = mapBrowserEvent.map; + var anchor = mapBrowserEvent.coordinate; + var delta = browserEvent.shiftKey ? -this.delta_ : this.delta_; + var view = map.getView(); + zoomByDelta(view, delta, anchor, this.duration_); + mapBrowserEvent.preventDefault(); + stopEvent = true; + } + return !stopEvent; +} - var covered = true; - var tile, tileCoordKey, loaded; - for (var x = tileRange.minX; x <= tileRange.maxX; ++x) { - for (var y = tileRange.minY; y <= tileRange.maxY; ++y) { - tileCoordKey = getKeyZXY(z, x, y); - loaded = false; - if (tileCache.containsKey(tileCoordKey)) { - tile = /** @type {!import("../Tile.js").default} */ (tileCache.get(tileCoordKey)); - loaded = tile.getState() === TileState["a" /* default */].LOADED; - if (loaded) { - loaded = (callback(tile) !== false); - } - } - if (!loaded) { - covered = false; - } - } - } - return covered; - }; +/* harmony default export */ var interaction_DoubleClickZoom = (DoubleClickZoom); - /** - * @param {import("../proj/Projection.js").default} projection Projection. - * @return {number} Gutter. - */ - TileSource.prototype.getGutterForProjection = function getGutterForProjection (projection) { - return 0; - }; +//# sourceMappingURL=DoubleClickZoom.js.map +// EXTERNAL MODULE: ./node_modules/ol/ViewHint.js +var ViewHint = __webpack_require__(13); - /** - * Return the key to be used for all tiles in the source. - * @return {string} The key for all tiles. - * @protected - */ - TileSource.prototype.getKey = function getKey () { - return this.key_; - }; +// EXTERNAL MODULE: ./node_modules/ol/coordinate.js + 1 modules +var coordinate = __webpack_require__(47); - /** - * Set the value to be used as the key for all tiles in the source. - * @param {string} key The key for tiles. - * @protected - */ - TileSource.prototype.setKey = function setKey (key) { - if (this.key_ !== key) { - this.key_ = key; - this.changed(); - } - }; +// EXTERNAL MODULE: ./node_modules/ol/asserts.js +var asserts = __webpack_require__(14); - /** - * @param {import("../proj/Projection.js").default} projection Projection. - * @return {boolean} Opaque. - */ - TileSource.prototype.getOpaque = function getOpaque (projection) { - return this.opaque_; - }; +// EXTERNAL MODULE: ./node_modules/ol/functions.js +var functions = __webpack_require__(17); - /** - * @inheritDoc - */ - TileSource.prototype.getResolutions = function getResolutions () { - return this.tileGrid.getResolutions(); - }; +// EXTERNAL MODULE: ./node_modules/ol/has.js +var has = __webpack_require__(19); - /** - * @abstract - * @param {number} z Tile coordinate z. - * @param {number} x Tile coordinate x. - * @param {number} y Tile coordinate y. - * @param {number} pixelRatio Pixel ratio. - * @param {import("../proj/Projection.js").default} projection Projection. - * @return {!import("../Tile.js").default} Tile. - */ - TileSource.prototype.getTile = function getTile (z, x, y, pixelRatio, projection) { - return Object(util["b" /* abstract */])(); - }; +// CONCATENATED MODULE: ./node_modules/ol/events/condition.js +/** + * @module ol/events/condition + */ - /** - * Return the tile grid of the tile source. - * @return {import("../tilegrid/TileGrid.js").default} Tile grid. - * @api - */ - TileSource.prototype.getTileGrid = function getTileGrid () { - return this.tileGrid; - }; - /** - * @param {import("../proj/Projection.js").default} projection Projection. - * @return {!import("../tilegrid/TileGrid.js").default} Tile grid. - */ - TileSource.prototype.getTileGridForProjection = function getTileGridForProjection$1 (projection) { - if (!this.tileGrid) { - return getForProjection(projection); - } else { - return this.tileGrid; - } - }; - /** - * @param {import("../proj/Projection.js").default} projection Projection. - * @return {import("../TileCache.js").default} Tile cache. - * @protected - */ - TileSource.prototype.getTileCacheForProjection = function getTileCacheForProjection (projection) { - var thisProj = this.getProjection(); - if (thisProj && !Object(ol_proj["c" /* equivalent */])(thisProj, projection)) { - return null; - } else { - return this.tileCache; - } - }; - /** - * Get the tile pixel ratio for this source. Subclasses may override this - * method, which is meant to return a supported pixel ratio that matches the - * provided `pixelRatio` as close as possible. - * @param {number} pixelRatio Pixel ratio. - * @return {number} Tile pixel ratio. - */ - TileSource.prototype.getTilePixelRatio = function getTilePixelRatio (pixelRatio) { - return this.tilePixelRatio_; - }; - /** - * @param {number} z Z. - * @param {number} pixelRatio Pixel ratio. - * @param {import("../proj/Projection.js").default} projection Projection. - * @return {import("../size.js").Size} Tile size. - */ - TileSource.prototype.getTilePixelSize = function getTilePixelSize (z, pixelRatio, projection) { - var tileGrid = this.getTileGridForProjection(projection); - var tilePixelRatio = this.getTilePixelRatio(pixelRatio); - var tileSize = Object(ol_size["c" /* toSize */])(tileGrid.getTileSize(z), this.tmpSize); - if (tilePixelRatio == 1) { - return tileSize; - } else { - return Object(ol_size["b" /* scale */])(tileSize, tilePixelRatio, this.tmpSize); - } - }; - /** - * Returns a tile coordinate wrapped around the x-axis. When the tile coordinate - * is outside the resolution and extent range of the tile grid, `null` will be - * returned. - * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate. - * @param {import("../proj/Projection.js").default=} opt_projection Projection. - * @return {import("../tilecoord.js").TileCoord} Tile coordinate to be passed to the tileUrlFunction or - * null if no tile URL should be created for the passed `tileCoord`. - */ - TileSource.prototype.getTileCoordForTileUrlFunction = function getTileCoordForTileUrlFunction (tileCoord, opt_projection) { - var projection = opt_projection !== undefined ? - opt_projection : this.getProjection(); - var tileGrid = this.getTileGridForProjection(projection); - if (this.getWrapX() && projection.isGlobal()) { - tileCoord = wrapX(tileGrid, tileCoord, projection); - } - return withinExtentAndZ(tileCoord, tileGrid) ? tileCoord : null; - }; +/** + * A function that takes an {@link module:ol/MapBrowserEvent} and returns a + * `{boolean}`. If the condition is met, true should be returned. + * + * @typedef {function(this: ?, import("../MapBrowserEvent.js").default): boolean} Condition + */ - /** - * @inheritDoc - */ - TileSource.prototype.refresh = function refresh () { - this.tileCache.clear(); - this.changed(); - }; - /** - * Marks a tile coord as being used, without triggering a load. - * @abstract - * @param {number} z Tile coordinate z. - * @param {number} x Tile coordinate x. - * @param {number} y Tile coordinate y. - * @param {import("../proj/Projection.js").default} projection Projection. - */ - TileSource.prototype.useTile = function useTile (z, x, y, projection) {}; +/** + * Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when + * additionally the shift-key is pressed). + * + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} True if only the alt key is pressed. + * @api + */ +var altKeyOnly = function(mapBrowserEvent) { + var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent); + return ( + originalEvent.altKey && + !(originalEvent.metaKey || originalEvent.ctrlKey) && + !originalEvent.shiftKey); +}; - return TileSource; -}(source_Source["a" /* default */])); + +/** + * Return `true` if only the alt-key and shift-key is pressed, `false` otherwise + * (e.g. when additionally the platform-modifier-key is pressed). + * + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} True if only the alt and shift keys are pressed. + * @api + */ +var altShiftKeysOnly = function(mapBrowserEvent) { + var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent); + return ( + originalEvent.altKey && + !(originalEvent.metaKey || originalEvent.ctrlKey) && + originalEvent.shiftKey); +}; + + +/** + * Return `true` if the map has the focus. This condition requires a map target + * element with a `tabindex` attribute, e.g. `
`. + * + * @param {import("../MapBrowserEvent.js").default} event Map browser event. + * @return {boolean} The map has the focus. + * @api + */ +var condition_focus = function(event) { + return event.target.getTargetElement() === document.activeElement; +}; + + +/** + * Return always true. + * + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} True. + * @api + */ +var always = functions["b" /* TRUE */]; + + +/** + * Return `true` if the event is a `click` event, `false` otherwise. + * + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} True if the event is a map `click` event. + * @api + */ +var click = function(mapBrowserEvent) { + return mapBrowserEvent.type == MapBrowserEventType["a" /* default */].CLICK; +}; + + +/** + * Return `true` if the event has an "action"-producing mouse button. + * + * By definition, this includes left-click on windows/linux, and left-click + * without the ctrl key on Macs. + * + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} The result. + */ +var mouseActionButton = function(mapBrowserEvent) { + var originalEvent = /** @type {MouseEvent} */ (mapBrowserEvent.originalEvent); + return originalEvent.button == 0 && + !(has["i" /* WEBKIT */] && has["d" /* MAC */] && originalEvent.ctrlKey); +}; + + +/** + * Return always false. + * + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} False. + * @api + */ +var never = functions["a" /* FALSE */]; + + +/** + * Return `true` if the browser event is a `pointermove` event, `false` + * otherwise. + * + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} True if the browser event is a `pointermove` event. + * @api + */ +var pointerMove = function(mapBrowserEvent) { + return mapBrowserEvent.type == 'pointermove'; +}; + + +/** + * Return `true` if the event is a map `singleclick` event, `false` otherwise. + * + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} True if the event is a map `singleclick` event. + * @api + */ +var singleClick = function(mapBrowserEvent) { + return mapBrowserEvent.type == MapBrowserEventType["a" /* default */].SINGLECLICK; +}; + + +/** + * Return `true` if the event is a map `dblclick` event, `false` otherwise. + * + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} True if the event is a map `dblclick` event. + * @api + */ +var doubleClick = function(mapBrowserEvent) { + return mapBrowserEvent.type == MapBrowserEventType["a" /* default */].DBLCLICK; +}; + + +/** + * Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is + * pressed. + * + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} True only if there no modifier keys are pressed. + * @api + */ +var noModifierKeys = function(mapBrowserEvent) { + var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent); + return ( + !originalEvent.altKey && + !(originalEvent.metaKey || originalEvent.ctrlKey) && + !originalEvent.shiftKey); +}; + + +/** + * Return `true` if only the platform-modifier-key (the meta-key on Mac, + * ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally + * the shift-key is pressed). + * + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} True if only the platform modifier key is pressed. + * @api + */ +var platformModifierKeyOnly = function(mapBrowserEvent) { + var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent); + return !originalEvent.altKey && + (has["d" /* MAC */] ? originalEvent.metaKey : originalEvent.ctrlKey) && + !originalEvent.shiftKey; +}; + + +/** + * Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when + * additionally the alt-key is pressed). + * + * @param {import("../MapBrowserEvent.js").default} mapBrowserEvent Map browser event. + * @return {boolean} True if only the shift key is pressed. + * @api + */ +var shiftKeyOnly = function(mapBrowserEvent) { + var originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */ (mapBrowserEvent.originalEvent); + return ( + !originalEvent.altKey && + !(originalEvent.metaKey || originalEvent.ctrlKey) && + originalEvent.shiftKey); +}; + + +/** + * Return `true` if the target element is not editable, i.e. not a ``-, + * `