From c37fca7f15f814f3f9c4eb097f3b750c10584b2e Mon Sep 17 00:00:00 2001 From: TuxCoder Date: Tue, 9 Jul 2019 21:54:19 +0200 Subject: [PATCH] update --- dist/main.js | 35285 +++++++++++++++++++++++++++------------------ dist/main.js.map | 2 +- 2 files changed, 20972 insertions(+), 14315 deletions(-) diff --git a/dist/main.js b/dist/main.js index d034da0..5280b88 100644 --- a/dist/main.js +++ b/dist/main.js @@ -81,11 +81,12896 @@ /******/ /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 10); +/******/ return __webpack_require__(__webpack_require__.s = 91); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return boundingExtent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return buffer; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return clone; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return closestSquaredDistanceXY; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return containsCoordinate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return containsExtent; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return containsXY; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return coordinateRelationship; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return createEmpty; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return createOrUpdate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return createOrUpdateEmpty; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return createOrUpdateFromCoordinate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return createOrUpdateFromCoordinates; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return createOrUpdateFromFlatCoordinates; }); +/* unused harmony export createOrUpdateFromRings */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return equals; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return extend; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "r", function() { return extendCoordinate; }); +/* unused harmony export extendCoordinates */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "s", function() { return extendFlatCoordinates; }); +/* unused harmony export extendRings */ +/* unused harmony export extendXY */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "t", function() { return forEachCorner; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "u", function() { return getArea; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "v", function() { return getBottomLeft; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "w", function() { return getBottomRight; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "x", function() { return getCenter; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "y", function() { return getCorner; }); +/* unused harmony export getEnlargedArea */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "z", function() { return getForViewAndSize; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "A", function() { return getHeight; }); +/* unused harmony export getIntersectionArea */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "B", function() { return getIntersection; }); +/* unused harmony export getMargin */ +/* unused harmony export getSize */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "C", function() { return getTopLeft; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "D", function() { return getTopRight; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "E", function() { return getWidth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "F", function() { return intersects; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "H", function() { return isEmpty; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "I", function() { return returnOrUpdate; }); +/* 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__(56); +/* harmony import */ var _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22); +/** + * @module ol/extent + */ + + + + + +/** + * An array of numbers representing an extent: `[minx, miny, maxx, maxy]`. + * @typedef {Array} Extent + * @api + */ + +/** + * Build an extent that includes all given coordinates. + * + * @param {Array} coordinates Coordinates. + * @return {Extent} Bounding extent. + * @api + */ +function boundingExtent(coordinates) { + var extent = createEmpty(); + for (var i = 0, ii = coordinates.length; i < ii; ++i) { + extendCoordinate(extent, coordinates[i]); + } + return extent; +} + + +/** + * @param {Array} xs Xs. + * @param {Array} ys Ys. + * @param {Extent=} opt_extent Destination extent. + * @private + * @return {Extent} Extent. + */ +function _boundingExtentXYs(xs, ys, opt_extent) { + var minX = Math.min.apply(null, xs); + var minY = Math.min.apply(null, ys); + var maxX = Math.max.apply(null, xs); + var maxY = Math.max.apply(null, ys); + return createOrUpdate(minX, minY, maxX, maxY, opt_extent); +} + + +/** + * Return extent increased by the provided value. + * @param {Extent} extent Extent. + * @param {number} value The amount by which the extent should be buffered. + * @param {Extent=} opt_extent Extent. + * @return {Extent} Extent. + * @api + */ +function buffer(extent, value, opt_extent) { + if (opt_extent) { + opt_extent[0] = extent[0] - value; + opt_extent[1] = extent[1] - value; + opt_extent[2] = extent[2] + value; + opt_extent[3] = extent[3] + value; + return opt_extent; + } else { + return [ + extent[0] - value, + extent[1] - value, + extent[2] + value, + extent[3] + value + ]; + } +} + + +/** + * Creates a clone of an extent. + * + * @param {Extent} extent Extent to clone. + * @param {Extent=} opt_extent Extent. + * @return {Extent} The clone. + */ +function clone(extent, opt_extent) { + if (opt_extent) { + opt_extent[0] = extent[0]; + opt_extent[1] = extent[1]; + opt_extent[2] = extent[2]; + opt_extent[3] = extent[3]; + return opt_extent; + } else { + return extent.slice(); + } +} + + +/** + * @param {Extent} extent Extent. + * @param {number} x X. + * @param {number} y Y. + * @return {number} Closest squared distance. + */ +function closestSquaredDistanceXY(extent, x, y) { + var dx, dy; + if (x < extent[0]) { + dx = extent[0] - x; + } else if (extent[2] < x) { + dx = x - extent[2]; + } else { + dx = 0; + } + if (y < extent[1]) { + dy = extent[1] - y; + } else if (extent[3] < y) { + dy = y - extent[3]; + } else { + dy = 0; + } + return dx * dx + dy * dy; +} + + +/** + * Check if the passed coordinate is contained or on the edge of the extent. + * + * @param {Extent} extent Extent. + * @param {import("./coordinate.js").Coordinate} coordinate Coordinate. + * @return {boolean} The coordinate is contained in the extent. + * @api + */ +function containsCoordinate(extent, coordinate) { + return containsXY(extent, coordinate[0], coordinate[1]); +} + + +/** + * Check if one extent contains another. + * + * An extent is deemed contained if it lies completely within the other extent, + * including if they share one or more edges. + * + * @param {Extent} extent1 Extent 1. + * @param {Extent} extent2 Extent 2. + * @return {boolean} The second extent is contained by or on the edge of the + * first. + * @api + */ +function containsExtent(extent1, extent2) { + return extent1[0] <= extent2[0] && extent2[2] <= extent1[2] && + extent1[1] <= extent2[1] && extent2[3] <= extent1[3]; +} + + +/** + * Check if the passed coordinate is contained or on the edge of the extent. + * + * @param {Extent} extent Extent. + * @param {number} x X coordinate. + * @param {number} y Y coordinate. + * @return {boolean} The x, y values are contained in the extent. + * @api + */ +function containsXY(extent, x, y) { + return extent[0] <= x && x <= extent[2] && extent[1] <= y && y <= extent[3]; +} + + +/** + * Get the relationship between a coordinate and extent. + * @param {Extent} extent The extent. + * @param {import("./coordinate.js").Coordinate} coordinate The coordinate. + * @return {Relationship} The relationship (bitwise compare with + * import("./extent/Relationship.js").Relationship). + */ +function coordinateRelationship(extent, coordinate) { + var minX = extent[0]; + var minY = extent[1]; + var maxX = extent[2]; + var maxY = extent[3]; + var x = coordinate[0]; + var y = coordinate[1]; + var relationship = _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].UNKNOWN; + if (x < minX) { + relationship = relationship | _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].LEFT; + } else if (x > maxX) { + relationship = relationship | _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].RIGHT; + } + if (y < minY) { + relationship = relationship | _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].BELOW; + } else if (y > maxY) { + relationship = relationship | _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].ABOVE; + } + if (relationship === _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].UNKNOWN) { + relationship = _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].INTERSECTING; + } + return relationship; +} + + +/** + * Create an empty extent. + * @return {Extent} Empty extent. + * @api + */ +function createEmpty() { + return [Infinity, Infinity, -Infinity, -Infinity]; +} + + +/** + * Create a new extent or update the provided extent. + * @param {number} minX Minimum X. + * @param {number} minY Minimum Y. + * @param {number} maxX Maximum X. + * @param {number} maxY Maximum Y. + * @param {Extent=} opt_extent Destination extent. + * @return {Extent} Extent. + */ +function createOrUpdate(minX, minY, maxX, maxY, opt_extent) { + if (opt_extent) { + opt_extent[0] = minX; + opt_extent[1] = minY; + opt_extent[2] = maxX; + opt_extent[3] = maxY; + return opt_extent; + } else { + return [minX, minY, maxX, maxY]; + } +} + + +/** + * Create a new empty extent or make the provided one empty. + * @param {Extent=} opt_extent Extent. + * @return {Extent} Extent. + */ +function createOrUpdateEmpty(opt_extent) { + return createOrUpdate( + Infinity, Infinity, -Infinity, -Infinity, opt_extent); +} + + +/** + * @param {import("./coordinate.js").Coordinate} coordinate Coordinate. + * @param {Extent=} opt_extent Extent. + * @return {Extent} Extent. + */ +function createOrUpdateFromCoordinate(coordinate, opt_extent) { + var x = coordinate[0]; + var y = coordinate[1]; + return createOrUpdate(x, y, x, y, opt_extent); +} + + +/** + * @param {Array} coordinates Coordinates. + * @param {Extent=} opt_extent Extent. + * @return {Extent} Extent. + */ +function createOrUpdateFromCoordinates(coordinates, opt_extent) { + var extent = createOrUpdateEmpty(opt_extent); + return extendCoordinates(extent, coordinates); +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @param {Extent=} opt_extent Extent. + * @return {Extent} Extent. + */ +function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end, stride, opt_extent) { + var extent = createOrUpdateEmpty(opt_extent); + return extendFlatCoordinates(extent, flatCoordinates, offset, end, stride); +} + +/** + * @param {Array>} rings Rings. + * @param {Extent=} opt_extent Extent. + * @return {Extent} Extent. + */ +function createOrUpdateFromRings(rings, opt_extent) { + var extent = createOrUpdateEmpty(opt_extent); + return extendRings(extent, rings); +} + + +/** + * Determine if two extents are equivalent. + * @param {Extent} extent1 Extent 1. + * @param {Extent} extent2 Extent 2. + * @return {boolean} The two extents are equivalent. + * @api + */ +function equals(extent1, extent2) { + return extent1[0] == extent2[0] && extent1[2] == extent2[2] && + extent1[1] == extent2[1] && extent1[3] == extent2[3]; +} + + +/** + * Modify an extent to include another extent. + * @param {Extent} extent1 The extent to be modified. + * @param {Extent} extent2 The extent that will be included in the first. + * @return {Extent} A reference to the first (extended) extent. + * @api + */ +function extend(extent1, extent2) { + if (extent2[0] < extent1[0]) { + extent1[0] = extent2[0]; + } + if (extent2[2] > extent1[2]) { + extent1[2] = extent2[2]; + } + if (extent2[1] < extent1[1]) { + extent1[1] = extent2[1]; + } + if (extent2[3] > extent1[3]) { + extent1[3] = extent2[3]; + } + return extent1; +} + + +/** + * @param {Extent} extent Extent. + * @param {import("./coordinate.js").Coordinate} coordinate Coordinate. + */ +function extendCoordinate(extent, coordinate) { + if (coordinate[0] < extent[0]) { + extent[0] = coordinate[0]; + } + if (coordinate[0] > extent[2]) { + extent[2] = coordinate[0]; + } + if (coordinate[1] < extent[1]) { + extent[1] = coordinate[1]; + } + if (coordinate[1] > extent[3]) { + extent[3] = coordinate[1]; + } +} + + +/** + * @param {Extent} extent Extent. + * @param {Array} coordinates Coordinates. + * @return {Extent} Extent. + */ +function extendCoordinates(extent, coordinates) { + for (var i = 0, ii = coordinates.length; i < ii; ++i) { + extendCoordinate(extent, coordinates[i]); + } + return extent; +} + + +/** + * @param {Extent} extent Extent. + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @return {Extent} Extent. + */ +function extendFlatCoordinates(extent, flatCoordinates, offset, end, stride) { + for (; offset < end; offset += stride) { + extendXY(extent, flatCoordinates[offset], flatCoordinates[offset + 1]); + } + return extent; +} + + +/** + * @param {Extent} extent Extent. + * @param {Array>} rings Rings. + * @return {Extent} Extent. + */ +function extendRings(extent, rings) { + for (var i = 0, ii = rings.length; i < ii; ++i) { + extendCoordinates(extent, rings[i]); + } + return extent; +} + + +/** + * @param {Extent} extent Extent. + * @param {number} x X. + * @param {number} y Y. + */ +function extendXY(extent, x, y) { + extent[0] = Math.min(extent[0], x); + extent[1] = Math.min(extent[1], y); + extent[2] = Math.max(extent[2], x); + extent[3] = Math.max(extent[3], y); +} + + +/** + * This function calls `callback` for each corner of the extent. If the + * callback returns a truthy value the function returns that value + * immediately. Otherwise the function returns `false`. + * @param {Extent} extent Extent. + * @param {function(this:T, import("./coordinate.js").Coordinate): S} callback Callback. + * @param {T=} opt_this Value to use as `this` when executing `callback`. + * @return {S|boolean} Value. + * @template S, T + */ +function forEachCorner(extent, callback, opt_this) { + var val; + val = callback.call(opt_this, getBottomLeft(extent)); + if (val) { + return val; + } + val = callback.call(opt_this, getBottomRight(extent)); + if (val) { + return val; + } + val = callback.call(opt_this, getTopRight(extent)); + if (val) { + return val; + } + val = callback.call(opt_this, getTopLeft(extent)); + if (val) { + return val; + } + return false; +} + + +/** + * Get the size of an extent. + * @param {Extent} extent Extent. + * @return {number} Area. + * @api + */ +function getArea(extent) { + var area = 0; + if (!isEmpty(extent)) { + area = getWidth(extent) * getHeight(extent); + } + return area; +} + + +/** + * Get the bottom left coordinate of an extent. + * @param {Extent} extent Extent. + * @return {import("./coordinate.js").Coordinate} Bottom left coordinate. + * @api + */ +function getBottomLeft(extent) { + return [extent[0], extent[1]]; +} + + +/** + * Get the bottom right coordinate of an extent. + * @param {Extent} extent Extent. + * @return {import("./coordinate.js").Coordinate} Bottom right coordinate. + * @api + */ +function getBottomRight(extent) { + return [extent[2], extent[1]]; +} + + +/** + * Get the center coordinate of an extent. + * @param {Extent} extent Extent. + * @return {import("./coordinate.js").Coordinate} Center. + * @api + */ +function getCenter(extent) { + return [(extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2]; +} + + +/** + * Get a corner coordinate of an extent. + * @param {Extent} extent Extent. + * @param {Corner} corner Corner. + * @return {import("./coordinate.js").Coordinate} Corner coordinate. + */ +function getCorner(extent, corner) { + var coordinate; + if (corner === _extent_Corner_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].BOTTOM_LEFT) { + coordinate = getBottomLeft(extent); + } else if (corner === _extent_Corner_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].BOTTOM_RIGHT) { + coordinate = getBottomRight(extent); + } else if (corner === _extent_Corner_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].TOP_LEFT) { + coordinate = getTopLeft(extent); + } else if (corner === _extent_Corner_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].TOP_RIGHT) { + coordinate = getTopRight(extent); + } else { + Object(_asserts_js__WEBPACK_IMPORTED_MODULE_0__[/* assert */ "a"])(false, 13); // Invalid corner + } + return coordinate; +} + + +/** + * @param {Extent} extent1 Extent 1. + * @param {Extent} extent2 Extent 2. + * @return {number} Enlarged area. + */ +function getEnlargedArea(extent1, extent2) { + var minX = Math.min(extent1[0], extent2[0]); + var minY = Math.min(extent1[1], extent2[1]); + var maxX = Math.max(extent1[2], extent2[2]); + var maxY = Math.max(extent1[3], extent2[3]); + return (maxX - minX) * (maxY - minY); +} + + +/** + * @param {import("./coordinate.js").Coordinate} center Center. + * @param {number} resolution Resolution. + * @param {number} rotation Rotation. + * @param {import("./size.js").Size} size Size. + * @param {Extent=} opt_extent Destination extent. + * @return {Extent} Extent. + */ +function getForViewAndSize(center, resolution, rotation, size, opt_extent) { + var dx = resolution * size[0] / 2; + var dy = resolution * size[1] / 2; + var cosRotation = Math.cos(rotation); + var sinRotation = Math.sin(rotation); + var xCos = dx * cosRotation; + var xSin = dx * sinRotation; + var yCos = dy * cosRotation; + var ySin = dy * sinRotation; + var x = center[0]; + var y = center[1]; + var x0 = x - xCos + ySin; + var x1 = x - xCos - ySin; + var x2 = x + xCos - ySin; + var x3 = x + xCos + ySin; + var y0 = y - xSin - yCos; + var y1 = y - xSin + yCos; + var y2 = y + xSin + yCos; + var y3 = y + xSin - yCos; + return createOrUpdate( + Math.min(x0, x1, x2, x3), Math.min(y0, y1, y2, y3), + Math.max(x0, x1, x2, x3), Math.max(y0, y1, y2, y3), + opt_extent); +} + + +/** + * Get the height of an extent. + * @param {Extent} extent Extent. + * @return {number} Height. + * @api + */ +function getHeight(extent) { + return extent[3] - extent[1]; +} + + +/** + * @param {Extent} extent1 Extent 1. + * @param {Extent} extent2 Extent 2. + * @return {number} Intersection area. + */ +function getIntersectionArea(extent1, extent2) { + var intersection = getIntersection(extent1, extent2); + return getArea(intersection); +} + + +/** + * Get the intersection of two extents. + * @param {Extent} extent1 Extent 1. + * @param {Extent} extent2 Extent 2. + * @param {Extent=} opt_extent Optional extent to populate with intersection. + * @return {Extent} Intersecting extent. + * @api + */ +function getIntersection(extent1, extent2, opt_extent) { + var intersection = opt_extent ? opt_extent : createEmpty(); + if (intersects(extent1, extent2)) { + if (extent1[0] > extent2[0]) { + intersection[0] = extent1[0]; + } else { + intersection[0] = extent2[0]; + } + if (extent1[1] > extent2[1]) { + intersection[1] = extent1[1]; + } else { + intersection[1] = extent2[1]; + } + if (extent1[2] < extent2[2]) { + intersection[2] = extent1[2]; + } else { + intersection[2] = extent2[2]; + } + if (extent1[3] < extent2[3]) { + intersection[3] = extent1[3]; + } else { + intersection[3] = extent2[3]; + } + } else { + createOrUpdateEmpty(intersection); + } + return intersection; +} + + +/** + * @param {Extent} extent Extent. + * @return {number} Margin. + */ +function getMargin(extent) { + return getWidth(extent) + getHeight(extent); +} + + +/** + * Get the size (width, height) of an extent. + * @param {Extent} extent The extent. + * @return {import("./size.js").Size} The extent size. + * @api + */ +function getSize(extent) { + return [extent[2] - extent[0], extent[3] - extent[1]]; +} + + +/** + * Get the top left coordinate of an extent. + * @param {Extent} extent Extent. + * @return {import("./coordinate.js").Coordinate} Top left coordinate. + * @api + */ +function getTopLeft(extent) { + return [extent[0], extent[3]]; +} + + +/** + * Get the top right coordinate of an extent. + * @param {Extent} extent Extent. + * @return {import("./coordinate.js").Coordinate} Top right coordinate. + * @api + */ +function getTopRight(extent) { + return [extent[2], extent[3]]; +} + + +/** + * Get the width of an extent. + * @param {Extent} extent Extent. + * @return {number} Width. + * @api + */ +function getWidth(extent) { + return extent[2] - extent[0]; +} + + +/** + * Determine if one extent intersects another. + * @param {Extent} extent1 Extent 1. + * @param {Extent} extent2 Extent. + * @return {boolean} The two extents intersect. + * @api + */ +function intersects(extent1, extent2) { + return extent1[0] <= extent2[2] && + extent1[2] >= extent2[0] && + extent1[1] <= extent2[3] && + extent1[3] >= extent2[1]; +} + + +/** + * Determine if an extent is empty. + * @param {Extent} extent Extent. + * @return {boolean} Is empty. + * @api + */ +function isEmpty(extent) { + return extent[2] < extent[0] || extent[3] < extent[1]; +} + + +/** + * @param {Extent} extent Extent. + * @param {Extent=} opt_extent Extent. + * @return {Extent} Extent. + */ +function returnOrUpdate(extent, opt_extent) { + if (opt_extent) { + opt_extent[0] = extent[0]; + opt_extent[1] = extent[1]; + opt_extent[2] = extent[2]; + opt_extent[3] = extent[3]; + return opt_extent; + } else { + return extent; + } +} + + +/** + * @param {Extent} extent Extent. + * @param {number} value Value. + */ +function scaleFromCenter(extent, value) { + var deltaX = ((extent[2] - extent[0]) / 2) * (value - 1); + var deltaY = ((extent[3] - extent[1]) / 2) * (value - 1); + extent[0] -= deltaX; + extent[2] += deltaX; + extent[1] -= deltaY; + extent[3] += deltaY; +} + + +/** + * Determine if the segment between two coordinates intersects (crosses, + * touches, or is contained by) the provided extent. + * @param {Extent} extent The extent. + * @param {import("./coordinate.js").Coordinate} start Segment start coordinate. + * @param {import("./coordinate.js").Coordinate} end Segment end coordinate. + * @return {boolean} The segment intersects the extent. + */ +function intersectsSegment(extent, start, end) { + var intersects = false; + var startRel = coordinateRelationship(extent, start); + var endRel = coordinateRelationship(extent, end); + if (startRel === _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].INTERSECTING || + endRel === _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].INTERSECTING) { + intersects = true; + } else { + var minX = extent[0]; + var minY = extent[1]; + var maxX = extent[2]; + var maxY = extent[3]; + var startX = start[0]; + var startY = start[1]; + var endX = end[0]; + var endY = end[1]; + var slope = (endY - startY) / (endX - startX); + var x, y; + if (!!(endRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].ABOVE) && + !(startRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].ABOVE)) { + // potentially intersects top + x = endX - ((endY - maxY) / slope); + intersects = x >= minX && x <= maxX; + } + if (!intersects && !!(endRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].RIGHT) && + !(startRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].RIGHT)) { + // potentially intersects right + y = endY - ((endX - maxX) * slope); + intersects = y >= minY && y <= maxY; + } + if (!intersects && !!(endRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].BELOW) && + !(startRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].BELOW)) { + // potentially intersects bottom + x = endX - ((endY - minY) / slope); + intersects = x >= minX && x <= maxX; + } + if (!intersects && !!(endRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].LEFT) && + !(startRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"].LEFT)) { + // potentially intersects left + y = endY - ((endX - minX) * slope); + intersects = y >= minY && y <= maxY; + } + + } + return intersects; +} + + +/** + * Apply a transform function to the extent. + * @param {Extent} extent Extent. + * @param {import("./proj.js").TransformFunction} transformFn Transform function. + * Called with `[minX, minY, maxX, maxY]` extent coordinates. + * @param {Extent=} opt_extent Destination extent. + * @return {Extent} Extent. + * @api + */ +function applyTransform(extent, transformFn, opt_extent) { + var coordinates = [ + extent[0], extent[1], + extent[0], extent[3], + extent[2], extent[1], + extent[2], extent[3] + ]; + transformFn(coordinates, coordinates, 2); + var xs = [coordinates[0], coordinates[2], coordinates[4], coordinates[6]]; + var ys = [coordinates[1], coordinates[3], coordinates[5], coordinates[7]]; + return _boundingExtentXYs(xs, ys, opt_extent); +} + +//# sourceMappingURL=extent.js.map + +/***/ }), +/* 1 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return abstract; }); +/* unused harmony export inherits */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getUid; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VERSION; }); +/** + * @module ol/util + */ + +/** + * @return {?} Any return. + */ +function abstract() { + return /** @type {?} */ ((function() { + throw new Error('Unimplemented abstract method.'); + })()); +} + +/** + * Inherit the prototype methods from one constructor into another. + * + * Usage: + * + * function ParentClass(a, b) { } + * ParentClass.prototype.foo = function(a) { } + * + * function ChildClass(a, b, c) { + * // Call parent constructor + * ParentClass.call(this, a, b); + * } + * inherits(ChildClass, ParentClass); + * + * var child = new ChildClass('a', 'b', 'see'); + * child.foo(); // This works. + * + * @param {!Function} childCtor Child constructor. + * @param {!Function} parentCtor Parent constructor. + * @function module:ol.inherits + * @deprecated + * @api + */ +function inherits(childCtor, parentCtor) { + childCtor.prototype = Object.create(parentCtor.prototype); + childCtor.prototype.constructor = childCtor; +} + +/** + * Counter for getUid. + * @type {number} + * @private + */ +var uidCounter_ = 0; + +/** + * Gets a unique ID for an object. This mutates the object so that further calls + * with the same object as a parameter returns the same value. Unique IDs are generated + * as a strictly increasing sequence. Adapted from goog.getUid. + * + * @param {Object} obj The object to get the unique ID for. + * @return {string} The unique ID for the object. + * @function module:ol.getUid + * @api + */ +function getUid(obj) { + return obj.ol_uid || (obj.ol_uid = String(++uidCounter_)); +} + +/** + * OpenLayers version. + * @type {string} + */ +var VERSION = '5.3.3'; + +//# sourceMappingURL=util.js.map + +/***/ }), +/* 2 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* unused harmony export bindListener */ +/* unused harmony export findListener */ +/* unused harmony export getListeners */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return listen; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return listenOnce; }); +/* 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); +/** + * @module ol/events + */ + + + +/** + * Key to use with {@link module:ol/Observable~Observable#unByKey}. + * @typedef {Object} EventsKey + * @property {Object} [bindTo] + * @property {ListenerFunction} [boundListener] + * @property {boolean} callOnce + * @property {number} [deleteIndex] + * @property {ListenerFunction} listener + * @property {import("./events/Target.js").EventTargetLike} target + * @property {string} type + * @api + */ + + +/** + * Listener function. This function is called with an event object as argument. + * When the function returns `false`, event propagation will stop. + * + * @typedef {function((Event|import("./events/Event.js").default)): (void|boolean)} ListenerFunction + * @api + */ + + +/** + * @param {EventsKey} listenerObj Listener object. + * @return {ListenerFunction} Bound listener. + */ +function bindListener(listenerObj) { + var boundListener = function(evt) { + var listener = listenerObj.listener; + var bindTo = listenerObj.bindTo || listenerObj.target; + if (listenerObj.callOnce) { + unlistenByKey(listenerObj); + } + return listener.call(bindTo, evt); + }; + listenerObj.boundListener = boundListener; + return boundListener; +} + + +/** + * Finds the matching {@link module:ol/events~EventsKey} in the given listener + * array. + * + * @param {!Array} listeners Array of listeners. + * @param {!Function} listener The listener function. + * @param {Object=} opt_this The `this` value inside the listener. + * @param {boolean=} opt_setDeleteIndex Set the deleteIndex on the matching + * listener, for {@link module:ol/events~unlistenByKey}. + * @return {EventsKey|undefined} The matching listener object. + */ +function findListener(listeners, listener, opt_this, opt_setDeleteIndex) { + var listenerObj; + for (var i = 0, ii = listeners.length; i < ii; ++i) { + listenerObj = listeners[i]; + if (listenerObj.listener === listener && + listenerObj.bindTo === opt_this) { + if (opt_setDeleteIndex) { + listenerObj.deleteIndex = i; + } + return listenerObj; + } + } + return undefined; +} + + +/** + * @param {import("./events/Target.js").EventTargetLike} target Target. + * @param {string} type Type. + * @return {Array|undefined} Listeners. + */ +function getListeners(target, type) { + var listenerMap = getListenerMap(target); + return listenerMap ? listenerMap[type] : undefined; +} + + +/** + * Get the lookup of listeners. + * @param {Object} target Target. + * @param {boolean=} opt_create If a map should be created if it doesn't exist. + * @return {!Object>} Map of + * listeners by event type. + */ +function getListenerMap(target, opt_create) { + var listenerMap = target.ol_lm; + if (!listenerMap && opt_create) { + listenerMap = target.ol_lm = {}; + } + return listenerMap; +} + + +/** + * Remove the listener map from a target. + * @param {Object} target Target. + */ +function removeListenerMap(target) { + delete target.ol_lm; +} + + +/** + * Clean up all listener objects of the given type. All properties on the + * listener objects will be removed, and if no listeners remain in the listener + * map, it will be removed from the target. + * @param {import("./events/Target.js").EventTargetLike} target Target. + * @param {string} type Type. + */ +function removeListeners(target, type) { + var listeners = getListeners(target, type); + if (listeners) { + for (var i = 0, ii = listeners.length; i < ii; ++i) { + /** @type {import("./events/Target.js").default} */ (target). + removeEventListener(type, listeners[i].boundListener); + Object(_obj_js__WEBPACK_IMPORTED_MODULE_0__[/* clear */ "b"])(listeners[i]); + } + listeners.length = 0; + var listenerMap = getListenerMap(target); + if (listenerMap) { + delete listenerMap[type]; + if (Object.keys(listenerMap).length === 0) { + removeListenerMap(target); + } + } + } +} + + +/** + * Registers an event listener on an event target. Inspired by + * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html + * + * This function efficiently binds a `listener` to a `this` object, and returns + * a key for use with {@link module:ol/events~unlistenByKey}. + * + * @param {import("./events/Target.js").EventTargetLike} target Event target. + * @param {string} type Event type. + * @param {ListenerFunction} listener Listener. + * @param {Object=} opt_this Object referenced by the `this` keyword in the + * listener. Default is the `target`. + * @param {boolean=} opt_once If true, add the listener as one-off listener. + * @return {EventsKey} Unique key for the listener. + */ +function listen(target, type, listener, opt_this, opt_once) { + var listenerMap = getListenerMap(target, true); + var listeners = listenerMap[type]; + if (!listeners) { + listeners = listenerMap[type] = []; + } + var listenerObj = findListener(listeners, listener, opt_this, false); + if (listenerObj) { + if (!opt_once) { + // Turn one-off listener into a permanent one. + listenerObj.callOnce = false; + } + } else { + listenerObj = /** @type {EventsKey} */ ({ + bindTo: opt_this, + callOnce: !!opt_once, + listener: listener, + target: target, + type: type + }); + /** @type {import("./events/Target.js").default} */ (target). + addEventListener(type, bindListener(listenerObj)); + listeners.push(listenerObj); + } + + return listenerObj; +} + + +/** + * Registers a one-off event listener on an event target. Inspired by + * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html + * + * This function efficiently binds a `listener` as self-unregistering listener + * to a `this` object, and returns a key for use with + * {@link module:ol/events~unlistenByKey} in case the listener needs to be + * unregistered before it is called. + * + * When {@link module:ol/events~listen} is called with the same arguments after this + * function, the self-unregistering listener will be turned into a permanent + * listener. + * + * @param {import("./events/Target.js").EventTargetLike} target Event target. + * @param {string} type Event type. + * @param {ListenerFunction} listener Listener. + * @param {Object=} opt_this Object referenced by the `this` keyword in the + * listener. Default is the `target`. + * @return {EventsKey} Key for unlistenByKey. + */ +function listenOnce(target, type, listener, opt_this) { + return listen(target, type, listener, opt_this, true); +} + + +/** + * Unregisters an event listener on an event target. Inspired by + * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html + * + * To return a listener, this function needs to be called with the exact same + * arguments that were used for a previous {@link module:ol/events~listen} call. + * + * @param {import("./events/Target.js").EventTargetLike} target Event target. + * @param {string} type Event type. + * @param {ListenerFunction} listener Listener. + * @param {Object=} opt_this Object referenced by the `this` keyword in the + * listener. Default is the `target`. + */ +function unlisten(target, type, listener, opt_this) { + var listeners = getListeners(target, type); + if (listeners) { + var listenerObj = findListener(listeners, listener, opt_this, true); + if (listenerObj) { + unlistenByKey(listenerObj); + } + } +} + + +/** + * Unregisters event listeners on an event target. Inspired by + * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html + * + * The argument passed to this function is the key returned from + * {@link module:ol/events~listen} or {@link module:ol/events~listenOnce}. + * + * @param {EventsKey} key The key. + */ +function unlistenByKey(key) { + if (key && key.target) { + /** @type {import("./events/Target.js").default} */ (key.target). + removeEventListener(key.type, key.boundListener); + var listeners = getListeners(key.target, key.type); + if (listeners) { + var i = 'deleteIndex' in key ? key.deleteIndex : listeners.indexOf(key); + if (i !== -1) { + listeners.splice(i, 1); + } + if (listeners.length === 0) { + removeListeners(key.target, key.type); + } + } + Object(_obj_js__WEBPACK_IMPORTED_MODULE_0__[/* clear */ "b"])(key); + } +} + + +/** + * Unregisters all event listeners on an event target. Inspired by + * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html + * + * @param {import("./events/Target.js").EventTargetLike} target Target. + */ +function unlistenAll(target) { + var listenerMap = getListenerMap(target); + if (listenerMap) { + for (var type in listenerMap) { + removeListeners(target, type); + } + } +} + +//# sourceMappingURL=events.js.map + +/***/ }), +/* 3 */ +/***/ (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 + +/***/ }), +/* 4 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return defaultFont; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return defaultFillStyle; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return defaultLineCap; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return defaultLineDash; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return defaultLineDashOffset; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return defaultLineJoin; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return defaultMiterLimit; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return defaultStrokeStyle; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "l", function() { return defaultTextAlign; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "m", function() { return defaultTextBaseline; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return defaultPadding; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return defaultLineWidth; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "o", function() { return labelCache; }); +/* unused harmony export checkedFonts */ +/* unused harmony export textHeights */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return checkFont; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "p", function() { return measureTextHeight; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "q", function() { return measureTextWidth; }); +/* 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__(24); +/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); +/* 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); +/** + * @module ol/render/canvas + */ + + + + + + + +/** + * @typedef {Object} FillState + * @property {import("../colorlike.js").ColorLike} fillStyle + */ + + +/** + * @typedef {Object} FillStrokeState + * @property {import("../colorlike.js").ColorLike} [currentFillStyle] + * @property {import("../colorlike.js").ColorLike} [currentStrokeStyle] + * @property {string} [currentLineCap] + * @property {Array} currentLineDash + * @property {number} [currentLineDashOffset] + * @property {string} [currentLineJoin] + * @property {number} [currentLineWidth] + * @property {number} [currentMiterLimit] + * @property {number} [lastStroke] + * @property {import("../colorlike.js").ColorLike} [fillStyle] + * @property {import("../colorlike.js").ColorLike} [strokeStyle] + * @property {string} [lineCap] + * @property {Array} lineDash + * @property {number} [lineDashOffset] + * @property {string} [lineJoin] + * @property {number} [lineWidth] + * @property {number} [miterLimit] + */ + + +/** + * @typedef {Object} StrokeState + * @property {string} lineCap + * @property {Array} lineDash + * @property {number} lineDashOffset + * @property {string} lineJoin + * @property {number} lineWidth + * @property {number} miterLimit + * @property {import("../colorlike.js").ColorLike} strokeStyle + */ + + +/** + * @typedef {Object} TextState + * @property {string} font + * @property {string} [textAlign] + * @property {string} textBaseline + * @property {string} [placement] + * @property {number} [maxAngle] + * @property {boolean} [overflow] + * @property {import("../style/Fill.js").default} [backgroundFill] + * @property {import("../style/Stroke.js").default} [backgroundStroke] + * @property {number} [scale] + * @property {Array} [padding] + */ + + +/** + * Container for decluttered replay instructions that need to be rendered or + * omitted together, i.e. when styles render both an image and text, or for the + * characters that form text along lines. The basic elements of this array are + * `[minX, minY, maxX, maxY, count]`, where the first four entries are the + * rendered extent of the group in pixel space. `count` is the number of styles + * in the group, i.e. 2 when an image and a text are grouped, or 1 otherwise. + * In addition to these four elements, declutter instruction arrays (i.e. the + * arguments to {@link module:ol/render/canvas~drawImage} are appended to the array. + * @typedef {Array<*>} DeclutterGroup + */ + + +/** + * @const + * @type {string} + */ +var defaultFont = '10px sans-serif'; + + +/** + * @const + * @type {import("../color.js").Color} + */ +var defaultFillStyle = [0, 0, 0, 1]; + + +/** + * @const + * @type {string} + */ +var defaultLineCap = 'round'; + + +/** + * @const + * @type {Array} + */ +var defaultLineDash = []; + + +/** + * @const + * @type {number} + */ +var defaultLineDashOffset = 0; + + +/** + * @const + * @type {string} + */ +var defaultLineJoin = 'round'; + + +/** + * @const + * @type {number} + */ +var defaultMiterLimit = 10; + + +/** + * @const + * @type {import("../color.js").Color} + */ +var defaultStrokeStyle = [0, 0, 0, 1]; + + +/** + * @const + * @type {string} + */ +var defaultTextAlign = 'center'; + + +/** + * @const + * @type {string} + */ +var defaultTextBaseline = 'middle'; + + +/** + * @const + * @type {Array} + */ +var defaultPadding = [0, 0, 0, 0]; + + +/** + * @const + * @type {number} + */ +var defaultLineWidth = 1; + + +/** + * The label cache for text rendering. To change the default cache size of 2048 + * entries, use {@link module:ol/structs/LRUCache#setSize}. + * @type {LRUCache} + * @api + */ +var labelCache = new _structs_LRUCache_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"](); + + +/** + * @type {!Object} + */ +var checkedFonts = {}; + + +/** + * @type {CanvasRenderingContext2D} + */ +var measureContext = null; + + +/** + * @type {!Object} + */ +var textHeights = {}; + + +/** + * Clears the label cache when a font becomes available. + * @param {string} fontSpec CSS font spec. + */ +var checkFont = (function() { + var retries = 60; + var checked = checkedFonts; + var size = '32px '; + var referenceFonts = ['monospace', 'serif']; + var len = referenceFonts.length; + var text = 'wmytzilWMYTZIL@#/&?$%10\uF013'; + var interval, referenceWidth; + + function isAvailable(font) { + var context = getMeasureContext(); + // Check weight ranges according to + // https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight#Fallback_weights + for (var weight = 100; weight <= 700; weight += 300) { + var fontWeight = weight + ' '; + var available = true; + for (var i = 0; i < len; ++i) { + var referenceFont = referenceFonts[i]; + context.font = fontWeight + size + referenceFont; + referenceWidth = context.measureText(text).width; + if (font != referenceFont) { + context.font = fontWeight + size + font + ',' + referenceFont; + var width = context.measureText(text).width; + // If width and referenceWidth are the same, then the fallback was used + // instead of the font we wanted, so the font is not available. + available = available && width != referenceWidth; + } + } + if (available) { + // Consider font available when it is available in one weight range. + //FIXME With this we miss rare corner cases, so we should consider + //FIXME checking availability for each requested weight range. + return true; + } + } + return false; + } + + function check() { + var done = true; + for (var font in checked) { + if (checked[font] < retries) { + if (isAvailable(font)) { + checked[font] = retries; + Object(_obj_js__WEBPACK_IMPORTED_MODULE_2__[/* clear */ "b"])(textHeights); + // Make sure that loaded fonts are picked up by Safari + measureContext = null; + labelCache.clear(); + } else { + ++checked[font]; + done = false; + } + } + } + if (done) { + clearInterval(interval); + interval = undefined; + } + } + + return function(fontSpec) { + var fontFamilies = Object(_css_js__WEBPACK_IMPORTED_MODULE_0__[/* getFontFamilies */ "e"])(fontSpec); + if (!fontFamilies) { + return; + } + for (var i = 0, ii = fontFamilies.length; i < ii; ++i) { + var fontFamily = fontFamilies[i]; + if (!(fontFamily in checked)) { + checked[fontFamily] = retries; + if (!isAvailable(fontFamily)) { + checked[fontFamily] = 0; + if (interval === undefined) { + interval = setInterval(check, 32); + } + } + } + } + }; +})(); + + +/** + * @return {CanvasRenderingContext2D} Measure context. + */ +function getMeasureContext() { + if (!measureContext) { + measureContext = Object(_dom_js__WEBPACK_IMPORTED_MODULE_1__[/* createCanvasContext2D */ "a"])(1, 1); + } + return measureContext; +} + + +/** + * @param {string} font Font to use for measuring. + * @return {import("../size.js").Size} Measurement. + */ +var measureTextHeight = (function() { + var span; + var heights = textHeights; + return function(font) { + var height = heights[font]; + if (height == undefined) { + if (!span) { + span = document.createElement('span'); + span.textContent = 'M'; + span.style.margin = span.style.padding = '0 !important'; + span.style.position = 'absolute !important'; + span.style.left = '-99999px !important'; + } + span.style.font = font; + document.body.appendChild(span); + height = heights[font] = span.offsetHeight; + document.body.removeChild(span); + } + return height; + }; +})(); + + +/** + * @param {string} font Font. + * @param {string} text Text. + * @return {number} Width. + */ +function measureTextWidth(font, text) { + var measureContext = getMeasureContext(); + if (font != measureContext.font) { + measureContext.font = font; + } + return measureContext.measureText(text).width; +} + + +/** + * @param {CanvasRenderingContext2D} context Context. + * @param {number} rotation Rotation. + * @param {number} offsetX X offset. + * @param {number} offsetY Y offset. + */ +function rotateAtOffset(context, rotation, offsetX, offsetY) { + if (rotation !== 0) { + context.translate(offsetX, offsetY); + context.rotate(rotation); + context.translate(-offsetX, -offsetY); + } +} + + +var resetTransform = Object(_transform_js__WEBPACK_IMPORTED_MODULE_4__[/* create */ "c"])(); + + +/** + * @param {CanvasRenderingContext2D} context Context. + * @param {import("../transform.js").Transform|null} transform Transform. + * @param {number} opacity Opacity. + * @param {HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} image Image. + * @param {number} originX Origin X. + * @param {number} originY Origin Y. + * @param {number} w Width. + * @param {number} h Height. + * @param {number} x X. + * @param {number} y Y. + * @param {number} scale Scale. + */ +function drawImage(context, + transform, opacity, image, originX, originY, w, h, x, y, scale) { + var alpha; + if (opacity != 1) { + alpha = context.globalAlpha; + context.globalAlpha = alpha * opacity; + } + if (transform) { + context.setTransform.apply(context, transform); + } + + context.drawImage(image, originX, originY, w, h, x, y, w * scale, h * scale); + + if (alpha) { + context.globalAlpha = alpha; + } + if (transform) { + context.setTransform.apply(context, resetTransform); + } +} + +//# sourceMappingURL=canvas.js.map + +/***/ }), +/* 5 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * @module ol/events/EventType + */ + +/** + * @enum {string} + * @const + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + /** + * Generic change event. Triggered when the revision counter is increased. + * @event module:ol/events/Event~Event#change + * @api + */ + CHANGE: 'change', + + CLEAR: 'clear', + CONTEXTMENU: 'contextmenu', + CLICK: 'click', + DBLCLICK: 'dblclick', + DRAGENTER: 'dragenter', + DRAGOVER: 'dragover', + DROP: 'drop', + ERROR: 'error', + KEYDOWN: 'keydown', + KEYPRESS: 'keypress', + LOAD: 'load', + MOUSEDOWN: 'mousedown', + MOUSEMOVE: 'mousemove', + MOUSEOUT: 'mouseout', + MOUSEUP: 'mouseup', + MOUSEWHEEL: 'mousewheel', + MSPOINTERDOWN: 'MSPointerDown', + RESIZE: 'resize', + TOUCHSTART: 'touchstart', + TOUCHMOVE: 'touchmove', + TOUCHEND: 'touchend', + WHEEL: 'wheel' +}); + +//# sourceMappingURL=EventType.js.map + +/***/ }), +/* 6 */ +/***/ (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 + +/***/ }), +/* 7 */ +/***/ (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__, "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); +/** + * @module ol/math + */ + + +/** + * Takes a number and clamps it to within the provided bounds. + * @param {number} value The input number. + * @param {number} min The minimum value to return. + * @param {number} max The maximum value to return. + * @return {number} The input number if it is within bounds, or the nearest + * number within the bounds. + */ +function clamp(value, min, max) { + return Math.min(Math.max(value, min), max); +} + + +/** + * Return the hyperbolic cosine of a given number. The method will use the + * native `Math.cosh` function if it is available, otherwise the hyperbolic + * cosine will be calculated via the reference implementation of the Mozilla + * developer network. + * + * @param {number} x X. + * @return {number} Hyperbolic cosine of x. + */ +var cosh = (function() { + // Wrapped in a iife, to save the overhead of checking for the native + // implementation on every invocation. + var cosh; + if ('cosh' in Math) { + // The environment supports the native Math.cosh function, use it… + cosh = Math.cosh; + } else { + // … else, use the reference implementation of MDN: + cosh = function(x) { + var y = /** @type {Math} */ (Math).exp(x); + return (y + 1 / y) / 2; + }; + } + return cosh; +}()); + + +/** + * @param {number} x X. + * @return {number} The smallest power of two greater than or equal to x. + */ +function roundUpToPowerOfTwo(x) { + Object(_asserts_js__WEBPACK_IMPORTED_MODULE_0__[/* assert */ "a"])(0 < x, 29); // `x` must be greater than `0` + return Math.pow(2, Math.ceil(Math.log(x) / Math.LN2)); +} + + +/** + * Returns the square of the closest distance between the point (x, y) and the + * line segment (x1, y1) to (x2, y2). + * @param {number} x X. + * @param {number} y Y. + * @param {number} x1 X1. + * @param {number} y1 Y1. + * @param {number} x2 X2. + * @param {number} y2 Y2. + * @return {number} Squared distance. + */ +function squaredSegmentDistance(x, y, x1, y1, x2, y2) { + var dx = x2 - x1; + var dy = y2 - y1; + if (dx !== 0 || dy !== 0) { + var t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy); + if (t > 1) { + x1 = x2; + y1 = y2; + } else if (t > 0) { + x1 += dx * t; + y1 += dy * t; + } + } + return squaredDistance(x, y, x1, y1); +} + + +/** + * Returns the square of the distance between the points (x1, y1) and (x2, y2). + * @param {number} x1 X1. + * @param {number} y1 Y1. + * @param {number} x2 X2. + * @param {number} y2 Y2. + * @return {number} Squared distance. + */ +function squaredDistance(x1, y1, x2, y2) { + var dx = x2 - x1; + var dy = y2 - y1; + return dx * dx + dy * dy; +} + + +/** + * Solves system of linear equations using Gaussian elimination method. + * + * @param {Array>} mat Augmented matrix (n x n + 1 column) + * in row-major order. + * @return {Array} The resulting vector. + */ +function solveLinearSystem(mat) { + var n = mat.length; + + for (var i = 0; i < n; i++) { + // Find max in the i-th column (ignoring i - 1 first rows) + var maxRow = i; + var maxEl = Math.abs(mat[i][i]); + for (var r = i + 1; r < n; r++) { + var absValue = Math.abs(mat[r][i]); + if (absValue > maxEl) { + maxEl = absValue; + maxRow = r; + } + } + + if (maxEl === 0) { + return null; // matrix is singular + } + + // Swap max row with i-th (current) row + var tmp = mat[maxRow]; + mat[maxRow] = mat[i]; + mat[i] = tmp; + + // Subtract the i-th row to make all the remaining rows 0 in the i-th column + for (var j = i + 1; j < n; j++) { + var coef = -mat[j][i] / mat[i][i]; + for (var k = i; k < n + 1; k++) { + if (i == k) { + mat[j][k] = 0; + } else { + mat[j][k] += coef * mat[i][k]; + } + } + } + } + + // Solve Ax=b for upper triangular matrix A (mat) + var x = new Array(n); + for (var l = n - 1; l >= 0; l--) { + x[l] = mat[l][n] / mat[l][l]; + for (var m = l - 1; m >= 0; m--) { + mat[m][n] -= mat[m][l] * x[l]; + } + } + return x; +} + + +/** + * Converts radians to to degrees. + * + * @param {number} angleInRadians Angle in radians. + * @return {number} Angle in degrees. + */ +function toDegrees(angleInRadians) { + return angleInRadians * 180 / Math.PI; +} + + +/** + * Converts degrees to radians. + * + * @param {number} angleInDegrees Angle in degrees. + * @return {number} Angle in radians. + */ +function toRadians(angleInDegrees) { + return angleInDegrees * Math.PI / 180; +} + +/** + * Returns the modulo of a / b, depending on the sign of b. + * + * @param {number} a Dividend. + * @param {number} b Divisor. + * @return {number} Modulo. + */ +function modulo(a, b) { + var r = a % b; + return r * b < 0 ? r + b : r; +} + +/** + * Calculates the linearly interpolated value of x between a and b. + * + * @param {number} a Number + * @param {number} b Number + * @param {number} x Value to be interpolated. + * @return {number} Interpolated value. + */ +function lerp(a, b, x) { + return a + x * (b - a); +} + +//# sourceMappingURL=math.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 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return assign; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return clear; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return getValues; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return isEmpty; }); +/** + * @module ol/obj + */ + + +/** + * Polyfill for Object.assign(). Assigns enumerable and own properties from + * one or more source objects to a target object. + * See https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign. + * + * @param {!Object} target The target object. + * @param {...Object} var_sources The source object(s). + * @return {!Object} The modified target object. + */ +var assign = (typeof Object.assign === 'function') ? Object.assign : function(target, var_sources) { + var arguments$1 = arguments; + + if (target === undefined || target === null) { + throw new TypeError('Cannot convert undefined or null to object'); + } + + var output = Object(target); + for (var i = 1, ii = arguments.length; i < ii; ++i) { + var source = arguments$1[i]; + if (source !== undefined && source !== null) { + for (var key in source) { + if (source.hasOwnProperty(key)) { + output[key] = source[key]; + } + } + } + } + return output; +}; + + +/** + * Removes all properties from an object. + * @param {Object} object The object to clear. + */ +function clear(object) { + for (var property in object) { + delete object[property]; + } +} + + +/** + * Get an array of property values from an object. + * @param {Object} object The object from which to get the values. + * @return {!Array} The property values. + * @template K,V + */ +function getValues(object) { + var values = []; + for (var property in object) { + values.push(object[property]); + } + return values; +} + + +/** + * Determine if an object has any properties. + * @param {Object} object The object to check. + * @return {boolean} The object is empty. + */ +function isEmpty(object) { + var property; + for (property in object) { + return false; + } + return !property; +} + +//# 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__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return binarySearch; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return numberSafeCompareFunction; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return includes; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return linearFindNearest; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return reverseSubArray; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return extend; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return remove; }); +/* unused harmony export find */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return equals; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return stableSort; }); +/* unused harmony export findIndex */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return isSorted; }); +/** + * @module ol/array + */ + + +/** + * Performs a binary search on the provided sorted list and returns the index of the item if found. If it can't be found it'll return -1. + * https://github.com/darkskyapp/binary-search + * + * @param {Array<*>} haystack Items to search through. + * @param {*} needle The item to look for. + * @param {Function=} opt_comparator Comparator function. + * @return {number} The index of the item if found, -1 if not. + */ +function binarySearch(haystack, needle, opt_comparator) { + var mid, cmp; + var comparator = opt_comparator || numberSafeCompareFunction; + var low = 0; + var high = haystack.length; + var found = false; + + while (low < high) { + /* Note that "(low + high) >>> 1" may overflow, and results in a typecast + * to double (which gives the wrong results). */ + mid = low + (high - low >> 1); + cmp = +comparator(haystack[mid], needle); + + if (cmp < 0.0) { /* Too low. */ + low = mid + 1; + + } else { /* Key found or too high */ + high = mid; + found = !cmp; + } + } + + /* Key not found. */ + return found ? low : ~low; +} + + +/** + * Compare function for array sort that is safe for numbers. + * @param {*} a The first object to be compared. + * @param {*} b The second object to be compared. + * @return {number} A negative number, zero, or a positive number as the first + * argument is less than, equal to, or greater than the second. + */ +function numberSafeCompareFunction(a, b) { + return a > b ? 1 : a < b ? -1 : 0; +} + + +/** + * Whether the array contains the given object. + * @param {Array<*>} arr The array to test for the presence of the element. + * @param {*} obj The object for which to test. + * @return {boolean} The object is in the array. + */ +function includes(arr, obj) { + return arr.indexOf(obj) >= 0; +} + + +/** + * @param {Array} arr Array. + * @param {number} target Target. + * @param {number} direction 0 means return the nearest, > 0 + * means return the largest nearest, < 0 means return the + * smallest nearest. + * @return {number} Index. + */ +function linearFindNearest(arr, target, direction) { + var n = arr.length; + if (arr[0] <= target) { + return 0; + } else if (target <= arr[n - 1]) { + return n - 1; + } else { + var i; + if (direction > 0) { + for (i = 1; i < n; ++i) { + if (arr[i] < target) { + return i - 1; + } + } + } else if (direction < 0) { + for (i = 1; i < n; ++i) { + if (arr[i] <= target) { + return i; + } + } + } else { + for (i = 1; i < n; ++i) { + if (arr[i] == target) { + return i; + } else if (arr[i] < target) { + if (arr[i - 1] - target < target - arr[i]) { + return i - 1; + } else { + return i; + } + } + } + } + return n - 1; + } +} + + +/** + * @param {Array<*>} arr Array. + * @param {number} begin Begin index. + * @param {number} end End index. + */ +function reverseSubArray(arr, begin, end) { + while (begin < end) { + var tmp = arr[begin]; + arr[begin] = arr[end]; + arr[end] = tmp; + ++begin; + --end; + } +} + + +/** + * @param {Array} arr The array to modify. + * @param {!Array|VALUE} data The elements or arrays of elements to add to arr. + * @template VALUE + */ +function extend(arr, data) { + var extension = Array.isArray(data) ? data : [data]; + var length = extension.length; + for (var i = 0; i < length; i++) { + arr[arr.length] = extension[i]; + } +} + + +/** + * @param {Array} arr The array to modify. + * @param {VALUE} obj The element to remove. + * @template VALUE + * @return {boolean} If the element was removed. + */ +function remove(arr, obj) { + var i = arr.indexOf(obj); + var found = i > -1; + if (found) { + arr.splice(i, 1); + } + return found; +} + + +/** + * @param {Array} arr The array to search in. + * @param {function(VALUE, number, ?) : boolean} func The function to compare. + * @template VALUE + * @return {VALUE|null} The element found or null. + */ +function find(arr, func) { + var length = arr.length >>> 0; + var value; + + for (var i = 0; i < length; i++) { + value = arr[i]; + if (func(value, i, arr)) { + return value; + } + } + return null; +} + + +/** + * @param {Array|Uint8ClampedArray} arr1 The first array to compare. + * @param {Array|Uint8ClampedArray} arr2 The second array to compare. + * @return {boolean} Whether the two arrays are equal. + */ +function equals(arr1, arr2) { + var len1 = arr1.length; + if (len1 !== arr2.length) { + return false; + } + for (var i = 0; i < len1; i++) { + if (arr1[i] !== arr2[i]) { + return false; + } + } + return true; +} + + +/** + * Sort the passed array such that the relative order of equal elements is preverved. + * See https://en.wikipedia.org/wiki/Sorting_algorithm#Stability for details. + * @param {Array<*>} arr The array to sort (modifies original). + * @param {!function(*, *): number} compareFnc Comparison function. + * @api + */ +function stableSort(arr, compareFnc) { + var length = arr.length; + var tmp = Array(arr.length); + var i; + for (i = 0; i < length; i++) { + tmp[i] = {index: i, value: arr[i]}; + } + tmp.sort(function(a, b) { + return compareFnc(a.value, b.value) || a.index - b.index; + }); + for (i = 0; i < arr.length; i++) { + arr[i] = tmp[i].value; + } +} + + +/** + * @param {Array<*>} arr The array to search in. + * @param {Function} func Comparison function. + * @return {number} Return index. + */ +function findIndex(arr, func) { + var index; + var found = !arr.every(function(el, idx) { + index = idx; + return !func(el, idx, arr); + }); + return found ? index : -1; +} + + +/** + * @param {Array<*>} arr The array to test. + * @param {Function=} opt_func Comparison function. + * @param {boolean=} opt_strict Strictly sorted (default false). + * @return {boolean} Return index. + */ +function isSorted(arr, opt_func, opt_strict) { + var compare = opt_func || numberSafeCompareFunction; + return arr.every(function(currentVal, index) { + if (index === 0) { + return true; + } + var res = compare(arr[index - 1], currentVal); + return !(res > 0 || opt_strict && res === 0); + }); +} + +//# sourceMappingURL=array.js.map + +/***/ }), +/* 12 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * @module ol/ViewHint + */ + +/** + * @enum {number} + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + ANIMATING: 0, + INTERACTING: 1 +}); + +//# sourceMappingURL=ViewHint.js.map + +/***/ }), +/* 13 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// EXTERNAL MODULE: ./node_modules/ol/sphere.js +var sphere = __webpack_require__(59); + +// EXTERNAL MODULE: ./node_modules/ol/extent.js +var ol_extent = __webpack_require__(0); + +// EXTERNAL MODULE: ./node_modules/ol/math.js +var math = __webpack_require__(7); + +// EXTERNAL MODULE: ./node_modules/ol/proj/Units.js +var Units = __webpack_require__(23); + +// CONCATENATED MODULE: ./node_modules/ol/proj/Projection.js +/** + * @module ol/proj/Projection + */ + + + +/** + * @typedef {Object} Options + * @property {string} code The SRS identifier code, e.g. `EPSG:4326`. + * @property {import("./Units.js").default|string} [units] Units. Required unless a + * proj4 projection is defined for `code`. + * @property {import("../extent.js").Extent} [extent] The validity extent for the SRS. + * @property {string} [axisOrientation='enu'] The axis orientation as specified in Proj4. + * @property {boolean} [global=false] Whether the projection is valid for the whole globe. + * @property {number} [metersPerUnit] The meters per unit for the SRS. + * If not provided, the `units` are used to get the meters per unit from the {@link module:ol/proj/Units~METERS_PER_UNIT} + * lookup table. + * @property {import("../extent.js").Extent} [worldExtent] The world extent for the SRS. + * @property {function(number, import("../coordinate.js").Coordinate):number} [getPointResolution] + * Function to determine resolution at a point. The function is called with a + * `{number}` view resolution and an `{import("../coordinate.js").Coordinate}` as arguments, and returns + * the `{number}` resolution at the passed coordinate. If this is `undefined`, + * the default {@link module:ol/proj#getPointResolution} function will be used. + */ + + +/** + * @classdesc + * Projection definition class. One of these is created for each projection + * supported in the application and stored in the {@link module:ol/proj} namespace. + * You can use these in applications, but this is not required, as API params + * and options use {@link module:ol/proj~ProjectionLike} which means the simple string + * code will suffice. + * + * You can use {@link module:ol/proj~get} to retrieve the object for a particular + * projection. + * + * The library includes definitions for `EPSG:4326` and `EPSG:3857`, together + * with the following aliases: + * * `EPSG:4326`: CRS:84, urn:ogc:def:crs:EPSG:6.6:4326, + * urn:ogc:def:crs:OGC:1.3:CRS84, urn:ogc:def:crs:OGC:2:84, + * http://www.opengis.net/gml/srs/epsg.xml#4326, + * urn:x-ogc:def:crs:EPSG:4326 + * * `EPSG:3857`: EPSG:102100, EPSG:102113, EPSG:900913, + * urn:ogc:def:crs:EPSG:6.18:3:3857, + * http://www.opengis.net/gml/srs/epsg.xml#3857 + * + * If you use [proj4js](https://github.com/proj4js/proj4js), aliases can + * be added using `proj4.defs()`. After all required projection definitions are + * added, call the {@link module:ol/proj/proj4~register} function. + * + * @api + */ +var Projection_Projection = function Projection(options) { + /** + * @private + * @type {string} + */ + this.code_ = options.code; + + /** + * Units of projected coordinates. When set to `TILE_PIXELS`, a + * `this.extent_` and `this.worldExtent_` must be configured properly for each + * tile. + * @private + * @type {import("./Units.js").default} + */ + this.units_ = /** @type {import("./Units.js").default} */ (options.units); + + /** + * Validity extent of the projection in projected coordinates. For projections + * with `TILE_PIXELS` units, this is the extent of the tile in + * tile pixel space. + * @private + * @type {import("../extent.js").Extent} + */ + this.extent_ = options.extent !== undefined ? options.extent : null; + + /** + * Extent of the world in EPSG:4326. For projections with + * `TILE_PIXELS` units, this is the extent of the tile in + * projected coordinate space. + * @private + * @type {import("../extent.js").Extent} + */ + this.worldExtent_ = options.worldExtent !== undefined ? + options.worldExtent : null; + + /** + * @private + * @type {string} + */ + this.axisOrientation_ = options.axisOrientation !== undefined ? + options.axisOrientation : 'enu'; + + /** + * @private + * @type {boolean} + */ + this.global_ = options.global !== undefined ? options.global : false; + + /** + * @private + * @type {boolean} + */ + this.canWrapX_ = !!(this.global_ && this.extent_); + + /** + * @private + * @type {function(number, import("../coordinate.js").Coordinate):number|undefined} + */ + this.getPointResolutionFunc_ = options.getPointResolution; + + /** + * @private + * @type {import("../tilegrid/TileGrid.js").default} + */ + this.defaultTileGrid_ = null; + + /** + * @private + * @type {number|undefined} + */ + this.metersPerUnit_ = options.metersPerUnit; +}; + +/** + * @return {boolean} The projection is suitable for wrapping the x-axis + */ +Projection_Projection.prototype.canWrapX = function canWrapX () { + return this.canWrapX_; +}; + +/** + * Get the code for this projection, e.g. 'EPSG:4326'. + * @return {string} Code. + * @api + */ +Projection_Projection.prototype.getCode = function getCode () { + return this.code_; +}; + +/** + * Get the validity extent for this projection. + * @return {import("../extent.js").Extent} Extent. + * @api + */ +Projection_Projection.prototype.getExtent = function getExtent () { + return this.extent_; +}; + +/** + * Get the units of this projection. + * @return {import("./Units.js").default} Units. + * @api + */ +Projection_Projection.prototype.getUnits = function getUnits () { + return this.units_; +}; + +/** + * Get the amount of meters per unit of this projection.If the projection is + * not configured with `metersPerUnit` or a units identifier, the return is + * `undefined`. + * @return {number|undefined} Meters. + * @api + */ +Projection_Projection.prototype.getMetersPerUnit = function getMetersPerUnit () { + return this.metersPerUnit_ || Units["a" /* METERS_PER_UNIT */][this.units_]; +}; + +/** + * Get the world extent for this projection. + * @return {import("../extent.js").Extent} Extent. + * @api + */ +Projection_Projection.prototype.getWorldExtent = function getWorldExtent () { + return this.worldExtent_; +}; + +/** + * Get the axis orientation of this projection. + * Example values are: + * enu - the default easting, northing, elevation. + * neu - northing, easting, up - useful for "lat/long" geographic coordinates, + * or south orientated transverse mercator. + * wnu - westing, northing, up - some planetary coordinate systems have + * "west positive" coordinate systems + * @return {string} Axis orientation. + * @api + */ +Projection_Projection.prototype.getAxisOrientation = function getAxisOrientation () { + return this.axisOrientation_; +}; + +/** + * Is this projection a global projection which spans the whole world? + * @return {boolean} Whether the projection is global. + * @api + */ +Projection_Projection.prototype.isGlobal = function isGlobal () { + return this.global_; +}; + +/** + * Set if the projection is a global projection which spans the whole world + * @param {boolean} global Whether the projection is global. + * @api + */ +Projection_Projection.prototype.setGlobal = function setGlobal (global) { + this.global_ = global; + this.canWrapX_ = !!(global && this.extent_); +}; + +/** + * @return {import("../tilegrid/TileGrid.js").default} The default tile grid. + */ +Projection_Projection.prototype.getDefaultTileGrid = function getDefaultTileGrid () { + return this.defaultTileGrid_; +}; + +/** + * @param {import("../tilegrid/TileGrid.js").default} tileGrid The default tile grid. + */ +Projection_Projection.prototype.setDefaultTileGrid = function setDefaultTileGrid (tileGrid) { + this.defaultTileGrid_ = tileGrid; +}; + +/** + * Set the validity extent for this projection. + * @param {import("../extent.js").Extent} extent Extent. + * @api + */ +Projection_Projection.prototype.setExtent = function setExtent (extent) { + this.extent_ = extent; + this.canWrapX_ = !!(this.global_ && extent); +}; + +/** + * Set the world extent for this projection. + * @param {import("../extent.js").Extent} worldExtent World extent + * [minlon, minlat, maxlon, maxlat]. + * @api + */ +Projection_Projection.prototype.setWorldExtent = function setWorldExtent (worldExtent) { + this.worldExtent_ = worldExtent; +}; + +/** + * Set the getPointResolution function (see {@link module:ol/proj~getPointResolution} + * for this projection. + * @param {function(number, import("../coordinate.js").Coordinate):number} func Function + * @api + */ +Projection_Projection.prototype.setGetPointResolution = function setGetPointResolution (func) { + this.getPointResolutionFunc_ = func; +}; + +/** + * Get the custom point resolution function for this projection (if set). + * @return {function(number, import("../coordinate.js").Coordinate):number|undefined} The custom point + * resolution function (if set). + */ +Projection_Projection.prototype.getPointResolutionFunc = function getPointResolutionFunc () { + return this.getPointResolutionFunc_; +}; + +/* harmony default export */ var proj_Projection = (Projection_Projection); + +//# sourceMappingURL=Projection.js.map +// CONCATENATED MODULE: ./node_modules/ol/proj/epsg3857.js +/** + * @module ol/proj/epsg3857 + */ + + + + + +/** + * Radius of WGS84 sphere + * + * @const + * @type {number} + */ +var RADIUS = 6378137; + + +/** + * @const + * @type {number} + */ +var HALF_SIZE = Math.PI * RADIUS; + + +/** + * @const + * @type {import("../extent.js").Extent} + */ +var EXTENT = [ + -HALF_SIZE, -HALF_SIZE, + HALF_SIZE, HALF_SIZE +]; + + +/** + * @const + * @type {import("../extent.js").Extent} + */ +var WORLD_EXTENT = [-180, -85, 180, 85]; + + +/** + * @classdesc + * Projection object for web/spherical Mercator (EPSG:3857). + */ +var epsg3857_EPSG3857Projection = /*@__PURE__*/(function (Projection) { + function EPSG3857Projection(code) { + Projection.call(this, { + code: code, + units: Units["b" /* default */].METERS, + extent: EXTENT, + global: true, + worldExtent: WORLD_EXTENT, + getPointResolution: function(resolution, point) { + return resolution / Object(math["b" /* cosh */])(point[1] / RADIUS); + } + }); + + } + + if ( Projection ) EPSG3857Projection.__proto__ = Projection; + EPSG3857Projection.prototype = Object.create( Projection && Projection.prototype ); + EPSG3857Projection.prototype.constructor = EPSG3857Projection; + + return EPSG3857Projection; +}(proj_Projection)); + + +/** + * Projections equal to EPSG:3857. + * + * @const + * @type {Array} + */ +var PROJECTIONS = [ + new epsg3857_EPSG3857Projection('EPSG:3857'), + new epsg3857_EPSG3857Projection('EPSG:102100'), + new epsg3857_EPSG3857Projection('EPSG:102113'), + new epsg3857_EPSG3857Projection('EPSG:900913'), + new epsg3857_EPSG3857Projection('urn:ogc:def:crs:EPSG:6.18:3:3857'), + new epsg3857_EPSG3857Projection('urn:ogc:def:crs:EPSG::3857'), + new epsg3857_EPSG3857Projection('http://www.opengis.net/gml/srs/epsg.xml#3857') +]; + + +/** + * Transformation from EPSG:4326 to EPSG:3857. + * + * @param {Array} input Input array of coordinate values. + * @param {Array=} opt_output Output array of coordinate values. + * @param {number=} opt_dimension Dimension (default is `2`). + * @return {Array} Output array of coordinate values. + */ +function fromEPSG4326(input, opt_output, opt_dimension) { + var length = input.length; + var dimension = opt_dimension > 1 ? opt_dimension : 2; + var output = opt_output; + if (output === undefined) { + if (dimension > 2) { + // preserve values beyond second dimension + output = input.slice(); + } else { + output = new Array(length); + } + } + var halfSize = HALF_SIZE; + for (var i = 0; i < length; i += dimension) { + output[i] = halfSize * input[i] / 180; + var y = RADIUS * + Math.log(Math.tan(Math.PI * (input[i + 1] + 90) / 360)); + if (y > halfSize) { + y = halfSize; + } else if (y < -halfSize) { + y = -halfSize; + } + output[i + 1] = y; + } + return output; +} + + +/** + * Transformation from EPSG:3857 to EPSG:4326. + * + * @param {Array} input Input array of coordinate values. + * @param {Array=} opt_output Output array of coordinate values. + * @param {number=} opt_dimension Dimension (default is `2`). + * @return {Array} Output array of coordinate values. + */ +function epsg3857_toEPSG4326(input, opt_output, opt_dimension) { + var length = input.length; + var dimension = opt_dimension > 1 ? opt_dimension : 2; + var output = opt_output; + if (output === undefined) { + if (dimension > 2) { + // preserve values beyond second dimension + output = input.slice(); + } else { + output = new Array(length); + } + } + for (var i = 0; i < length; i += dimension) { + output[i] = 180 * input[i] / HALF_SIZE; + output[i + 1] = 360 * Math.atan( + Math.exp(input[i + 1] / RADIUS)) / Math.PI - 90; + } + return output; +} + +//# sourceMappingURL=epsg3857.js.map +// CONCATENATED MODULE: ./node_modules/ol/proj/epsg4326.js +/** + * @module ol/proj/epsg4326 + */ + + + + +/** + * Semi-major radius of the WGS84 ellipsoid. + * + * @const + * @type {number} + */ +var epsg4326_RADIUS = 6378137; + + +/** + * Extent of the EPSG:4326 projection which is the whole world. + * + * @const + * @type {import("../extent.js").Extent} + */ +var epsg4326_EXTENT = [-180, -90, 180, 90]; + + +/** + * @const + * @type {number} + */ +var METERS_PER_UNIT = Math.PI * epsg4326_RADIUS / 180; + + +/** + * @classdesc + * Projection object for WGS84 geographic coordinates (EPSG:4326). + * + * Note that OpenLayers does not strictly comply with the EPSG definition. + * The EPSG registry defines 4326 as a CRS for Latitude,Longitude (y,x). + * OpenLayers treats EPSG:4326 as a pseudo-projection, with x,y coordinates. + */ +var epsg4326_EPSG4326Projection = /*@__PURE__*/(function (Projection) { + function EPSG4326Projection(code, opt_axisOrientation) { + Projection.call(this, { + code: code, + units: Units["b" /* default */].DEGREES, + extent: epsg4326_EXTENT, + axisOrientation: opt_axisOrientation, + global: true, + metersPerUnit: METERS_PER_UNIT, + worldExtent: epsg4326_EXTENT + }); + + } + + if ( Projection ) EPSG4326Projection.__proto__ = Projection; + EPSG4326Projection.prototype = Object.create( Projection && Projection.prototype ); + EPSG4326Projection.prototype.constructor = EPSG4326Projection; + + return EPSG4326Projection; +}(proj_Projection)); + + +/** + * Projections equal to EPSG:4326. + * + * @const + * @type {Array} + */ +var epsg4326_PROJECTIONS = [ + new epsg4326_EPSG4326Projection('CRS:84'), + new epsg4326_EPSG4326Projection('EPSG:4326', 'neu'), + new epsg4326_EPSG4326Projection('urn:ogc:def:crs:EPSG::4326', 'neu'), + new epsg4326_EPSG4326Projection('urn:ogc:def:crs:EPSG:6.6:4326', 'neu'), + new epsg4326_EPSG4326Projection('urn:ogc:def:crs:OGC:1.3:CRS84'), + new epsg4326_EPSG4326Projection('urn:ogc:def:crs:OGC:2:84'), + new epsg4326_EPSG4326Projection('http://www.opengis.net/gml/srs/epsg.xml#4326', 'neu'), + new epsg4326_EPSG4326Projection('urn:x-ogc:def:crs:EPSG:4326', 'neu') +]; + +//# sourceMappingURL=epsg4326.js.map +// CONCATENATED MODULE: ./node_modules/ol/proj/projections.js +/** + * @module ol/proj/projections + */ + + +/** + * @type {Object} + */ +var cache = {}; + + +/** + * Clear the projections cache. + */ +function clear() { + cache = {}; +} + + +/** + * Get a cached projection by code. + * @param {string} code The code for the projection. + * @return {import("./Projection.js").default} The projection (if cached). + */ +function get(code) { + return cache[code] || null; +} + + +/** + * Add a projection to the cache. + * @param {string} code The projection code. + * @param {import("./Projection.js").default} projection The projection to cache. + */ +function add(code, projection) { + cache[code] = projection; +} + +//# sourceMappingURL=projections.js.map +// EXTERNAL MODULE: ./node_modules/ol/obj.js +var obj = __webpack_require__(9); + +// CONCATENATED MODULE: ./node_modules/ol/proj/transforms.js +/** + * @module ol/proj/transforms + */ + + + +/** + * @private + * @type {!Object>} + */ +var transforms = {}; + + +/** + * Clear the transform cache. + */ +function transforms_clear() { + transforms = {}; +} + + +/** + * Registers a conversion function to convert coordinates from the source + * projection to the destination projection. + * + * @param {import("./Projection.js").default} source Source. + * @param {import("./Projection.js").default} destination Destination. + * @param {import("../proj.js").TransformFunction} transformFn Transform. + */ +function transforms_add(source, destination, transformFn) { + var sourceCode = source.getCode(); + var destinationCode = destination.getCode(); + if (!(sourceCode in transforms)) { + transforms[sourceCode] = {}; + } + transforms[sourceCode][destinationCode] = transformFn; +} + + +/** + * Unregisters the conversion function to convert coordinates from the source + * projection to the destination projection. This method is used to clean up + * cached transforms during testing. + * + * @param {import("./Projection.js").default} source Source projection. + * @param {import("./Projection.js").default} destination Destination projection. + * @return {import("../proj.js").TransformFunction} transformFn The unregistered transform. + */ +function remove(source, destination) { + var sourceCode = source.getCode(); + var destinationCode = destination.getCode(); + var transform = transforms[sourceCode][destinationCode]; + delete transforms[sourceCode][destinationCode]; + if (Object(obj["d" /* isEmpty */])(transforms[sourceCode])) { + delete transforms[sourceCode]; + } + return transform; +} + + +/** + * Get a transform given a source code and a destination code. + * @param {string} sourceCode The code for the source projection. + * @param {string} destinationCode The code for the destination projection. + * @return {import("../proj.js").TransformFunction|undefined} The transform function (if found). + */ +function transforms_get(sourceCode, destinationCode) { + var transform; + if (sourceCode in transforms && destinationCode in transforms[sourceCode]) { + transform = transforms[sourceCode][destinationCode]; + } + return transform; +} + +//# sourceMappingURL=transforms.js.map +// CONCATENATED MODULE: ./node_modules/ol/proj.js +/* unused harmony export cloneTransform */ +/* unused harmony export identityTransform */ +/* unused harmony export addProjection */ +/* unused harmony export addProjections */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return proj_get; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return getPointResolution; }); +/* unused harmony export addEquivalentProjections */ +/* unused harmony export addEquivalentTransforms */ +/* unused harmony export clearAllProjections */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return createProjection; }); +/* 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__, "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; }); +/* 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 */]; }); +/* unused concated harmony import Projection */ +/** + * @module ol/proj + */ + +/** + * The ol/proj module stores: + * * a list of {@link module:ol/proj/Projection} + * objects, one for each projection supported by the application + * * a list of transform functions needed to convert coordinates in one projection + * into another. + * + * The static functions are the methods used to maintain these. + * Each transform function can handle not only simple coordinate pairs, but also + * large arrays of coordinates such as vector geometries. + * + * When loaded, the library adds projection objects for EPSG:4326 (WGS84 + * geographic coordinates) and EPSG:3857 (Web or Spherical Mercator, as used + * for example by Bing Maps or OpenStreetMap), together with the relevant + * transform functions. + * + * Additional transforms may be added by using the http://proj4js.org/ + * library (version 2.2 or later). You can use the full build supplied by + * Proj4js, or create a custom build to support those projections you need; see + * the Proj4js website for how to do this. You also need the Proj4js definitions + * for the required projections. These definitions can be obtained from + * https://epsg.io/, and are a JS function, so can be loaded in a script + * tag (as in the examples) or pasted into your application. + * + * After all required projection definitions are added to proj4's registry (by + * using `proj4.defs()`), simply call `register(proj4)` from the `ol/proj/proj4` + * package. Existing transforms are not changed by this function. See + * examples/wms-image-custom-proj for an example of this. + * + * Additional projection definitions can be registered with `proj4.defs()` any + * time. Just make sure to call `register(proj4)` again; for example, with user-supplied data where you don't + * know in advance what projections are needed, you can initially load minimal + * support and then load whichever are requested. + * + * Note that Proj4js does not support projection extents. If you want to add + * one for creating default tile grids, you can add it after the Projection + * object has been created with `setExtent`, for example, + * `get('EPSG:1234').setExtent(extent)`. + * + * In addition to Proj4js support, any transform functions can be added with + * {@link module:ol/proj~addCoordinateTransforms}. To use this, you must first create + * a {@link module:ol/proj/Projection} object for the new projection and add it with + * {@link module:ol/proj~addProjection}. You can then add the forward and inverse + * functions with {@link module:ol/proj~addCoordinateTransforms}. See + * examples/wms-custom-proj for an example of this. + * + * Note that if no transforms are needed and you only need to define the + * projection, just add a {@link module:ol/proj/Projection} with + * {@link module:ol/proj~addProjection}. See examples/wms-no-proj for an example of + * this. + */ + + + + + + + + + + + +/** + * A projection as {@link module:ol/proj/Projection}, SRS identifier + * string or undefined. + * @typedef {Projection|string|undefined} ProjectionLike + * @api + */ + + +/** + * A transform function accepts an array of input coordinate values, an optional + * output array, and an optional dimension (default should be 2). The function + * transforms the input coordinate values, populates the output array, and + * returns the output array. + * + * @typedef {function(Array, Array=, number=): Array} TransformFunction + * @api + */ + + + + + + +/** + * @param {Array} input Input coordinate array. + * @param {Array=} opt_output Output array of coordinate values. + * @param {number=} opt_dimension Dimension. + * @return {Array} Output coordinate array (new array, same coordinate + * values). + */ +function cloneTransform(input, opt_output, opt_dimension) { + var output; + if (opt_output !== undefined) { + for (var i = 0, ii = input.length; i < ii; ++i) { + opt_output[i] = input[i]; + } + output = opt_output; + } else { + output = input.slice(); + } + return output; +} + + +/** + * @param {Array} input Input coordinate array. + * @param {Array=} opt_output Output array of coordinate values. + * @param {number=} opt_dimension Dimension. + * @return {Array} Input coordinate array (same array as input). + */ +function identityTransform(input, opt_output, opt_dimension) { + if (opt_output !== undefined && input !== opt_output) { + for (var i = 0, ii = input.length; i < ii; ++i) { + opt_output[i] = input[i]; + } + input = opt_output; + } + return input; +} + + +/** + * Add a Projection object to the list of supported projections that can be + * looked up by their code. + * + * @param {Projection} projection Projection instance. + * @api + */ +function addProjection(projection) { + add(projection.getCode(), projection); + transforms_add(projection, projection, cloneTransform); +} + + +/** + * @param {Array} projections Projections. + */ +function addProjections(projections) { + projections.forEach(addProjection); +} + + +/** + * Fetches a Projection object for the code specified. + * + * @param {ProjectionLike} projectionLike Either a code string which is + * a combination of authority and identifier such as "EPSG:4326", or an + * existing projection object, or undefined. + * @return {Projection} Projection object, or null if not in list. + * @api + */ +function proj_get(projectionLike) { + return typeof projectionLike === 'string' ? + get(/** @type {string} */ (projectionLike)) : + (/** @type {Projection} */ (projectionLike) || null); +} + + +/** + * Get the resolution of the point in degrees or distance units. + * For projections with degrees as the unit this will simply return the + * provided resolution. For other projections the point resolution is + * by default estimated by transforming the 'point' pixel to EPSG:4326, + * measuring its width and height on the normal sphere, + * and taking the average of the width and height. + * A custom function can be provided for a specific projection, either + * by setting the `getPointResolution` option in the + * {@link module:ol/proj/Projection~Projection} constructor or by using + * {@link module:ol/proj/Projection~Projection#setGetPointResolution} to change an existing + * projection object. + * @param {ProjectionLike} projection The projection. + * @param {number} resolution Nominal resolution in projection units. + * @param {import("./coordinate.js").Coordinate} point Point to find adjusted resolution at. + * @param {Units=} opt_units Units to get the point resolution in. + * Default is the projection's units. + * @return {number} Point resolution. + * @api + */ +function getPointResolution(projection, resolution, point, opt_units) { + projection = proj_get(projection); + var pointResolution; + var getter = projection.getPointResolutionFunc(); + if (getter) { + pointResolution = getter(resolution, point); + } else { + var units = projection.getUnits(); + if (units == Units["b" /* default */].DEGREES && !opt_units || opt_units == Units["b" /* default */].DEGREES) { + pointResolution = resolution; + } else { + // Estimate point resolution by transforming the center pixel to EPSG:4326, + // measuring its width and height on the normal sphere, and taking the + // average of the width and height. + var toEPSG4326 = getTransformFromProjections(projection, proj_get('EPSG:4326')); + var vertices = [ + point[0] - resolution / 2, point[1], + point[0] + resolution / 2, point[1], + point[0], point[1] - resolution / 2, + point[0], point[1] + resolution / 2 + ]; + vertices = toEPSG4326(vertices, vertices, 2); + var width = Object(sphere["a" /* getDistance */])(vertices.slice(0, 2), vertices.slice(2, 4)); + var height = Object(sphere["a" /* getDistance */])(vertices.slice(4, 6), vertices.slice(6, 8)); + pointResolution = (width + height) / 2; + var metersPerUnit = opt_units ? + Units["a" /* METERS_PER_UNIT */][opt_units] : + projection.getMetersPerUnit(); + if (metersPerUnit !== undefined) { + pointResolution /= metersPerUnit; + } + } + } + return pointResolution; +} + + +/** + * Registers transformation functions that don't alter coordinates. Those allow + * to transform between projections with equal meaning. + * + * @param {Array} projections Projections. + * @api + */ +function addEquivalentProjections(projections) { + addProjections(projections); + projections.forEach(function(source) { + projections.forEach(function(destination) { + if (source !== destination) { + transforms_add(source, destination, cloneTransform); + } + }); + }); +} + + +/** + * Registers transformation functions to convert coordinates in any projection + * in projection1 to any projection in projection2. + * + * @param {Array} projections1 Projections with equal + * meaning. + * @param {Array} projections2 Projections with equal + * meaning. + * @param {TransformFunction} forwardTransform Transformation from any + * projection in projection1 to any projection in projection2. + * @param {TransformFunction} inverseTransform Transform from any projection + * in projection2 to any projection in projection1.. + */ +function addEquivalentTransforms(projections1, projections2, forwardTransform, inverseTransform) { + projections1.forEach(function(projection1) { + projections2.forEach(function(projection2) { + transforms_add(projection1, projection2, forwardTransform); + transforms_add(projection2, projection1, inverseTransform); + }); + }); +} + + +/** + * Clear all cached projections and transforms. + */ +function clearAllProjections() { + clear(); + transforms_clear(); +} + + +/** + * @param {Projection|string|undefined} projection Projection. + * @param {string} defaultCode Default code. + * @return {Projection} Projection. + */ +function createProjection(projection, defaultCode) { + if (!projection) { + return proj_get(defaultCode); + } else if (typeof projection === 'string') { + return proj_get(projection); + } else { + return ( + /** @type {Projection} */ (projection) + ); + } +} + + +/** + * Creates a {@link module:ol/proj~TransformFunction} from a simple 2D coordinate transform + * function. + * @param {function(import("./coordinate.js").Coordinate): import("./coordinate.js").Coordinate} coordTransform Coordinate + * transform. + * @return {TransformFunction} Transform function. + */ +function createTransformFromCoordinateTransform(coordTransform) { + return ( + /** + * @param {Array} input Input. + * @param {Array=} opt_output Output. + * @param {number=} opt_dimension Dimension. + * @return {Array} Output. + */ + function(input, opt_output, opt_dimension) { + var length = input.length; + var dimension = opt_dimension !== undefined ? opt_dimension : 2; + var output = opt_output !== undefined ? opt_output : new Array(length); + for (var i = 0; i < length; i += dimension) { + var point = coordTransform([input[i], input[i + 1]]); + output[i] = point[0]; + output[i + 1] = point[1]; + for (var j = dimension - 1; j >= 2; --j) { + output[i + j] = input[i + j]; + } + } + return output; + }); +} + + +/** + * Registers coordinate transform functions to convert coordinates between the + * source projection and the destination projection. + * The forward and inverse functions convert coordinate pairs; this function + * converts these into the functions used internally which also handle + * extents and coordinate arrays. + * + * @param {ProjectionLike} source Source projection. + * @param {ProjectionLike} destination Destination projection. + * @param {function(import("./coordinate.js").Coordinate): import("./coordinate.js").Coordinate} forward The forward transform + * function (that is, from the source projection to the destination + * projection) that takes a {@link module:ol/coordinate~Coordinate} as argument and returns + * the transformed {@link module:ol/coordinate~Coordinate}. + * @param {function(import("./coordinate.js").Coordinate): import("./coordinate.js").Coordinate} inverse The inverse transform + * function (that is, from the destination projection to the source + * projection) that takes a {@link module:ol/coordinate~Coordinate} as argument and returns + * the transformed {@link module:ol/coordinate~Coordinate}. + * @api + */ +function addCoordinateTransforms(source, destination, forward, inverse) { + var sourceProj = proj_get(source); + var destProj = proj_get(destination); + transforms_add(sourceProj, destProj, createTransformFromCoordinateTransform(forward)); + transforms_add(destProj, sourceProj, createTransformFromCoordinateTransform(inverse)); +} + + +/** + * Transforms a coordinate from longitude/latitude to a different projection. + * @param {import("./coordinate.js").Coordinate} coordinate Coordinate as longitude and latitude, i.e. + * an array with longitude as 1st and latitude as 2nd element. + * @param {ProjectionLike=} opt_projection Target projection. The + * default is Web Mercator, i.e. 'EPSG:3857'. + * @return {import("./coordinate.js").Coordinate} Coordinate projected to the target projection. + * @api + */ +function fromLonLat(coordinate, opt_projection) { + return proj_transform(coordinate, 'EPSG:4326', + opt_projection !== undefined ? opt_projection : 'EPSG:3857'); +} + + +/** + * Transforms a coordinate to longitude/latitude. + * @param {import("./coordinate.js").Coordinate} coordinate Projected coordinate. + * @param {ProjectionLike=} opt_projection Projection of the coordinate. + * The default is Web Mercator, i.e. 'EPSG:3857'. + * @return {import("./coordinate.js").Coordinate} Coordinate as longitude and latitude, i.e. an array + * with longitude as 1st and latitude as 2nd element. + * @api + */ +function toLonLat(coordinate, opt_projection) { + var lonLat = proj_transform(coordinate, + opt_projection !== undefined ? opt_projection : 'EPSG:3857', 'EPSG:4326'); + var lon = lonLat[0]; + if (lon < -180 || lon > 180) { + lonLat[0] = Object(math["d" /* modulo */])(lon + 180, 360) - 180; + } + return lonLat; +} + + +/** + * Checks if two projections are the same, that is every coordinate in one + * projection does represent the same geographic point as the same coordinate in + * the other projection. + * + * @param {Projection} projection1 Projection 1. + * @param {Projection} projection2 Projection 2. + * @return {boolean} Equivalent. + * @api + */ +function equivalent(projection1, projection2) { + if (projection1 === projection2) { + return true; + } + var equalUnits = projection1.getUnits() === projection2.getUnits(); + if (projection1.getCode() === projection2.getCode()) { + return equalUnits; + } else { + var transformFunc = getTransformFromProjections(projection1, projection2); + return transformFunc === cloneTransform && equalUnits; + } +} + + +/** + * Searches in the list of transform functions for the function for converting + * coordinates from the source projection to the destination projection. + * + * @param {Projection} sourceProjection Source Projection object. + * @param {Projection} destinationProjection Destination Projection + * object. + * @return {TransformFunction} Transform function. + */ +function getTransformFromProjections(sourceProjection, destinationProjection) { + var sourceCode = sourceProjection.getCode(); + var destinationCode = destinationProjection.getCode(); + var transformFunc = transforms_get(sourceCode, destinationCode); + if (!transformFunc) { + transformFunc = identityTransform; + } + return transformFunc; +} + + +/** + * Given the projection-like objects, searches for a transformation + * function to convert a coordinates array from the source projection to the + * destination projection. + * + * @param {ProjectionLike} source Source. + * @param {ProjectionLike} destination Destination. + * @return {TransformFunction} Transform function. + * @api + */ +function getTransform(source, destination) { + var sourceProjection = proj_get(source); + var destinationProjection = proj_get(destination); + return getTransformFromProjections(sourceProjection, destinationProjection); +} + + +/** + * Transforms a coordinate from source projection to destination projection. + * This returns a new coordinate (and does not modify the original). + * + * See {@link module:ol/proj~transformExtent} for extent transformation. + * See the transform method of {@link module:ol/geom/Geometry~Geometry} and its + * subclasses for geometry transforms. + * + * @param {import("./coordinate.js").Coordinate} coordinate Coordinate. + * @param {ProjectionLike} source Source projection-like. + * @param {ProjectionLike} destination Destination projection-like. + * @return {import("./coordinate.js").Coordinate} Coordinate. + * @api + */ +function proj_transform(coordinate, source, destination) { + var transformFunc = getTransform(source, destination); + return transformFunc(coordinate, undefined, coordinate.length); +} + + +/** + * Transforms an extent from source projection to destination projection. This + * returns a new extent (and does not modify the original). + * + * @param {import("./extent.js").Extent} extent The extent to transform. + * @param {ProjectionLike} source Source projection-like. + * @param {ProjectionLike} destination Destination projection-like. + * @return {import("./extent.js").Extent} The transformed extent. + * @api + */ +function transformExtent(extent, source, destination) { + var transformFunc = getTransform(source, destination); + return Object(ol_extent["a" /* applyTransform */])(extent, transformFunc); +} + + +/** + * Transforms the given point to the destination projection. + * + * @param {import("./coordinate.js").Coordinate} point Point. + * @param {Projection} sourceProjection Source projection. + * @param {Projection} destinationProjection Destination projection. + * @return {import("./coordinate.js").Coordinate} Point. + */ +function transformWithProjections(point, sourceProjection, destinationProjection) { + var transformFunc = getTransformFromProjections(sourceProjection, destinationProjection); + return transformFunc(point); +} + +/** + * Add transforms to and from EPSG:4326 and EPSG:3857. This function is called + * by when this module is executed and should only need to be called again after + * `clearAllProjections()` is called (e.g. in tests). + */ +function addCommon() { + // Add transformations that don't alter coordinates to convert within set of + // projections with equal meaning. + addEquivalentProjections(PROJECTIONS); + addEquivalentProjections(epsg4326_PROJECTIONS); + // Add transformations to convert EPSG:4326 like coordinates to EPSG:3857 like + // coordinates and back. + addEquivalentTransforms(epsg4326_PROJECTIONS, PROJECTIONS, fromEPSG4326, epsg3857_toEPSG4326); +} + +addCommon(); + +//# sourceMappingURL=proj.js.map + +/***/ }), +/* 14 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createCanvasContext2D; }); +/* unused harmony export outerWidth */ +/* unused harmony export outerHeight */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return replaceNode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return removeNode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return removeChildren; }); +/** + * @module ol/dom + */ + + +/** + * Create an html canvas element and returns its 2d context. + * @param {number=} opt_width Canvas width. + * @param {number=} opt_height Canvas height. + * @return {CanvasRenderingContext2D} The context. + */ +function createCanvasContext2D(opt_width, opt_height) { + var canvas = /** @type {HTMLCanvasElement} */ (document.createElement('canvas')); + if (opt_width) { + canvas.width = opt_width; + } + if (opt_height) { + canvas.height = opt_height; + } + return /** @type {CanvasRenderingContext2D} */ (canvas.getContext('2d')); +} + + +/** + * Get the current computed width for the given element including margin, + * padding and border. + * Equivalent to jQuery's `$(el).outerWidth(true)`. + * @param {!HTMLElement} element Element. + * @return {number} The width. + */ +function outerWidth(element) { + var width = element.offsetWidth; + var style = getComputedStyle(element); + width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10); + + return width; +} + + +/** + * Get the current computed height for the given element including margin, + * padding and border. + * Equivalent to jQuery's `$(el).outerHeight(true)`. + * @param {!HTMLElement} element Element. + * @return {number} The height. + */ +function outerHeight(element) { + var height = element.offsetHeight; + var style = getComputedStyle(element); + height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10); + + return height; +} + +/** + * @param {Node} newNode Node to replace old node + * @param {Node} oldNode The node to be replaced + */ +function replaceNode(newNode, oldNode) { + var parent = oldNode.parentNode; + if (parent) { + parent.replaceChild(newNode, oldNode); + } +} + +/** + * @param {Node} node The node to remove. + * @returns {Node} The node that was removed or null. + */ +function removeNode(node) { + return node && node.parentNode ? node.parentNode.removeChild(node) : null; +} + +/** + * @param {Node} node The node to remove the children from. + */ +function removeChildren(node) { + while (node.lastChild) { + node.removeChild(node.lastChild); + } +} + +//# sourceMappingURL=dom.js.map + +/***/ }), +/* 15 */ +/***/ (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 + +/***/ }), +/* 16 */ +/***/ (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__(51); +/* harmony import */ var _Observable_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(63); +/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25); +/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9); +/** + * @module ol/Object + */ + + + + + + + +/** + * @classdesc + * Events emitted by {@link module:ol/Object~BaseObject} instances are instances of this type. + */ +var ObjectEvent = /*@__PURE__*/(function (Event) { + function ObjectEvent(type, key, oldValue) { + Event.call(this, type); + + /** + * The name of the property whose value is changing. + * @type {string} + * @api + */ + this.key = key; + + /** + * The old value. To get the new value use `e.target.get(e.key)` where + * `e` is the event object. + * @type {*} + * @api + */ + this.oldValue = oldValue; + + } + + if ( Event ) ObjectEvent.__proto__ = Event; + ObjectEvent.prototype = Object.create( Event && Event.prototype ); + ObjectEvent.prototype.constructor = ObjectEvent; + + return ObjectEvent; +}(_events_Event_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])); + + +/** + * @classdesc + * Abstract base class; normally only used for creating subclasses and not + * instantiated in apps. + * Most non-trivial classes inherit from this. + * + * This extends {@link module:ol/Observable} with observable + * properties, where each property is observable as well as the object as a + * whole. + * + * Classes that inherit from this have pre-defined properties, to which you can + * add your owns. The pre-defined properties are listed in this documentation as + * 'Observable Properties', and have their own accessors; for example, + * {@link module:ol/Map~Map} has a `target` property, accessed with + * `getTarget()` and changed with `setTarget()`. Not all properties are however + * settable. There are also general-purpose accessors `get()` and `set()`. For + * example, `get('target')` is equivalent to `getTarget()`. + * + * The `set` accessors trigger a change event, and you can monitor this by + * registering a listener. For example, {@link module:ol/View~View} has a + * `center` property, so `view.on('change:center', function(evt) {...});` would + * call the function whenever the value of the center property changes. Within + * the function, `evt.target` would be the view, so `evt.target.getCenter()` + * would return the new center. + * + * You can add your own observable properties with + * `object.set('prop', 'value')`, and retrieve that with `object.get('prop')`. + * You can listen for changes on that property value with + * `object.on('change:prop', listener)`. You can get a list of all + * properties with {@link module:ol/Object~BaseObject#getProperties}. + * + * Note that the observable properties are separate from standard JS properties. + * You can, for example, give your map object a title with + * `map.title='New title'` and with `map.set('title', 'Another title')`. The + * first will be a `hasOwnProperty`; the second will appear in + * `getProperties()`. Only the second is observable. + * + * Properties can be deleted by using the unset method. E.g. + * object.unset('foo'). + * + * @fires ObjectEvent + * @api + */ +var BaseObject = /*@__PURE__*/(function (Observable) { + function BaseObject(opt_values) { + Observable.call(this); + + // Call {@link module:ol/util~getUid} to ensure that the order of objects' ids is + // the same as the order in which they were created. This also helps to + // ensure that object properties are always added in the same order, which + // helps many JavaScript engines generate faster code. + Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* getUid */ "c"])(this); + + /** + * @private + * @type {!Object} + */ + this.values_ = {}; + + if (opt_values !== undefined) { + this.setProperties(opt_values); + } + } + + if ( Observable ) BaseObject.__proto__ = Observable; + BaseObject.prototype = Object.create( Observable && Observable.prototype ); + BaseObject.prototype.constructor = BaseObject; + + /** + * Gets a value. + * @param {string} key Key name. + * @return {*} Value. + * @api + */ + BaseObject.prototype.get = function get (key) { + var value; + if (this.values_.hasOwnProperty(key)) { + value = this.values_[key]; + } + return value; + }; + + /** + * Get a list of object property names. + * @return {Array} List of property names. + * @api + */ + BaseObject.prototype.getKeys = function getKeys () { + return Object.keys(this.values_); + }; + + /** + * Get an object of all property names and values. + * @return {Object} Object. + * @api + */ + BaseObject.prototype.getProperties = function getProperties () { + return Object(_obj_js__WEBPACK_IMPORTED_MODULE_4__[/* assign */ "a"])({}, this.values_); + }; + + /** + * @param {string} key Key name. + * @param {*} oldValue Old value. + */ + BaseObject.prototype.notify = function notify (key, oldValue) { + var eventType; + eventType = getChangeEventType(key); + this.dispatchEvent(new ObjectEvent(eventType, key, oldValue)); + eventType = _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"].PROPERTYCHANGE; + this.dispatchEvent(new ObjectEvent(eventType, key, oldValue)); + }; + + /** + * Sets a value. + * @param {string} key Key name. + * @param {*} value Value. + * @param {boolean=} opt_silent Update without triggering an event. + * @api + */ + BaseObject.prototype.set = function set (key, value, opt_silent) { + if (opt_silent) { + this.values_[key] = value; + } else { + var oldValue = this.values_[key]; + this.values_[key] = value; + if (oldValue !== value) { + this.notify(key, oldValue); + } + } + }; + + /** + * Sets a collection of key-value pairs. Note that this changes any existing + * properties and adds new ones (it does not remove any existing properties). + * @param {Object} values Values. + * @param {boolean=} opt_silent Update without triggering an event. + * @api + */ + BaseObject.prototype.setProperties = function setProperties (values, opt_silent) { + for (var key in values) { + this.set(key, values[key], opt_silent); + } + }; + + /** + * Unsets a property. + * @param {string} key Key name. + * @param {boolean=} opt_silent Unset without triggering an event. + * @api + */ + BaseObject.prototype.unset = function unset (key, opt_silent) { + if (key in this.values_) { + var oldValue = this.values_[key]; + delete this.values_[key]; + if (!opt_silent) { + this.notify(key, oldValue); + } + } + }; + + return BaseObject; +}(_Observable_js__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])); + + +/** + * @type {Object} + */ +var changeEventTypeCache = {}; + + +/** + * @param {string} key Key name. + * @return {string} Change name. + */ +function getChangeEventType(key) { + return changeEventTypeCache.hasOwnProperty(key) ? + changeEventTypeCache[key] : + (changeEventTypeCache[key] = 'change:' + key); +} + + +/* harmony default export */ __webpack_exports__["a"] = (BaseObject); + +//# sourceMappingURL=Object.js.map + +/***/ }), +/* 17 */ +/***/ (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 + +/***/ }), +/* 18 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * @module ol/geom/GeometryLayout + */ + +/** + * The coordinate layout for geometries, indicating whether a 3rd or 4th z ('Z') + * or measure ('M') coordinate is available. Supported values are `'XY'`, + * `'XYZ'`, `'XYM'`, `'XYZM'`. + * @enum {string} + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + XY: 'XY', + XYZ: 'XYZ', + XYM: 'XYM', + XYZM: 'XYZM' +}); + +//# sourceMappingURL=GeometryLayout.js.map + +/***/ }), +/* 19 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * @module ol/layer/Property + */ + +/** + * @enum {string} + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + OPACITY: 'opacity', + VISIBLE: 'visible', + EXTENT: 'extent', + Z_INDEX: 'zIndex', + MAX_RESOLUTION: 'maxResolution', + MIN_RESOLUTION: 'minResolution', + SOURCE: 'source' +}); + +//# 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__, "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 + +/***/ }), +/* 22 */ +/***/ (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 + +/***/ }), +/* 23 */ +/***/ (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 + +/***/ }), +/* 24 */ +/***/ (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 */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return CLASS_UNSELECTABLE; }); +/* unused harmony export CLASS_UNSUPPORTED */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CLASS_CONTROL; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CLASS_COLLAPSED; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getFontFamilies; }); +/** + * @module ol/css + */ + + +/** + * The CSS class for hidden feature. + * + * @const + * @type {string} + */ +var CLASS_HIDDEN = 'ol-hidden'; + + +/** + * The CSS class that we'll give the DOM elements to have them selectable. + * + * @const + * @type {string} + */ +var CLASS_SELECTABLE = 'ol-selectable'; + + +/** + * The CSS class that we'll give the DOM elements to have them unselectable. + * + * @const + * @type {string} + */ +var CLASS_UNSELECTABLE = 'ol-unselectable'; + + +/** + * The CSS class for unsupported feature. + * + * @const + * @type {string} + */ +var CLASS_UNSUPPORTED = 'ol-unsupported'; + + +/** + * The CSS class for controls. + * + * @const + * @type {string} + */ +var CLASS_CONTROL = 'ol-control'; + + +/** + * The CSS class that we'll give the DOM elements that are collapsed, i.e. + * to those elements which usually can be expanded. + * + * @const + * @type {string} + */ +var CLASS_COLLAPSED = 'ol-collapsed'; + + +/** + * Get the list of font families from a font spec. Note that this doesn't work + * for font families that have commas in them. + * @param {string} The CSS font property. + * @return {Object} The font families (or null if the input spec is invalid). + */ +var getFontFamilies = (function() { + var style; + var cache = {}; + return function(font) { + if (!style) { + style = document.createElement('div').style; + } + if (!(font in cache)) { + style.font = font; + var family = style.fontFamily; + style.font = ''; + if (!family) { + return null; + } + cache[font] = family.split(/,\s?/); + } + return cache[font]; + }; +})(); + +//# sourceMappingURL=css.js.map + +/***/ }), +/* 25 */ +/***/ (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 + +/***/ }), +/* 26 */ +/***/ (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 + +/***/ }), +/* 27 */ +/***/ (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 + +/***/ }), +/* 28 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* unused harmony export buffer */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasArea; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return scale; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return toSize; }); +/** + * @module ol/size + */ + + +/** + * An array of numbers representing a size: `[width, height]`. + * @typedef {Array} Size + * @api + */ + + +/** + * Returns a buffered size. + * @param {Size} size Size. + * @param {number} num The amount by which to buffer. + * @param {Size=} opt_size Optional reusable size array. + * @return {Size} The buffered size. + */ +function buffer(size, num, opt_size) { + if (opt_size === undefined) { + opt_size = [0, 0]; + } + opt_size[0] = size[0] + 2 * num; + opt_size[1] = size[1] + 2 * num; + return opt_size; +} + + +/** + * Determines if a size has a positive area. + * @param {Size} size The size to test. + * @return {boolean} The size has a positive area. + */ +function hasArea(size) { + return size[0] > 0 && size[1] > 0; +} + + +/** + * Returns a size scaled by a ratio. The result will be an array of integers. + * @param {Size} size Size. + * @param {number} ratio Ratio. + * @param {Size=} opt_size Optional reusable size array. + * @return {Size} The scaled size. + */ +function scale(size, ratio, opt_size) { + if (opt_size === undefined) { + opt_size = [0, 0]; + } + opt_size[0] = (size[0] * ratio + 0.5) | 0; + opt_size[1] = (size[1] * ratio + 0.5) | 0; + return opt_size; +} + + +/** + * Returns an `Size` array for the passed in number (meaning: square) or + * `Size` array. + * (meaning: non-square), + * @param {number|Size} size Width and height. + * @param {Size=} opt_size Optional reusable size array. + * @return {Size} Size. + * @api + */ +function toSize(size, opt_size) { + if (Array.isArray(size)) { + return size; + } else { + if (opt_size === undefined) { + opt_size = [size, size]; + } else { + opt_size[0] = opt_size[1] = /** @type {number} */ (size); + } + return opt_size; + } +} + +//# sourceMappingURL=size.js.map + +/***/ }), +/* 29 */ +/***/ (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 + +/***/ }), +/* 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__(34); +/** + * @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 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ERROR_THRESHOLD; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ENABLE_RASTER_REPROJECTION; }); +/** + * @module ol/reproj/common + */ + +/** + * Default maximum allowed threshold (in pixels) for reprojection + * triangulation. + * @type {number} + */ +var ERROR_THRESHOLD = 0.5; + +/** + * Enable automatic reprojection of raster sources. Default is `true`. + * TODO: decide if we want to expose this as a build flag or remove it + * @type {boolean} + */ +var ENABLE_RASTER_REPROJECTION = true; + +//# sourceMappingURL=common.js.map + +/***/ }), +/* 33 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _Disposable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(58); +/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); +/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15); +/* harmony import */ var _Event_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25); +/** + * @module ol/events/Target + */ + + + + + + +/** + * @typedef {EventTarget|Target} EventTargetLike + */ + + +/** + * @classdesc + * A simplified implementation of the W3C DOM Level 2 EventTarget interface. + * See https://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-EventTarget. + * + * There are two important simplifications compared to the specification: + * + * 1. The handling of `useCapture` in `addEventListener` and + * `removeEventListener`. There is no real capture model. + * 2. The handling of `stopPropagation` and `preventDefault` on `dispatchEvent`. + * There is no event target hierarchy. When a listener calls + * `stopPropagation` or `preventDefault` on an event object, it means that no + * more listeners after this one will be called. Same as when the listener + * returns false. + */ +var Target = /*@__PURE__*/(function (Disposable) { + function Target() { + + Disposable.call(this); + + /** + * @private + * @type {!Object} + */ + this.pendingRemovals_ = {}; + + /** + * @private + * @type {!Object} + */ + this.dispatching_ = {}; + + /** + * @private + * @type {!Object>} + */ + this.listeners_ = {}; + + } + + if ( Disposable ) Target.__proto__ = Disposable; + Target.prototype = Object.create( Disposable && Disposable.prototype ); + Target.prototype.constructor = Target; + + /** + * @param {string} type Type. + * @param {import("../events.js").ListenerFunction} listener Listener. + */ + Target.prototype.addEventListener = function addEventListener (type, listener) { + var listeners = this.listeners_[type]; + if (!listeners) { + listeners = this.listeners_[type] = []; + } + if (listeners.indexOf(listener) === -1) { + listeners.push(listener); + } + }; + + /** + * Dispatches an event and calls all listeners listening for events + * of this type. The event parameter can either be a string or an + * Object with a `type` property. + * + * @param {{type: string, + * target: (EventTargetLike|undefined), + * propagationStopped: (boolean|undefined)}| + * import("./Event.js").default|string} event Event object. + * @return {boolean|undefined} `false` if anyone called preventDefault on the + * event object or if any of the listeners returned false. + * @api + */ + Target.prototype.dispatchEvent = function dispatchEvent (event) { + var evt = typeof event === 'string' ? new _Event_js__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"](event) : event; + var type = evt.type; + evt.target = this; + var listeners = this.listeners_[type]; + var propagate; + if (listeners) { + if (!(type in this.dispatching_)) { + this.dispatching_[type] = 0; + this.pendingRemovals_[type] = 0; + } + ++this.dispatching_[type]; + for (var i = 0, ii = listeners.length; i < ii; ++i) { + if (listeners[i].call(this, evt) === false || evt.propagationStopped) { + propagate = false; + break; + } + } + --this.dispatching_[type]; + if (this.dispatching_[type] === 0) { + var pendingRemovals = this.pendingRemovals_[type]; + delete this.pendingRemovals_[type]; + while (pendingRemovals--) { + this.removeEventListener(type, _functions_js__WEBPACK_IMPORTED_MODULE_2__[/* VOID */ "c"]); + } + delete this.dispatching_[type]; + } + return propagate; + } + }; + + /** + * @inheritDoc + */ + Target.prototype.disposeInternal = function disposeInternal () { + Object(_events_js__WEBPACK_IMPORTED_MODULE_1__[/* unlistenAll */ "d"])(this); + }; + + /** + * Get the listeners for a specified event type. Listeners are returned in the + * order that they will be called in. + * + * @param {string} type Type. + * @return {Array} Listeners. + */ + Target.prototype.getListeners = function getListeners (type) { + return this.listeners_[type]; + }; + + /** + * @param {string=} opt_type Type. If not provided, + * `true` will be returned if this event target has any listeners. + * @return {boolean} Has listeners. + */ + Target.prototype.hasListener = function hasListener (opt_type) { + return opt_type ? + opt_type in this.listeners_ : + Object.keys(this.listeners_).length > 0; + }; + + /** + * @param {string} type Type. + * @param {import("../events.js").ListenerFunction} listener Listener. + */ + Target.prototype.removeEventListener = function removeEventListener (type, listener) { + var listeners = this.listeners_[type]; + if (listeners) { + var index = listeners.indexOf(listener); + if (type in this.pendingRemovals_) { + // make listener a no-op, and remove later in #dispatchEvent() + listeners[index] = _functions_js__WEBPACK_IMPORTED_MODULE_2__[/* VOID */ "c"]; + ++this.pendingRemovals_[type]; + } else { + listeners.splice(index, 1); + if (listeners.length === 0) { + delete this.listeners_[type]; + } + } + } + }; + + return Target; +}(_Disposable_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])); + + +/* harmony default export */ __webpack_exports__["a"] = (Target); + +//# sourceMappingURL=Target.js.map + +/***/ }), +/* 34 */ +/***/ (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__(7); +/** + * @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 + +/***/ }), +/* 35 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// EXTERNAL MODULE: ./node_modules/ol/tilegrid/common.js +var common = __webpack_require__(54); + +// EXTERNAL MODULE: ./node_modules/ol/size.js +var ol_size = __webpack_require__(28); + +// 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__(56); + +// 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__(23); + +// EXTERNAL MODULE: ./node_modules/ol/asserts.js +var asserts = __webpack_require__(10); + +// EXTERNAL MODULE: ./node_modules/ol/TileRange.js +var TileRange = __webpack_require__(57); + +// EXTERNAL MODULE: ./node_modules/ol/array.js +var array = __webpack_require__(11); + +// EXTERNAL MODULE: ./node_modules/ol/math.js +var math = __webpack_require__(7); + +// EXTERNAL MODULE: ./node_modules/ol/tilecoord.js +var tilecoord = __webpack_require__(26); + +// 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__, "d", function() { return getForProjection; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return wrapX; }); +/* unused harmony export createForExtent */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return createXYZ; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createForProjection; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", 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 + +/***/ }), +/* 36 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// EXTERNAL MODULE: ./node_modules/ol/math.js +var math = __webpack_require__(7); + +// CONCATENATED MODULE: ./node_modules/ol/string.js +/** + * @module ol/string + */ + +/** + * @param {number} number Number to be formatted + * @param {number} width The desired width + * @param {number=} opt_precision Precision of the output string (i.e. number of decimal places) + * @returns {string} Formatted string + */ +function padNumber(number, width, opt_precision) { + var numberString = opt_precision !== undefined ? number.toFixed(opt_precision) : '' + number; + var decimal = numberString.indexOf('.'); + decimal = decimal === -1 ? numberString.length : decimal; + return decimal > width ? numberString : new Array(1 + width - decimal).join('0') + numberString; +} + + +/** + * Adapted from https://github.com/omichelsen/compare-versions/blob/master/index.js + * @param {string|number} v1 First version + * @param {string|number} v2 Second version + * @returns {number} Value + */ +function compareVersions(v1, v2) { + var s1 = ('' + v1).split('.'); + var s2 = ('' + v2).split('.'); + + for (var i = 0; i < Math.max(s1.length, s2.length); i++) { + var n1 = parseInt(s1[i] || '0', 10); + var n2 = parseInt(s2[i] || '0', 10); + + if (n1 > n2) { + return 1; + } + if (n2 > n1) { + return -1; + } + } + + return 0; +} + +//# sourceMappingURL=string.js.map +// CONCATENATED MODULE: ./node_modules/ol/coordinate.js +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return add; }); +/* unused harmony export closestOnCircle */ +/* unused harmony export closestOnSegment */ +/* unused harmony export createStringXY */ +/* unused harmony export degreesToStringHDMS */ +/* unused harmony export format */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return equals; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return rotate; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return scale; }); +/* unused harmony export squaredDistance */ +/* unused harmony export distance */ +/* unused harmony export squaredDistanceToSegment */ +/* unused harmony export toStringHDMS */ +/* unused harmony export toStringXY */ +/** + * @module ol/coordinate + */ + + + + +/** + * An array of numbers representing an xy coordinate. Example: `[16, 48]`. + * @typedef {Array} Coordinate + * @api + */ + + +/** + * A function that takes a {@link module:ol/coordinate~Coordinate} and + * transforms it into a `{string}`. + * + * @typedef {function((Coordinate|undefined)): string} CoordinateFormat + * @api + */ + + +/** + * Add `delta` to `coordinate`. `coordinate` is modified in place and returned + * by the function. + * + * Example: + * + * import {add} from 'ol/coordinate'; + * + * var coord = [7.85, 47.983333]; + * add(coord, [-2, 4]); + * // coord is now [5.85, 51.983333] + * + * @param {Coordinate} coordinate Coordinate. + * @param {Coordinate} delta Delta. + * @return {Coordinate} The input coordinate adjusted by + * the given delta. + * @api + */ +function add(coordinate, delta) { + coordinate[0] += delta[0]; + coordinate[1] += delta[1]; + return coordinate; +} + + +/** + * Calculates the point closest to the passed coordinate on the passed circle. + * + * @param {Coordinate} coordinate The coordinate. + * @param {import("./geom/Circle.js").default} circle The circle. + * @return {Coordinate} Closest point on the circumference. + */ +function closestOnCircle(coordinate, circle) { + var r = circle.getRadius(); + var center = circle.getCenter(); + var x0 = center[0]; + var y0 = center[1]; + var x1 = coordinate[0]; + var y1 = coordinate[1]; + + var dx = x1 - x0; + var dy = y1 - y0; + if (dx === 0 && dy === 0) { + dx = 1; + } + var d = Math.sqrt(dx * dx + dy * dy); + + var x = x0 + r * dx / d; + var y = y0 + r * dy / d; + + return [x, y]; +} + + +/** + * Calculates the point closest to the passed coordinate on the passed segment. + * This is the foot of the perpendicular of the coordinate to the segment when + * the foot is on the segment, or the closest segment coordinate when the foot + * is outside the segment. + * + * @param {Coordinate} coordinate The coordinate. + * @param {Array} segment The two coordinates + * of the segment. + * @return {Coordinate} The foot of the perpendicular of + * the coordinate to the segment. + */ +function closestOnSegment(coordinate, segment) { + var x0 = coordinate[0]; + var y0 = coordinate[1]; + var start = segment[0]; + var end = segment[1]; + var x1 = start[0]; + var y1 = start[1]; + var x2 = end[0]; + var y2 = end[1]; + var dx = x2 - x1; + var dy = y2 - y1; + var along = (dx === 0 && dy === 0) ? 0 : + ((dx * (x0 - x1)) + (dy * (y0 - y1))) / ((dx * dx + dy * dy) || 0); + var x, y; + if (along <= 0) { + x = x1; + y = y1; + } else if (along >= 1) { + x = x2; + y = y2; + } else { + x = x1 + along * dx; + y = y1 + along * dy; + } + return [x, y]; +} + + +/** + * Returns a {@link module:ol/coordinate~CoordinateFormat} function that can be + * used to format + * a {Coordinate} to a string. + * + * Example without specifying the fractional digits: + * + * import {createStringXY} from 'ol/coordinate'; + * + * var coord = [7.85, 47.983333]; + * var stringifyFunc = createStringXY(); + * var out = stringifyFunc(coord); + * // out is now '8, 48' + * + * Example with explicitly specifying 2 fractional digits: + * + * import {createStringXY} from 'ol/coordinate'; + * + * var coord = [7.85, 47.983333]; + * var stringifyFunc = createStringXY(2); + * var out = stringifyFunc(coord); + * // out is now '7.85, 47.98' + * + * @param {number=} opt_fractionDigits The number of digits to include + * after the decimal point. Default is `0`. + * @return {CoordinateFormat} Coordinate format. + * @api + */ +function createStringXY(opt_fractionDigits) { + return ( + /** + * @param {Coordinate} coordinate Coordinate. + * @return {string} String XY. + */ + function(coordinate) { + return toStringXY(coordinate, opt_fractionDigits); + } + ); +} + + +/** + * @param {string} hemispheres Hemispheres. + * @param {number} degrees Degrees. + * @param {number=} opt_fractionDigits The number of digits to include + * after the decimal point. Default is `0`. + * @return {string} String. + */ +function degreesToStringHDMS(hemispheres, degrees, opt_fractionDigits) { + var normalizedDegrees = Object(math["d" /* modulo */])(degrees + 180, 360) - 180; + var x = Math.abs(3600 * normalizedDegrees); + var dflPrecision = opt_fractionDigits || 0; + var precision = Math.pow(10, dflPrecision); + + var deg = Math.floor(x / 3600); + var min = Math.floor((x - deg * 3600) / 60); + var sec = x - (deg * 3600) - (min * 60); + sec = Math.ceil(sec * precision) / precision; + + if (sec >= 60) { + sec = 0; + min += 1; + } + + if (min >= 60) { + min = 0; + deg += 1; + } + + return deg + '\u00b0 ' + padNumber(min, 2) + '\u2032 ' + + padNumber(sec, 2, dflPrecision) + '\u2033' + + (normalizedDegrees == 0 ? '' : ' ' + hemispheres.charAt(normalizedDegrees < 0 ? 1 : 0)); +} + + +/** + * Transforms the given {@link module:ol/coordinate~Coordinate} to a string + * using the given string template. The strings `{x}` and `{y}` in the template + * will be replaced with the first and second coordinate values respectively. + * + * Example without specifying the fractional digits: + * + * import {format} from 'ol/coordinate'; + * + * var coord = [7.85, 47.983333]; + * var template = 'Coordinate is ({x}|{y}).'; + * var out = format(coord, template); + * // out is now 'Coordinate is (8|48).' + * + * Example explicitly specifying the fractional digits: + * + * import {format} from 'ol/coordinate'; + * + * var coord = [7.85, 47.983333]; + * var template = 'Coordinate is ({x}|{y}).'; + * var out = format(coord, template, 2); + * // out is now 'Coordinate is (7.85|47.98).' + * + * @param {Coordinate} coordinate Coordinate. + * @param {string} template A template string with `{x}` and `{y}` placeholders + * that will be replaced by first and second coordinate values. + * @param {number=} opt_fractionDigits The number of digits to include + * after the decimal point. Default is `0`. + * @return {string} Formatted coordinate. + * @api + */ +function format(coordinate, template, opt_fractionDigits) { + if (coordinate) { + return template + .replace('{x}', coordinate[0].toFixed(opt_fractionDigits)) + .replace('{y}', coordinate[1].toFixed(opt_fractionDigits)); + } else { + return ''; + } +} + + +/** + * @param {Coordinate} coordinate1 First coordinate. + * @param {Coordinate} coordinate2 Second coordinate. + * @return {boolean} The two coordinates are equal. + */ +function equals(coordinate1, coordinate2) { + var equals = true; + for (var i = coordinate1.length - 1; i >= 0; --i) { + if (coordinate1[i] != coordinate2[i]) { + equals = false; + break; + } + } + return equals; +} + + +/** + * Rotate `coordinate` by `angle`. `coordinate` is modified in place and + * returned by the function. + * + * Example: + * + * import {rotate} from 'ol/coordinate'; + * + * var coord = [7.85, 47.983333]; + * var rotateRadians = Math.PI / 2; // 90 degrees + * rotate(coord, rotateRadians); + * // coord is now [-47.983333, 7.85] + * + * @param {Coordinate} coordinate Coordinate. + * @param {number} angle Angle in radian. + * @return {Coordinate} Coordinate. + * @api + */ +function rotate(coordinate, angle) { + var cosAngle = Math.cos(angle); + var sinAngle = Math.sin(angle); + var x = coordinate[0] * cosAngle - coordinate[1] * sinAngle; + var y = coordinate[1] * cosAngle + coordinate[0] * sinAngle; + coordinate[0] = x; + coordinate[1] = y; + return coordinate; +} + + +/** + * Scale `coordinate` by `scale`. `coordinate` is modified in place and returned + * by the function. + * + * Example: + * + * import {scale as scaleCoordinate} from 'ol/coordinate'; + * + * var coord = [7.85, 47.983333]; + * var scale = 1.2; + * scaleCoordinate(coord, scale); + * // coord is now [9.42, 57.5799996] + * + * @param {Coordinate} coordinate Coordinate. + * @param {number} scale Scale factor. + * @return {Coordinate} Coordinate. + */ +function scale(coordinate, scale) { + coordinate[0] *= scale; + coordinate[1] *= scale; + return coordinate; +} + + +/** + * @param {Coordinate} coord1 First coordinate. + * @param {Coordinate} coord2 Second coordinate. + * @return {number} Squared distance between coord1 and coord2. + */ +function squaredDistance(coord1, coord2) { + var dx = coord1[0] - coord2[0]; + var dy = coord1[1] - coord2[1]; + return dx * dx + dy * dy; +} + + +/** + * @param {Coordinate} coord1 First coordinate. + * @param {Coordinate} coord2 Second coordinate. + * @return {number} Distance between coord1 and coord2. + */ +function distance(coord1, coord2) { + return Math.sqrt(squaredDistance(coord1, coord2)); +} + + +/** + * Calculate the squared distance from a coordinate to a line segment. + * + * @param {Coordinate} coordinate Coordinate of the point. + * @param {Array} segment Line segment (2 + * coordinates). + * @return {number} Squared distance from the point to the line segment. + */ +function squaredDistanceToSegment(coordinate, segment) { + return squaredDistance(coordinate, + closestOnSegment(coordinate, segment)); +} + + +/** + * Format a geographic coordinate with the hemisphere, degrees, minutes, and + * seconds. + * + * Example without specifying fractional digits: + * + * import {toStringHDMS} from 'ol/coordinate'; + * + * var coord = [7.85, 47.983333]; + * var out = toStringHDMS(coord); + * // out is now '47° 58′ 60″ N 7° 50′ 60″ E' + * + * Example explicitly specifying 1 fractional digit: + * + * import {toStringHDMS} from 'ol/coordinate'; + * + * var coord = [7.85, 47.983333]; + * var out = toStringHDMS(coord, 1); + * // out is now '47° 58′ 60.0″ N 7° 50′ 60.0″ E' + * + * @param {Coordinate} coordinate Coordinate. + * @param {number=} opt_fractionDigits The number of digits to include + * after the decimal point. Default is `0`. + * @return {string} Hemisphere, degrees, minutes and seconds. + * @api + */ +function toStringHDMS(coordinate, opt_fractionDigits) { + if (coordinate) { + return degreesToStringHDMS('NS', coordinate[1], opt_fractionDigits) + ' ' + + degreesToStringHDMS('EW', coordinate[0], opt_fractionDigits); + } else { + return ''; + } +} + + +/** + * Format a coordinate as a comma delimited string. + * + * Example without specifying fractional digits: + * + * import {toStringXY} from 'ol/coordinate'; + * + * var coord = [7.85, 47.983333]; + * var out = toStringXY(coord); + * // out is now '8, 48' + * + * Example explicitly specifying 1 fractional digit: + * + * import {toStringXY} from 'ol/coordinate'; + * + * var coord = [7.85, 47.983333]; + * var out = toStringXY(coord, 1); + * // out is now '7.8, 48.0' + * + * @param {Coordinate} coordinate Coordinate. + * @param {number=} opt_fractionDigits The number of digits to include + * after the decimal point. Default is `0`. + * @return {string} XY. + * @api + */ +function toStringXY(coordinate, opt_fractionDigits) { + return format(coordinate, '{x}, {y}', opt_fractionDigits); +} + +//# sourceMappingURL=coordinate.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__(2); +/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); +/* 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__(68); +/* 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__(39); +/** + * @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"; +/** + * @module ol/layer/VectorTileRenderType + */ + +/** + * @enum {string} + * Render mode for vector tiles: + * * `'image'`: Vector tiles are rendered as images. Great performance, but + * point symbols and texts are always rotated with the view and pixels are + * scaled during zoom animations. + * * `'hybrid'`: Polygon and line elements are rendered as images, so pixels + * are scaled during zoom animations. Point symbols and texts are accurately + * rendered as vectors and can stay upright on rotated views. + * * `'vector'`: Vector tiles are rendered as vectors. Most accurate rendering + * even during animations, but slower performance than the other options. + * @api + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + IMAGE: 'image', + HYBRID: 'hybrid', + VECTOR: 'vector' +}); + +//# sourceMappingURL=VectorTileRenderType.js.map + +/***/ }), +/* 39 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * @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 + +/***/ }), +/* 40 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; + +// EXTERNAL MODULE: ./node_modules/ol/util.js +var util = __webpack_require__(1); + +// 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); + +// EXTERNAL MODULE: ./node_modules/ol/geom/flat/transform.js +var flat_transform = __webpack_require__(29); + +// 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__(23); + +// EXTERNAL MODULE: ./node_modules/ol/transform.js +var ol_transform = __webpack_require__(8); + +// CONCATENATED MODULE: ./node_modules/ol/geom/Geometry.js +/** + * @module ol/geom/Geometry + */ + + + + + + + + + +/** + * @type {import("../transform.js").Transform} + */ +var tmpTransform = Object(ol_transform["c" /* create */])(); + + +/** + * @classdesc + * Abstract base class; normally only used for creating subclasses and not + * instantiated in apps. + * Base class for vector geometries. + * + * To get notified of changes to the geometry, register a listener for the + * generic `change` event on your geometry instance. + * + * @abstract + * @api + */ +var Geometry_Geometry = /*@__PURE__*/(function (BaseObject) { + function Geometry() { + + BaseObject.call(this); + + /** + * @private + * @type {import("../extent.js").Extent} + */ + this.extent_ = Object(ol_extent["j" /* createEmpty */])(); + + /** + * @private + * @type {number} + */ + this.extentRevision_ = -1; + + /** + * @protected + * @type {Object} + */ + this.simplifiedGeometryCache = {}; + + /** + * @protected + * @type {number} + */ + this.simplifiedGeometryMaxMinSquaredTolerance = 0; + + /** + * @protected + * @type {number} + */ + this.simplifiedGeometryRevision = 0; + + } + + if ( BaseObject ) Geometry.__proto__ = BaseObject; + Geometry.prototype = Object.create( BaseObject && BaseObject.prototype ); + Geometry.prototype.constructor = Geometry; + + /** + * Make a complete copy of the geometry. + * @abstract + * @return {!Geometry} Clone. + */ + Geometry.prototype.clone = function clone () { + return Object(util["b" /* abstract */])(); + }; + + /** + * @abstract + * @param {number} x X. + * @param {number} y Y. + * @param {import("../coordinate.js").Coordinate} closestPoint Closest point. + * @param {number} minSquaredDistance Minimum squared distance. + * @return {number} Minimum squared distance. + */ + Geometry.prototype.closestPointXY = function closestPointXY (x, y, closestPoint, minSquaredDistance) { + return Object(util["b" /* abstract */])(); + }; + + /** + * @param {number} x X. + * @param {number} y Y. + * @return {boolean} Contains (x, y). + */ + Geometry.prototype.containsXY = function containsXY (x, y) { + return false; + }; + + /** + * Return the closest point of the geometry to the passed point as + * {@link module:ol/coordinate~Coordinate coordinate}. + * @param {import("../coordinate.js").Coordinate} point Point. + * @param {import("../coordinate.js").Coordinate=} opt_closestPoint Closest point. + * @return {import("../coordinate.js").Coordinate} Closest point. + * @api + */ + Geometry.prototype.getClosestPoint = function getClosestPoint (point, opt_closestPoint) { + var closestPoint = opt_closestPoint ? opt_closestPoint : [NaN, NaN]; + this.closestPointXY(point[0], point[1], closestPoint, Infinity); + return closestPoint; + }; + + /** + * Returns true if this geometry includes the specified coordinate. If the + * coordinate is on the boundary of the geometry, returns false. + * @param {import("../coordinate.js").Coordinate} coordinate Coordinate. + * @return {boolean} Contains coordinate. + * @api + */ + Geometry.prototype.intersectsCoordinate = function intersectsCoordinate (coordinate) { + return this.containsXY(coordinate[0], coordinate[1]); + }; + + /** + * @abstract + * @param {import("../extent.js").Extent} extent Extent. + * @protected + * @return {import("../extent.js").Extent} extent Extent. + */ + Geometry.prototype.computeExtent = function computeExtent (extent) { + return Object(util["b" /* abstract */])(); + }; + + /** + * Get the extent of the geometry. + * @param {import("../extent.js").Extent=} opt_extent Extent. + * @return {import("../extent.js").Extent} extent Extent. + * @api + */ + Geometry.prototype.getExtent = function getExtent (opt_extent) { + if (this.extentRevision_ != this.getRevision()) { + this.extent_ = this.computeExtent(this.extent_); + this.extentRevision_ = this.getRevision(); + } + return Object(ol_extent["I" /* returnOrUpdate */])(this.extent_, opt_extent); + }; + + /** + * Rotate the geometry around a given coordinate. This modifies the geometry + * coordinates in place. + * @abstract + * @param {number} angle Rotation angle in radians. + * @param {import("../coordinate.js").Coordinate} anchor The rotation center. + * @api + */ + Geometry.prototype.rotate = function rotate (angle, anchor) { + Object(util["b" /* abstract */])(); + }; + + /** + * Scale the geometry (with an optional origin). This modifies the geometry + * coordinates in place. + * @abstract + * @param {number} sx The scaling factor in the x-direction. + * @param {number=} opt_sy The scaling factor in the y-direction (defaults to + * sx). + * @param {import("../coordinate.js").Coordinate=} opt_anchor The scale origin (defaults to the center + * of the geometry extent). + * @api + */ + Geometry.prototype.scale = function scale (sx, opt_sy, opt_anchor) { + Object(util["b" /* abstract */])(); + }; + + /** + * Create a simplified version of this geometry. For linestrings, this uses + * the the {@link + * https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm + * Douglas Peucker} algorithm. For polygons, a quantization-based + * simplification is used to preserve topology. + * @param {number} tolerance The tolerance distance for simplification. + * @return {Geometry} A new, simplified version of the original geometry. + * @api + */ + Geometry.prototype.simplify = function simplify (tolerance) { + return this.getSimplifiedGeometry(tolerance * tolerance); + }; + + /** + * Create a simplified version of this geometry using the Douglas Peucker + * algorithm. + * See https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm. + * @abstract + * @param {number} squaredTolerance Squared tolerance. + * @return {Geometry} Simplified geometry. + */ + Geometry.prototype.getSimplifiedGeometry = function getSimplifiedGeometry (squaredTolerance) { + return Object(util["b" /* abstract */])(); + }; + + /** + * Get the type of this geometry. + * @abstract + * @return {import("./GeometryType.js").default} Geometry type. + */ + Geometry.prototype.getType = function getType () { + return Object(util["b" /* abstract */])(); + }; + + /** + * Apply a transform function to each coordinate of the geometry. + * The geometry is modified in place. + * If you do not want the geometry modified in place, first `clone()` it and + * then use this function on the clone. + * @abstract + * @param {import("../proj.js").TransformFunction} transformFn Transform. + */ + Geometry.prototype.applyTransform = function applyTransform (transformFn) { + Object(util["b" /* abstract */])(); + }; + + /** + * Test if the geometry and the passed extent intersect. + * @abstract + * @param {import("../extent.js").Extent} extent Extent. + * @return {boolean} `true` if the geometry and the extent intersect. + */ + Geometry.prototype.intersectsExtent = function intersectsExtent (extent) { + return Object(util["b" /* abstract */])(); + }; + + /** + * Translate the geometry. This modifies the geometry coordinates in place. If + * instead you want a new geometry, first `clone()` this geometry. + * @abstract + * @param {number} deltaX Delta X. + * @param {number} deltaY Delta Y. + * @api + */ + Geometry.prototype.translate = function translate (deltaX, deltaY) { + Object(util["b" /* abstract */])(); + }; + + /** + * Transform each coordinate of the geometry from one coordinate reference + * system to another. The geometry is modified in place. + * For example, a line will be transformed to a line and a circle to a circle. + * If you do not want the geometry modified in place, first `clone()` it and + * then use this function on the clone. + * + * @param {import("../proj.js").ProjectionLike} source The current projection. Can be a + * string identifier or a {@link module:ol/proj/Projection~Projection} object. + * @param {import("../proj.js").ProjectionLike} destination The desired projection. Can be a + * string identifier or a {@link module:ol/proj/Projection~Projection} object. + * @return {Geometry} This geometry. Note that original geometry is + * modified in place. + * @api + */ + Geometry.prototype.transform = function transform (source, destination) { + /** @type {import("../proj/Projection.js").default} */ + var sourceProj = Object(proj["e" /* get */])(source); + var transformFn = sourceProj.getUnits() == Units["b" /* default */].TILE_PIXELS ? + function(inCoordinates, outCoordinates, stride) { + var pixelExtent = sourceProj.getExtent(); + var projectedExtent = sourceProj.getWorldExtent(); + var scale = Object(ol_extent["A" /* getHeight */])(projectedExtent) / Object(ol_extent["A" /* getHeight */])(pixelExtent); + Object(ol_transform["b" /* compose */])(tmpTransform, + projectedExtent[0], projectedExtent[3], + scale, -scale, 0, + 0, 0); + Object(flat_transform["c" /* transform2D */])(inCoordinates, 0, inCoordinates.length, stride, + tmpTransform, outCoordinates); + return Object(proj["g" /* getTransform */])(sourceProj, destination)(inCoordinates, outCoordinates, stride); + } : + Object(proj["g" /* getTransform */])(sourceProj, destination); + this.applyTransform(transformFn); + return this; + }; + + return Geometry; +}(ol_Object["a" /* default */])); + + +/* harmony default export */ var geom_Geometry = (Geometry_Geometry); + +//# sourceMappingURL=Geometry.js.map +// EXTERNAL MODULE: ./node_modules/ol/geom/GeometryLayout.js +var GeometryLayout = __webpack_require__(18); + +// EXTERNAL MODULE: ./node_modules/ol/obj.js +var obj = __webpack_require__(9); + +// CONCATENATED MODULE: ./node_modules/ol/geom/SimpleGeometry.js +/* unused harmony export getStrideForLayout */ +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return transformGeom2D; }); +/** + * @module ol/geom/SimpleGeometry + */ + + + + + + + +/** + * @classdesc + * Abstract base class; only used for creating subclasses; do not instantiate + * in apps, as cannot be rendered. + * + * @abstract + * @api + */ +var SimpleGeometry_SimpleGeometry = /*@__PURE__*/(function (Geometry) { + function SimpleGeometry() { + + Geometry.call(this); + + /** + * @protected + * @type {GeometryLayout} + */ + this.layout = GeometryLayout["a" /* default */].XY; + + /** + * @protected + * @type {number} + */ + this.stride = 2; + + /** + * @protected + * @type {Array} + */ + this.flatCoordinates = null; + + } + + if ( Geometry ) SimpleGeometry.__proto__ = Geometry; + SimpleGeometry.prototype = Object.create( Geometry && Geometry.prototype ); + SimpleGeometry.prototype.constructor = SimpleGeometry; + + /** + * @inheritDoc + */ + SimpleGeometry.prototype.computeExtent = function computeExtent (extent) { + return Object(ol_extent["o" /* createOrUpdateFromFlatCoordinates */])(this.flatCoordinates, + 0, this.flatCoordinates.length, this.stride, extent); + }; + + /** + * @abstract + * @return {Array} Coordinates. + */ + SimpleGeometry.prototype.getCoordinates = function getCoordinates () { + return Object(util["b" /* abstract */])(); + }; + + /** + * Return the first coordinate of the geometry. + * @return {import("../coordinate.js").Coordinate} First coordinate. + * @api + */ + SimpleGeometry.prototype.getFirstCoordinate = function getFirstCoordinate () { + return this.flatCoordinates.slice(0, this.stride); + }; + + /** + * @return {Array} Flat coordinates. + */ + SimpleGeometry.prototype.getFlatCoordinates = function getFlatCoordinates () { + return this.flatCoordinates; + }; + + /** + * Return the last coordinate of the geometry. + * @return {import("../coordinate.js").Coordinate} Last point. + * @api + */ + SimpleGeometry.prototype.getLastCoordinate = function getLastCoordinate () { + return this.flatCoordinates.slice(this.flatCoordinates.length - this.stride); + }; + + /** + * Return the {@link module:ol/geom/GeometryLayout layout} of the geometry. + * @return {GeometryLayout} Layout. + * @api + */ + SimpleGeometry.prototype.getLayout = function getLayout () { + return this.layout; + }; + + /** + * @inheritDoc + */ + SimpleGeometry.prototype.getSimplifiedGeometry = function getSimplifiedGeometry (squaredTolerance) { + if (this.simplifiedGeometryRevision != this.getRevision()) { + Object(obj["b" /* clear */])(this.simplifiedGeometryCache); + this.simplifiedGeometryMaxMinSquaredTolerance = 0; + this.simplifiedGeometryRevision = this.getRevision(); + } + // If squaredTolerance is negative or if we know that simplification will not + // have any effect then just return this. + if (squaredTolerance < 0 || + (this.simplifiedGeometryMaxMinSquaredTolerance !== 0 && + squaredTolerance <= this.simplifiedGeometryMaxMinSquaredTolerance)) { + return this; + } + var key = squaredTolerance.toString(); + if (this.simplifiedGeometryCache.hasOwnProperty(key)) { + return this.simplifiedGeometryCache[key]; + } else { + var simplifiedGeometry = + this.getSimplifiedGeometryInternal(squaredTolerance); + var simplifiedFlatCoordinates = simplifiedGeometry.getFlatCoordinates(); + if (simplifiedFlatCoordinates.length < this.flatCoordinates.length) { + this.simplifiedGeometryCache[key] = simplifiedGeometry; + return simplifiedGeometry; + } else { + // Simplification did not actually remove any coordinates. We now know + // that any calls to getSimplifiedGeometry with a squaredTolerance less + // than or equal to the current squaredTolerance will also not have any + // effect. This allows us to short circuit simplification (saving CPU + // cycles) and prevents the cache of simplified geometries from filling + // up with useless identical copies of this geometry (saving memory). + this.simplifiedGeometryMaxMinSquaredTolerance = squaredTolerance; + return this; + } + } + }; + + /** + * @param {number} squaredTolerance Squared tolerance. + * @return {SimpleGeometry} Simplified geometry. + * @protected + */ + SimpleGeometry.prototype.getSimplifiedGeometryInternal = function getSimplifiedGeometryInternal (squaredTolerance) { + return this; + }; + + /** + * @return {number} Stride. + */ + SimpleGeometry.prototype.getStride = function getStride () { + return this.stride; + }; + + /** + * @param {GeometryLayout} layout Layout. + * @param {Array} flatCoordinates Flat coordinates. + */ + SimpleGeometry.prototype.setFlatCoordinates = function setFlatCoordinates (layout, flatCoordinates) { + this.stride = getStrideForLayout(layout); + this.layout = layout; + this.flatCoordinates = flatCoordinates; + }; + + /** + * @abstract + * @param {!Array} coordinates Coordinates. + * @param {GeometryLayout=} opt_layout Layout. + */ + SimpleGeometry.prototype.setCoordinates = function setCoordinates (coordinates, opt_layout) { + Object(util["b" /* abstract */])(); + }; + + /** + * @param {GeometryLayout|undefined} layout Layout. + * @param {Array} coordinates Coordinates. + * @param {number} nesting Nesting. + * @protected + */ + SimpleGeometry.prototype.setLayout = function setLayout (layout, coordinates, nesting) { + /** @type {number} */ + var stride; + if (layout) { + stride = getStrideForLayout(layout); + } else { + for (var i = 0; i < nesting; ++i) { + if (coordinates.length === 0) { + this.layout = GeometryLayout["a" /* default */].XY; + this.stride = 2; + return; + } else { + coordinates = /** @type {Array} */ (coordinates[0]); + } + } + stride = coordinates.length; + layout = getLayoutForStride(stride); + } + this.layout = layout; + this.stride = stride; + }; + + /** + * @inheritDoc + * @api + */ + SimpleGeometry.prototype.applyTransform = function applyTransform (transformFn) { + if (this.flatCoordinates) { + transformFn(this.flatCoordinates, this.flatCoordinates, this.stride); + this.changed(); + } + }; + + /** + * @inheritDoc + * @api + */ + SimpleGeometry.prototype.rotate = function rotate$1 (angle, anchor) { + var flatCoordinates = this.getFlatCoordinates(); + if (flatCoordinates) { + var stride = this.getStride(); + Object(flat_transform["a" /* rotate */])( + flatCoordinates, 0, flatCoordinates.length, + stride, angle, anchor, flatCoordinates); + this.changed(); + } + }; + + /** + * @inheritDoc + * @api + */ + SimpleGeometry.prototype.scale = function scale$1 (sx, opt_sy, opt_anchor) { + var sy = opt_sy; + if (sy === undefined) { + sy = sx; + } + var anchor = opt_anchor; + if (!anchor) { + anchor = Object(ol_extent["x" /* getCenter */])(this.getExtent()); + } + var flatCoordinates = this.getFlatCoordinates(); + if (flatCoordinates) { + var stride = this.getStride(); + Object(flat_transform["b" /* scale */])( + flatCoordinates, 0, flatCoordinates.length, + stride, sx, sy, anchor, flatCoordinates); + this.changed(); + } + }; + + /** + * @inheritDoc + * @api + */ + SimpleGeometry.prototype.translate = function translate$1 (deltaX, deltaY) { + var flatCoordinates = this.getFlatCoordinates(); + if (flatCoordinates) { + var stride = this.getStride(); + Object(flat_transform["d" /* translate */])( + flatCoordinates, 0, flatCoordinates.length, stride, + deltaX, deltaY, flatCoordinates); + this.changed(); + } + }; + + return SimpleGeometry; +}(geom_Geometry)); + + +/** + * @param {number} stride Stride. + * @return {GeometryLayout} layout Layout. + */ +function getLayoutForStride(stride) { + var layout; + if (stride == 2) { + layout = GeometryLayout["a" /* default */].XY; + } else if (stride == 3) { + layout = GeometryLayout["a" /* default */].XYZ; + } else if (stride == 4) { + layout = GeometryLayout["a" /* default */].XYZM; + } + return ( + /** @type {GeometryLayout} */ (layout) + ); +} + + +/** + * @param {GeometryLayout} layout Layout. + * @return {number} Stride. + */ +function getStrideForLayout(layout) { + var stride; + if (layout == GeometryLayout["a" /* default */].XY) { + stride = 2; + } else if (layout == GeometryLayout["a" /* default */].XYZ || layout == GeometryLayout["a" /* default */].XYM) { + stride = 3; + } else if (layout == GeometryLayout["a" /* default */].XYZM) { + stride = 4; + } + return /** @type {number} */ (stride); +} + + +/** + * @param {SimpleGeometry} simpleGeometry Simple geometry. + * @param {import("../transform.js").Transform} transform Transform. + * @param {Array=} opt_dest Destination. + * @return {Array} Transformed flat coordinates. + */ +function transformGeom2D(simpleGeometry, transform, opt_dest) { + var flatCoordinates = simpleGeometry.getFlatCoordinates(); + if (!flatCoordinates) { + return null; + } else { + var stride = simpleGeometry.getStride(); + return Object(flat_transform["c" /* transform2D */])( + flatCoordinates, 0, flatCoordinates.length, stride, + transform, opt_dest); + } +} + +/* harmony default export */ var geom_SimpleGeometry = __webpack_exports__["a"] = (SimpleGeometry_SimpleGeometry); + +//# sourceMappingURL=SimpleGeometry.js.map + +/***/ }), +/* 41 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return inflateCoordinates; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return inflateCoordinatesArray; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return inflateMultiCoordinatesArray; }); +/** + * @module ol/geom/flat/inflate + */ + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @param {Array=} opt_coordinates Coordinates. + * @return {Array} Coordinates. + */ +function inflateCoordinates(flatCoordinates, offset, end, stride, opt_coordinates) { + var coordinates = opt_coordinates !== undefined ? opt_coordinates : []; + var i = 0; + for (var j = offset; j < end; j += stride) { + coordinates[i++] = flatCoordinates.slice(j, j + stride); + } + coordinates.length = i; + return coordinates; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array} ends Ends. + * @param {number} stride Stride. + * @param {Array>=} opt_coordinatess Coordinatess. + * @return {Array>} Coordinatess. + */ +function inflateCoordinatesArray(flatCoordinates, offset, ends, stride, opt_coordinatess) { + var coordinatess = opt_coordinatess !== undefined ? opt_coordinatess : []; + var i = 0; + for (var j = 0, jj = ends.length; j < jj; ++j) { + var end = ends[j]; + coordinatess[i++] = inflateCoordinates( + flatCoordinates, offset, end, stride, coordinatess[i]); + offset = end; + } + coordinatess.length = i; + return coordinatess; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array>} endss Endss. + * @param {number} stride Stride. + * @param {Array>>=} opt_coordinatesss + * Coordinatesss. + * @return {Array>>} Coordinatesss. + */ +function inflateMultiCoordinatesArray(flatCoordinates, offset, endss, stride, opt_coordinatesss) { + var coordinatesss = opt_coordinatesss !== undefined ? opt_coordinatesss : []; + var i = 0; + for (var j = 0, jj = endss.length; j < jj; ++j) { + var ends = endss[j]; + coordinatesss[i++] = inflateCoordinatesArray( + flatCoordinates, offset, ends, stride, coordinatesss[i]); + offset = ends[ends.length - 1]; + } + coordinatesss.length = i; + return coordinatesss; +} + +//# sourceMappingURL=inflate.js.map + +/***/ }), +/* 42 */ +/***/ (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 + +/***/ }), +/* 43 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return disable; }); +/* 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__(7); +/** + * @module ol/rotationconstraint + */ + + + +/** + * @typedef {function((number|undefined), number): (number|undefined)} Type + */ + + +/** + * @param {number|undefined} rotation Rotation. + * @param {number} delta Delta. + * @return {number|undefined} Rotation. + */ +function disable(rotation, delta) { + if (rotation !== undefined) { + return 0; + } else { + return undefined; + } +} + + +/** + * @param {number|undefined} rotation Rotation. + * @param {number} delta Delta. + * @return {number|undefined} Rotation. + */ +function none(rotation, delta) { + if (rotation !== undefined) { + return rotation + delta; + } else { + return undefined; + } +} + + +/** + * @param {number} n N. + * @return {Type} Rotation constraint. + */ +function createSnapToN(n) { + var theta = 2 * Math.PI / n; + return ( + /** + * @param {number|undefined} rotation Rotation. + * @param {number} delta Delta. + * @return {number|undefined} Rotation. + */ + function(rotation, delta) { + if (rotation !== undefined) { + rotation = Math.floor((rotation + delta) / theta + 0.5) * theta; + return rotation; + } else { + return undefined; + } + }); +} + + +/** + * @param {number=} opt_tolerance Tolerance. + * @return {Type} Rotation constraint. + */ +function createSnapToZero(opt_tolerance) { + var tolerance = opt_tolerance || Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* toRadians */ "i"])(5); + return ( + /** + * @param {number|undefined} rotation Rotation. + * @param {number} delta Delta. + * @return {number|undefined} Rotation. + */ + function(rotation, delta) { + if (rotation !== undefined) { + if (Math.abs(rotation + delta) <= tolerance) { + return 0; + } else { + return rotation + delta; + } + } else { + return undefined; + } + }); +} + +//# sourceMappingURL=rotationconstraint.js.map + +/***/ }), +/* 44 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/** + * @module ol/layer/TileProperty + */ + +/** + * @enum {string} + */ +/* harmony default export */ __webpack_exports__["a"] = ({ + PRELOAD: 'preload', + USE_INTERIM_TILES_ON_ERROR: 'useInterimTilesOnError' +}); + +//# sourceMappingURL=TileProperty.js.map + +/***/ }), +/* 45 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); +/** + * @module ol/style/Stroke + */ + + + +/** + * @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. + * @property {string} [lineCap='round'] Line cap style: `butt`, `round`, or `square`. + * @property {string} [lineJoin='round'] Line join style: `bevel`, `round`, or `miter`. + * @property {Array} [lineDash] Line dash pattern. Default is `undefined` (no dash). + * Please note that Internet Explorer 10 and lower do not support the `setLineDash` method on + * the `CanvasRenderingContext2D` and therefore this option will have no visual effect in these browsers. + * @property {number} [lineDashOffset=0] Line dash offset. + * @property {number} [miterLimit=10] Miter limit. + * @property {number} [width] Width. + */ + + +/** + * @classdesc + * Set stroke style for vector features. + * Note that the defaults given are the Canvas defaults, which will be used if + * option is not defined. The `get` functions return whatever was entered in + * the options; they will not return the default. + * @api + */ +var Stroke = function Stroke(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.lineCap_ = options.lineCap; + + /** + * @private + * @type {Array} + */ + this.lineDash_ = options.lineDash !== undefined ? options.lineDash : null; + + /** + * @private + * @type {number|undefined} + */ + this.lineDashOffset_ = options.lineDashOffset; + + /** + * @private + * @type {string|undefined} + */ + this.lineJoin_ = options.lineJoin; + + /** + * @private + * @type {number|undefined} + */ + this.miterLimit_ = options.miterLimit; + + /** + * @private + * @type {number|undefined} + */ + this.width_ = options.width; + + /** + * @private + * @type {string|undefined} + */ + this.checksum_ = undefined; +}; + +/** + * Clones the style. + * @return {Stroke} The cloned style. + * @api + */ +Stroke.prototype.clone = function clone () { + var color = this.getColor(); + return new Stroke({ + color: Array.isArray(color) ? color.slice() : color || undefined, + lineCap: this.getLineCap(), + lineDash: this.getLineDash() ? this.getLineDash().slice() : undefined, + lineDashOffset: this.getLineDashOffset(), + lineJoin: this.getLineJoin(), + miterLimit: this.getMiterLimit(), + width: this.getWidth() + }); +}; + +/** + * Get the stroke color. + * @return {import("../color.js").Color|import("../colorlike.js").ColorLike} Color. + * @api + */ +Stroke.prototype.getColor = function getColor () { + return this.color_; +}; + +/** + * Get the line cap type for the stroke. + * @return {string|undefined} Line cap. + * @api + */ +Stroke.prototype.getLineCap = function getLineCap () { + return this.lineCap_; +}; + +/** + * Get the line dash style for the stroke. + * @return {Array} Line dash. + * @api + */ +Stroke.prototype.getLineDash = function getLineDash () { + return this.lineDash_; +}; + +/** + * Get the line dash offset for the stroke. + * @return {number|undefined} Line dash offset. + * @api + */ +Stroke.prototype.getLineDashOffset = function getLineDashOffset () { + return this.lineDashOffset_; +}; + +/** + * Get the line join type for the stroke. + * @return {string|undefined} Line join. + * @api + */ +Stroke.prototype.getLineJoin = function getLineJoin () { + return this.lineJoin_; +}; + +/** + * Get the miter limit for the stroke. + * @return {number|undefined} Miter limit. + * @api + */ +Stroke.prototype.getMiterLimit = function getMiterLimit () { + return this.miterLimit_; +}; + +/** + * Get the stroke width. + * @return {number|undefined} Width. + * @api + */ +Stroke.prototype.getWidth = function getWidth () { + return this.width_; +}; + +/** + * Set the color. + * + * @param {import("../color.js").Color|import("../colorlike.js").ColorLike} color Color. + * @api + */ +Stroke.prototype.setColor = function setColor (color) { + this.color_ = color; + this.checksum_ = undefined; +}; + +/** + * Set the line cap. + * + * @param {string|undefined} lineCap Line cap. + * @api + */ +Stroke.prototype.setLineCap = function setLineCap (lineCap) { + this.lineCap_ = lineCap; + this.checksum_ = undefined; +}; + +/** + * Set the line dash. + * + * Please note that Internet Explorer 10 and lower [do not support][mdn] the + * `setLineDash` method on the `CanvasRenderingContext2D` and therefore this + * property will have no visual effect in these browsers. + * + * [mdn]: https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility + * + * @param {Array} lineDash Line dash. + * @api + */ +Stroke.prototype.setLineDash = function setLineDash (lineDash) { + this.lineDash_ = lineDash; + this.checksum_ = undefined; +}; + +/** + * Set the line dash offset. + * + * @param {number|undefined} lineDashOffset Line dash offset. + * @api + */ +Stroke.prototype.setLineDashOffset = function setLineDashOffset (lineDashOffset) { + this.lineDashOffset_ = lineDashOffset; + this.checksum_ = undefined; +}; + +/** + * Set the line join. + * + * @param {string|undefined} lineJoin Line join. + * @api + */ +Stroke.prototype.setLineJoin = function setLineJoin (lineJoin) { + this.lineJoin_ = lineJoin; + this.checksum_ = undefined; +}; + +/** + * Set the miter limit. + * + * @param {number|undefined} miterLimit Miter limit. + * @api + */ +Stroke.prototype.setMiterLimit = function setMiterLimit (miterLimit) { + this.miterLimit_ = miterLimit; + this.checksum_ = undefined; +}; + +/** + * Set the width. + * + * @param {number|undefined} width Width. + * @api + */ +Stroke.prototype.setWidth = function setWidth (width) { + this.width_ = width; + this.checksum_ = undefined; +}; + +/** + * @return {string} The checksum. + */ +Stroke.prototype.getChecksum = function getChecksum () { + if (this.checksum_ === undefined) { + this.checksum_ = 's'; + if (this.color_) { + if (typeof this.color_ === 'string') { + this.checksum_ += this.color_; + } else { + this.checksum_ += Object(_util_js__WEBPACK_IMPORTED_MODULE_0__[/* getUid */ "c"])(this.color_); + } + } else { + this.checksum_ += '-'; + } + this.checksum_ += ',' + + (this.lineCap_ !== undefined ? + this.lineCap_.toString() : '-') + ',' + + (this.lineDash_ ? + this.lineDash_.toString() : '-') + ',' + + (this.lineDashOffset_ !== undefined ? + this.lineDashOffset_ : '-') + ',' + + (this.lineJoin_ !== undefined ? + this.lineJoin_ : '-') + ',' + + (this.miterLimit_ !== undefined ? + this.miterLimit_.toString() : '-') + ',' + + (this.width_ !== undefined ? + this.width_.toString() : '-'); + } + + return this.checksum_; +}; + +/* harmony default export */ __webpack_exports__["a"] = (Stroke); + +//# sourceMappingURL=Stroke.js.map + +/***/ }), +/* 46 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return maxSquaredDelta; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return arrayMaxSquaredDelta; }); +/* unused harmony export multiArrayMaxSquaredDelta */ +/* 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__(7); +/** + * @module ol/geom/flat/closest + */ + + + +/** + * Returns the point on the 2D line segment flatCoordinates[offset1] to + * flatCoordinates[offset2] that is closest to the point (x, y). Extra + * dimensions are linearly interpolated. + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset1 Offset 1. + * @param {number} offset2 Offset 2. + * @param {number} stride Stride. + * @param {number} x X. + * @param {number} y Y. + * @param {Array} closestPoint Closest point. + */ +function assignClosest(flatCoordinates, offset1, offset2, stride, x, y, closestPoint) { + var x1 = flatCoordinates[offset1]; + var y1 = flatCoordinates[offset1 + 1]; + var dx = flatCoordinates[offset2] - x1; + var dy = flatCoordinates[offset2 + 1] - y1; + var offset; + if (dx === 0 && dy === 0) { + offset = offset1; + } else { + var t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy); + if (t > 1) { + offset = offset2; + } else if (t > 0) { + for (var i = 0; i < stride; ++i) { + closestPoint[i] = Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[/* lerp */ "c"])(flatCoordinates[offset1 + i], + flatCoordinates[offset2 + i], t); + } + closestPoint.length = stride; + return; + } else { + offset = offset1; + } + } + for (var i$1 = 0; i$1 < stride; ++i$1) { + closestPoint[i$1] = flatCoordinates[offset + i$1]; + } + closestPoint.length = stride; +} + + +/** + * Return the squared of the largest distance between any pair of consecutive + * coordinates. + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @param {number} max Max squared delta. + * @return {number} Max squared delta. + */ +function maxSquaredDelta(flatCoordinates, offset, end, stride, max) { + var x1 = flatCoordinates[offset]; + var y1 = flatCoordinates[offset + 1]; + 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); + if (squaredDelta > max) { + max = squaredDelta; + } + x1 = x2; + y1 = y2; + } + return max; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array} ends Ends. + * @param {number} stride Stride. + * @param {number} max Max squared delta. + * @return {number} Max squared delta. + */ +function arrayMaxSquaredDelta(flatCoordinates, offset, ends, stride, max) { + for (var i = 0, ii = ends.length; i < ii; ++i) { + var end = ends[i]; + max = maxSquaredDelta( + flatCoordinates, offset, end, stride, max); + offset = end; + } + return max; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array>} endss Endss. + * @param {number} stride Stride. + * @param {number} max Max squared delta. + * @return {number} Max squared delta. + */ +function multiArrayMaxSquaredDelta(flatCoordinates, offset, endss, stride, max) { + for (var i = 0, ii = endss.length; i < ii; ++i) { + var ends = endss[i]; + max = arrayMaxSquaredDelta( + flatCoordinates, offset, ends, stride, max); + offset = ends[ends.length - 1]; + } + return max; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {number} end End. + * @param {number} stride Stride. + * @param {number} maxDelta Max delta. + * @param {boolean} isRing Is ring. + * @param {number} x X. + * @param {number} y Y. + * @param {Array} closestPoint Closest point. + * @param {number} minSquaredDistance Minimum squared distance. + * @param {Array=} opt_tmpPoint Temporary point object. + * @return {number} Minimum squared distance. + */ +function assignClosestPoint(flatCoordinates, offset, end, + stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, + opt_tmpPoint) { + if (offset == end) { + return minSquaredDistance; + } + 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"])( + x, y, flatCoordinates[offset], flatCoordinates[offset + 1]); + if (squaredDistance < minSquaredDistance) { + for (i = 0; i < stride; ++i) { + closestPoint[i] = flatCoordinates[offset + i]; + } + closestPoint.length = stride; + return squaredDistance; + } else { + return minSquaredDistance; + } + } + var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN]; + var index = offset + stride; + 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]); + if (squaredDistance < minSquaredDistance) { + minSquaredDistance = squaredDistance; + for (i = 0; i < stride; ++i) { + closestPoint[i] = tmpPoint[i]; + } + closestPoint.length = stride; + index += stride; + } else { + // Skip ahead multiple points, because we know that all the skipped + // points cannot be any closer than the closest point we have found so + // far. We know this because we know how close the current point is, how + // close the closest point we have found so far is, and the maximum + // distance between consecutive points. For example, if we're currently + // at distance 10, the best we've found so far is 3, and that the maximum + // distance between consecutive points is 2, then we'll need to skip at + // least (10 - 3) / 2 == 3 (rounded down) points to have any chance of + // finding a closer point. We use Math.max(..., 1) to ensure that we + // always advance at least one point, to avoid an infinite loop. + index += stride * Math.max( + ((Math.sqrt(squaredDistance) - + Math.sqrt(minSquaredDistance)) / maxDelta) | 0, 1); + } + } + if (isRing) { + // 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]); + if (squaredDistance < minSquaredDistance) { + minSquaredDistance = squaredDistance; + for (i = 0; i < stride; ++i) { + closestPoint[i] = tmpPoint[i]; + } + closestPoint.length = stride; + } + } + return minSquaredDistance; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array} ends Ends. + * @param {number} stride Stride. + * @param {number} maxDelta Max delta. + * @param {boolean} isRing Is ring. + * @param {number} x X. + * @param {number} y Y. + * @param {Array} closestPoint Closest point. + * @param {number} minSquaredDistance Minimum squared distance. + * @param {Array=} opt_tmpPoint Temporary point object. + * @return {number} Minimum squared distance. + */ +function assignClosestArrayPoint(flatCoordinates, offset, ends, + stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, + opt_tmpPoint) { + var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN]; + for (var i = 0, ii = ends.length; i < ii; ++i) { + var end = ends[i]; + minSquaredDistance = assignClosestPoint( + flatCoordinates, offset, end, stride, + maxDelta, isRing, x, y, closestPoint, minSquaredDistance, tmpPoint); + offset = end; + } + return minSquaredDistance; +} + + +/** + * @param {Array} flatCoordinates Flat coordinates. + * @param {number} offset Offset. + * @param {Array>} endss Endss. + * @param {number} stride Stride. + * @param {number} maxDelta Max delta. + * @param {boolean} isRing Is ring. + * @param {number} x X. + * @param {number} y Y. + * @param {Array} closestPoint Closest point. + * @param {number} minSquaredDistance Minimum squared distance. + * @param {Array=} opt_tmpPoint Temporary point object. + * @return {number} Minimum squared distance. + */ +function assignClosestMultiArrayPoint(flatCoordinates, offset, + endss, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, + opt_tmpPoint) { + var tmpPoint = opt_tmpPoint ? opt_tmpPoint : [NaN, NaN]; + for (var i = 0, ii = endss.length; i < ii; ++i) { + var ends = endss[i]; + minSquaredDistance = assignClosestArrayPoint( + flatCoordinates, offset, ends, stride, + maxDelta, isRing, x, y, closestPoint, minSquaredDistance, tmpPoint); + offset = ends[ends.length - 1]; + } + return minSquaredDistance; +} + +//# sourceMappingURL=closest.js.map + +/***/ }), +/* 47 */ +/***/ (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 _geom_GeometryType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6); +/* harmony import */ var _Circle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(73); +/* harmony import */ var _Fill_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(53); +/* harmony import */ var _Stroke_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(45); +/** + * @module ol/style/Style + */ + +/** + * Feature styles. + * + * If no style is defined, the following default style is used: + * ```js + * import {Fill, Stroke, Circle, Style} from 'ol/style'; + * + * var fill = new Fill({ + * color: 'rgba(255,255,255,0.4)' + * }); + * var stroke = new Stroke({ + * color: '#3399CC', + * width: 1.25 + * }); + * var styles = [ + * new Style({ + * image: new Circle({ + * fill: fill, + * stroke: stroke, + * radius: 5 + * }), + * fill: fill, + * stroke: stroke + * }) + * ]; + * ``` + * + * A separate editing style has the following defaults: + * ```js + * import {Fill, Stroke, Circle, Style} from 'ol/style'; + * import GeometryType from 'ol/geom/GeometryType'; + * + * var white = [255, 255, 255, 1]; + * var blue = [0, 153, 255, 1]; + * var width = 3; + * styles[GeometryType.POLYGON] = [ + * new Style({ + * fill: new Fill({ + * color: [255, 255, 255, 0.5] + * }) + * }) + * ]; + * styles[GeometryType.MULTI_POLYGON] = + * styles[GeometryType.POLYGON]; + * styles[GeometryType.LINE_STRING] = [ + * new Style({ + * stroke: new Stroke({ + * color: white, + * width: width + 2 + * }) + * }), + * new Style({ + * stroke: new Stroke({ + * color: blue, + * width: width + * }) + * }) + * ]; + * styles[GeometryType.MULTI_LINE_STRING] = + * styles[GeometryType.LINE_STRING]; + * styles[GeometryType.POINT] = [ + * new Style({ + * image: new Circle({ + * radius: width * 2, + * fill: new Fill({ + * color: blue + * }), + * stroke: new Stroke({ + * color: white, + * width: width / 2 + * }) + * }), + * zIndex: Infinity + * }) + * ]; + * styles[GeometryType.MULTI_POINT] = + * styles[GeometryType.POINT]; + * styles[GeometryType.GEOMETRY_COLLECTION] = + * styles[GeometryType.POLYGON].concat( + * styles[GeometryType.LINE_STRING], + * styles[GeometryType.POINT] + * ); + * ``` + */ + + + + + + + +/** + * A function that takes an {@link module:ol/Feature} and a `{number}` + * representing the view's resolution. The function should return a + * {@link module:ol/style/Style} or an array of them. This way e.g. a + * vector layer can be styled. + * + * @typedef {function(import("../Feature.js").FeatureLike, number):(Style|Array