2045 lines
1.7 MiB
2045 lines
1.7 MiB
/*
|
||
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
||
* This devtool is neither made for production nor for readable output files.
|
||
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
||
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
||
* or disable the default devtool with "devtool: false".
|
||
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
||
*/
|
||
(self["webpackChunkcomplexes"] = self["webpackChunkcomplexes"] || []).push([["node_modules_ol_Map_js-node_modules_ol_Overlay_js-node_modules_ol_control_ZoomSlider_js-node_-a83a42"],{
|
||
|
||
/***/ "./node_modules/rbush/rbush.min.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/rbush/rbush.min.js ***!
|
||
\*****************************************/
|
||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
||
|
||
eval("__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n!function (t, i) {\n true ? module.exports = i() : 0;\n}(this, function () {\n \"use strict\";\n\n function t(t, r, e, a, h) {\n !function t(n, r, e, a, h) {\n for (; a > e;) {\n if (a - e > 600) {\n var o = a - e + 1,\n s = r - e + 1,\n l = Math.log(o),\n f = .5 * Math.exp(2 * l / 3),\n u = .5 * Math.sqrt(l * f * (o - f) / o) * (s - o / 2 < 0 ? -1 : 1),\n m = Math.max(e, Math.floor(r - s * f / o + u)),\n c = Math.min(a, Math.floor(r + (o - s) * f / o + u));\n t(n, r, m, c, h);\n }\n var p = n[r],\n d = e,\n x = a;\n for (i(n, e, r), h(n[a], p) > 0 && i(n, e, a); d < x;) {\n for (i(n, d, x), d++, x--; h(n[d], p) < 0;) d++;\n for (; h(n[x], p) > 0;) x--;\n }\n 0 === h(n[e], p) ? i(n, e, x) : i(n, ++x, a), x <= r && (e = x + 1), r <= x && (a = x - 1);\n }\n }(t, r, e || 0, a || t.length - 1, h || n);\n }\n function i(t, i, n) {\n var r = t[i];\n t[i] = t[n], t[n] = r;\n }\n function n(t, i) {\n return t < i ? -1 : t > i ? 1 : 0;\n }\n var r = function (t) {\n void 0 === t && (t = 9), this._maxEntries = Math.max(4, t), this._minEntries = Math.max(2, Math.ceil(.4 * this._maxEntries)), this.clear();\n };\n function e(t, i, n) {\n if (!n) return i.indexOf(t);\n for (var r = 0; r < i.length; r++) if (n(t, i[r])) return r;\n return -1;\n }\n function a(t, i) {\n h(t, 0, t.children.length, i, t);\n }\n function h(t, i, n, r, e) {\n e || (e = p(null)), e.minX = 1 / 0, e.minY = 1 / 0, e.maxX = -1 / 0, e.maxY = -1 / 0;\n for (var a = i; a < n; a++) {\n var h = t.children[a];\n o(e, t.leaf ? r(h) : h);\n }\n return e;\n }\n function o(t, i) {\n return t.minX = Math.min(t.minX, i.minX), t.minY = Math.min(t.minY, i.minY), t.maxX = Math.max(t.maxX, i.maxX), t.maxY = Math.max(t.maxY, i.maxY), t;\n }\n function s(t, i) {\n return t.minX - i.minX;\n }\n function l(t, i) {\n return t.minY - i.minY;\n }\n function f(t) {\n return (t.maxX - t.minX) * (t.maxY - t.minY);\n }\n function u(t) {\n return t.maxX - t.minX + (t.maxY - t.minY);\n }\n function m(t, i) {\n return t.minX <= i.minX && t.minY <= i.minY && i.maxX <= t.maxX && i.maxY <= t.maxY;\n }\n function c(t, i) {\n return i.minX <= t.maxX && i.minY <= t.maxY && i.maxX >= t.minX && i.maxY >= t.minY;\n }\n function p(t) {\n return {\n children: t,\n height: 1,\n leaf: !0,\n minX: 1 / 0,\n minY: 1 / 0,\n maxX: -1 / 0,\n maxY: -1 / 0\n };\n }\n function d(i, n, r, e, a) {\n for (var h = [n, r]; h.length;) if (!((r = h.pop()) - (n = h.pop()) <= e)) {\n var o = n + Math.ceil((r - n) / e / 2) * e;\n t(i, o, n, r, a), h.push(n, o, o, r);\n }\n }\n return r.prototype.all = function () {\n return this._all(this.data, []);\n }, r.prototype.search = function (t) {\n var i = this.data,\n n = [];\n if (!c(t, i)) return n;\n for (var r = this.toBBox, e = []; i;) {\n for (var a = 0; a < i.children.length; a++) {\n var h = i.children[a],\n o = i.leaf ? r(h) : h;\n c(t, o) && (i.leaf ? n.push(h) : m(t, o) ? this._all(h, n) : e.push(h));\n }\n i = e.pop();\n }\n return n;\n }, r.prototype.collides = function (t) {\n var i = this.data;\n if (!c(t, i)) return !1;\n for (var n = []; i;) {\n for (var r = 0; r < i.children.length; r++) {\n var e = i.children[r],\n a = i.leaf ? this.toBBox(e) : e;\n if (c(t, a)) {\n if (i.leaf || m(t, a)) return !0;\n n.push(e);\n }\n }\n i = n.pop();\n }\n return !1;\n }, r.prototype.load = function (t) {\n if (!t || !t.length) return this;\n if (t.length < this._minEntries) {\n for (var i = 0; i < t.length; i++) this.insert(t[i]);\n return this;\n }\n var n = this._build(t.slice(), 0, t.length - 1, 0);\n if (this.data.children.length) {\n if (this.data.height === n.height) this._splitRoot(this.data, n);else {\n if (this.data.height < n.height) {\n var r = this.data;\n this.data = n, n = r;\n }\n this._insert(n, this.data.height - n.height - 1, !0);\n }\n } else this.data = n;\n return this;\n }, r.prototype.insert = function (t) {\n return t && this._insert(t, this.data.height - 1), this;\n }, r.prototype.clear = function () {\n return this.data = p([]), this;\n }, r.prototype.remove = function (t, i) {\n if (!t) return this;\n for (var n, r, a, h = this.data, o = this.toBBox(t), s = [], l = []; h || s.length;) {\n if (h || (h = s.pop(), r = s[s.length - 1], n = l.pop(), a = !0), h.leaf) {\n var f = e(t, h.children, i);\n if (-1 !== f) return h.children.splice(f, 1), s.push(h), this._condense(s), this;\n }\n a || h.leaf || !m(h, o) ? r ? (n++, h = r.children[n], a = !1) : h = null : (s.push(h), l.push(n), n = 0, r = h, h = h.children[0]);\n }\n return this;\n }, r.prototype.toBBox = function (t) {\n return t;\n }, r.prototype.compareMinX = function (t, i) {\n return t.minX - i.minX;\n }, r.prototype.compareMinY = function (t, i) {\n return t.minY - i.minY;\n }, r.prototype.toJSON = function () {\n return this.data;\n }, r.prototype.fromJSON = function (t) {\n return this.data = t, this;\n }, r.prototype._all = function (t, i) {\n for (var n = []; t;) t.leaf ? i.push.apply(i, t.children) : n.push.apply(n, t.children), t = n.pop();\n return i;\n }, r.prototype._build = function (t, i, n, r) {\n var e,\n h = n - i + 1,\n o = this._maxEntries;\n if (h <= o) return a(e = p(t.slice(i, n + 1)), this.toBBox), e;\n r || (r = Math.ceil(Math.log(h) / Math.log(o)), o = Math.ceil(h / Math.pow(o, r - 1))), (e = p([])).leaf = !1, e.height = r;\n var s = Math.ceil(h / o),\n l = s * Math.ceil(Math.sqrt(o));\n d(t, i, n, l, this.compareMinX);\n for (var f = i; f <= n; f += l) {\n var u = Math.min(f + l - 1, n);\n d(t, f, u, s, this.compareMinY);\n for (var m = f; m <= u; m += s) {\n var c = Math.min(m + s - 1, u);\n e.children.push(this._build(t, m, c, r - 1));\n }\n }\n return a(e, this.toBBox), e;\n }, r.prototype._chooseSubtree = function (t, i, n, r) {\n for (; r.push(i), !i.leaf && r.length - 1 !== n;) {\n for (var e = 1 / 0, a = 1 / 0, h = void 0, o = 0; o < i.children.length; o++) {\n var s = i.children[o],\n l = f(s),\n u = (m = t, c = s, (Math.max(c.maxX, m.maxX) - Math.min(c.minX, m.minX)) * (Math.max(c.maxY, m.maxY) - Math.min(c.minY, m.minY)) - l);\n u < a ? (a = u, e = l < e ? l : e, h = s) : u === a && l < e && (e = l, h = s);\n }\n i = h || i.children[0];\n }\n var m, c;\n return i;\n }, r.prototype._insert = function (t, i, n) {\n var r = n ? t : this.toBBox(t),\n e = [],\n a = this._chooseSubtree(r, this.data, i, e);\n for (a.children.push(t), o(a, r); i >= 0 && e[i].children.length > this._maxEntries;) this._split(e, i), i--;\n this._adjustParentBBoxes(r, e, i);\n }, r.prototype._split = function (t, i) {\n var n = t[i],\n r = n.children.length,\n e = this._minEntries;\n this._chooseSplitAxis(n, e, r);\n var h = this._chooseSplitIndex(n, e, r),\n o = p(n.children.splice(h, n.children.length - h));\n o.height = n.height, o.leaf = n.leaf, a(n, this.toBBox), a(o, this.toBBox), i ? t[i - 1].children.push(o) : this._splitRoot(n, o);\n }, r.prototype._splitRoot = function (t, i) {\n this.data = p([t, i]), this.data.height = t.height + 1, this.data.leaf = !1, a(this.data, this.toBBox);\n }, r.prototype._chooseSplitIndex = function (t, i, n) {\n for (var r, e, a, o, s, l, u, m = 1 / 0, c = 1 / 0, p = i; p <= n - i; p++) {\n var d = h(t, 0, p, this.toBBox),\n x = h(t, p, n, this.toBBox),\n v = (e = d, a = x, o = void 0, s = void 0, l = void 0, u = void 0, o = Math.max(e.minX, a.minX), s = Math.max(e.minY, a.minY), l = Math.min(e.maxX, a.maxX), u = Math.min(e.maxY, a.maxY), Math.max(0, l - o) * Math.max(0, u - s)),\n M = f(d) + f(x);\n v < m ? (m = v, r = p, c = M < c ? M : c) : v === m && M < c && (c = M, r = p);\n }\n return r || n - i;\n }, r.prototype._chooseSplitAxis = function (t, i, n) {\n var r = t.leaf ? this.compareMinX : s,\n e = t.leaf ? this.compareMinY : l;\n this._allDistMargin(t, i, n, r) < this._allDistMargin(t, i, n, e) && t.children.sort(r);\n }, r.prototype._allDistMargin = function (t, i, n, r) {\n t.children.sort(r);\n for (var e = this.toBBox, a = h(t, 0, i, e), s = h(t, n - i, n, e), l = u(a) + u(s), f = i; f < n - i; f++) {\n var m = t.children[f];\n o(a, t.leaf ? e(m) : m), l += u(a);\n }\n for (var c = n - i - 1; c >= i; c--) {\n var p = t.children[c];\n o(s, t.leaf ? e(p) : p), l += u(s);\n }\n return l;\n }, r.prototype._adjustParentBBoxes = function (t, i, n) {\n for (var r = n; r >= 0; r--) o(i[r], t);\n }, r.prototype._condense = function (t) {\n for (var i = t.length - 1, n = void 0; i >= 0; i--) 0 === t[i].children.length ? i > 0 ? (n = t[i - 1].children).splice(n.indexOf(t[i]), 1) : this.clear() : a(t[i], this.toBBox);\n }, r;\n});\n\n//# sourceURL=webpack://complexes/./node_modules/rbush/rbush.min.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/color-parse/index.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/color-parse/index.js ***!
|
||
\*******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var color_name__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! color-name */ \"./node_modules/color-parse/node_modules/color-name/index.js\");\n/**\n * @module color-parse\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (parse);\n\n/**\n * Base hues\n * http://dev.w3.org/csswg/css-color/#typedef-named-hue\n */\n//FIXME: use external hue detector\nvar baseHues = {\n red: 0,\n orange: 60,\n yellow: 120,\n green: 180,\n blue: 240,\n purple: 300\n};\n\n/**\n * Parse color from the string passed\n *\n * @return {Object} A space indicator `space`, an array `values` and `alpha`\n */\nfunction parse(cstr) {\n var m,\n parts = [],\n alpha = 1,\n space;\n\n //numeric case\n if (typeof cstr === 'number') {\n return {\n space: 'rgb',\n values: [cstr >>> 16, (cstr & 0x00ff00) >>> 8, cstr & 0x0000ff],\n alpha: 1\n };\n }\n if (typeof cstr === 'number') return {\n space: 'rgb',\n values: [cstr >>> 16, (cstr & 0x00ff00) >>> 8, cstr & 0x0000ff],\n alpha: 1\n };\n cstr = String(cstr).toLowerCase();\n\n //keyword\n if (color_name__WEBPACK_IMPORTED_MODULE_0__[\"default\"][cstr]) {\n parts = color_name__WEBPACK_IMPORTED_MODULE_0__[\"default\"][cstr].slice();\n space = 'rgb';\n }\n\n //reserved words\n else if (cstr === 'transparent') {\n alpha = 0;\n space = 'rgb';\n parts = [0, 0, 0];\n }\n\n //hex\n else if (cstr[0] === '#') {\n var base = cstr.slice(1);\n var size = base.length;\n var isShort = size <= 4;\n alpha = 1;\n if (isShort) {\n parts = [parseInt(base[0] + base[0], 16), parseInt(base[1] + base[1], 16), parseInt(base[2] + base[2], 16)];\n if (size === 4) {\n alpha = parseInt(base[3] + base[3], 16) / 255;\n }\n } else {\n parts = [parseInt(base[0] + base[1], 16), parseInt(base[2] + base[3], 16), parseInt(base[4] + base[5], 16)];\n if (size === 8) {\n alpha = parseInt(base[6] + base[7], 16) / 255;\n }\n }\n if (!parts[0]) parts[0] = 0;\n if (!parts[1]) parts[1] = 0;\n if (!parts[2]) parts[2] = 0;\n space = 'rgb';\n }\n\n // color space\n else if (m = /^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\\s*\\(([^\\)]*)\\)/.exec(cstr)) {\n var name = m[1];\n space = name.replace(/a$/, '');\n var dims = space === 'cmyk' ? 4 : space === 'gray' ? 1 : 3;\n parts = m[2].trim().split(/\\s*[,\\/]\\s*|\\s+/);\n\n // color(srgb-linear x x x) -> srgb-linear(x x x)\n if (space === 'color') space = parts.shift();\n parts = parts.map(function (x, i) {\n //<percentage>\n if (x[x.length - 1] === '%') {\n x = parseFloat(x) / 100;\n // alpha -> 0..1\n if (i === 3) return x;\n // rgb -> 0..255\n if (space === 'rgb') return x * 255;\n // hsl, hwb H -> 0..100\n if (space[0] === 'h') return x * 100;\n // lch, lab L -> 0..100\n if (space[0] === 'l' && !i) return x * 100;\n // lab A B -> -125..125\n if (space === 'lab') return x * 125;\n // lch C -> 0..150, H -> 0..360\n if (space === 'lch') return i < 2 ? x * 150 : x * 360;\n // oklch/oklab L -> 0..1\n if (space[0] === 'o' && !i) return x;\n // oklab A B -> -0.4..0.4\n if (space === 'oklab') return x * 0.4;\n // oklch C -> 0..0.4, H -> 0..360\n if (space === 'oklch') return i < 2 ? x * 0.4 : x * 360;\n // color(xxx) -> 0..1\n return x;\n }\n\n //hue\n if (space[i] === 'h' || i === 2 && space[space.length - 1] === 'h') {\n //<base-hue>\n if (baseHues[x] !== undefined) return baseHues[x];\n //<deg>\n if (x.endsWith('deg')) return parseFloat(x);\n //<turn>\n if (x.endsWith('turn')) return parseFloat(x) * 360;\n if (x.endsWith('grad')) return parseFloat(x) * 360 / 400;\n if (x.endsWith('rad')) return parseFloat(x) * 180 / Math.PI;\n }\n if (x === 'none') return 0;\n return parseFloat(x);\n });\n alpha = parts.length > dims ? parts.pop() : 1;\n }\n\n //named channels case\n else if (/[0-9](?:\\s|\\/|,)/.test(cstr)) {\n parts = cstr.match(/([0-9]+)/g).map(function (value) {\n return parseFloat(value);\n });\n space = cstr.match(/([a-z])/ig)?.join('')?.toLowerCase() || 'rgb';\n }\n return {\n space,\n values: parts,\n alpha\n };\n}\n\n//# sourceURL=webpack://complexes/./node_modules/color-parse/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/color-parse/node_modules/color-name/index.js":
|
||
/*!*******************************************************************!*\
|
||
!*** ./node_modules/color-parse/node_modules/color-name/index.js ***!
|
||
\*******************************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n aliceblue: [240, 248, 255],\n antiquewhite: [250, 235, 215],\n aqua: [0, 255, 255],\n aquamarine: [127, 255, 212],\n azure: [240, 255, 255],\n beige: [245, 245, 220],\n bisque: [255, 228, 196],\n black: [0, 0, 0],\n blanchedalmond: [255, 235, 205],\n blue: [0, 0, 255],\n blueviolet: [138, 43, 226],\n brown: [165, 42, 42],\n burlywood: [222, 184, 135],\n cadetblue: [95, 158, 160],\n chartreuse: [127, 255, 0],\n chocolate: [210, 105, 30],\n coral: [255, 127, 80],\n cornflowerblue: [100, 149, 237],\n cornsilk: [255, 248, 220],\n crimson: [220, 20, 60],\n cyan: [0, 255, 255],\n darkblue: [0, 0, 139],\n darkcyan: [0, 139, 139],\n darkgoldenrod: [184, 134, 11],\n darkgray: [169, 169, 169],\n darkgreen: [0, 100, 0],\n darkgrey: [169, 169, 169],\n darkkhaki: [189, 183, 107],\n darkmagenta: [139, 0, 139],\n darkolivegreen: [85, 107, 47],\n darkorange: [255, 140, 0],\n darkorchid: [153, 50, 204],\n darkred: [139, 0, 0],\n darksalmon: [233, 150, 122],\n darkseagreen: [143, 188, 143],\n darkslateblue: [72, 61, 139],\n darkslategray: [47, 79, 79],\n darkslategrey: [47, 79, 79],\n darkturquoise: [0, 206, 209],\n darkviolet: [148, 0, 211],\n deeppink: [255, 20, 147],\n deepskyblue: [0, 191, 255],\n dimgray: [105, 105, 105],\n dimgrey: [105, 105, 105],\n dodgerblue: [30, 144, 255],\n firebrick: [178, 34, 34],\n floralwhite: [255, 250, 240],\n forestgreen: [34, 139, 34],\n fuchsia: [255, 0, 255],\n gainsboro: [220, 220, 220],\n ghostwhite: [248, 248, 255],\n gold: [255, 215, 0],\n goldenrod: [218, 165, 32],\n gray: [128, 128, 128],\n green: [0, 128, 0],\n greenyellow: [173, 255, 47],\n grey: [128, 128, 128],\n honeydew: [240, 255, 240],\n hotpink: [255, 105, 180],\n indianred: [205, 92, 92],\n indigo: [75, 0, 130],\n ivory: [255, 255, 240],\n khaki: [240, 230, 140],\n lavender: [230, 230, 250],\n lavenderblush: [255, 240, 245],\n lawngreen: [124, 252, 0],\n lemonchiffon: [255, 250, 205],\n lightblue: [173, 216, 230],\n lightcoral: [240, 128, 128],\n lightcyan: [224, 255, 255],\n lightgoldenrodyellow: [250, 250, 210],\n lightgray: [211, 211, 211],\n lightgreen: [144, 238, 144],\n lightgrey: [211, 211, 211],\n lightpink: [255, 182, 193],\n lightsalmon: [255, 160, 122],\n lightseagreen: [32, 178, 170],\n lightskyblue: [135, 206, 250],\n lightslategray: [119, 136, 153],\n lightslategrey: [119, 136, 153],\n lightsteelblue: [176, 196, 222],\n lightyellow: [255, 255, 224],\n lime: [0, 255, 0],\n limegreen: [50, 205, 50],\n linen: [250, 240, 230],\n magenta: [255, 0, 255],\n maroon: [128, 0, 0],\n mediumaquamarine: [102, 205, 170],\n mediumblue: [0, 0, 205],\n mediumorchid: [186, 85, 211],\n mediumpurple: [147, 112, 219],\n mediumseagreen: [60, 179, 113],\n mediumslateblue: [123, 104, 238],\n mediumspringgreen: [0, 250, 154],\n mediumturquoise: [72, 209, 204],\n mediumvioletred: [199, 21, 133],\n midnightblue: [25, 25, 112],\n mintcream: [245, 255, 250],\n mistyrose: [255, 228, 225],\n moccasin: [255, 228, 181],\n navajowhite: [255, 222, 173],\n navy: [0, 0, 128],\n oldlace: [253, 245, 230],\n olive: [128, 128, 0],\n olivedrab: [107, 142, 35],\n orange: [255, 165, 0],\n orangered: [255, 69, 0],\n orchid: [218, 112, 214],\n palegoldenrod: [238, 232, 170],\n palegreen: [152, 251, 152],\n paleturquoise: [175, 238, 238],\n palevioletred: [219, 112, 147],\n papayawhip: [255, 239, 213],\n peachpuff: [255, 218, 185],\n peru: [205, 133, 63],\n pink: [255, 192, 203],\n plum: [221, 160, 221],\n powderblue: [176, 224, 230],\n purple: [128, 0, 128],\n rebeccapurple: [102, 51, 153],\n red: [255, 0, 0],\n rosybrown: [188, 143, 143],\n royalblue: [65, 105, 225],\n saddlebrown: [139, 69, 19],\n salmon: [250, 128, 114],\n sandybrown: [244, 164, 96],\n seagreen: [46, 139, 87],\n seashell: [255, 245, 238],\n sienna: [160, 82, 45],\n silver: [192, 192, 192],\n skyblue: [135, 206, 235],\n slateblue: [106, 90, 205],\n slategray: [112, 128, 144],\n slategrey: [112, 128, 144],\n snow: [255, 250, 250],\n springgreen: [0, 255, 127],\n steelblue: [70, 130, 180],\n tan: [210, 180, 140],\n teal: [0, 128, 128],\n thistle: [216, 191, 216],\n tomato: [255, 99, 71],\n turquoise: [64, 224, 208],\n violet: [238, 130, 238],\n wheat: [245, 222, 179],\n white: [255, 255, 255],\n whitesmoke: [245, 245, 245],\n yellow: [255, 255, 0],\n yellowgreen: [154, 205, 50]\n});\n\n//# sourceURL=webpack://complexes/./node_modules/color-parse/node_modules/color-name/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/color-rgba/index.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/color-rgba/index.js ***!
|
||
\******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ rgba; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var color_parse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! color-parse */ \"./node_modules/color-parse/index.js\");\n/* harmony import */ var color_space_rgb_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! color-space/rgb.js */ \"./node_modules/color-space/rgb.js\");\n/* harmony import */ var color_space_hsl_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! color-space/hsl.js */ \"./node_modules/color-space/hsl.js\");\n\n/** @module color-rgba */\n\n\n\nfunction rgba(color) {\n // template literals\n if (Array.isArray(color) && color.raw) color = String.raw(...arguments);\n if (color instanceof Number) color = +color;\n var values, i, l;\n\n //attempt to parse non-array arguments\n var parsed = (0,color_parse__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(color);\n if (!parsed.space) return [];\n const min = parsed.space[0] === 'h' ? color_space_hsl_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].min : color_space_rgb_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].min;\n const max = parsed.space[0] === 'h' ? color_space_hsl_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].max : color_space_rgb_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].max;\n values = Array(3);\n values[0] = Math.min(Math.max(parsed.values[0], min[0]), max[0]);\n values[1] = Math.min(Math.max(parsed.values[1], min[1]), max[1]);\n values[2] = Math.min(Math.max(parsed.values[2], min[2]), max[2]);\n if (parsed.space[0] === 'h') {\n values = color_space_hsl_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].rgb(values);\n }\n values.push(Math.min(Math.max(parsed.alpha, 0), 1));\n return values;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/color-rgba/index.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/color-space/hsl.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/color-space/hsl.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _rgb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rgb.js */ \"./node_modules/color-space/rgb.js\");\n/**\n * @module color-space/hsl\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'hsl',\n min: [0, 0, 0],\n max: [360, 100, 100],\n channel: ['hue', 'saturation', 'lightness'],\n alias: ['HSL'],\n rgb: function (hsl) {\n var h = hsl[0] / 360,\n s = hsl[1] / 100,\n l = hsl[2] / 100,\n t1,\n t2,\n t3,\n rgb,\n val,\n i = 0;\n if (s === 0) return val = l * 255, [val, val, val];\n t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;\n t1 = 2 * l - t2;\n rgb = [0, 0, 0];\n for (; i < 3;) {\n t3 = h + 1 / 3 * -(i - 1);\n t3 < 0 ? t3++ : t3 > 1 && t3--;\n val = 6 * t3 < 1 ? t1 + (t2 - t1) * 6 * t3 : 2 * t3 < 1 ? t2 : 3 * t3 < 2 ? t1 + (t2 - t1) * (2 / 3 - t3) * 6 : t1;\n rgb[i++] = val * 255;\n }\n return rgb;\n }\n});\n\n//extend rgb\n_rgb_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].hsl = function (rgb) {\n var r = rgb[0] / 255,\n g = rgb[1] / 255,\n b = rgb[2] / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n delta = max - min,\n h,\n s,\n l;\n if (max === min) {\n h = 0;\n } else if (r === max) {\n h = (g - b) / delta;\n } else if (g === max) {\n h = 2 + (b - r) / delta;\n } else if (b === max) {\n h = 4 + (r - g) / delta;\n }\n h = Math.min(h * 60, 360);\n if (h < 0) {\n h += 360;\n }\n l = (min + max) / 2;\n if (max === min) {\n s = 0;\n } else if (l <= 0.5) {\n s = delta / (max + min);\n } else {\n s = delta / (2 - max - min);\n }\n return [h, s * 100, l * 100];\n};\n\n//# sourceURL=webpack://complexes/./node_modules/color-space/hsl.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/color-space/lchuv.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/color-space/lchuv.js ***!
|
||
\*******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _luv_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./luv.js */ \"./node_modules/color-space/luv.js\");\n/* harmony import */ var _xyz_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./xyz.js */ \"./node_modules/color-space/xyz.js\");\n/**\n * Cylindrical CIE LUV\n *\n * @module color-space/lchuv\n */\n\n\n\n//cylindrical luv\nvar lchuv = {\n name: 'lchuv',\n channel: ['lightness', 'chroma', 'hue'],\n alias: ['LCHuv', 'cielchuv'],\n min: [0, 0, 0],\n max: [100, 100, 360],\n luv: function (luv) {\n var l = luv[0],\n c = luv[1],\n h = luv[2],\n u,\n v,\n hr;\n hr = h / 360 * 2 * Math.PI;\n u = c * Math.cos(hr);\n v = c * Math.sin(hr);\n return [l, u, v];\n },\n xyz: function (arg) {\n return _luv_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].xyz(lchuv.luv(arg));\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (lchuv);\n_luv_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].lchuv = function (luv) {\n var l = luv[0],\n u = luv[1],\n v = luv[2];\n var c = Math.sqrt(u * u + v * v);\n var hr = Math.atan2(v, u);\n var h = hr * 360 / 2 / Math.PI;\n if (h < 0) {\n h += 360;\n }\n return [l, c, h];\n};\n_xyz_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].lchuv = function (arg) {\n return _luv_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].lchuv(_xyz_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].luv(arg));\n};\n\n//# sourceURL=webpack://complexes/./node_modules/color-space/lchuv.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/color-space/luv.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/color-space/luv.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _xyz_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./xyz.js */ \"./node_modules/color-space/xyz.js\");\n/**\n * CIE LUV (C'est la vie)\n *\n * @module color-space/luv\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'luv',\n //NOTE: luv has no rigidly defined limits\n //easyrgb fails to get proper coords\n //boronine states no rigid limits\n //colorMine refers this ones:\n min: [0, -134, -140],\n max: [100, 224, 122],\n channel: ['lightness', 'u', 'v'],\n alias: ['LUV', 'cieluv', 'cie1976'],\n xyz: function (arg, i, o) {\n var _u, _v, l, u, v, x, y, z, xn, yn, zn, un, vn;\n l = arg[0], u = arg[1], v = arg[2];\n if (l === 0) return [0, 0, 0];\n\n //get constants\n //var e = 0.008856451679035631; //(6/29)^3\n var k = 0.0011070564598794539; //(3/29)^3\n\n //get illuminant/observer\n i = i || 'D65';\n o = o || 2;\n xn = _xyz_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].whitepoint[o][i][0];\n yn = _xyz_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].whitepoint[o][i][1];\n zn = _xyz_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].whitepoint[o][i][2];\n un = 4 * xn / (xn + 15 * yn + 3 * zn);\n vn = 9 * yn / (xn + 15 * yn + 3 * zn);\n // un = 0.19783000664283;\n // vn = 0.46831999493879;\n\n _u = u / (13 * l) + un || 0;\n _v = v / (13 * l) + vn || 0;\n y = l > 8 ? yn * Math.pow((l + 16) / 116, 3) : yn * l * k;\n\n //wikipedia method\n x = y * 9 * _u / (4 * _v) || 0;\n z = y * (12 - 3 * _u - 20 * _v) / (4 * _v) || 0;\n\n //boronine method\n //https://github.com/boronine/husl/blob/master/husl.coffee#L201\n // x = 0 - (9 * y * _u) / ((_u - 4) * _v - _u * _v);\n // z = (9 * y - (15 * _v * y) - (_v * x)) / (3 * _v);\n\n return [x, y, z];\n }\n});\n\n// http://www.brucelindbloom.com/index.html?Equations.html\n// https://github.com/boronine/husl/blob/master/husl.coffee\n//i - illuminant\n//o - observer\n_xyz_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].luv = function (arg, i, o) {\n var _u, _v, l, u, v, x, y, z, xn, yn, zn, un, vn;\n\n //get constants\n var e = 0.008856451679035631; //(6/29)^3\n var k = 903.2962962962961; //(29/3)^3\n\n //get illuminant/observer coords\n i = i || 'D65';\n o = o || 2;\n xn = _xyz_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].whitepoint[o][i][0];\n yn = _xyz_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].whitepoint[o][i][1];\n zn = _xyz_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].whitepoint[o][i][2];\n un = 4 * xn / (xn + 15 * yn + 3 * zn);\n vn = 9 * yn / (xn + 15 * yn + 3 * zn);\n x = arg[0], y = arg[1], z = arg[2];\n _u = 4 * x / (x + 15 * y + 3 * z) || 0;\n _v = 9 * y / (x + 15 * y + 3 * z) || 0;\n var yr = y / yn;\n l = yr <= e ? k * yr : 116 * Math.pow(yr, 1 / 3) - 16;\n u = 13 * l * (_u - un);\n v = 13 * l * (_v - vn);\n return [l, u, v];\n};\n\n//# sourceURL=webpack://complexes/./node_modules/color-space/luv.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/color-space/rgb.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/color-space/rgb.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * RGB space.\n *\n * @module color-space/rgb\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'rgb',\n min: [0, 0, 0],\n max: [255, 255, 255],\n channel: ['red', 'green', 'blue'],\n alias: ['RGB']\n});\n\n//# sourceURL=webpack://complexes/./node_modules/color-space/rgb.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/color-space/xyz.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/color-space/xyz.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _rgb_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rgb.js */ \"./node_modules/color-space/rgb.js\");\n/**\n * CIE XYZ\n *\n * @module color-space/xyz\n */\n\nvar xyz = {\n name: 'xyz',\n min: [0, 0, 0],\n channel: ['X', 'Y', 'Z'],\n alias: ['XYZ', 'ciexyz', 'cie1931']\n};\n\n/**\n * Whitepoint reference values with observer/illuminant\n *\n * http://en.wikipedia.org/wiki/Standard_illuminant\n */\nxyz.whitepoint = {\n //1931 2°\n 2: {\n //incadescent\n A: [109.85, 100, 35.585],\n // B:[],\n C: [98.074, 100, 118.232],\n D50: [96.422, 100, 82.521],\n D55: [95.682, 100, 92.149],\n //daylight\n D65: [95.045592705167, 100, 108.9057750759878],\n D75: [94.972, 100, 122.638],\n //flourescent\n // F1: [],\n F2: [99.187, 100, 67.395],\n // F3: [],\n // F4: [],\n // F5: [],\n // F6:[],\n F7: [95.044, 100, 108.755],\n // F8: [],\n // F9: [],\n // F10: [],\n F11: [100.966, 100, 64.370],\n // F12: [],\n E: [100, 100, 100]\n },\n //1964 10°\n 10: {\n //incadescent\n A: [111.144, 100, 35.200],\n C: [97.285, 100, 116.145],\n D50: [96.720, 100, 81.427],\n D55: [95.799, 100, 90.926],\n //daylight\n D65: [94.811, 100, 107.304],\n D75: [94.416, 100, 120.641],\n //flourescent\n F2: [103.280, 100, 69.026],\n F7: [95.792, 100, 107.687],\n F11: [103.866, 100, 65.627],\n E: [100, 100, 100]\n }\n};\n\n/**\n * Top values are the whitepoint’s top values, default are D65\n */\nxyz.max = xyz.whitepoint[2].D65;\n\n/**\n * Transform xyz to rgb\n *\n * @param {Array} xyz Array of xyz values\n *\n * @return {Array} RGB values\n */\nxyz.rgb = function (_xyz, white) {\n //FIXME: make sure we have to divide like this. Probably we have to replace matrix as well then\n white = white || xyz.whitepoint[2].E;\n var x = _xyz[0] / white[0],\n y = _xyz[1] / white[1],\n z = _xyz[2] / white[2],\n r,\n g,\n b;\n\n // assume sRGB\n // http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html\n r = x * 3.240969941904521 + y * -1.537383177570093 + z * -0.498610760293;\n g = x * -0.96924363628087 + y * 1.87596750150772 + z * 0.041555057407175;\n b = x * 0.055630079696993 + y * -0.20397695888897 + z * 1.056971514242878;\n r = r > 0.0031308 ? 1.055 * Math.pow(r, 1.0 / 2.4) - 0.055 : r = r * 12.92;\n g = g > 0.0031308 ? 1.055 * Math.pow(g, 1.0 / 2.4) - 0.055 : g = g * 12.92;\n b = b > 0.0031308 ? 1.055 * Math.pow(b, 1.0 / 2.4) - 0.055 : b = b * 12.92;\n r = Math.min(Math.max(0, r), 1);\n g = Math.min(Math.max(0, g), 1);\n b = Math.min(Math.max(0, b), 1);\n return [r * 255, g * 255, b * 255];\n};\n\n/**\n * RGB to XYZ\n *\n * @param {Array} rgb RGB channels\n *\n * @return {Array} XYZ channels\n */\n_rgb_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].xyz = function (rgb, white) {\n var r = rgb[0] / 255,\n g = rgb[1] / 255,\n b = rgb[2] / 255;\n\n // assume sRGB\n r = r > 0.04045 ? Math.pow((r + 0.055) / 1.055, 2.4) : r / 12.92;\n g = g > 0.04045 ? Math.pow((g + 0.055) / 1.055, 2.4) : g / 12.92;\n b = b > 0.04045 ? Math.pow((b + 0.055) / 1.055, 2.4) : b / 12.92;\n var x = r * 0.41239079926595 + g * 0.35758433938387 + b * 0.18048078840183;\n var y = r * 0.21263900587151 + g * 0.71516867876775 + b * 0.072192315360733;\n var z = r * 0.019330818715591 + g * 0.11919477979462 + b * 0.95053215224966;\n white = white || xyz.whitepoint[2].E;\n return [x * white[0], y * white[1], z * white[2]];\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (xyz);\n\n//# sourceURL=webpack://complexes/./node_modules/color-space/xyz.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/Collection.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/Collection.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CollectionEvent: function() { return /* binding */ CollectionEvent; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Object.js */ \"./node_modules/ol/Object.js\");\n/* harmony import */ var _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CollectionEventType.js */ \"./node_modules/ol/CollectionEventType.js\");\n/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./events/Event.js */ \"./node_modules/ol/events/Event.js\");\n\n/**\n * @module ol/Collection\n */\n\n\n\n\n/**\n * @enum {string}\n * @private\n */\nconst Property = {\n LENGTH: 'length'\n};\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/Collection~Collection} instances are instances of this\n * type.\n * @template T\n */\nclass CollectionEvent extends _events_Event_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {import(\"./CollectionEventType.js\").default} type Type.\n * @param {T} element Element.\n * @param {number} index The index of the added or removed element.\n */\n constructor(type, element, index) {\n super(type);\n\n /**\n * The element that is added to or removed from the collection.\n * @type {T}\n * @api\n */\n this.element = element;\n\n /**\n * The index of the added or removed element.\n * @type {number}\n * @api\n */\n this.index = index;\n }\n}\n\n/***\n * @template T\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<import(\"./ObjectEventType\").Types|'change:length', import(\"./Object\").ObjectEvent, Return> &\n * import(\"./Observable\").OnSignature<'add'|'remove', CollectionEvent<T>, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|import(\"./ObjectEventType\").Types|\n * 'change:length'|'add'|'remove',Return>} CollectionOnSignature\n */\n\n/**\n * @typedef {Object} Options\n * @property {boolean} [unique=false] Disallow the same item from being added to\n * the collection twice.\n */\n\n/**\n * @classdesc\n * An expanded version of standard JS Array, adding convenience methods for\n * manipulation. Add and remove changes to the Collection trigger a Collection\n * event. Note that this does not cover changes to the objects _within_ the\n * Collection; they trigger events on the appropriate object, not on the\n * Collection as a whole.\n *\n * @fires CollectionEvent\n *\n * @template T\n * @api\n */\nclass Collection extends _Object_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n /**\n * @param {Array<T>} [array] Array.\n * @param {Options} [options] Collection options.\n */\n constructor(array, options) {\n super();\n\n /***\n * @type {CollectionOnSignature<T, import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {CollectionOnSignature<T, import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {CollectionOnSignature<T, void>}\n */\n this.un;\n options = options || {};\n\n /**\n * @private\n * @type {boolean}\n */\n this.unique_ = !!options.unique;\n\n /**\n * @private\n * @type {!Array<T>}\n */\n this.array_ = array ? array : [];\n if (this.unique_) {\n for (let i = 0, ii = this.array_.length; i < ii; ++i) {\n this.assertUnique_(this.array_[i], i);\n }\n }\n this.updateLength_();\n }\n\n /**\n * Remove all elements from the collection.\n * @api\n */\n clear() {\n while (this.getLength() > 0) {\n this.pop();\n }\n }\n\n /**\n * Add elements to the collection. This pushes each item in the provided array\n * to the end of the collection.\n * @param {!Array<T>} arr Array.\n * @return {Collection<T>} This collection.\n * @api\n */\n extend(arr) {\n for (let i = 0, ii = arr.length; i < ii; ++i) {\n this.push(arr[i]);\n }\n return this;\n }\n\n /**\n * Iterate over each element, calling the provided callback.\n * @param {function(T, number, Array<T>): *} f The function to call\n * for every element. This function takes 3 arguments (the element, the\n * index and the array). The return value is ignored.\n * @api\n */\n forEach(f) {\n const array = this.array_;\n for (let i = 0, ii = array.length; i < ii; ++i) {\n f(array[i], i, array);\n }\n }\n\n /**\n * Get a reference to the underlying Array object. Warning: if the array\n * is mutated, no events will be dispatched by the collection, and the\n * collection's \"length\" property won't be in sync with the actual length\n * of the array.\n * @return {!Array<T>} Array.\n * @api\n */\n getArray() {\n return this.array_;\n }\n\n /**\n * Get the element at the provided index.\n * @param {number} index Index.\n * @return {T} Element.\n * @api\n */\n item(index) {\n return this.array_[index];\n }\n\n /**\n * Get the length of this collection.\n * @return {number} The length of the array.\n * @observable\n * @api\n */\n getLength() {\n return this.get(Property.LENGTH);\n }\n\n /**\n * Insert an element at the provided index.\n * @param {number} index Index.\n * @param {T} elem Element.\n * @api\n */\n insertAt(index, elem) {\n if (index < 0 || index > this.getLength()) {\n throw new Error('Index out of bounds: ' + index);\n }\n if (this.unique_) {\n this.assertUnique_(elem);\n }\n this.array_.splice(index, 0, elem);\n this.updateLength_();\n this.dispatchEvent(new CollectionEvent(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ADD, elem, index));\n }\n\n /**\n * Remove the last element of the collection and return it.\n * Return `undefined` if the collection is empty.\n * @return {T|undefined} Element.\n * @api\n */\n pop() {\n return this.removeAt(this.getLength() - 1);\n }\n\n /**\n * Insert the provided element at the end of the collection.\n * @param {T} elem Element.\n * @return {number} New length of the collection.\n * @api\n */\n push(elem) {\n if (this.unique_) {\n this.assertUnique_(elem);\n }\n const n = this.getLength();\n this.insertAt(n, elem);\n return this.getLength();\n }\n\n /**\n * Remove the first occurrence of an element from the collection.\n * @param {T} elem Element.\n * @return {T|undefined} The removed element or undefined if none found.\n * @api\n */\n remove(elem) {\n const arr = this.array_;\n for (let i = 0, ii = arr.length; i < ii; ++i) {\n if (arr[i] === elem) {\n return this.removeAt(i);\n }\n }\n return undefined;\n }\n\n /**\n * Remove the element at the provided index and return it.\n * Return `undefined` if the collection does not contain this index.\n * @param {number} index Index.\n * @return {T|undefined} Value.\n * @api\n */\n removeAt(index) {\n if (index < 0 || index >= this.getLength()) {\n return undefined;\n }\n const prev = this.array_[index];\n this.array_.splice(index, 1);\n this.updateLength_();\n this.dispatchEvent(/** @type {CollectionEvent<T>} */\n new CollectionEvent(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].REMOVE, prev, index));\n return prev;\n }\n\n /**\n * Set the element at the provided index.\n * @param {number} index Index.\n * @param {T} elem Element.\n * @api\n */\n setAt(index, elem) {\n const n = this.getLength();\n if (index >= n) {\n this.insertAt(index, elem);\n return;\n }\n if (index < 0) {\n throw new Error('Index out of bounds: ' + index);\n }\n if (this.unique_) {\n this.assertUnique_(elem, index);\n }\n const prev = this.array_[index];\n this.array_[index] = elem;\n this.dispatchEvent(/** @type {CollectionEvent<T>} */\n new CollectionEvent(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].REMOVE, prev, index));\n this.dispatchEvent(/** @type {CollectionEvent<T>} */\n new CollectionEvent(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ADD, elem, index));\n }\n\n /**\n * @private\n */\n updateLength_() {\n this.set(Property.LENGTH, this.array_.length);\n }\n\n /**\n * @private\n * @param {T} elem Element.\n * @param {number} [except] Optional index to ignore.\n */\n assertUnique_(elem, except) {\n for (let i = 0, ii = this.array_.length; i < ii; ++i) {\n if (this.array_[i] === elem && i !== except) {\n throw new Error('Duplicate item added to a unique collection');\n }\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Collection);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/Collection.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/CollectionEventType.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ol/CollectionEventType.js ***!
|
||
\************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/CollectionEventType\n */\n\n/**\n * @enum {string}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n /**\n * Triggered when an item is added to the collection.\n * @event module:ol/Collection.CollectionEvent#add\n * @api\n */\n ADD: 'add',\n /**\n * Triggered when an item is removed from the collection.\n * @event module:ol/Collection.CollectionEvent#remove\n * @api\n */\n REMOVE: 'remove'\n});\n\n//# sourceURL=webpack://complexes/./node_modules/ol/CollectionEventType.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/Disposable.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/Disposable.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/Disposable\n */\n\n/**\n * @classdesc\n * Objects that need to clean up after themselves.\n */\nclass Disposable {\n constructor() {\n /**\n * The object has already been disposed.\n * @type {boolean}\n * @protected\n */\n this.disposed = false;\n }\n\n /**\n * Clean up.\n */\n dispose() {\n if (!this.disposed) {\n this.disposed = true;\n this.disposeInternal();\n }\n }\n\n /**\n * Extension point for disposable objects.\n * @protected\n */\n disposeInternal() {}\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Disposable);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/Disposable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/Feature.js":
|
||
/*!************************************!*\
|
||
!*** ./node_modules/ol/Feature.js ***!
|
||
\************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createStyleFunction: function() { return /* binding */ createStyleFunction; }\n/* harmony export */ });\n/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Object.js */ \"./node_modules/ol/Object.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./asserts.js */ \"./node_modules/ol/asserts.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./events.js */ \"./node_modules/ol/events.js\");\n/**\n * @module ol/Feature\n */\n\n\n\n\n\n/**\n * @typedef {typeof Feature|typeof import(\"./render/Feature.js\").default} FeatureClass\n */\n\n/**\n * @typedef {Feature|import(\"./render/Feature.js\").default} FeatureLike\n */\n\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<import(\"./ObjectEventType\").Types|'change:geometry', import(\"./Object\").ObjectEvent, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|import(\"./ObjectEventType\").Types\n * |'change:geometry', Return>} FeatureOnSignature\n */\n\n/***\n * @template {import(\"./geom/Geometry.js\").default} [Geometry=import(\"./geom/Geometry.js\").default]\n * @typedef {Object<string, *> & { geometry?: Geometry }} ObjectWithGeometry\n */\n\n/**\n * @classdesc\n * A vector object for geographic features with a geometry and other\n * attribute properties, similar to the features in vector file formats like\n * GeoJSON.\n *\n * Features can be styled individually with `setStyle`; otherwise they use the\n * style of their vector layer.\n *\n * Note that attribute properties are set as {@link module:ol/Object~BaseObject} properties on\n * the feature object, so they are observable, and have get/set accessors.\n *\n * Typically, a feature has a single geometry property. You can set the\n * geometry using the `setGeometry` method and get it with `getGeometry`.\n * It is possible to store more than one geometry on a feature using attribute\n * properties. By default, the geometry used for rendering is identified by\n * the property name `geometry`. If you want to use another geometry property\n * for rendering, use the `setGeometryName` method to change the attribute\n * property associated with the geometry for the feature. For example:\n *\n * ```js\n *\n * import Feature from 'ol/Feature.js';\n * import Polygon from 'ol/geom/Polygon.js';\n * import Point from 'ol/geom/Point.js';\n *\n * const feature = new Feature({\n * geometry: new Polygon(polyCoords),\n * labelPoint: new Point(labelCoords),\n * name: 'My Polygon',\n * });\n *\n * // get the polygon geometry\n * const poly = feature.getGeometry();\n *\n * // Render the feature as a point using the coordinates from labelPoint\n * feature.setGeometryName('labelPoint');\n *\n * // get the point geometry\n * const point = feature.getGeometry();\n * ```\n *\n * @api\n * @template {import(\"./geom/Geometry.js\").default} [Geometry=import(\"./geom/Geometry.js\").default]\n */\nclass Feature extends _Object_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Geometry|ObjectWithGeometry<Geometry>} [geometryOrProperties]\n * You may pass a Geometry object directly, or an object literal containing\n * properties. If you pass an object literal, you may include a Geometry\n * associated with a `geometry` key.\n */\n constructor(geometryOrProperties) {\n super();\n\n /***\n * @type {FeatureOnSignature<import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {FeatureOnSignature<import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {FeatureOnSignature<void>}\n */\n this.un;\n\n /**\n * @private\n * @type {number|string|undefined}\n */\n this.id_ = undefined;\n\n /**\n * @type {string}\n * @private\n */\n this.geometryName_ = 'geometry';\n\n /**\n * User provided style.\n * @private\n * @type {import(\"./style/Style.js\").StyleLike}\n */\n this.style_ = null;\n\n /**\n * @private\n * @type {import(\"./style/Style.js\").StyleFunction|undefined}\n */\n this.styleFunction_ = undefined;\n\n /**\n * @private\n * @type {?import(\"./events.js\").EventsKey}\n */\n this.geometryChangeKey_ = null;\n this.addChangeListener(this.geometryName_, this.handleGeometryChanged_);\n if (geometryOrProperties) {\n if (typeof (/** @type {?} */geometryOrProperties.getSimplifiedGeometry) === 'function') {\n const geometry = /** @type {Geometry} */geometryOrProperties;\n this.setGeometry(geometry);\n } else {\n /** @type {Object<string, *>} */\n const properties = geometryOrProperties;\n this.setProperties(properties);\n }\n }\n }\n\n /**\n * Clone this feature. If the original feature has a geometry it\n * is also cloned. The feature id is not set in the clone.\n * @return {Feature<Geometry>} The clone.\n * @api\n */\n clone() {\n const clone = /** @type {Feature<Geometry>} */\n new Feature(this.hasProperties() ? this.getProperties() : null);\n clone.setGeometryName(this.getGeometryName());\n const geometry = this.getGeometry();\n if (geometry) {\n clone.setGeometry(/** @type {Geometry} */geometry.clone());\n }\n const style = this.getStyle();\n if (style) {\n clone.setStyle(style);\n }\n return clone;\n }\n\n /**\n * Get the feature's default geometry. A feature may have any number of named\n * geometries. The \"default\" geometry (the one that is rendered by default) is\n * set when calling {@link module:ol/Feature~Feature#setGeometry}.\n * @return {Geometry|undefined} The default geometry for the feature.\n * @api\n * @observable\n */\n getGeometry() {\n return /** @type {Geometry|undefined} */this.get(this.geometryName_);\n }\n\n /**\n * Get the feature identifier. This is a stable identifier for the feature and\n * is either set when reading data from a remote source or set explicitly by\n * calling {@link module:ol/Feature~Feature#setId}.\n * @return {number|string|undefined} Id.\n * @api\n */\n getId() {\n return this.id_;\n }\n\n /**\n * Get the name of the feature's default geometry. By default, the default\n * geometry is named `geometry`.\n * @return {string} Get the property name associated with the default geometry\n * for this feature.\n * @api\n */\n getGeometryName() {\n return this.geometryName_;\n }\n\n /**\n * Get the feature's style. Will return what was provided to the\n * {@link module:ol/Feature~Feature#setStyle} method.\n * @return {import(\"./style/Style.js\").StyleLike|undefined} The feature style.\n * @api\n */\n getStyle() {\n return this.style_;\n }\n\n /**\n * Get the feature's style function.\n * @return {import(\"./style/Style.js\").StyleFunction|undefined} Return a function\n * representing the current style of this feature.\n * @api\n */\n getStyleFunction() {\n return this.styleFunction_;\n }\n\n /**\n * @private\n */\n handleGeometryChange_() {\n this.changed();\n }\n\n /**\n * @private\n */\n handleGeometryChanged_() {\n if (this.geometryChangeKey_) {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_1__.unlistenByKey)(this.geometryChangeKey_);\n this.geometryChangeKey_ = null;\n }\n const geometry = this.getGeometry();\n if (geometry) {\n this.geometryChangeKey_ = (0,_events_js__WEBPACK_IMPORTED_MODULE_1__.listen)(geometry, _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].CHANGE, this.handleGeometryChange_, this);\n }\n this.changed();\n }\n\n /**\n * Set the default geometry for the feature. This will update the property\n * with the name returned by {@link module:ol/Feature~Feature#getGeometryName}.\n * @param {Geometry|undefined} geometry The new geometry.\n * @api\n * @observable\n */\n setGeometry(geometry) {\n this.set(this.geometryName_, geometry);\n }\n\n /**\n * Set the style for the feature to override the layer style. This can be a\n * single style object, an array of styles, or a function that takes a\n * resolution and returns an array of styles. To unset the feature style, call\n * `setStyle()` without arguments or a falsey value.\n * @param {import(\"./style/Style.js\").StyleLike} [style] Style for this feature.\n * @api\n * @fires module:ol/events/Event~BaseEvent#event:change\n */\n setStyle(style) {\n this.style_ = style;\n this.styleFunction_ = !style ? undefined : createStyleFunction(style);\n this.changed();\n }\n\n /**\n * Set the feature id. The feature id is considered stable and may be used when\n * requesting features or comparing identifiers returned from a remote source.\n * The feature id can be used with the\n * {@link module:ol/source/Vector~VectorSource#getFeatureById} method.\n * @param {number|string|undefined} id The feature id.\n * @api\n * @fires module:ol/events/Event~BaseEvent#event:change\n */\n setId(id) {\n this.id_ = id;\n this.changed();\n }\n\n /**\n * Set the property name to be used when getting the feature's default geometry.\n * When calling {@link module:ol/Feature~Feature#getGeometry}, the value of the property with\n * this name will be returned.\n * @param {string} name The property name of the default geometry.\n * @api\n */\n setGeometryName(name) {\n this.removeChangeListener(this.geometryName_, this.handleGeometryChanged_);\n this.geometryName_ = name;\n this.addChangeListener(this.geometryName_, this.handleGeometryChanged_);\n this.handleGeometryChanged_();\n }\n}\n\n/**\n * Convert the provided object into a feature style function. Functions passed\n * through unchanged. Arrays of Style or single style objects wrapped\n * in a new feature style function.\n * @param {!import(\"./style/Style.js\").StyleFunction|!Array<import(\"./style/Style.js\").default>|!import(\"./style/Style.js\").default} obj\n * A feature style function, a single style, or an array of styles.\n * @return {import(\"./style/Style.js\").StyleFunction} A style function.\n */\nfunction createStyleFunction(obj) {\n if (typeof obj === 'function') {\n return obj;\n }\n /**\n * @type {Array<import(\"./style/Style.js\").default>}\n */\n let styles;\n if (Array.isArray(obj)) {\n styles = obj;\n } else {\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_3__.assert)(typeof (/** @type {?} */obj.getZIndex) === 'function', 'Expected an `ol/style/Style` or an array of `ol/style/Style.js`');\n const style = /** @type {import(\"./style/Style.js\").default} */obj;\n styles = [style];\n }\n return function () {\n return styles;\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Feature);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/Feature.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/Image.js":
|
||
/*!**********************************!*\
|
||
!*** ./node_modules/ol/Image.js ***!
|
||
\**********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ decode: function() { return /* binding */ decode; },\n/* harmony export */ decodeFallback: function() { return /* binding */ decodeFallback; },\n/* harmony export */ listenImage: function() { return /* binding */ listenImage; },\n/* harmony export */ load: function() { return /* binding */ load; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _events_Target_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./events/Target.js */ \"./node_modules/ol/events/Target.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _ImageState_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ImageState.js */ \"./node_modules/ol/ImageState.js\");\n/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./has.js */ \"./node_modules/ol/has.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./events.js */ \"./node_modules/ol/events.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./functions.js */ \"./node_modules/ol/functions.js\");\n\n/**\n * @module ol/Image\n */\n\n\n\n\n\n\n\n/**\n * A function that takes an {@link module:ol/Image~ImageWrapper} for the image and a\n * `{string}` for the src as arguments. It is supposed to make it so the\n * underlying image {@link module:ol/Image~ImageWrapper#getImage} is assigned the\n * content specified by the src. If not specified, the default is\n *\n * function(image, src) {\n * image.getImage().src = src;\n * }\n *\n * Providing a custom `imageLoadFunction` can be useful to load images with\n * post requests or - in general - through XHR requests, where the src of the\n * image element would be set to a data URI when the content is loaded.\n *\n * @typedef {function(import(\"./Image.js\").default, string): void} LoadFunction\n * @api\n */\n\n/**\n * @typedef {Object} ImageObject\n * @property {import(\"./extent.js\").Extent} [extent] Extent, if different from the requested one.\n * @property {import(\"./resolution.js\").ResolutionLike} [resolution] Resolution, if different from the requested one.\n * When x and y resolution are different, use the array type (`[xResolution, yResolution]`).\n * @property {number} [pixelRatio] Pixel ratio, if different from the requested one.\n * @property {import('./DataTile.js').ImageLike} image Image.\n */\n\n/**\n * Loader function used for image sources. Receives extent, resolution and pixel ratio as arguments.\n * For images that cover any extent and resolution (static images), the loader function should not accept\n * any arguments. The function returns an {@link import(\"./DataTile.js\").ImageLike image}, an\n * {@link import(\"./Image.js\").ImageObject image object}, or a promise for the same.\n * For loaders that generate images, the promise should not resolve until the image is loaded.\n * If the returned image does not match the extent, resolution or pixel ratio passed to the loader,\n * it has to return an {@link import(\"./Image.js\").ImageObject image object} with the `image` and the\n * correct `extent`, `resolution` and `pixelRatio`.\n *\n * @typedef {function(import(\"./extent.js\").Extent, number, number, (function(HTMLImageElement, string): void)=): import(\"./DataTile.js\").ImageLike|ImageObject|Promise<import(\"./DataTile.js\").ImageLike|ImageObject>} Loader\n * @api\n */\n\n/**\n * Loader function used for image sources. Receives extent, resolution and pixel ratio as arguments.\n * The function returns a promise for an {@link import(\"./Image.js\").ImageObject image object}.\n *\n * @typedef {function(import(\"./extent.js\").Extent, number, number, (function(HTMLImageElement, string): void)=): import(\"./DataTile.js\").ImageLike|ImageObject|Promise<import(\"./DataTile.js\").ImageLike|ImageObject>} ImageObjectPromiseLoader\n */\n\nclass ImageWrapper extends _events_Target_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number|Array<number>|undefined} resolution Resolution. If provided as array, x and y\n * resolution will be assumed.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"./ImageState.js\").default|import(\"./Image.js\").Loader} stateOrLoader State.\n */\n constructor(extent, resolution, pixelRatio, stateOrLoader) {\n super();\n\n /**\n * @protected\n * @type {import(\"./extent.js\").Extent}\n */\n this.extent = extent;\n\n /**\n * @private\n * @type {number}\n */\n this.pixelRatio_ = pixelRatio;\n\n /**\n * @protected\n * @type {number|Array<number>|undefined}\n */\n this.resolution = resolution;\n\n /**\n * @protected\n * @type {import(\"./ImageState.js\").default}\n */\n this.state = typeof stateOrLoader === 'function' ? _ImageState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].IDLE : stateOrLoader;\n\n /**\n * @private\n * @type {import('./DataTile.js').ImageLike|null}\n */\n this.image_ = null;\n\n /**\n * @protected\n * @type {import(\"./Image.js\").Loader}\n */\n this.loader = typeof stateOrLoader === 'function' ? stateOrLoader : null;\n }\n\n /**\n * @protected\n */\n changed() {\n this.dispatchEvent(_events_EventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].CHANGE);\n }\n\n /**\n * @return {import(\"./extent.js\").Extent} Extent.\n */\n getExtent() {\n return this.extent;\n }\n\n /**\n * @return {import('./DataTile.js').ImageLike} Image.\n */\n getImage() {\n return this.image_;\n }\n\n /**\n * @return {number} PixelRatio.\n */\n getPixelRatio() {\n return this.pixelRatio_;\n }\n\n /**\n * @return {number|Array<number>} Resolution.\n */\n getResolution() {\n return /** @type {number} */this.resolution;\n }\n\n /**\n * @return {import(\"./ImageState.js\").default} State.\n */\n getState() {\n return this.state;\n }\n\n /**\n * Load not yet loaded URI.\n */\n load() {\n if (this.state == _ImageState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].IDLE) {\n if (this.loader) {\n this.state = _ImageState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].LOADING;\n this.changed();\n const resolution = this.getResolution();\n const requestResolution = Array.isArray(resolution) ? resolution[0] : resolution;\n (0,_functions_js__WEBPACK_IMPORTED_MODULE_4__.toPromise)(() => this.loader(this.getExtent(), requestResolution, this.getPixelRatio())).then(image => {\n if ('image' in image) {\n this.image_ = image.image;\n }\n if ('extent' in image) {\n this.extent = image.extent;\n }\n if ('resolution' in image) {\n this.resolution = image.resolution;\n }\n if ('pixelRatio' in image) {\n this.pixelRatio_ = image.pixelRatio;\n }\n if (image instanceof HTMLImageElement || image instanceof ImageBitmap || image instanceof HTMLCanvasElement || image instanceof HTMLVideoElement) {\n this.image_ = image;\n }\n this.state = _ImageState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].LOADED;\n }).catch(error => {\n this.state = _ImageState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ERROR;\n console.error(error); // eslint-disable-line no-console\n }).finally(() => this.changed());\n }\n }\n }\n\n /**\n * @param {import('./DataTile.js').ImageLike} image The image.\n */\n setImage(image) {\n this.image_ = image;\n }\n\n /**\n * @param {number|Array<number>} resolution Resolution.\n */\n setResolution(resolution) {\n this.resolution = resolution;\n }\n}\n\n/**\n * @param {import('./DataTile.js').ImageLike} image Image element.\n * @param {function():any} loadHandler Load callback function.\n * @param {function():any} errorHandler Error callback function.\n * @return {function():void} Callback to stop listening.\n */\nfunction listenImage(image, loadHandler, errorHandler) {\n const img = /** @type {HTMLImageElement} */image;\n let listening = true;\n let decoding = false;\n let loaded = false;\n const listenerKeys = [(0,_events_js__WEBPACK_IMPORTED_MODULE_5__.listenOnce)(img, _events_EventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].LOAD, function () {\n loaded = true;\n if (!decoding) {\n loadHandler();\n }\n })];\n if (img.src && _has_js__WEBPACK_IMPORTED_MODULE_6__.IMAGE_DECODE) {\n decoding = true;\n img.decode().then(function () {\n if (listening) {\n loadHandler();\n }\n }).catch(function (error) {\n if (listening) {\n if (loaded) {\n loadHandler();\n } else {\n errorHandler();\n }\n }\n });\n } else {\n listenerKeys.push((0,_events_js__WEBPACK_IMPORTED_MODULE_5__.listenOnce)(img, _events_EventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ERROR, errorHandler));\n }\n return function unlisten() {\n listening = false;\n listenerKeys.forEach(_events_js__WEBPACK_IMPORTED_MODULE_5__.unlistenByKey);\n };\n}\n\n/**\n * Loads an image.\n * @param {HTMLImageElement} image Image, not yet loaded.\n * @param {string} [src] `src` attribute of the image. Optional, not required if already present.\n * @return {Promise<HTMLImageElement>} Promise resolving to an `HTMLImageElement`.\n * @api\n */\nfunction load(image, src) {\n return new Promise((resolve, reject) => {\n function handleLoad() {\n unlisten();\n resolve(image);\n }\n function handleError() {\n unlisten();\n reject(new Error('Image load error'));\n }\n function unlisten() {\n image.removeEventListener('load', handleLoad);\n image.removeEventListener('error', handleError);\n }\n image.addEventListener('load', handleLoad);\n image.addEventListener('error', handleError);\n if (src) {\n image.src = src;\n }\n });\n}\n\n/**\n * @param {HTMLImageElement} image Image, not yet loaded.\n * @param {string} [src] `src` attribute of the image. Optional, not required if already present.\n * @return {Promise<HTMLImageElement>} Promise resolving to an `HTMLImageElement`.\n */\nfunction decodeFallback(image, src) {\n if (src) {\n image.src = src;\n }\n return image.src && _has_js__WEBPACK_IMPORTED_MODULE_6__.IMAGE_DECODE ? new Promise((resolve, reject) => image.decode().then(() => resolve(image)).catch(e => image.complete && image.width ? resolve(image) : reject(e))) : load(image);\n}\n\n/**\n * Loads an image and decodes it to an `ImageBitmap` if `createImageBitmap()` is supported. Returns\n * the loaded image otherwise.\n * @param {HTMLImageElement} image Image, not yet loaded.\n * @param {string} [src] `src` attribute of the image. Optional, not required if already present.\n * @return {Promise<ImageBitmap|HTMLImageElement>} Promise resolving to an `ImageBitmap` or an\n * `HTMLImageElement` if `createImageBitmap()` is not supported.\n * @api\n */\nfunction decode(image, src) {\n if (src) {\n image.src = src;\n }\n return image.src && _has_js__WEBPACK_IMPORTED_MODULE_6__.IMAGE_DECODE && _has_js__WEBPACK_IMPORTED_MODULE_6__.CREATE_IMAGE_BITMAP ? image.decode().then(() => createImageBitmap(image)).catch(e => {\n if (image.complete && image.width) {\n return image;\n }\n throw e;\n }) : decodeFallback(image);\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (ImageWrapper);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/Image.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/ImageState.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/ImageState.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/ImageState\n */\n\n/**\n * @enum {number}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n IDLE: 0,\n LOADING: 1,\n LOADED: 2,\n ERROR: 3,\n EMPTY: 4\n});\n\n//# sourceURL=webpack://complexes/./node_modules/ol/ImageState.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/Kinetic.js":
|
||
/*!************************************!*\
|
||
!*** ./node_modules/ol/Kinetic.js ***!
|
||
\************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n\n/**\n * @module ol/Kinetic\n */\n\n/**\n * @classdesc\n * Implementation of inertial deceleration for map movement.\n *\n * @api\n */\nclass Kinetic {\n /**\n * @param {number} decay Rate of decay (must be negative).\n * @param {number} minVelocity Minimum velocity (pixels/millisecond).\n * @param {number} delay Delay to consider to calculate the kinetic\n * initial values (milliseconds).\n */\n constructor(decay, minVelocity, delay) {\n /**\n * @private\n * @type {number}\n */\n this.decay_ = decay;\n\n /**\n * @private\n * @type {number}\n */\n this.minVelocity_ = minVelocity;\n\n /**\n * @private\n * @type {number}\n */\n this.delay_ = delay;\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.points_ = [];\n\n /**\n * @private\n * @type {number}\n */\n this.angle_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.initialVelocity_ = 0;\n }\n\n /**\n * FIXME empty description for jsdoc\n */\n begin() {\n this.points_.length = 0;\n this.angle_ = 0;\n this.initialVelocity_ = 0;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n */\n update(x, y) {\n this.points_.push(x, y, Date.now());\n }\n\n /**\n * @return {boolean} Whether we should do kinetic animation.\n */\n end() {\n if (this.points_.length < 6) {\n // at least 2 points are required (i.e. there must be at least 6 elements\n // in the array)\n return false;\n }\n const delay = Date.now() - this.delay_;\n const lastIndex = this.points_.length - 3;\n if (this.points_[lastIndex + 2] < delay) {\n // the last tracked point is too old, which means that the user stopped\n // panning before releasing the map\n return false;\n }\n\n // get the first point which still falls into the delay time\n let firstIndex = lastIndex - 3;\n while (firstIndex > 0 && this.points_[firstIndex + 2] > delay) {\n firstIndex -= 3;\n }\n const duration = this.points_[lastIndex + 2] - this.points_[firstIndex + 2];\n // we don't want a duration of 0 (divide by zero)\n // we also make sure the user panned for a duration of at least one frame\n // (1/60s) to compute sane displacement values\n if (duration < 1000 / 60) {\n return false;\n }\n const dx = this.points_[lastIndex] - this.points_[firstIndex];\n const dy = this.points_[lastIndex + 1] - this.points_[firstIndex + 1];\n this.angle_ = Math.atan2(dy, dx);\n this.initialVelocity_ = Math.sqrt(dx * dx + dy * dy) / duration;\n return this.initialVelocity_ > this.minVelocity_;\n }\n\n /**\n * @return {number} Total distance travelled (pixels).\n */\n getDistance() {\n return (this.minVelocity_ - this.initialVelocity_) / this.decay_;\n }\n\n /**\n * @return {number} Angle of the kinetic panning animation (radians).\n */\n getAngle() {\n return this.angle_;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Kinetic);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/Kinetic.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/Map.js":
|
||
/*!********************************!*\
|
||
!*** ./node_modules/ol/Map.js ***!
|
||
\********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Object.js */ \"./node_modules/ol/Object.js\");\n/* harmony import */ var _Collection_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Collection.js */ \"./node_modules/ol/Collection.js\");\n/* harmony import */ var _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./CollectionEventType.js */ \"./node_modules/ol/CollectionEventType.js\");\n/* harmony import */ var _renderer_Composite_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./renderer/Composite.js */ \"./node_modules/ol/renderer/Composite.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _layer_Layer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./layer/Layer.js */ \"./node_modules/ol/layer/Layer.js\");\n/* harmony import */ var _layer_Group_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./layer/Group.js */ \"./node_modules/ol/layer/Group.js\");\n/* harmony import */ var _MapBrowserEvent_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./MapBrowserEvent.js */ \"./node_modules/ol/MapBrowserEvent.js\");\n/* harmony import */ var _MapBrowserEventHandler_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./MapBrowserEventHandler.js */ \"./node_modules/ol/MapBrowserEventHandler.js\");\n/* harmony import */ var _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./MapBrowserEventType.js */ \"./node_modules/ol/MapBrowserEventType.js\");\n/* harmony import */ var _MapEvent_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./MapEvent.js */ \"./node_modules/ol/MapEvent.js\");\n/* harmony import */ var _MapEventType_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./MapEventType.js */ \"./node_modules/ol/MapEventType.js\");\n/* harmony import */ var _MapProperty_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./MapProperty.js */ \"./node_modules/ol/MapProperty.js\");\n/* harmony import */ var _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./ObjectEventType.js */ \"./node_modules/ol/ObjectEventType.js\");\n/* harmony import */ var _pointer_EventType_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./pointer/EventType.js */ \"./node_modules/ol/pointer/EventType.js\");\n/* harmony import */ var _render_EventType_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./render/EventType.js */ \"./node_modules/ol/render/EventType.js\");\n/* harmony import */ var _TileQueue_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./TileQueue.js */ \"./node_modules/ol/TileQueue.js\");\n/* harmony import */ var _View_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./View.js */ \"./node_modules/ol/View.js\");\n/* harmony import */ var _ViewHint_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./ViewHint.js */ \"./node_modules/ol/ViewHint.js\");\n/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./has.js */ \"./node_modules/ol/has.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./transform.js */ \"./node_modules/ol/transform.js\");\n/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./asserts.js */ \"./node_modules/ol/asserts.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _control_defaults_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./control/defaults.js */ \"./node_modules/ol/control/defaults.js\");\n/* harmony import */ var _interaction_defaults_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./interaction/defaults.js */ \"./node_modules/ol/interaction/defaults.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./proj.js */ \"./node_modules/ol/proj.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./size.js */ \"./node_modules/ol/size.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./events.js */ \"./node_modules/ol/events.js\");\n/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./dom.js */ \"./node_modules/ol/dom.js\");\n/* harmony import */ var _console_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./console.js */ \"./node_modules/ol/console.js\");\n\n/**\n * @module ol/Map\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * State of the current frame. Only `pixelRatio`, `time` and `viewState` should\n * be used in applications.\n * @typedef {Object} FrameState\n * @property {number} pixelRatio The pixel ratio of the frame.\n * @property {number} time The time when rendering of the frame was requested.\n * @property {import(\"./View.js\").State} viewState The state of the current view.\n * @property {boolean} animate Animate.\n * @property {import(\"./transform.js\").Transform} coordinateToPixelTransform CoordinateToPixelTransform.\n * @property {import(\"rbush\").default} declutterTree DeclutterTree.\n * @property {null|import(\"./extent.js\").Extent} extent Extent (in view projection coordinates).\n * @property {import(\"./extent.js\").Extent} [nextExtent] Next extent during an animation series.\n * @property {number} index Index.\n * @property {Array<import(\"./layer/Layer.js\").State>} layerStatesArray LayerStatesArray.\n * @property {number} layerIndex LayerIndex.\n * @property {import(\"./transform.js\").Transform} pixelToCoordinateTransform PixelToCoordinateTransform.\n * @property {Array<PostRenderFunction>} postRenderFunctions PostRenderFunctions.\n * @property {import(\"./size.js\").Size} size Size.\n * @property {TileQueue} tileQueue TileQueue.\n * @property {!Object<string, Object<string, boolean>>} usedTiles UsedTiles.\n * @property {Array<number>} viewHints ViewHints.\n * @property {!Object<string, Object<string, boolean>>} wantedTiles WantedTiles.\n * @property {string} mapId The id of the map.\n * @property {Object<string, boolean>} renderTargets Identifiers of previously rendered elements.\n */\n\n/**\n * @typedef {function(Map, ?FrameState): any} PostRenderFunction\n */\n\n/**\n * @typedef {Object} AtPixelOptions\n * @property {undefined|function(import(\"./layer/Layer.js\").default<import(\"./source/Source\").default>): boolean} [layerFilter] Layer filter\n * function. The filter function will receive one argument, the\n * {@link module:ol/layer/Layer~Layer layer-candidate} and it should return a boolean value.\n * Only layers which are visible and for which this function returns `true`\n * will be tested for features. By default, all visible layers will be tested.\n * @property {number} [hitTolerance=0] Hit-detection tolerance in css pixels. Pixels\n * inside the radius around the given position will be checked for features.\n * @property {boolean} [checkWrapped=true] Check-Wrapped Will check for wrapped geometries inside the range of\n * +/- 1 world width. Works only if a projection is used that can be wrapped.\n */\n\n/**\n * @typedef {Object} MapOptionsInternal\n * @property {Collection<import(\"./control/Control.js\").default>} [controls] Controls.\n * @property {Collection<import(\"./interaction/Interaction.js\").default>} [interactions] Interactions.\n * @property {HTMLElement|Document} keyboardEventTarget KeyboardEventTarget.\n * @property {Collection<import(\"./Overlay.js\").default>} overlays Overlays.\n * @property {Object<string, *>} values Values.\n */\n\n/**\n * @typedef {import(\"./ObjectEventType\").Types|'change:layergroup'|'change:size'|'change:target'|'change:view'} MapObjectEventTypes\n */\n\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<MapObjectEventTypes, import(\"./Object\").ObjectEvent, Return> &\n * import(\"./Observable\").OnSignature<import(\"./MapBrowserEventType\").Types, import(\"./MapBrowserEvent\").default, Return> &\n * import(\"./Observable\").OnSignature<import(\"./MapEventType\").Types, import(\"./MapEvent\").default, Return> &\n * import(\"./Observable\").OnSignature<import(\"./render/EventType\").MapRenderEventTypes, import(\"./render/Event\").default, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|MapObjectEventTypes|\n * import(\"./MapBrowserEventType\").Types|import(\"./MapEventType\").Types|\n * import(\"./render/EventType\").MapRenderEventTypes, Return>} MapEventHandler\n */\n\n/**\n * Object literal with config options for the map.\n * @typedef {Object} MapOptions\n * @property {Collection<import(\"./control/Control.js\").default>|Array<import(\"./control/Control.js\").default>} [controls]\n * Controls initially added to the map. If not specified,\n * {@link module:ol/control/defaults.defaults} is used.\n * @property {number} [pixelRatio=window.devicePixelRatio] The ratio between\n * physical pixels and device-independent pixels (dips) on the device.\n * @property {Collection<import(\"./interaction/Interaction.js\").default>|Array<import(\"./interaction/Interaction.js\").default>} [interactions]\n * Interactions that are initially added to the map. If not specified,\n * {@link module:ol/interaction/defaults.defaults} is used.\n * @property {HTMLElement|Document|string} [keyboardEventTarget] The element to\n * listen to keyboard events on. This determines when the `KeyboardPan` and\n * `KeyboardZoom` interactions trigger. For example, if this option is set to\n * `document` the keyboard interactions will always trigger. If this option is\n * not specified, the element the library listens to keyboard events on is the\n * map target (i.e. the user-provided div for the map). If this is not\n * `document`, the target element needs to be focused for key events to be\n * emitted, requiring that the target element has a `tabindex` attribute.\n * @property {Array<import(\"./layer/Base.js\").default>|Collection<import(\"./layer/Base.js\").default>|LayerGroup} [layers]\n * Layers. If this is not defined, a map with no layers will be rendered. Note\n * that layers are rendered in the order supplied, so if you want, for example,\n * a vector layer to appear on top of a tile layer, it must come after the tile\n * layer.\n * @property {number} [maxTilesLoading=16] Maximum number tiles to load\n * simultaneously.\n * @property {number} [moveTolerance=1] The minimum distance in pixels the\n * cursor must move to be detected as a map move event instead of a click.\n * Increasing this value can make it easier to click on the map.\n * @property {Collection<import(\"./Overlay.js\").default>|Array<import(\"./Overlay.js\").default>} [overlays]\n * Overlays initially added to the map. By default, no overlays are added.\n * @property {HTMLElement|string} [target] The container for the map, either the\n * element itself or the `id` of the element. If not specified at construction\n * time, {@link module:ol/Map~Map#setTarget} must be called for the map to be\n * rendered. If passed by element, the container can be in a secondary document.\n * **Note:** CSS `transform` support for the target element is limited to `scale`.\n * @property {View|Promise<import(\"./View.js\").ViewOptions>} [view] The map's view. No layer sources will be\n * fetched unless this is specified at construction time or through\n * {@link module:ol/Map~Map#setView}.\n */\n\n/**\n * @param {import(\"./layer/Base.js\").default} layer Layer.\n */\nfunction removeLayerMapProperty(layer) {\n if (layer instanceof _layer_Layer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]) {\n layer.setMapInternal(null);\n return;\n }\n if (layer instanceof _layer_Group_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n layer.getLayers().forEach(removeLayerMapProperty);\n }\n}\n\n/**\n * @param {import(\"./layer/Base.js\").default} layer Layer.\n * @param {Map} map Map.\n */\nfunction setLayerMapProperty(layer, map) {\n if (layer instanceof _layer_Layer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]) {\n layer.setMapInternal(map);\n return;\n }\n if (layer instanceof _layer_Group_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n const layers = layer.getLayers().getArray();\n for (let i = 0, ii = layers.length; i < ii; ++i) {\n setLayerMapProperty(layers[i], map);\n }\n }\n}\n\n/**\n * @classdesc\n * The map is the core component of OpenLayers. For a map to render, a view,\n * one or more layers, and a target container are needed:\n *\n * import Map from 'ol/Map.js';\n * import View from 'ol/View.js';\n * import TileLayer from 'ol/layer/Tile.js';\n * import OSM from 'ol/source/OSM.js';\n *\n * const map = new Map({\n * view: new View({\n * center: [0, 0],\n * zoom: 1,\n * }),\n * layers: [\n * new TileLayer({\n * source: new OSM(),\n * }),\n * ],\n * target: 'map',\n * });\n *\n * The above snippet creates a map using a {@link module:ol/layer/Tile~TileLayer} to\n * display {@link module:ol/source/OSM~OSM} OSM data and render it to a DOM\n * element with the id `map`.\n *\n * The constructor places a viewport container (with CSS class name\n * `ol-viewport`) in the target element (see `getViewport()`), and then two\n * further elements within the viewport: one with CSS class name\n * `ol-overlaycontainer-stopevent` for controls and some overlays, and one with\n * CSS class name `ol-overlaycontainer` for other overlays (see the `stopEvent`\n * option of {@link module:ol/Overlay~Overlay} for the difference). The map\n * itself is placed in a further element within the viewport.\n *\n * Layers are stored as a {@link module:ol/Collection~Collection} in\n * layerGroups. A top-level group is provided by the library. This is what is\n * accessed by `getLayerGroup` and `setLayerGroup`. Layers entered in the\n * options are added to this group, and `addLayer` and `removeLayer` change the\n * layer collection in the group. `getLayers` is a convenience function for\n * `getLayerGroup().getLayers()`. Note that {@link module:ol/layer/Group~LayerGroup}\n * is a subclass of {@link module:ol/layer/Base~BaseLayer}, so layers entered in the\n * options or added with `addLayer` can be groups, which can contain further\n * groups, and so on.\n *\n * @fires import(\"./MapBrowserEvent.js\").MapBrowserEvent\n * @fires import(\"./MapEvent.js\").MapEvent\n * @fires import(\"./render/Event.js\").default#precompose\n * @fires import(\"./render/Event.js\").default#postcompose\n * @fires import(\"./render/Event.js\").default#rendercomplete\n * @api\n */\nclass Map extends _Object_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"] {\n /**\n * @param {MapOptions} [options] Map options.\n */\n constructor(options) {\n super();\n options = options || {};\n\n /***\n * @type {MapEventHandler<import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {MapEventHandler<import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {MapEventHandler<void>}\n */\n this.un;\n const optionsInternal = createOptionsInternal(options);\n\n /**\n * @private\n * @type {boolean|undefined}\n */\n this.renderComplete_;\n\n /**\n * @private\n * @type {boolean}\n */\n this.loaded_ = true;\n\n /** @private */\n this.boundHandleBrowserEvent_ = this.handleBrowserEvent.bind(this);\n\n /**\n * @type {number}\n * @private\n */\n this.maxTilesLoading_ = options.maxTilesLoading !== undefined ? options.maxTilesLoading : 16;\n\n /**\n * @private\n * @type {number}\n */\n this.pixelRatio_ = options.pixelRatio !== undefined ? options.pixelRatio : _has_js__WEBPACK_IMPORTED_MODULE_5__.DEVICE_PIXEL_RATIO;\n\n /**\n * @private\n * @type {ReturnType<typeof setTimeout>}\n */\n this.postRenderTimeoutHandle_;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.animationDelayKey_;\n\n /**\n * @private\n */\n this.animationDelay_ = this.animationDelay_.bind(this);\n\n /**\n * @private\n * @type {import(\"./transform.js\").Transform}\n */\n this.coordinateToPixelTransform_ = (0,_transform_js__WEBPACK_IMPORTED_MODULE_6__.create)();\n\n /**\n * @private\n * @type {import(\"./transform.js\").Transform}\n */\n this.pixelToCoordinateTransform_ = (0,_transform_js__WEBPACK_IMPORTED_MODULE_6__.create)();\n\n /**\n * @private\n * @type {number}\n */\n this.frameIndex_ = 0;\n\n /**\n * @private\n * @type {?FrameState}\n */\n this.frameState_ = null;\n\n /**\n * The extent at the previous 'moveend' event.\n * @private\n * @type {import(\"./extent.js\").Extent}\n */\n this.previousExtent_ = null;\n\n /**\n * @private\n * @type {?import(\"./events.js\").EventsKey}\n */\n this.viewPropertyListenerKey_ = null;\n\n /**\n * @private\n * @type {?import(\"./events.js\").EventsKey}\n */\n this.viewChangeListenerKey_ = null;\n\n /**\n * @private\n * @type {?Array<import(\"./events.js\").EventsKey>}\n */\n this.layerGroupPropertyListenerKeys_ = null;\n\n /**\n * @private\n * @type {!HTMLElement}\n */\n this.viewport_ = document.createElement('div');\n this.viewport_.className = 'ol-viewport' + ('ontouchstart' in window ? ' ol-touch' : '');\n this.viewport_.style.position = 'relative';\n this.viewport_.style.overflow = 'hidden';\n this.viewport_.style.width = '100%';\n this.viewport_.style.height = '100%';\n\n /**\n * @private\n * @type {!HTMLElement}\n */\n this.overlayContainer_ = document.createElement('div');\n this.overlayContainer_.style.position = 'absolute';\n this.overlayContainer_.style.zIndex = '0';\n this.overlayContainer_.style.width = '100%';\n this.overlayContainer_.style.height = '100%';\n this.overlayContainer_.style.pointerEvents = 'none';\n this.overlayContainer_.className = 'ol-overlaycontainer';\n this.viewport_.appendChild(this.overlayContainer_);\n\n /**\n * @private\n * @type {!HTMLElement}\n */\n this.overlayContainerStopEvent_ = document.createElement('div');\n this.overlayContainerStopEvent_.style.position = 'absolute';\n this.overlayContainerStopEvent_.style.zIndex = '0';\n this.overlayContainerStopEvent_.style.width = '100%';\n this.overlayContainerStopEvent_.style.height = '100%';\n this.overlayContainerStopEvent_.style.pointerEvents = 'none';\n this.overlayContainerStopEvent_.className = 'ol-overlaycontainer-stopevent';\n this.viewport_.appendChild(this.overlayContainerStopEvent_);\n\n /**\n * @private\n * @type {MapBrowserEventHandler}\n */\n this.mapBrowserEventHandler_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.moveTolerance_ = options.moveTolerance;\n\n /**\n * @private\n * @type {HTMLElement|Document}\n */\n this.keyboardEventTarget_ = optionsInternal.keyboardEventTarget;\n\n /**\n * @private\n * @type {?Array<import(\"./events.js\").EventsKey>}\n */\n this.targetChangeHandlerKeys_ = null;\n\n /**\n * @private\n * @type {HTMLElement|null}\n */\n this.targetElement_ = null;\n\n /**\n * @type {ResizeObserver}\n */\n this.resizeObserver_ = new ResizeObserver(() => this.updateSize());\n\n /**\n * @type {Collection<import(\"./control/Control.js\").default>}\n * @protected\n */\n this.controls = optionsInternal.controls || (0,_control_defaults_js__WEBPACK_IMPORTED_MODULE_7__.defaults)();\n\n /**\n * @type {Collection<import(\"./interaction/Interaction.js\").default>}\n * @protected\n */\n this.interactions = optionsInternal.interactions || (0,_interaction_defaults_js__WEBPACK_IMPORTED_MODULE_8__.defaults)({\n onFocusOnly: true\n });\n\n /**\n * @type {Collection<import(\"./Overlay.js\").default>}\n * @private\n */\n this.overlays_ = optionsInternal.overlays;\n\n /**\n * A lookup of overlays by id.\n * @private\n * @type {Object<string, import(\"./Overlay.js\").default>}\n */\n this.overlayIdIndex_ = {};\n\n /**\n * @type {import(\"./renderer/Map.js\").default|null}\n * @private\n */\n this.renderer_ = null;\n\n /**\n * @private\n * @type {!Array<PostRenderFunction>}\n */\n this.postRenderFunctions_ = [];\n\n /**\n * @private\n * @type {TileQueue}\n */\n this.tileQueue_ = new _TileQueue_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"](this.getTilePriority.bind(this), this.handleTileChange_.bind(this));\n this.addChangeListener(_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].LAYERGROUP, this.handleLayerGroupChanged_);\n this.addChangeListener(_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].VIEW, this.handleViewChanged_);\n this.addChangeListener(_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].SIZE, this.handleSizeChanged_);\n this.addChangeListener(_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].TARGET, this.handleTargetChanged_);\n\n // setProperties will trigger the rendering of the map if the map\n // is \"defined\" already.\n this.setProperties(optionsInternal.values);\n const map = this;\n if (options.view && !(options.view instanceof _View_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"])) {\n options.view.then(function (viewOptions) {\n map.setView(new _View_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"](viewOptions));\n });\n }\n this.controls.addEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"].ADD,\n /**\n * @param {import(\"./Collection.js\").CollectionEvent<import(\"./control/Control.js\").default>} event CollectionEvent\n */\n event => {\n event.element.setMap(this);\n });\n this.controls.addEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"].REMOVE,\n /**\n * @param {import(\"./Collection.js\").CollectionEvent<import(\"./control/Control.js\").default>} event CollectionEvent.\n */\n event => {\n event.element.setMap(null);\n });\n this.interactions.addEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"].ADD,\n /**\n * @param {import(\"./Collection.js\").CollectionEvent<import(\"./interaction/Interaction.js\").default>} event CollectionEvent.\n */\n event => {\n event.element.setMap(this);\n });\n this.interactions.addEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"].REMOVE,\n /**\n * @param {import(\"./Collection.js\").CollectionEvent<import(\"./interaction/Interaction.js\").default>} event CollectionEvent.\n */\n event => {\n event.element.setMap(null);\n });\n this.overlays_.addEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"].ADD,\n /**\n * @param {import(\"./Collection.js\").CollectionEvent<import(\"./Overlay.js\").default>} event CollectionEvent.\n */\n event => {\n this.addOverlayInternal_(event.element);\n });\n this.overlays_.addEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"].REMOVE,\n /**\n * @param {import(\"./Collection.js\").CollectionEvent<import(\"./Overlay.js\").default>} event CollectionEvent.\n */\n event => {\n const id = event.element.getId();\n if (id !== undefined) {\n delete this.overlayIdIndex_[id.toString()];\n }\n event.element.setMap(null);\n });\n this.controls.forEach(\n /**\n * @param {import(\"./control/Control.js\").default} control Control.\n */\n control => {\n control.setMap(this);\n });\n this.interactions.forEach(\n /**\n * @param {import(\"./interaction/Interaction.js\").default} interaction Interaction.\n */\n interaction => {\n interaction.setMap(this);\n });\n this.overlays_.forEach(this.addOverlayInternal_.bind(this));\n }\n\n /**\n * Add the given control to the map.\n * @param {import(\"./control/Control.js\").default} control Control.\n * @api\n */\n addControl(control) {\n this.getControls().push(control);\n }\n\n /**\n * Add the given interaction to the map. If you want to add an interaction\n * at another point of the collection use `getInteractions()` and the methods\n * available on {@link module:ol/Collection~Collection}. This can be used to\n * stop the event propagation from the handleEvent function. The interactions\n * get to handle the events in the reverse order of this collection.\n * @param {import(\"./interaction/Interaction.js\").default} interaction Interaction to add.\n * @api\n */\n addInteraction(interaction) {\n this.getInteractions().push(interaction);\n }\n\n /**\n * Adds the given layer to the top of this map. If you want to add a layer\n * elsewhere in the stack, use `getLayers()` and the methods available on\n * {@link module:ol/Collection~Collection}.\n * @param {import(\"./layer/Base.js\").default} layer Layer.\n * @api\n */\n addLayer(layer) {\n const layers = this.getLayerGroup().getLayers();\n layers.push(layer);\n }\n\n /**\n * @param {import(\"./layer/Group.js\").GroupEvent} event The layer add event.\n * @private\n */\n handleLayerAdd_(event) {\n setLayerMapProperty(event.layer, this);\n }\n\n /**\n * Add the given overlay to the map.\n * @param {import(\"./Overlay.js\").default} overlay Overlay.\n * @api\n */\n addOverlay(overlay) {\n this.getOverlays().push(overlay);\n }\n\n /**\n * This deals with map's overlay collection changes.\n * @param {import(\"./Overlay.js\").default} overlay Overlay.\n * @private\n */\n addOverlayInternal_(overlay) {\n const id = overlay.getId();\n if (id !== undefined) {\n this.overlayIdIndex_[id.toString()] = overlay;\n }\n overlay.setMap(this);\n }\n\n /**\n *\n * Clean up.\n */\n disposeInternal() {\n this.controls.clear();\n this.interactions.clear();\n this.overlays_.clear();\n this.resizeObserver_.disconnect();\n this.setTarget(null);\n super.disposeInternal();\n }\n\n /**\n * Detect features that intersect a pixel on the viewport, and execute a\n * callback with each intersecting feature. Layers included in the detection can\n * be configured through the `layerFilter` option in `options`.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel.\n * @param {function(import(\"./Feature.js\").FeatureLike, import(\"./layer/Layer.js\").default<import(\"./source/Source\").default>, import(\"./geom/SimpleGeometry.js\").default): T} callback Feature callback. The callback will be\n * called with two arguments. The first argument is one\n * {@link module:ol/Feature~Feature feature} or\n * {@link module:ol/render/Feature~RenderFeature render feature} at the pixel, the second is\n * the {@link module:ol/layer/Layer~Layer layer} of the feature and will be null for\n * unmanaged layers. To stop detection, callback functions can return a\n * truthy value.\n * @param {AtPixelOptions} [options] Optional options.\n * @return {T|undefined} Callback result, i.e. the return value of last\n * callback execution, or the first truthy callback return value.\n * @template T\n * @api\n */\n forEachFeatureAtPixel(pixel, callback, options) {\n if (!this.frameState_ || !this.renderer_) {\n return;\n }\n const coordinate = this.getCoordinateFromPixelInternal(pixel);\n options = options !== undefined ? options : {};\n const hitTolerance = options.hitTolerance !== undefined ? options.hitTolerance : 0;\n const layerFilter = options.layerFilter !== undefined ? options.layerFilter : _functions_js__WEBPACK_IMPORTED_MODULE_13__.TRUE;\n const checkWrapped = options.checkWrapped !== false;\n return this.renderer_.forEachFeatureAtCoordinate(coordinate, this.frameState_, hitTolerance, checkWrapped, callback, null, layerFilter, null);\n }\n\n /**\n * Get all features that intersect a pixel on the viewport.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel.\n * @param {AtPixelOptions} [options] Optional options.\n * @return {Array<import(\"./Feature.js\").FeatureLike>} The detected features or\n * an empty array if none were found.\n * @api\n */\n getFeaturesAtPixel(pixel, options) {\n const features = [];\n this.forEachFeatureAtPixel(pixel, function (feature) {\n features.push(feature);\n }, options);\n return features;\n }\n\n /**\n * Get all layers from all layer groups.\n * @return {Array<import(\"./layer/Layer.js\").default>} Layers.\n * @api\n */\n getAllLayers() {\n const layers = [];\n function addLayersFrom(layerGroup) {\n layerGroup.forEach(function (layer) {\n if (layer instanceof _layer_Group_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n addLayersFrom(layer.getLayers());\n } else {\n layers.push(layer);\n }\n });\n }\n addLayersFrom(this.getLayers());\n return layers;\n }\n\n /**\n * Detect if features intersect a pixel on the viewport. Layers included in the\n * detection can be configured through the `layerFilter` option.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel.\n * @param {AtPixelOptions} [options] Optional options.\n * @return {boolean} Is there a feature at the given pixel?\n * @api\n */\n hasFeatureAtPixel(pixel, options) {\n if (!this.frameState_ || !this.renderer_) {\n return false;\n }\n const coordinate = this.getCoordinateFromPixelInternal(pixel);\n options = options !== undefined ? options : {};\n const layerFilter = options.layerFilter !== undefined ? options.layerFilter : _functions_js__WEBPACK_IMPORTED_MODULE_13__.TRUE;\n const hitTolerance = options.hitTolerance !== undefined ? options.hitTolerance : 0;\n const checkWrapped = options.checkWrapped !== false;\n return this.renderer_.hasFeatureAtCoordinate(coordinate, this.frameState_, hitTolerance, checkWrapped, layerFilter, null);\n }\n\n /**\n * Returns the coordinate in user projection for a browser event.\n * @param {MouseEvent} event Event.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate.\n * @api\n */\n getEventCoordinate(event) {\n return this.getCoordinateFromPixel(this.getEventPixel(event));\n }\n\n /**\n * Returns the coordinate in view projection for a browser event.\n * @param {MouseEvent} event Event.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate.\n */\n getEventCoordinateInternal(event) {\n return this.getCoordinateFromPixelInternal(this.getEventPixel(event));\n }\n\n /**\n * Returns the map pixel position for a browser event relative to the viewport.\n * @param {UIEvent|{clientX: number, clientY: number}} event Event.\n * @return {import(\"./pixel.js\").Pixel} Pixel.\n * @api\n */\n getEventPixel(event) {\n const viewport = this.viewport_;\n const viewportPosition = viewport.getBoundingClientRect();\n const viewportSize = this.getSize();\n const scaleX = viewportPosition.width / viewportSize[0];\n const scaleY = viewportPosition.height / viewportSize[1];\n const eventPosition =\n //FIXME Are we really calling this with a TouchEvent anywhere?\n 'changedTouches' in event ? /** @type {TouchEvent} */event.changedTouches[0] : (/** @type {MouseEvent} */event);\n return [(eventPosition.clientX - viewportPosition.left) / scaleX, (eventPosition.clientY - viewportPosition.top) / scaleY];\n }\n\n /**\n * Get the target in which this map is rendered.\n * Note that this returns what is entered as an option or in setTarget:\n * if that was an element, it returns an element; if a string, it returns that.\n * @return {HTMLElement|string|undefined} The Element or id of the Element that the\n * map is rendered in.\n * @observable\n * @api\n */\n getTarget() {\n return /** @type {HTMLElement|string|undefined} */this.get(_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].TARGET);\n }\n\n /**\n * Get the DOM element into which this map is rendered. In contrast to\n * `getTarget` this method always return an `Element`, or `null` if the\n * map has no target.\n * @return {HTMLElement} The element that the map is rendered in.\n * @api\n */\n getTargetElement() {\n return this.targetElement_;\n }\n\n /**\n * Get the coordinate for a given pixel. This returns a coordinate in the\n * user projection.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel position in the map viewport.\n * @return {import(\"./coordinate.js\").Coordinate} The coordinate for the pixel position.\n * @api\n */\n getCoordinateFromPixel(pixel) {\n return (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserCoordinate)(this.getCoordinateFromPixelInternal(pixel), this.getView().getProjection());\n }\n\n /**\n * Get the coordinate for a given pixel. This returns a coordinate in the\n * map view projection.\n * @param {import(\"./pixel.js\").Pixel} pixel Pixel position in the map viewport.\n * @return {import(\"./coordinate.js\").Coordinate} The coordinate for the pixel position.\n */\n getCoordinateFromPixelInternal(pixel) {\n const frameState = this.frameState_;\n if (!frameState) {\n return null;\n }\n return (0,_transform_js__WEBPACK_IMPORTED_MODULE_6__.apply)(frameState.pixelToCoordinateTransform, pixel.slice());\n }\n\n /**\n * Get the map controls. Modifying this collection changes the controls\n * associated with the map.\n * @return {Collection<import(\"./control/Control.js\").default>} Controls.\n * @api\n */\n getControls() {\n return this.controls;\n }\n\n /**\n * Get the map overlays. Modifying this collection changes the overlays\n * associated with the map.\n * @return {Collection<import(\"./Overlay.js\").default>} Overlays.\n * @api\n */\n getOverlays() {\n return this.overlays_;\n }\n\n /**\n * Get an overlay by its identifier (the value returned by overlay.getId()).\n * Note that the index treats string and numeric identifiers as the same. So\n * `map.getOverlayById(2)` will return an overlay with id `'2'` or `2`.\n * @param {string|number} id Overlay identifier.\n * @return {import(\"./Overlay.js\").default} Overlay.\n * @api\n */\n getOverlayById(id) {\n const overlay = this.overlayIdIndex_[id.toString()];\n return overlay !== undefined ? overlay : null;\n }\n\n /**\n * Get the map interactions. Modifying this collection changes the interactions\n * associated with the map.\n *\n * Interactions are used for e.g. pan, zoom and rotate.\n * @return {Collection<import(\"./interaction/Interaction.js\").default>} Interactions.\n * @api\n */\n getInteractions() {\n return this.interactions;\n }\n\n /**\n * Get the layergroup associated with this map.\n * @return {LayerGroup} A layer group containing the layers in this map.\n * @observable\n * @api\n */\n getLayerGroup() {\n return /** @type {LayerGroup} */this.get(_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].LAYERGROUP);\n }\n\n /**\n * Clear any existing layers and add layers to the map.\n * @param {Array<import(\"./layer/Base.js\").default>|Collection<import(\"./layer/Base.js\").default>} layers The layers to be added to the map.\n * @api\n */\n setLayers(layers) {\n const group = this.getLayerGroup();\n if (layers instanceof _Collection_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"]) {\n group.setLayers(layers);\n return;\n }\n const collection = group.getLayers();\n collection.clear();\n collection.extend(layers);\n }\n\n /**\n * Get the collection of layers associated with this map.\n * @return {!Collection<import(\"./layer/Base.js\").default>} Layers.\n * @api\n */\n getLayers() {\n const layers = this.getLayerGroup().getLayers();\n return layers;\n }\n\n /**\n * @return {boolean} Layers have sources that are still loading.\n */\n getLoadingOrNotReady() {\n const layerStatesArray = this.getLayerGroup().getLayerStatesArray();\n for (let i = 0, ii = layerStatesArray.length; i < ii; ++i) {\n const state = layerStatesArray[i];\n if (!state.visible) {\n continue;\n }\n const renderer = state.layer.getRenderer();\n if (renderer && !renderer.ready) {\n return true;\n }\n const source = state.layer.getSource();\n if (source && source.loading) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Get the pixel for a coordinate. This takes a coordinate in the user\n * projection and returns the corresponding pixel.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate A map coordinate.\n * @return {import(\"./pixel.js\").Pixel} A pixel position in the map viewport.\n * @api\n */\n getPixelFromCoordinate(coordinate) {\n const viewCoordinate = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(coordinate, this.getView().getProjection());\n return this.getPixelFromCoordinateInternal(viewCoordinate);\n }\n\n /**\n * Get the pixel for a coordinate. This takes a coordinate in the map view\n * projection and returns the corresponding pixel.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate A map coordinate.\n * @return {import(\"./pixel.js\").Pixel} A pixel position in the map viewport.\n */\n getPixelFromCoordinateInternal(coordinate) {\n const frameState = this.frameState_;\n if (!frameState) {\n return null;\n }\n return (0,_transform_js__WEBPACK_IMPORTED_MODULE_6__.apply)(frameState.coordinateToPixelTransform, coordinate.slice(0, 2));\n }\n\n /**\n * Get the map renderer.\n * @return {import(\"./renderer/Map.js\").default|null} Renderer\n */\n getRenderer() {\n return this.renderer_;\n }\n\n /**\n * Get the size of this map.\n * @return {import(\"./size.js\").Size|undefined} The size in pixels of the map in the DOM.\n * @observable\n * @api\n */\n getSize() {\n return /** @type {import(\"./size.js\").Size|undefined} */this.get(_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].SIZE);\n }\n\n /**\n * Get the view associated with this map. A view manages properties such as\n * center and resolution.\n * @return {View} The view that controls this map.\n * @observable\n * @api\n */\n getView() {\n return /** @type {View} */this.get(_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].VIEW);\n }\n\n /**\n * Get the element that serves as the map viewport.\n * @return {HTMLElement} Viewport.\n * @api\n */\n getViewport() {\n return this.viewport_;\n }\n\n /**\n * Get the element that serves as the container for overlays. Elements added to\n * this container will let mousedown and touchstart events through to the map,\n * so clicks and gestures on an overlay will trigger {@link module:ol/MapBrowserEvent~MapBrowserEvent}\n * events.\n * @return {!HTMLElement} The map's overlay container.\n */\n getOverlayContainer() {\n return this.overlayContainer_;\n }\n\n /**\n * Get the element that serves as a container for overlays that don't allow\n * event propagation. Elements added to this container won't let mousedown and\n * touchstart events through to the map, so clicks and gestures on an overlay\n * don't trigger any {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n * @return {!HTMLElement} The map's overlay container that stops events.\n */\n getOverlayContainerStopEvent() {\n return this.overlayContainerStopEvent_;\n }\n\n /**\n * @return {!Document} The document where the map is displayed.\n */\n getOwnerDocument() {\n const targetElement = this.getTargetElement();\n return targetElement ? targetElement.ownerDocument : document;\n }\n\n /**\n * @param {import(\"./Tile.js\").default} tile Tile.\n * @param {string} tileSourceKey Tile source key.\n * @param {import(\"./coordinate.js\").Coordinate} tileCenter Tile center.\n * @param {number} tileResolution Tile resolution.\n * @return {number} Tile priority.\n */\n getTilePriority(tile, tileSourceKey, tileCenter, tileResolution) {\n return (0,_TileQueue_js__WEBPACK_IMPORTED_MODULE_9__.getTilePriority)(this.frameState_, tile, tileSourceKey, tileCenter, tileResolution);\n }\n\n /**\n * @param {UIEvent} browserEvent Browser event.\n * @param {string} [type] Type.\n */\n handleBrowserEvent(browserEvent, type) {\n type = type || browserEvent.type;\n const mapBrowserEvent = new _MapBrowserEvent_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"](type, this, browserEvent);\n this.handleMapBrowserEvent(mapBrowserEvent);\n }\n\n /**\n * @param {MapBrowserEvent} mapBrowserEvent The event to handle.\n */\n handleMapBrowserEvent(mapBrowserEvent) {\n if (!this.frameState_) {\n // With no view defined, we cannot translate pixels into geographical\n // coordinates so interactions cannot be used.\n return;\n }\n const originalEvent = /** @type {PointerEvent} */\n mapBrowserEvent.originalEvent;\n const eventType = originalEvent.type;\n if (eventType === _pointer_EventType_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"].POINTERDOWN || eventType === _events_EventType_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"].WHEEL || eventType === _events_EventType_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"].KEYDOWN) {\n const doc = this.getOwnerDocument();\n const rootNode = this.viewport_.getRootNode ? this.viewport_.getRootNode() : doc;\n const target = /** @type {Node} */originalEvent.target;\n if (\n // Abort if the target is a child of the container for elements whose events are not meant\n // to be handled by map interactions.\n this.overlayContainerStopEvent_.contains(target) ||\n // Abort if the event target is a child of the container that is no longer in the page.\n // It's possible for the target to no longer be in the page if it has been removed in an\n // event listener, this might happen in a Control that recreates it's content based on\n // user interaction either manually or via a render in something like https://reactjs.org/\n !(rootNode === doc ? doc.documentElement : rootNode).contains(target)) {\n return;\n }\n }\n mapBrowserEvent.frameState = this.frameState_;\n if (this.dispatchEvent(mapBrowserEvent) !== false) {\n const interactionsArray = this.getInteractions().getArray().slice();\n for (let i = interactionsArray.length - 1; i >= 0; i--) {\n const interaction = interactionsArray[i];\n if (interaction.getMap() !== this || !interaction.getActive() || !this.getTargetElement()) {\n continue;\n }\n const cont = interaction.handleEvent(mapBrowserEvent);\n if (!cont || mapBrowserEvent.propagationStopped) {\n break;\n }\n }\n }\n }\n\n /**\n * @protected\n */\n handlePostRender() {\n const frameState = this.frameState_;\n\n // Manage the tile queue\n // Image loads are expensive and a limited resource, so try to use them\n // efficiently:\n // * When the view is static we allow a large number of parallel tile loads\n // to complete the frame as quickly as possible.\n // * When animating or interacting, image loads can cause janks, so we reduce\n // the maximum number of loads per frame and limit the number of parallel\n // tile loads to remain reactive to view changes and to reduce the chance of\n // loading tiles that will quickly disappear from view.\n const tileQueue = this.tileQueue_;\n if (!tileQueue.isEmpty()) {\n let maxTotalLoading = this.maxTilesLoading_;\n let maxNewLoads = maxTotalLoading;\n if (frameState) {\n const hints = frameState.viewHints;\n if (hints[_ViewHint_js__WEBPACK_IMPORTED_MODULE_18__[\"default\"].ANIMATING] || hints[_ViewHint_js__WEBPACK_IMPORTED_MODULE_18__[\"default\"].INTERACTING]) {\n const lowOnFrameBudget = Date.now() - frameState.time > 8;\n maxTotalLoading = lowOnFrameBudget ? 0 : 8;\n maxNewLoads = lowOnFrameBudget ? 0 : 2;\n }\n }\n if (tileQueue.getTilesLoading() < maxTotalLoading) {\n tileQueue.reprioritize(); // FIXME only call if view has changed\n tileQueue.loadMoreTiles(maxTotalLoading, maxNewLoads);\n }\n }\n if (frameState && this.renderer_ && !frameState.animate) {\n if (this.renderComplete_ === true) {\n if (this.hasListener(_render_EventType_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"].RENDERCOMPLETE)) {\n this.renderer_.dispatchRenderEvent(_render_EventType_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"].RENDERCOMPLETE, frameState);\n }\n if (this.loaded_ === false) {\n this.loaded_ = true;\n this.dispatchEvent(new _MapEvent_js__WEBPACK_IMPORTED_MODULE_20__[\"default\"](_MapEventType_js__WEBPACK_IMPORTED_MODULE_21__[\"default\"].LOADEND, this, frameState));\n }\n } else if (this.loaded_ === true) {\n this.loaded_ = false;\n this.dispatchEvent(new _MapEvent_js__WEBPACK_IMPORTED_MODULE_20__[\"default\"](_MapEventType_js__WEBPACK_IMPORTED_MODULE_21__[\"default\"].LOADSTART, this, frameState));\n }\n }\n const postRenderFunctions = this.postRenderFunctions_;\n for (let i = 0, ii = postRenderFunctions.length; i < ii; ++i) {\n postRenderFunctions[i](this, frameState);\n }\n postRenderFunctions.length = 0;\n }\n\n /**\n * @private\n */\n handleSizeChanged_() {\n if (this.getView() && !this.getView().getAnimating()) {\n this.getView().resolveConstraints(0);\n }\n this.render();\n }\n\n /**\n * @private\n */\n handleTargetChanged_() {\n if (this.mapBrowserEventHandler_) {\n for (let i = 0, ii = this.targetChangeHandlerKeys_.length; i < ii; ++i) {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_22__.unlistenByKey)(this.targetChangeHandlerKeys_[i]);\n }\n this.targetChangeHandlerKeys_ = null;\n this.viewport_.removeEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"].CONTEXTMENU, this.boundHandleBrowserEvent_);\n this.viewport_.removeEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"].WHEEL, this.boundHandleBrowserEvent_);\n this.mapBrowserEventHandler_.dispose();\n this.mapBrowserEventHandler_ = null;\n (0,_dom_js__WEBPACK_IMPORTED_MODULE_23__.removeNode)(this.viewport_);\n }\n if (this.targetElement_) {\n this.resizeObserver_.unobserve(this.targetElement_);\n const rootNode = this.targetElement_.getRootNode();\n if (rootNode instanceof ShadowRoot) {\n this.resizeObserver_.unobserve(rootNode.host);\n }\n this.setSize(undefined);\n }\n\n // target may be undefined, null, a string or an Element.\n // If it's a string we convert it to an Element before proceeding.\n // If it's not now an Element we remove the viewport from the DOM.\n // If it's an Element we append the viewport element to it.\n\n const target = this.getTarget();\n const targetElement = typeof target === 'string' ? document.getElementById(target) : target;\n this.targetElement_ = targetElement;\n if (!targetElement) {\n if (this.renderer_) {\n clearTimeout(this.postRenderTimeoutHandle_);\n this.postRenderTimeoutHandle_ = undefined;\n this.postRenderFunctions_.length = 0;\n this.renderer_.dispose();\n this.renderer_ = null;\n }\n if (this.animationDelayKey_) {\n cancelAnimationFrame(this.animationDelayKey_);\n this.animationDelayKey_ = undefined;\n }\n } else {\n targetElement.appendChild(this.viewport_);\n if (!this.renderer_) {\n this.renderer_ = new _renderer_Composite_js__WEBPACK_IMPORTED_MODULE_24__[\"default\"](this);\n }\n this.mapBrowserEventHandler_ = new _MapBrowserEventHandler_js__WEBPACK_IMPORTED_MODULE_25__[\"default\"](this, this.moveTolerance_);\n for (const key in _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_26__[\"default\"]) {\n this.mapBrowserEventHandler_.addEventListener(_MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_26__[\"default\"][key], this.handleMapBrowserEvent.bind(this));\n }\n this.viewport_.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"].CONTEXTMENU, this.boundHandleBrowserEvent_, false);\n this.viewport_.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"].WHEEL, this.boundHandleBrowserEvent_, _has_js__WEBPACK_IMPORTED_MODULE_5__.PASSIVE_EVENT_LISTENERS ? {\n passive: false\n } : false);\n const keyboardEventTarget = !this.keyboardEventTarget_ ? targetElement : this.keyboardEventTarget_;\n this.targetChangeHandlerKeys_ = [(0,_events_js__WEBPACK_IMPORTED_MODULE_22__.listen)(keyboardEventTarget, _events_EventType_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"].KEYDOWN, this.handleBrowserEvent, this), (0,_events_js__WEBPACK_IMPORTED_MODULE_22__.listen)(keyboardEventTarget, _events_EventType_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"].KEYPRESS, this.handleBrowserEvent, this)];\n const rootNode = targetElement.getRootNode();\n if (rootNode instanceof ShadowRoot) {\n this.resizeObserver_.observe(rootNode.host);\n }\n this.resizeObserver_.observe(targetElement);\n }\n this.updateSize();\n // updateSize calls setSize, so no need to call this.render\n // ourselves here.\n }\n\n /**\n * @private\n */\n handleTileChange_() {\n this.render();\n }\n\n /**\n * @private\n */\n handleViewPropertyChanged_() {\n this.render();\n }\n\n /**\n * @private\n */\n handleViewChanged_() {\n if (this.viewPropertyListenerKey_) {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_22__.unlistenByKey)(this.viewPropertyListenerKey_);\n this.viewPropertyListenerKey_ = null;\n }\n if (this.viewChangeListenerKey_) {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_22__.unlistenByKey)(this.viewChangeListenerKey_);\n this.viewChangeListenerKey_ = null;\n }\n const view = this.getView();\n if (view) {\n this.updateViewportSize_(this.getSize());\n this.viewPropertyListenerKey_ = (0,_events_js__WEBPACK_IMPORTED_MODULE_22__.listen)(view, _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_27__[\"default\"].PROPERTYCHANGE, this.handleViewPropertyChanged_, this);\n this.viewChangeListenerKey_ = (0,_events_js__WEBPACK_IMPORTED_MODULE_22__.listen)(view, _events_EventType_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"].CHANGE, this.handleViewPropertyChanged_, this);\n view.resolveConstraints(0);\n }\n this.render();\n }\n\n /**\n * @private\n */\n handleLayerGroupChanged_() {\n if (this.layerGroupPropertyListenerKeys_) {\n this.layerGroupPropertyListenerKeys_.forEach(_events_js__WEBPACK_IMPORTED_MODULE_22__.unlistenByKey);\n this.layerGroupPropertyListenerKeys_ = null;\n }\n const layerGroup = this.getLayerGroup();\n if (layerGroup) {\n this.handleLayerAdd_(new _layer_Group_js__WEBPACK_IMPORTED_MODULE_3__.GroupEvent('addlayer', layerGroup));\n this.layerGroupPropertyListenerKeys_ = [(0,_events_js__WEBPACK_IMPORTED_MODULE_22__.listen)(layerGroup, _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_27__[\"default\"].PROPERTYCHANGE, this.render, this), (0,_events_js__WEBPACK_IMPORTED_MODULE_22__.listen)(layerGroup, _events_EventType_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"].CHANGE, this.render, this), (0,_events_js__WEBPACK_IMPORTED_MODULE_22__.listen)(layerGroup, 'addlayer', this.handleLayerAdd_, this), (0,_events_js__WEBPACK_IMPORTED_MODULE_22__.listen)(layerGroup, 'removelayer', this.handleLayerRemove_, this)];\n }\n this.render();\n }\n\n /**\n * @return {boolean} Is rendered.\n */\n isRendered() {\n return !!this.frameState_;\n }\n\n /**\n * @private\n */\n animationDelay_() {\n this.animationDelayKey_ = undefined;\n this.renderFrame_(Date.now());\n }\n\n /**\n * Requests an immediate render in a synchronous manner.\n * @api\n */\n renderSync() {\n if (this.animationDelayKey_) {\n cancelAnimationFrame(this.animationDelayKey_);\n }\n this.animationDelay_();\n }\n\n /**\n * Redraws all text after new fonts have loaded\n */\n redrawText() {\n const layerStates = this.getLayerGroup().getLayerStatesArray();\n for (let i = 0, ii = layerStates.length; i < ii; ++i) {\n const layer = layerStates[i].layer;\n if (layer.hasRenderer()) {\n layer.getRenderer().handleFontsChanged();\n }\n }\n }\n\n /**\n * Request a map rendering (at the next animation frame).\n * @api\n */\n render() {\n if (this.renderer_ && this.animationDelayKey_ === undefined) {\n this.animationDelayKey_ = requestAnimationFrame(this.animationDelay_);\n }\n }\n\n /**\n * This method is meant to be called in a layer's `prerender` listener. It causes all collected\n * declutter items to be decluttered and rendered on the map immediately. This is useful for\n * layers that need to appear entirely above the decluttered items of layers lower in the layer\n * stack.\n * @api\n */\n flushDeclutterItems() {\n const frameState = this.frameState_;\n if (!frameState) {\n return;\n }\n this.renderer_.flushDeclutterItems(frameState);\n }\n\n /**\n * Remove the given control from the map.\n * @param {import(\"./control/Control.js\").default} control Control.\n * @return {import(\"./control/Control.js\").default|undefined} The removed control (or undefined\n * if the control was not found).\n * @api\n */\n removeControl(control) {\n return this.getControls().remove(control);\n }\n\n /**\n * Remove the given interaction from the map.\n * @param {import(\"./interaction/Interaction.js\").default} interaction Interaction to remove.\n * @return {import(\"./interaction/Interaction.js\").default|undefined} The removed interaction (or\n * undefined if the interaction was not found).\n * @api\n */\n removeInteraction(interaction) {\n return this.getInteractions().remove(interaction);\n }\n\n /**\n * Removes the given layer from the map.\n * @param {import(\"./layer/Base.js\").default} layer Layer.\n * @return {import(\"./layer/Base.js\").default|undefined} The removed layer (or undefined if the\n * layer was not found).\n * @api\n */\n removeLayer(layer) {\n const layers = this.getLayerGroup().getLayers();\n return layers.remove(layer);\n }\n\n /**\n * @param {import(\"./layer/Group.js\").GroupEvent} event The layer remove event.\n * @private\n */\n handleLayerRemove_(event) {\n removeLayerMapProperty(event.layer);\n }\n\n /**\n * Remove the given overlay from the map.\n * @param {import(\"./Overlay.js\").default} overlay Overlay.\n * @return {import(\"./Overlay.js\").default|undefined} The removed overlay (or undefined\n * if the overlay was not found).\n * @api\n */\n removeOverlay(overlay) {\n return this.getOverlays().remove(overlay);\n }\n\n /**\n * @param {number} time Time.\n * @private\n */\n renderFrame_(time) {\n const size = this.getSize();\n const view = this.getView();\n const previousFrameState = this.frameState_;\n /** @type {?FrameState} */\n let frameState = null;\n if (size !== undefined && (0,_size_js__WEBPACK_IMPORTED_MODULE_28__.hasArea)(size) && view && view.isDef()) {\n const viewHints = view.getHints(this.frameState_ ? this.frameState_.viewHints : undefined);\n const viewState = view.getState();\n frameState = {\n animate: false,\n coordinateToPixelTransform: this.coordinateToPixelTransform_,\n declutterTree: null,\n extent: (0,_extent_js__WEBPACK_IMPORTED_MODULE_29__.getForViewAndSize)(viewState.center, viewState.resolution, viewState.rotation, size),\n index: this.frameIndex_++,\n layerIndex: 0,\n layerStatesArray: this.getLayerGroup().getLayerStatesArray(),\n pixelRatio: this.pixelRatio_,\n pixelToCoordinateTransform: this.pixelToCoordinateTransform_,\n postRenderFunctions: [],\n size: size,\n tileQueue: this.tileQueue_,\n time: time,\n usedTiles: {},\n viewState: viewState,\n viewHints: viewHints,\n wantedTiles: {},\n mapId: (0,_util_js__WEBPACK_IMPORTED_MODULE_30__.getUid)(this),\n renderTargets: {}\n };\n if (viewState.nextCenter && viewState.nextResolution) {\n const rotation = isNaN(viewState.nextRotation) ? viewState.rotation : viewState.nextRotation;\n frameState.nextExtent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_29__.getForViewAndSize)(viewState.nextCenter, viewState.nextResolution, rotation, size);\n }\n }\n this.frameState_ = frameState;\n this.renderer_.renderFrame(frameState);\n if (frameState) {\n if (frameState.animate) {\n this.render();\n }\n Array.prototype.push.apply(this.postRenderFunctions_, frameState.postRenderFunctions);\n if (previousFrameState) {\n const moveStart = !this.previousExtent_ || !(0,_extent_js__WEBPACK_IMPORTED_MODULE_29__.isEmpty)(this.previousExtent_) && !(0,_extent_js__WEBPACK_IMPORTED_MODULE_29__.equals)(frameState.extent, this.previousExtent_);\n if (moveStart) {\n this.dispatchEvent(new _MapEvent_js__WEBPACK_IMPORTED_MODULE_20__[\"default\"](_MapEventType_js__WEBPACK_IMPORTED_MODULE_21__[\"default\"].MOVESTART, this, previousFrameState));\n this.previousExtent_ = (0,_extent_js__WEBPACK_IMPORTED_MODULE_29__.createOrUpdateEmpty)(this.previousExtent_);\n }\n }\n const idle = this.previousExtent_ && !frameState.viewHints[_ViewHint_js__WEBPACK_IMPORTED_MODULE_18__[\"default\"].ANIMATING] && !frameState.viewHints[_ViewHint_js__WEBPACK_IMPORTED_MODULE_18__[\"default\"].INTERACTING] && !(0,_extent_js__WEBPACK_IMPORTED_MODULE_29__.equals)(frameState.extent, this.previousExtent_);\n if (idle) {\n this.dispatchEvent(new _MapEvent_js__WEBPACK_IMPORTED_MODULE_20__[\"default\"](_MapEventType_js__WEBPACK_IMPORTED_MODULE_21__[\"default\"].MOVEEND, this, frameState));\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_29__.clone)(frameState.extent, this.previousExtent_);\n }\n }\n this.dispatchEvent(new _MapEvent_js__WEBPACK_IMPORTED_MODULE_20__[\"default\"](_MapEventType_js__WEBPACK_IMPORTED_MODULE_21__[\"default\"].POSTRENDER, this, frameState));\n this.renderComplete_ = this.hasListener(_MapEventType_js__WEBPACK_IMPORTED_MODULE_21__[\"default\"].LOADSTART) || this.hasListener(_MapEventType_js__WEBPACK_IMPORTED_MODULE_21__[\"default\"].LOADEND) || this.hasListener(_render_EventType_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"].RENDERCOMPLETE) ? !this.tileQueue_.getTilesLoading() && !this.tileQueue_.getCount() && !this.getLoadingOrNotReady() : undefined;\n if (!this.postRenderTimeoutHandle_) {\n this.postRenderTimeoutHandle_ = setTimeout(() => {\n this.postRenderTimeoutHandle_ = undefined;\n this.handlePostRender();\n }, 0);\n }\n }\n\n /**\n * Sets the layergroup of this map.\n * @param {LayerGroup} layerGroup A layer group containing the layers in this map.\n * @observable\n * @api\n */\n setLayerGroup(layerGroup) {\n const oldLayerGroup = this.getLayerGroup();\n if (oldLayerGroup) {\n this.handleLayerRemove_(new _layer_Group_js__WEBPACK_IMPORTED_MODULE_3__.GroupEvent('removelayer', oldLayerGroup));\n }\n this.set(_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].LAYERGROUP, layerGroup);\n }\n\n /**\n * Set the size of this map.\n * @param {import(\"./size.js\").Size|undefined} size The size in pixels of the map in the DOM.\n * @observable\n * @api\n */\n setSize(size) {\n this.set(_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].SIZE, size);\n }\n\n /**\n * Set the target element to render this map into.\n * @param {HTMLElement|string} [target] The Element or id of the Element\n * that the map is rendered in.\n * @observable\n * @api\n */\n setTarget(target) {\n this.set(_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].TARGET, target);\n }\n\n /**\n * Set the view for this map.\n * @param {View|Promise<import(\"./View.js\").ViewOptions>} view The view that controls this map.\n * It is also possible to pass a promise that resolves to options for constructing a view. This\n * alternative allows view properties to be resolved by sources or other components that load\n * view-related metadata.\n * @observable\n * @api\n */\n setView(view) {\n if (!view || view instanceof _View_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"]) {\n this.set(_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].VIEW, view);\n return;\n }\n this.set(_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].VIEW, new _View_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"]());\n const map = this;\n view.then(function (viewOptions) {\n map.setView(new _View_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"](viewOptions));\n });\n }\n\n /**\n * Force a recalculation of the map viewport size. This should be called when\n * third-party code changes the size of the map viewport.\n * @api\n */\n updateSize() {\n const targetElement = this.getTargetElement();\n let size = undefined;\n if (targetElement) {\n const computedStyle = getComputedStyle(targetElement);\n const width = targetElement.offsetWidth - parseFloat(computedStyle['borderLeftWidth']) - parseFloat(computedStyle['paddingLeft']) - parseFloat(computedStyle['paddingRight']) - parseFloat(computedStyle['borderRightWidth']);\n const height = targetElement.offsetHeight - parseFloat(computedStyle['borderTopWidth']) - parseFloat(computedStyle['paddingTop']) - parseFloat(computedStyle['paddingBottom']) - parseFloat(computedStyle['borderBottomWidth']);\n if (!isNaN(width) && !isNaN(height)) {\n size = [width, height];\n if (!(0,_size_js__WEBPACK_IMPORTED_MODULE_28__.hasArea)(size) && !!(targetElement.offsetWidth || targetElement.offsetHeight || targetElement.getClientRects().length)) {\n (0,_console_js__WEBPACK_IMPORTED_MODULE_31__.warn)(\"No map visible because the map container's width or height are 0.\");\n }\n }\n }\n const oldSize = this.getSize();\n if (size && (!oldSize || !(0,_array_js__WEBPACK_IMPORTED_MODULE_32__.equals)(size, oldSize))) {\n this.setSize(size);\n this.updateViewportSize_(size);\n }\n }\n\n /**\n * Recomputes the viewport size and save it on the view object (if any)\n * @param {import(\"./size.js\").Size|undefined} size The size.\n * @private\n */\n updateViewportSize_(size) {\n const view = this.getView();\n if (view) {\n view.setViewportSize(size);\n }\n }\n}\n\n/**\n * @param {MapOptions} options Map options.\n * @return {MapOptionsInternal} Internal map options.\n */\nfunction createOptionsInternal(options) {\n /**\n * @type {HTMLElement|Document}\n */\n let keyboardEventTarget = null;\n if (options.keyboardEventTarget !== undefined) {\n keyboardEventTarget = typeof options.keyboardEventTarget === 'string' ? document.getElementById(options.keyboardEventTarget) : options.keyboardEventTarget;\n }\n\n /**\n * @type {Object<string, *>}\n */\n const values = {};\n const layerGroup = options.layers && typeof (/** @type {?} */options.layers.getLayers) === 'function' ? (/** @type {LayerGroup} */options.layers) : new _layer_Group_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n layers: (/** @type {Collection<import(\"./layer/Base.js\").default>|Array<import(\"./layer/Base.js\").default>} */\n options.layers)\n });\n values[_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].LAYERGROUP] = layerGroup;\n values[_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].TARGET] = options.target;\n values[_MapProperty_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].VIEW] = options.view instanceof _View_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"] ? options.view : new _View_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"]();\n\n /** @type {Collection<import(\"./control/Control.js\").default>} */\n let controls;\n if (options.controls !== undefined) {\n if (Array.isArray(options.controls)) {\n controls = new _Collection_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"](options.controls.slice());\n } else {\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_33__.assert)(typeof (/** @type {?} */options.controls.getArray) === 'function', 'Expected `controls` to be an array or an `ol/Collection.js`');\n controls = options.controls;\n }\n }\n\n /** @type {Collection<import(\"./interaction/Interaction\").default>} */\n let interactions;\n if (options.interactions !== undefined) {\n if (Array.isArray(options.interactions)) {\n interactions = new _Collection_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"](options.interactions.slice());\n } else {\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_33__.assert)(typeof (/** @type {?} */options.interactions.getArray) === 'function', 'Expected `interactions` to be an array or an `ol/Collection.js`');\n interactions = options.interactions;\n }\n }\n\n /** @type {Collection<import(\"./Overlay.js\").default>} */\n let overlays;\n if (options.overlays !== undefined) {\n if (Array.isArray(options.overlays)) {\n overlays = new _Collection_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"](options.overlays.slice());\n } else {\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_33__.assert)(typeof (/** @type {?} */options.overlays.getArray) === 'function', 'Expected `overlays` to be an array or an `ol/Collection.js`');\n overlays = options.overlays;\n }\n } else {\n overlays = new _Collection_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"]();\n }\n return {\n controls: controls,\n interactions: interactions,\n keyboardEventTarget: keyboardEventTarget,\n overlays: overlays,\n values: values\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Map);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/Map.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/MapBrowserEvent.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/MapBrowserEvent.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _MapEvent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./MapEvent.js */ \"./node_modules/ol/MapEvent.js\");\n/**\n * @module ol/MapBrowserEvent\n */\n\n\n/**\n * @classdesc\n * Events emitted as map browser events are instances of this type.\n * See {@link module:ol/Map~Map} for which events trigger a map browser event.\n * @template {UIEvent} EVENT\n */\nclass MapBrowserEvent extends _MapEvent_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {string} type Event type.\n * @param {import(\"./Map.js\").default} map Map.\n * @param {EVENT} originalEvent Original event.\n * @param {boolean} [dragging] Is the map currently being dragged?\n * @param {import(\"./Map.js\").FrameState} [frameState] Frame state.\n * @param {Array<PointerEvent>} [activePointers] Active pointers.\n */\n constructor(type, map, originalEvent, dragging, frameState, activePointers) {\n super(type, map, frameState);\n\n /**\n * The original browser event.\n * @const\n * @type {EVENT}\n * @api\n */\n this.originalEvent = originalEvent;\n\n /**\n * The map pixel relative to the viewport corresponding to the original browser event.\n * @type {?import(\"./pixel.js\").Pixel}\n */\n this.pixel_ = null;\n\n /**\n * The coordinate in the user projection corresponding to the original browser event.\n * @type {?import(\"./coordinate.js\").Coordinate}\n */\n this.coordinate_ = null;\n\n /**\n * Indicates if the map is currently being dragged. Only set for\n * `POINTERDRAG` and `POINTERMOVE` events. Default is `false`.\n *\n * @type {boolean}\n * @api\n */\n this.dragging = dragging !== undefined ? dragging : false;\n\n /**\n * @type {Array<PointerEvent>|undefined}\n */\n this.activePointers = activePointers;\n }\n\n /**\n * The map pixel relative to the viewport corresponding to the original event.\n * @type {import(\"./pixel.js\").Pixel}\n * @api\n */\n get pixel() {\n if (!this.pixel_) {\n this.pixel_ = this.map.getEventPixel(this.originalEvent);\n }\n return this.pixel_;\n }\n set pixel(pixel) {\n this.pixel_ = pixel;\n }\n\n /**\n * The coordinate corresponding to the original browser event. This will be in the user\n * projection if one is set. Otherwise it will be in the view projection.\n * @type {import(\"./coordinate.js\").Coordinate}\n * @api\n */\n get coordinate() {\n if (!this.coordinate_) {\n this.coordinate_ = this.map.getCoordinateFromPixel(this.pixel);\n }\n return this.coordinate_;\n }\n set coordinate(coordinate) {\n this.coordinate_ = coordinate;\n }\n\n /**\n * Prevents the default browser action.\n * See https://developer.mozilla.org/en-US/docs/Web/API/event.preventDefault.\n * @api\n */\n preventDefault() {\n super.preventDefault();\n if ('preventDefault' in this.originalEvent) {\n /** @type {UIEvent} */this.originalEvent.preventDefault();\n }\n }\n\n /**\n * Prevents further propagation of the current event.\n * See https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation.\n * @api\n */\n stopPropagation() {\n super.stopPropagation();\n if ('stopPropagation' in this.originalEvent) {\n /** @type {UIEvent} */this.originalEvent.stopPropagation();\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (MapBrowserEvent);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/MapBrowserEvent.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/MapBrowserEventHandler.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/ol/MapBrowserEventHandler.js ***!
|
||
\***************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _MapBrowserEvent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MapBrowserEvent.js */ \"./node_modules/ol/MapBrowserEvent.js\");\n/* harmony import */ var _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./MapBrowserEventType.js */ \"./node_modules/ol/MapBrowserEventType.js\");\n/* harmony import */ var _pointer_EventType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pointer/EventType.js */ \"./node_modules/ol/pointer/EventType.js\");\n/* harmony import */ var _events_Target_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./events/Target.js */ \"./node_modules/ol/events/Target.js\");\n/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./has.js */ \"./node_modules/ol/has.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./events.js */ \"./node_modules/ol/events.js\");\n\n/**\n * @module ol/MapBrowserEventHandler\n */\n\n\n\n\n\n\n\n\nclass MapBrowserEventHandler extends _events_Target_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {import(\"./Map.js\").default} map The map with the viewport to listen to events on.\n * @param {number} [moveTolerance] The minimal distance the pointer must travel to trigger a move.\n */\n constructor(map, moveTolerance) {\n super(map);\n\n /**\n * This is the element that we will listen to the real events on.\n * @type {import(\"./Map.js\").default}\n * @private\n */\n this.map_ = map;\n\n /**\n * @type {ReturnType<typeof setTimeout>}\n * @private\n */\n this.clickTimeoutId_;\n\n /**\n * Emulate dblclick and singleclick. Will be true when only one pointer is active.\n * @type {boolean}\n */\n this.emulateClicks_ = false;\n\n /**\n * @type {boolean}\n * @private\n */\n this.dragging_ = false;\n\n /**\n * @type {!Array<import(\"./events.js\").EventsKey>}\n * @private\n */\n this.dragListenerKeys_ = [];\n\n /**\n * @type {number}\n * @private\n */\n this.moveTolerance_ = moveTolerance === undefined ? 1 : moveTolerance;\n\n /**\n * The most recent \"down\" type event (or null if none have occurred).\n * Set on pointerdown.\n * @type {PointerEvent|null}\n * @private\n */\n this.down_ = null;\n const element = this.map_.getViewport();\n\n /**\n * @type {Array<PointerEvent>}\n * @private\n */\n this.activePointers_ = [];\n\n /**\n * @type {!Object<number, Event>}\n * @private\n */\n this.trackedTouches_ = {};\n this.element_ = element;\n\n /**\n * @type {?import(\"./events.js\").EventsKey}\n * @private\n */\n this.pointerdownListenerKey_ = (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listen)(element, _pointer_EventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].POINTERDOWN, this.handlePointerDown_, this);\n\n /**\n * @type {PointerEvent}\n * @private\n */\n this.originalPointerMoveEvent_;\n\n /**\n * @type {?import(\"./events.js\").EventsKey}\n * @private\n */\n this.relayedListenerKey_ = (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listen)(element, _pointer_EventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].POINTERMOVE, this.relayMoveEvent_, this);\n\n /**\n * @private\n */\n this.boundHandleTouchMove_ = this.handleTouchMove_.bind(this);\n this.element_.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].TOUCHMOVE, this.boundHandleTouchMove_, _has_js__WEBPACK_IMPORTED_MODULE_5__.PASSIVE_EVENT_LISTENERS ? {\n passive: false\n } : false);\n }\n\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n emulateClick_(pointerEvent) {\n let newEvent = new _MapBrowserEvent_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](_MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].CLICK, this.map_, pointerEvent);\n this.dispatchEvent(newEvent);\n if (this.clickTimeoutId_ !== undefined) {\n // double-click\n clearTimeout(this.clickTimeoutId_);\n this.clickTimeoutId_ = undefined;\n newEvent = new _MapBrowserEvent_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](_MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].DBLCLICK, this.map_, pointerEvent);\n this.dispatchEvent(newEvent);\n } else {\n // click\n this.clickTimeoutId_ = setTimeout(() => {\n this.clickTimeoutId_ = undefined;\n const newEvent = new _MapBrowserEvent_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](_MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].SINGLECLICK, this.map_, pointerEvent);\n this.dispatchEvent(newEvent);\n }, 250);\n }\n }\n\n /**\n * Keeps track on how many pointers are currently active.\n *\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n updateActivePointers_(pointerEvent) {\n const event = pointerEvent;\n const id = event.pointerId;\n if (event.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POINTERUP || event.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POINTERCANCEL) {\n delete this.trackedTouches_[id];\n for (const pointerId in this.trackedTouches_) {\n if (this.trackedTouches_[pointerId].target !== event.target) {\n // Some platforms assign a new pointerId when the target changes.\n // If this happens, delete one tracked pointer. If there is more\n // than one tracked pointer for the old target, it will be cleared\n // by subsequent POINTERUP events from other pointers.\n delete this.trackedTouches_[pointerId];\n break;\n }\n }\n } else if (event.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POINTERDOWN || event.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POINTERMOVE) {\n this.trackedTouches_[id] = event;\n }\n this.activePointers_ = Object.values(this.trackedTouches_);\n }\n\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n handlePointerUp_(pointerEvent) {\n this.updateActivePointers_(pointerEvent);\n const newEvent = new _MapBrowserEvent_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](_MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POINTERUP, this.map_, pointerEvent, undefined, undefined, this.activePointers_);\n this.dispatchEvent(newEvent);\n\n // We emulate click events on left mouse button click, touch contact, and pen\n // contact. isMouseActionButton returns true in these cases (evt.button is set\n // to 0).\n // See http://www.w3.org/TR/pointerevents/#button-states\n // We only fire click, singleclick, and doubleclick if nobody has called\n // event.preventDefault().\n if (this.emulateClicks_ && !newEvent.defaultPrevented && !this.dragging_ && this.isMouseActionButton_(pointerEvent)) {\n this.emulateClick_(this.down_);\n }\n if (this.activePointers_.length === 0) {\n this.dragListenerKeys_.forEach(_events_js__WEBPACK_IMPORTED_MODULE_2__.unlistenByKey);\n this.dragListenerKeys_.length = 0;\n this.dragging_ = false;\n this.down_ = null;\n }\n }\n\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @return {boolean} If the left mouse button was pressed.\n * @private\n */\n isMouseActionButton_(pointerEvent) {\n return pointerEvent.button === 0;\n }\n\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n handlePointerDown_(pointerEvent) {\n this.emulateClicks_ = this.activePointers_.length === 0;\n this.updateActivePointers_(pointerEvent);\n const newEvent = new _MapBrowserEvent_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](_MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POINTERDOWN, this.map_, pointerEvent, undefined, undefined, this.activePointers_);\n this.dispatchEvent(newEvent);\n this.down_ = new PointerEvent(pointerEvent.type, pointerEvent);\n Object.defineProperty(this.down_, 'target', {\n writable: false,\n value: pointerEvent.target\n });\n if (this.dragListenerKeys_.length === 0) {\n const doc = this.map_.getOwnerDocument();\n this.dragListenerKeys_.push((0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listen)(doc, _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POINTERMOVE, this.handlePointerMove_, this), (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listen)(doc, _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POINTERUP, this.handlePointerUp_, this),\n /* Note that the listener for `pointercancel is set up on\n * `pointerEventHandler_` and not `documentPointerEventHandler_` like\n * the `pointerup` and `pointermove` listeners.\n *\n * The reason for this is the following: `TouchSource.vacuumTouches_()`\n * issues `pointercancel` events, when there was no `touchend` for a\n * `touchstart`. Now, let's say a first `touchstart` is registered on\n * `pointerEventHandler_`. The `documentPointerEventHandler_` is set up.\n * But `documentPointerEventHandler_` doesn't know about the first\n * `touchstart`. If there is no `touchend` for the `touchstart`, we can\n * only receive a `touchcancel` from `pointerEventHandler_`, because it is\n * only registered there.\n */\n (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listen)(this.element_, _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POINTERCANCEL, this.handlePointerUp_, this));\n if (this.element_.getRootNode && this.element_.getRootNode() !== doc) {\n this.dragListenerKeys_.push((0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listen)(this.element_.getRootNode(), _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POINTERUP, this.handlePointerUp_, this));\n }\n }\n }\n\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n handlePointerMove_(pointerEvent) {\n // Between pointerdown and pointerup, pointermove events are triggered.\n // To avoid a 'false' touchmove event to be dispatched, we test if the pointer\n // moved a significant distance.\n if (this.isMoving_(pointerEvent)) {\n this.updateActivePointers_(pointerEvent);\n this.dragging_ = true;\n const newEvent = new _MapBrowserEvent_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](_MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POINTERDRAG, this.map_, pointerEvent, this.dragging_, undefined, this.activePointers_);\n this.dispatchEvent(newEvent);\n }\n }\n\n /**\n * Wrap and relay a pointermove event.\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @private\n */\n relayMoveEvent_(pointerEvent) {\n this.originalPointerMoveEvent_ = pointerEvent;\n const dragging = !!(this.down_ && this.isMoving_(pointerEvent));\n this.dispatchEvent(new _MapBrowserEvent_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](_MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POINTERMOVE, this.map_, pointerEvent, dragging));\n }\n\n /**\n * Flexible handling of a `touch-action: none` css equivalent: because calling\n * `preventDefault()` on a `pointermove` event does not stop native page scrolling\n * and zooming, we also listen for `touchmove` and call `preventDefault()` on it\n * when an interaction (currently `DragPan` handles the event.\n * @param {TouchEvent} event Event.\n * @private\n */\n handleTouchMove_(event) {\n // Due to https://github.com/mpizenberg/elm-pep/issues/2, `this.originalPointerMoveEvent_`\n // may not be initialized yet when we get here on a platform without native pointer events,\n // when elm-pep is used as pointer events polyfill.\n const originalEvent = this.originalPointerMoveEvent_;\n if ((!originalEvent || originalEvent.defaultPrevented) && (typeof event.cancelable !== 'boolean' || event.cancelable === true)) {\n event.preventDefault();\n }\n }\n\n /**\n * @param {PointerEvent} pointerEvent Pointer\n * event.\n * @return {boolean} Is moving.\n * @private\n */\n isMoving_(pointerEvent) {\n return this.dragging_ || Math.abs(pointerEvent.clientX - this.down_.clientX) > this.moveTolerance_ || Math.abs(pointerEvent.clientY - this.down_.clientY) > this.moveTolerance_;\n }\n\n /**\n * Clean up.\n */\n disposeInternal() {\n if (this.relayedListenerKey_) {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.unlistenByKey)(this.relayedListenerKey_);\n this.relayedListenerKey_ = null;\n }\n this.element_.removeEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].TOUCHMOVE, this.boundHandleTouchMove_);\n if (this.pointerdownListenerKey_) {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.unlistenByKey)(this.pointerdownListenerKey_);\n this.pointerdownListenerKey_ = null;\n }\n this.dragListenerKeys_.forEach(_events_js__WEBPACK_IMPORTED_MODULE_2__.unlistenByKey);\n this.dragListenerKeys_.length = 0;\n this.element_ = null;\n super.disposeInternal();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (MapBrowserEventHandler);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/MapBrowserEventHandler.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/MapBrowserEventType.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ol/MapBrowserEventType.js ***!
|
||
\************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/**\n * @module ol/MapBrowserEventType\n */\n\n\n/**\n * Constants for event names.\n * @enum {string}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n /**\n * A true single click with no dragging and no double click. Note that this\n * event is delayed by 250 ms to ensure that it is not a double click.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#singleclick\n * @api\n */\n SINGLECLICK: 'singleclick',\n /**\n * A click with no dragging. A double click will fire two of this.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#click\n * @api\n */\n CLICK: _events_EventType_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].CLICK,\n /**\n * A true double click, with no dragging.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#dblclick\n * @api\n */\n DBLCLICK: _events_EventType_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].DBLCLICK,\n /**\n * Triggered when a pointer is dragged.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#pointerdrag\n * @api\n */\n POINTERDRAG: 'pointerdrag',\n /**\n * Triggered when a pointer is moved. Note that on touch devices this is\n * triggered when the map is panned, so is not the same as mousemove.\n * @event module:ol/MapBrowserEvent~MapBrowserEvent#pointermove\n * @api\n */\n POINTERMOVE: 'pointermove',\n POINTERDOWN: 'pointerdown',\n POINTERUP: 'pointerup',\n POINTEROVER: 'pointerover',\n POINTEROUT: 'pointerout',\n POINTERENTER: 'pointerenter',\n POINTERLEAVE: 'pointerleave',\n POINTERCANCEL: 'pointercancel'\n});\n\n/***\n * @typedef {'singleclick'|'click'|'dblclick'|'pointerdrag'|'pointermove'} Types\n */\n\n//# sourceURL=webpack://complexes/./node_modules/ol/MapBrowserEventType.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/MapEvent.js":
|
||
/*!*************************************!*\
|
||
!*** ./node_modules/ol/MapEvent.js ***!
|
||
\*************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./events/Event.js */ \"./node_modules/ol/events/Event.js\");\n/**\n * @module ol/MapEvent\n */\n\n\n/**\n * @classdesc\n * Events emitted as map events are instances of this type.\n * See {@link module:ol/Map~Map} for which events trigger a map event.\n */\nclass MapEvent extends _events_Event_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {string} type Event type.\n * @param {import(\"./Map.js\").default} map Map.\n * @param {?import(\"./Map.js\").FrameState} [frameState] Frame state.\n */\n constructor(type, map, frameState) {\n super(type);\n\n /**\n * The map where the event occurred.\n * @type {import(\"./Map.js\").default}\n * @api\n */\n this.map = map;\n\n /**\n * The frame state at the time of the event.\n * @type {?import(\"./Map.js\").FrameState}\n * @api\n */\n this.frameState = frameState !== undefined ? frameState : null;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (MapEvent);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/MapEvent.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/MapEventType.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ol/MapEventType.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/MapEventType\n */\n\n/**\n * @enum {string}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n /**\n * Triggered after a map frame is rendered.\n * @event module:ol/MapEvent~MapEvent#postrender\n * @api\n */\n POSTRENDER: 'postrender',\n /**\n * Triggered when the map starts moving.\n * @event module:ol/MapEvent~MapEvent#movestart\n * @api\n */\n MOVESTART: 'movestart',\n /**\n * Triggered after the map is moved.\n * @event module:ol/MapEvent~MapEvent#moveend\n * @api\n */\n MOVEEND: 'moveend',\n /**\n * Triggered when loading of additional map data (tiles, images, features) starts.\n * @event module:ol/MapEvent~MapEvent#loadstart\n * @api\n */\n LOADSTART: 'loadstart',\n /**\n * Triggered when loading of additional map data has completed.\n * @event module:ol/MapEvent~MapEvent#loadend\n * @api\n */\n LOADEND: 'loadend'\n});\n\n/***\n * @typedef {'postrender'|'movestart'|'moveend'|'loadstart'|'loadend'} Types\n */\n\n//# sourceURL=webpack://complexes/./node_modules/ol/MapEventType.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/MapProperty.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/ol/MapProperty.js ***!
|
||
\****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/MapProperty\n */\n\n/**\n * @enum {string}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n LAYERGROUP: 'layergroup',\n SIZE: 'size',\n TARGET: 'target',\n VIEW: 'view'\n});\n\n//# sourceURL=webpack://complexes/./node_modules/ol/MapProperty.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/Object.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/ol/Object.js ***!
|
||
\***********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ObjectEvent: function() { return /* binding */ ObjectEvent; }\n/* harmony export */ });\n/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./events/Event.js */ \"./node_modules/ol/events/Event.js\");\n/* harmony import */ var _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ObjectEventType.js */ \"./node_modules/ol/ObjectEventType.js\");\n/* harmony import */ var _Observable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Observable.js */ \"./node_modules/ol/Observable.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./obj.js */ \"./node_modules/ol/obj.js\");\n/**\n * @module ol/Object\n */\n\n\n\n\n\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/Object~BaseObject} instances are instances of this type.\n */\nclass ObjectEvent extends _events_Event_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {string} type The event type.\n * @param {string} key The property name.\n * @param {*} oldValue The old value for `key`.\n */\n constructor(type, key, oldValue) {\n super(type);\n\n /**\n * The name of the property whose value is changing.\n * @type {string}\n * @api\n */\n this.key = key;\n\n /**\n * The old value. To get the new value use `e.target.get(e.key)` where\n * `e` is the event object.\n * @type {*}\n * @api\n */\n this.oldValue = oldValue;\n }\n}\n\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<import(\"./ObjectEventType\").Types, ObjectEvent, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|import(\"./ObjectEventType\").Types, Return>} ObjectOnSignature\n */\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Most non-trivial classes inherit from this.\n *\n * This extends {@link module:ol/Observable~Observable} with observable\n * properties, where each property is observable as well as the object as a\n * whole.\n *\n * Classes that inherit from this have pre-defined properties, to which you can\n * add your owns. The pre-defined properties are listed in this documentation as\n * 'Observable Properties', and have their own accessors; for example,\n * {@link module:ol/Map~Map} has a `target` property, accessed with\n * `getTarget()` and changed with `setTarget()`. Not all properties are however\n * settable. There are also general-purpose accessors `get()` and `set()`. For\n * example, `get('target')` is equivalent to `getTarget()`.\n *\n * The `set` accessors trigger a change event, and you can monitor this by\n * registering a listener. For example, {@link module:ol/View~View} has a\n * `center` property, so `view.on('change:center', function(evt) {...});` would\n * call the function whenever the value of the center property changes. Within\n * the function, `evt.target` would be the view, so `evt.target.getCenter()`\n * would return the new center.\n *\n * You can add your own observable properties with\n * `object.set('prop', 'value')`, and retrieve that with `object.get('prop')`.\n * You can listen for changes on that property value with\n * `object.on('change:prop', listener)`. You can get a list of all\n * properties with {@link module:ol/Object~BaseObject#getProperties}.\n *\n * Note that the observable properties are separate from standard JS properties.\n * You can, for example, give your map object a title with\n * `map.title='New title'` and with `map.set('title', 'Another title')`. The\n * first will be a `hasOwnProperty`; the second will appear in\n * `getProperties()`. Only the second is observable.\n *\n * Properties can be deleted by using the unset method. E.g.\n * object.unset('foo').\n *\n * @fires ObjectEvent\n * @api\n */\nclass BaseObject extends _Observable_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {Object<string, *>} [values] An object with key-value pairs.\n */\n constructor(values) {\n super();\n\n /***\n * @type {ObjectOnSignature<import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {ObjectOnSignature<import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {ObjectOnSignature<void>}\n */\n this.un;\n\n // Call {@link module:ol/util.getUid} to ensure that the order of objects' ids is\n // the same as the order in which they were created. This also helps to\n // ensure that object properties are always added in the same order, which\n // helps many JavaScript engines generate faster code.\n (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.getUid)(this);\n\n /**\n * @private\n * @type {Object<string, *>|null}\n */\n this.values_ = null;\n if (values !== undefined) {\n this.setProperties(values);\n }\n }\n\n /**\n * Gets a value.\n * @param {string} key Key name.\n * @return {*} Value.\n * @api\n */\n get(key) {\n let value;\n if (this.values_ && this.values_.hasOwnProperty(key)) {\n value = this.values_[key];\n }\n return value;\n }\n\n /**\n * Get a list of object property names.\n * @return {Array<string>} List of property names.\n * @api\n */\n getKeys() {\n return this.values_ && Object.keys(this.values_) || [];\n }\n\n /**\n * Get an object of all property names and values.\n * @return {Object<string, *>} Object.\n * @api\n */\n getProperties() {\n return this.values_ && Object.assign({}, this.values_) || {};\n }\n\n /**\n * Get an object of all property names and values.\n * @return {Object<string, *>?} Object.\n */\n getPropertiesInternal() {\n return this.values_;\n }\n\n /**\n * @return {boolean} The object has properties.\n */\n hasProperties() {\n return !!this.values_;\n }\n\n /**\n * @param {string} key Key name.\n * @param {*} oldValue Old value.\n */\n notify(key, oldValue) {\n let eventType;\n eventType = `change:${key}`;\n if (this.hasListener(eventType)) {\n this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));\n }\n eventType = _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].PROPERTYCHANGE;\n if (this.hasListener(eventType)) {\n this.dispatchEvent(new ObjectEvent(eventType, key, oldValue));\n }\n }\n\n /**\n * @param {string} key Key name.\n * @param {import(\"./events.js\").Listener} listener Listener.\n */\n addChangeListener(key, listener) {\n this.addEventListener(`change:${key}`, listener);\n }\n\n /**\n * @param {string} key Key name.\n * @param {import(\"./events.js\").Listener} listener Listener.\n */\n removeChangeListener(key, listener) {\n this.removeEventListener(`change:${key}`, listener);\n }\n\n /**\n * Sets a value.\n * @param {string} key Key name.\n * @param {*} value Value.\n * @param {boolean} [silent] Update without triggering an event.\n * @api\n */\n set(key, value, silent) {\n const values = this.values_ || (this.values_ = {});\n if (silent) {\n values[key] = value;\n } else {\n const oldValue = values[key];\n values[key] = value;\n if (oldValue !== value) {\n this.notify(key, oldValue);\n }\n }\n }\n\n /**\n * Sets a collection of key-value pairs. Note that this changes any existing\n * properties and adds new ones (it does not remove any existing properties).\n * @param {Object<string, *>} values Values.\n * @param {boolean} [silent] Update without triggering an event.\n * @api\n */\n setProperties(values, silent) {\n for (const key in values) {\n this.set(key, values[key], silent);\n }\n }\n\n /**\n * Apply any properties from another object without triggering events.\n * @param {BaseObject} source The source object.\n * @protected\n */\n applyProperties(source) {\n if (!source.values_) {\n return;\n }\n Object.assign(this.values_ || (this.values_ = {}), source.values_);\n }\n\n /**\n * Unsets a property.\n * @param {string} key Key name.\n * @param {boolean} [silent] Unset without triggering an event.\n * @api\n */\n unset(key, silent) {\n if (this.values_ && key in this.values_) {\n const oldValue = this.values_[key];\n delete this.values_[key];\n if ((0,_obj_js__WEBPACK_IMPORTED_MODULE_4__.isEmpty)(this.values_)) {\n this.values_ = null;\n }\n if (!silent) {\n this.notify(key, oldValue);\n }\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (BaseObject);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/Object.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/ObjectEventType.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/ObjectEventType.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/ObjectEventType\n */\n\n/**\n * @enum {string}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n /**\n * Triggered when a property is changed.\n * @event module:ol/Object.ObjectEvent#propertychange\n * @api\n */\n PROPERTYCHANGE: 'propertychange'\n});\n\n/**\n * @typedef {'propertychange'} Types\n */\n\n//# sourceURL=webpack://complexes/./node_modules/ol/ObjectEventType.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/Observable.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/Observable.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ unByKey: function() { return /* binding */ unByKey; }\n/* harmony export */ });\n/* harmony import */ var _events_Target_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./events/Target.js */ \"./node_modules/ol/events/Target.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./events.js */ \"./node_modules/ol/events.js\");\n/**\n * @module ol/Observable\n */\n\n\n\n\n/***\n * @template {string} Type\n * @template {Event|import(\"./events/Event.js\").default} EventClass\n * @template Return\n * @typedef {(type: Type, listener: (event: EventClass) => ?) => Return} OnSignature\n */\n\n/***\n * @template {string} Type\n * @template Return\n * @typedef {(type: Type[], listener: (event: Event|import(\"./events/Event\").default) => ?) => Return extends void ? void : Return[]} CombinedOnSignature\n */\n\n/**\n * @typedef {'change'|'error'} EventTypes\n */\n\n/***\n * @template Return\n * @typedef {OnSignature<EventTypes, import(\"./events/Event.js\").default, Return> & CombinedOnSignature<EventTypes, Return>} ObservableOnSignature\n */\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * An event target providing convenient methods for listener registration\n * and unregistration. A generic `change` event is always available through\n * {@link module:ol/Observable~Observable#changed}.\n *\n * @fires import(\"./events/Event.js\").default\n * @api\n */\nclass Observable extends _events_Target_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor() {\n super();\n this.on = /** @type {ObservableOnSignature<import(\"./events\").EventsKey>} */\n this.onInternal;\n this.once = /** @type {ObservableOnSignature<import(\"./events\").EventsKey>} */\n this.onceInternal;\n this.un = /** @type {ObservableOnSignature<void>} */this.unInternal;\n\n /**\n * @private\n * @type {number}\n */\n this.revision_ = 0;\n }\n\n /**\n * Increases the revision counter and dispatches a 'change' event.\n * @api\n */\n changed() {\n ++this.revision_;\n this.dispatchEvent(_events_EventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].CHANGE);\n }\n\n /**\n * Get the version number for this object. Each time the object is modified,\n * its version number will be incremented.\n * @return {number} Revision.\n * @api\n */\n getRevision() {\n return this.revision_;\n }\n\n /**\n * @param {string|Array<string>} type Type.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener Listener.\n * @return {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} Event key.\n * @protected\n */\n onInternal(type, listener) {\n if (Array.isArray(type)) {\n const len = type.length;\n const keys = new Array(len);\n for (let i = 0; i < len; ++i) {\n keys[i] = (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listen)(this, type[i], listener);\n }\n return keys;\n }\n return (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listen)(this, /** @type {string} */type, listener);\n }\n\n /**\n * @param {string|Array<string>} type Type.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener Listener.\n * @return {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} Event key.\n * @protected\n */\n onceInternal(type, listener) {\n let key;\n if (Array.isArray(type)) {\n const len = type.length;\n key = new Array(len);\n for (let i = 0; i < len; ++i) {\n key[i] = (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listenOnce)(this, type[i], listener);\n }\n } else {\n key = (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listenOnce)(this, /** @type {string} */type, listener);\n }\n /** @type {Object} */\n listener.ol_key = key;\n return key;\n }\n\n /**\n * Unlisten for a certain type of event.\n * @param {string|Array<string>} type Type.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener Listener.\n * @protected\n */\n unInternal(type, listener) {\n const key = /** @type {Object} */listener.ol_key;\n if (key) {\n unByKey(key);\n } else if (Array.isArray(type)) {\n for (let i = 0, ii = type.length; i < ii; ++i) {\n this.removeEventListener(type[i], listener);\n }\n } else {\n this.removeEventListener(type, listener);\n }\n }\n}\n\n/**\n * Listen for a certain type of event.\n * @function\n * @param {string|Array<string>} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener The listener function.\n * @return {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} Unique key for the listener. If\n * called with an array of event types as the first argument, the return\n * will be an array of keys.\n * @api\n */\nObservable.prototype.on;\n\n/**\n * Listen once for a certain type of event.\n * @function\n * @param {string|Array<string>} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener The listener function.\n * @return {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} Unique key for the listener. If\n * called with an array of event types as the first argument, the return\n * will be an array of keys.\n * @api\n */\nObservable.prototype.once;\n\n/**\n * Unlisten for a certain type of event.\n * @function\n * @param {string|Array<string>} type The event type or array of event types.\n * @param {function((Event|import(\"./events/Event\").default)): ?} listener The listener function.\n * @api\n */\nObservable.prototype.un;\n\n/**\n * Removes an event listener using the key returned by `on()` or `once()`.\n * @param {import(\"./events.js\").EventsKey|Array<import(\"./events.js\").EventsKey>} key The key returned by `on()`\n * or `once()` (or an array of keys).\n * @api\n */\nfunction unByKey(key) {\n if (Array.isArray(key)) {\n for (let i = 0, ii = key.length; i < ii; ++i) {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.unlistenByKey)(key[i]);\n }\n } else {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.unlistenByKey)(/** @type {import(\"./events.js\").EventsKey} */key);\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Observable);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/Observable.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/Overlay.js":
|
||
/*!************************************!*\
|
||
!*** ./node_modules/ol/Overlay.js ***!
|
||
\************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Object.js */ \"./node_modules/ol/Object.js\");\n/* harmony import */ var _MapEventType_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MapEventType.js */ \"./node_modules/ol/MapEventType.js\");\n/* harmony import */ var _css_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./css.js */ \"./node_modules/ol/css.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./events.js */ \"./node_modules/ol/events.js\");\n/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dom.js */ \"./node_modules/ol/dom.js\");\n/**\n * @module ol/Overlay\n */\n\n\n\n\n\n\n\n/**\n * @typedef {'bottom-left' | 'bottom-center' | 'bottom-right' | 'center-left' | 'center-center' | 'center-right' | 'top-left' | 'top-center' | 'top-right'} Positioning\n * The overlay position: `'bottom-left'`, `'bottom-center'`, `'bottom-right'`,\n * `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`,\n * `'top-center'`, or `'top-right'`.\n */\n\n/**\n * @typedef {Object} Options\n * @property {number|string} [id] Set the overlay id. The overlay id can be used\n * with the {@link module:ol/Map~Map#getOverlayById} method.\n * @property {HTMLElement} [element] The overlay element.\n * @property {Array<number>} [offset=[0, 0]] Offsets in pixels used when positioning\n * the overlay. The first element in the\n * array is the horizontal offset. A positive value shifts the overlay right.\n * The second element in the array is the vertical offset. A positive value\n * shifts the overlay down.\n * @property {import(\"./coordinate.js\").Coordinate} [position] The overlay position\n * in map projection.\n * @property {Positioning} [positioning='top-left'] Defines how\n * the overlay is actually positioned with respect to its `position` property.\n * Possible values are `'bottom-left'`, `'bottom-center'`, `'bottom-right'`,\n * `'center-left'`, `'center-center'`, `'center-right'`, `'top-left'`,\n * `'top-center'`, and `'top-right'`.\n * @property {boolean} [stopEvent=true] Whether event propagation to the map\n * viewport should be stopped. If `true` the overlay is placed in the same\n * container as that of the controls (CSS class name\n * `ol-overlaycontainer-stopevent`); if `false` it is placed in the container\n * with CSS class name specified by the `className` property.\n * @property {boolean} [insertFirst=true] Whether the overlay is inserted first\n * in the overlay container, or appended. If the overlay is placed in the same\n * container as that of the controls (see the `stopEvent` option) you will\n * probably set `insertFirst` to `true` so the overlay is displayed below the\n * controls.\n * @property {PanIntoViewOptions|boolean} [autoPan=false] Pan the map when calling\n * `setPosition`, so that the overlay is entirely visible in the current viewport.\n * @property {string} [className='ol-overlay-container ol-selectable'] CSS class\n * name.\n */\n\n/**\n * @typedef {Object} PanOptions\n * @property {number} [duration=1000] The duration of the animation in\n * milliseconds.\n * @property {function(number):number} [easing] The easing function to use. Can\n * be one from {@link module:ol/easing} or a custom function.\n * Default is {@link module:ol/easing.inAndOut}.\n */\n\n/**\n * @typedef {Object} PanIntoViewOptions\n * @property {PanOptions} [animation={}] The animation parameters for the pan\n * @property {number} [margin=20] The margin (in pixels) between the\n * overlay and the borders of the map when panning into view.\n */\n\n/**\n * @enum {string}\n * @protected\n */\nconst Property = {\n ELEMENT: 'element',\n MAP: 'map',\n OFFSET: 'offset',\n POSITION: 'position',\n POSITIONING: 'positioning'\n};\n\n/**\n * @typedef {import(\"./ObjectEventType\").Types|'change:element'|'change:map'|'change:offset'|'change:position'|\n * 'change:positioning'} OverlayObjectEventTypes\n */\n\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<OverlayObjectEventTypes, import(\"./Object\").ObjectEvent, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|OverlayObjectEventTypes, Return>} OverlayOnSignature\n */\n\n/**\n * @classdesc\n * An element to be displayed over the map and attached to a single map\n * location. Like {@link module:ol/control/Control~Control}, Overlays are\n * visible widgets. Unlike Controls, they are not in a fixed position on the\n * screen, but are tied to a geographical coordinate, so panning the map will\n * move an Overlay but not a Control.\n *\n * Example:\n *\n * import Overlay from 'ol/Overlay.js';\n *\n * // ...\n * const popup = new Overlay({\n * element: document.getElementById('popup'),\n * });\n * popup.setPosition(coordinate);\n * map.addOverlay(popup);\n *\n * @api\n */\nclass Overlay extends _Object_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} options Overlay options.\n */\n constructor(options) {\n super();\n\n /***\n * @type {OverlayOnSignature<import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {OverlayOnSignature<import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {OverlayOnSignature<void>}\n */\n this.un;\n\n /**\n * @protected\n * @type {Options}\n */\n this.options = options;\n\n /**\n * @protected\n * @type {number|string|undefined}\n */\n this.id = options.id;\n\n /**\n * @protected\n * @type {boolean}\n */\n this.insertFirst = options.insertFirst !== undefined ? options.insertFirst : true;\n\n /**\n * @protected\n * @type {boolean}\n */\n this.stopEvent = options.stopEvent !== undefined ? options.stopEvent : true;\n\n /**\n * @protected\n * @type {HTMLElement}\n */\n this.element = document.createElement('div');\n this.element.className = options.className !== undefined ? options.className : 'ol-overlay-container ' + _css_js__WEBPACK_IMPORTED_MODULE_1__.CLASS_SELECTABLE;\n this.element.style.position = 'absolute';\n this.element.style.pointerEvents = 'auto';\n\n /**\n * @protected\n * @type {PanIntoViewOptions|undefined}\n */\n this.autoPan = options.autoPan === true ? {} : options.autoPan || undefined;\n\n /**\n * @protected\n * @type {{transform_: string,\n * visible: boolean}}\n */\n this.rendered = {\n transform_: '',\n visible: true\n };\n\n /**\n * @protected\n * @type {?import(\"./events.js\").EventsKey}\n */\n this.mapPostrenderListenerKey = null;\n this.addChangeListener(Property.ELEMENT, this.handleElementChanged);\n this.addChangeListener(Property.MAP, this.handleMapChanged);\n this.addChangeListener(Property.OFFSET, this.handleOffsetChanged);\n this.addChangeListener(Property.POSITION, this.handlePositionChanged);\n this.addChangeListener(Property.POSITIONING, this.handlePositioningChanged);\n if (options.element !== undefined) {\n this.setElement(options.element);\n }\n this.setOffset(options.offset !== undefined ? options.offset : [0, 0]);\n this.setPositioning(options.positioning || 'top-left');\n if (options.position !== undefined) {\n this.setPosition(options.position);\n }\n }\n\n /**\n * Get the DOM element of this overlay.\n * @return {HTMLElement|undefined} The Element containing the overlay.\n * @observable\n * @api\n */\n getElement() {\n return /** @type {HTMLElement|undefined} */this.get(Property.ELEMENT);\n }\n\n /**\n * Get the overlay identifier which is set on constructor.\n * @return {number|string|undefined} Id.\n * @api\n */\n getId() {\n return this.id;\n }\n\n /**\n * Get the map associated with this overlay.\n * @return {import(\"./Map.js\").default|null} The map that the\n * overlay is part of.\n * @observable\n * @api\n */\n getMap() {\n return /** @type {import(\"./Map.js\").default|null} */this.get(Property.MAP) || null;\n }\n\n /**\n * Get the offset of this overlay.\n * @return {Array<number>} The offset.\n * @observable\n * @api\n */\n getOffset() {\n return /** @type {Array<number>} */this.get(Property.OFFSET);\n }\n\n /**\n * Get the current position of this overlay.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} The spatial point that the overlay is\n * anchored at.\n * @observable\n * @api\n */\n getPosition() {\n return /** @type {import(\"./coordinate.js\").Coordinate|undefined} */this.get(Property.POSITION);\n }\n\n /**\n * Get the current positioning of this overlay.\n * @return {Positioning} How the overlay is positioned\n * relative to its point on the map.\n * @observable\n * @api\n */\n getPositioning() {\n return /** @type {Positioning} */this.get(Property.POSITIONING);\n }\n\n /**\n * @protected\n */\n handleElementChanged() {\n (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.removeChildren)(this.element);\n const element = this.getElement();\n if (element) {\n this.element.appendChild(element);\n }\n }\n\n /**\n * @protected\n */\n handleMapChanged() {\n if (this.mapPostrenderListenerKey) {\n (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.removeNode)(this.element);\n (0,_events_js__WEBPACK_IMPORTED_MODULE_3__.unlistenByKey)(this.mapPostrenderListenerKey);\n this.mapPostrenderListenerKey = null;\n }\n const map = this.getMap();\n if (map) {\n this.mapPostrenderListenerKey = (0,_events_js__WEBPACK_IMPORTED_MODULE_3__.listen)(map, _MapEventType_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].POSTRENDER, this.render, this);\n this.updatePixelPosition();\n const container = this.stopEvent ? map.getOverlayContainerStopEvent() : map.getOverlayContainer();\n if (this.insertFirst) {\n container.insertBefore(this.element, container.childNodes[0] || null);\n } else {\n container.appendChild(this.element);\n }\n this.performAutoPan();\n }\n }\n\n /**\n * @protected\n */\n render() {\n this.updatePixelPosition();\n }\n\n /**\n * @protected\n */\n handleOffsetChanged() {\n this.updatePixelPosition();\n }\n\n /**\n * @protected\n */\n handlePositionChanged() {\n this.updatePixelPosition();\n this.performAutoPan();\n }\n\n /**\n * @protected\n */\n handlePositioningChanged() {\n this.updatePixelPosition();\n }\n\n /**\n * Set the DOM element to be associated with this overlay.\n * @param {HTMLElement|undefined} element The Element containing the overlay.\n * @observable\n * @api\n */\n setElement(element) {\n this.set(Property.ELEMENT, element);\n }\n\n /**\n * Set the map to be associated with this overlay.\n * @param {import(\"./Map.js\").default|null} map The map that the\n * overlay is part of. Pass `null` to just remove the overlay from the current map.\n * @observable\n * @api\n */\n setMap(map) {\n this.set(Property.MAP, map);\n }\n\n /**\n * Set the offset for this overlay.\n * @param {Array<number>} offset Offset.\n * @observable\n * @api\n */\n setOffset(offset) {\n this.set(Property.OFFSET, offset);\n }\n\n /**\n * Set the position for this overlay. If the position is `undefined` the\n * overlay is hidden.\n * @param {import(\"./coordinate.js\").Coordinate|undefined} position The spatial point that the overlay\n * is anchored at.\n * @observable\n * @api\n */\n setPosition(position) {\n this.set(Property.POSITION, position);\n }\n\n /**\n * Pan the map so that the overlay is entirely visible in the current viewport\n * (if necessary) using the configured autoPan parameters\n * @protected\n */\n performAutoPan() {\n if (this.autoPan) {\n this.panIntoView(this.autoPan);\n }\n }\n\n /**\n * Pan the map so that the overlay is entirely visible in the current viewport\n * (if necessary).\n * @param {PanIntoViewOptions} [panIntoViewOptions] Options for the pan action\n * @api\n */\n panIntoView(panIntoViewOptions) {\n const map = this.getMap();\n if (!map || !map.getTargetElement() || !this.get(Property.POSITION)) {\n return;\n }\n const mapRect = this.getRect(map.getTargetElement(), map.getSize());\n const element = this.getElement();\n const overlayRect = this.getRect(element, [(0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.outerWidth)(element), (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.outerHeight)(element)]);\n panIntoViewOptions = panIntoViewOptions || {};\n const myMargin = panIntoViewOptions.margin === undefined ? 20 : panIntoViewOptions.margin;\n if (!(0,_extent_js__WEBPACK_IMPORTED_MODULE_5__.containsExtent)(mapRect, overlayRect)) {\n // the overlay is not completely inside the viewport, so pan the map\n const offsetLeft = overlayRect[0] - mapRect[0];\n const offsetRight = mapRect[2] - overlayRect[2];\n const offsetTop = overlayRect[1] - mapRect[1];\n const offsetBottom = mapRect[3] - overlayRect[3];\n const delta = [0, 0];\n if (offsetLeft < 0) {\n // move map to the left\n delta[0] = offsetLeft - myMargin;\n } else if (offsetRight < 0) {\n // move map to the right\n delta[0] = Math.abs(offsetRight) + myMargin;\n }\n if (offsetTop < 0) {\n // move map up\n delta[1] = offsetTop - myMargin;\n } else if (offsetBottom < 0) {\n // move map down\n delta[1] = Math.abs(offsetBottom) + myMargin;\n }\n if (delta[0] !== 0 || delta[1] !== 0) {\n const center = /** @type {import(\"./coordinate.js\").Coordinate} */\n map.getView().getCenterInternal();\n const centerPx = map.getPixelFromCoordinateInternal(center);\n if (!centerPx) {\n return;\n }\n const newCenterPx = [centerPx[0] + delta[0], centerPx[1] + delta[1]];\n const panOptions = panIntoViewOptions.animation || {};\n map.getView().animateInternal({\n center: map.getCoordinateFromPixelInternal(newCenterPx),\n duration: panOptions.duration,\n easing: panOptions.easing\n });\n }\n }\n }\n\n /**\n * Get the extent of an element relative to the document\n * @param {HTMLElement} element The element.\n * @param {import(\"./size.js\").Size} size The size of the element.\n * @return {import(\"./extent.js\").Extent} The extent.\n * @protected\n */\n getRect(element, size) {\n const box = element.getBoundingClientRect();\n const offsetX = box.left + window.pageXOffset;\n const offsetY = box.top + window.pageYOffset;\n return [offsetX, offsetY, offsetX + size[0], offsetY + size[1]];\n }\n\n /**\n * Set the positioning for this overlay.\n * @param {Positioning} positioning how the overlay is\n * positioned relative to its point on the map.\n * @observable\n * @api\n */\n setPositioning(positioning) {\n this.set(Property.POSITIONING, positioning);\n }\n\n /**\n * Modify the visibility of the element.\n * @param {boolean} visible Element visibility.\n * @protected\n */\n setVisible(visible) {\n if (this.rendered.visible !== visible) {\n this.element.style.display = visible ? '' : 'none';\n this.rendered.visible = visible;\n }\n }\n\n /**\n * Update pixel position.\n * @protected\n */\n updatePixelPosition() {\n const map = this.getMap();\n const position = this.getPosition();\n if (!map || !map.isRendered() || !position) {\n this.setVisible(false);\n return;\n }\n const pixel = map.getPixelFromCoordinate(position);\n const mapSize = map.getSize();\n this.updateRenderedPosition(pixel, mapSize);\n }\n\n /**\n * @param {import(\"./pixel.js\").Pixel} pixel The pixel location.\n * @param {import(\"./size.js\").Size|undefined} mapSize The map size.\n * @protected\n */\n updateRenderedPosition(pixel, mapSize) {\n const style = this.element.style;\n const offset = this.getOffset();\n const positioning = this.getPositioning();\n this.setVisible(true);\n const x = Math.round(pixel[0] + offset[0]) + 'px';\n const y = Math.round(pixel[1] + offset[1]) + 'px';\n let posX = '0%';\n let posY = '0%';\n if (positioning == 'bottom-right' || positioning == 'center-right' || positioning == 'top-right') {\n posX = '-100%';\n } else if (positioning == 'bottom-center' || positioning == 'center-center' || positioning == 'top-center') {\n posX = '-50%';\n }\n if (positioning == 'bottom-left' || positioning == 'bottom-center' || positioning == 'bottom-right') {\n posY = '-100%';\n } else if (positioning == 'center-left' || positioning == 'center-center' || positioning == 'center-right') {\n posY = '-50%';\n }\n const transform = `translate(${posX}, ${posY}) translate(${x}, ${y})`;\n if (this.rendered.transform_ != transform) {\n this.rendered.transform_ = transform;\n style.transform = transform;\n }\n }\n\n /**\n * returns the options this Overlay has been created with\n * @return {Options} overlay options\n */\n getOptions() {\n return this.options;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Overlay);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/Overlay.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/TileQueue.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/ol/TileQueue.js ***!
|
||
\**************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getTilePriority: function() { return /* binding */ getTilePriority; }\n/* harmony export */ });\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _structs_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./structs/PriorityQueue.js */ \"./node_modules/ol/structs/PriorityQueue.js\");\n/* harmony import */ var _TileState_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TileState.js */ \"./node_modules/ol/TileState.js\");\n/**\n * @module ol/TileQueue\n */\n\n\n\n\n/**\n * @typedef {function(import(\"./Tile.js\").default, string, import(\"./coordinate.js\").Coordinate, number): number} PriorityFunction\n */\n\nclass TileQueue extends _structs_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {PriorityFunction} tilePriorityFunction Tile priority function.\n * @param {function(): ?} tileChangeCallback Function called on each tile change event.\n */\n constructor(tilePriorityFunction, tileChangeCallback) {\n super(\n /**\n * @param {Array} element Element.\n * @return {number} Priority.\n */\n function (element) {\n return tilePriorityFunction.apply(null, element);\n },\n /**\n * @param {Array} element Element.\n * @return {string} Key.\n */\n function (element) {\n return /** @type {import(\"./Tile.js\").default} */element[0].getKey();\n });\n\n /** @private */\n this.boundHandleTileChange_ = this.handleTileChange.bind(this);\n\n /**\n * @private\n * @type {function(): ?}\n */\n this.tileChangeCallback_ = tileChangeCallback;\n\n /**\n * @private\n * @type {number}\n */\n this.tilesLoading_ = 0;\n\n /**\n * @private\n * @type {!Object<string,boolean>}\n */\n this.tilesLoadingKeys_ = {};\n }\n\n /**\n * @param {Array} element Element.\n * @return {boolean} The element was added to the queue.\n */\n enqueue(element) {\n const added = super.enqueue(element);\n if (added) {\n const tile = element[0];\n tile.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].CHANGE, this.boundHandleTileChange_);\n }\n return added;\n }\n\n /**\n * @return {number} Number of tiles loading.\n */\n getTilesLoading() {\n return this.tilesLoading_;\n }\n\n /**\n * @param {import(\"./events/Event.js\").default} event Event.\n * @protected\n */\n handleTileChange(event) {\n const tile = /** @type {import(\"./Tile.js\").default} */event.target;\n const state = tile.getState();\n if (state === _TileState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].LOADED || state === _TileState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ERROR || state === _TileState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].EMPTY) {\n if (state !== _TileState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ERROR) {\n tile.removeEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].CHANGE, this.boundHandleTileChange_);\n }\n const tileKey = tile.getKey();\n if (tileKey in this.tilesLoadingKeys_) {\n delete this.tilesLoadingKeys_[tileKey];\n --this.tilesLoading_;\n }\n this.tileChangeCallback_();\n }\n }\n\n /**\n * @param {number} maxTotalLoading Maximum number tiles to load simultaneously.\n * @param {number} maxNewLoads Maximum number of new tiles to load.\n */\n loadMoreTiles(maxTotalLoading, maxNewLoads) {\n let newLoads = 0;\n let state, tile, tileKey;\n while (this.tilesLoading_ < maxTotalLoading && newLoads < maxNewLoads && this.getCount() > 0) {\n tile = /** @type {import(\"./Tile.js\").default} */this.dequeue()[0];\n tileKey = tile.getKey();\n state = tile.getState();\n if (state === _TileState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].IDLE && !(tileKey in this.tilesLoadingKeys_)) {\n this.tilesLoadingKeys_[tileKey] = true;\n ++this.tilesLoading_;\n ++newLoads;\n tile.load();\n }\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (TileQueue);\n\n/**\n * @param {import('./Map.js').FrameState} frameState Frame state.\n * @param {import(\"./Tile.js\").default} tile Tile.\n * @param {string} tileSourceKey Tile source key.\n * @param {import(\"./coordinate.js\").Coordinate} tileCenter Tile center.\n * @param {number} tileResolution Tile resolution.\n * @return {number} Tile priority.\n */\nfunction getTilePriority(frameState, tile, tileSourceKey, tileCenter, tileResolution) {\n // Filter out tiles at higher zoom levels than the current zoom level, or that\n // are outside the visible extent.\n if (!frameState || !(tileSourceKey in frameState.wantedTiles)) {\n return _structs_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_0__.DROP;\n }\n if (!frameState.wantedTiles[tileSourceKey][tile.getKey()]) {\n return _structs_PriorityQueue_js__WEBPACK_IMPORTED_MODULE_0__.DROP;\n }\n // Prioritize the highest zoom level tiles closest to the focus.\n // Tiles at higher zoom levels are prioritized using Math.log(tileResolution).\n // Within a zoom level, tiles are prioritized by the distance in pixels between\n // the center of the tile and the center of the viewport. The factor of 65536\n // means that the prioritization should behave as desired for tiles up to\n // 65536 * Math.log(2) = 45426 pixels from the focus.\n const center = frameState.viewState.center;\n const deltaX = tileCenter[0] - center[0];\n const deltaY = tileCenter[1] - center[1];\n return 65536 * Math.log(tileResolution) + Math.sqrt(deltaX * deltaX + deltaY * deltaY) / tileResolution;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/TileQueue.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/TileState.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/ol/TileState.js ***!
|
||
\**************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/TileState\n */\n\n/**\n * @enum {number}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n IDLE: 0,\n LOADING: 1,\n LOADED: 2,\n /**\n * Indicates that tile loading failed\n * @type {number}\n */\n ERROR: 3,\n EMPTY: 4\n});\n\n//# sourceURL=webpack://complexes/./node_modules/ol/TileState.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/View.js":
|
||
/*!*********************************!*\
|
||
!*** ./node_modules/ol/View.js ***!
|
||
\*********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createCenterConstraint: function() { return /* binding */ createCenterConstraint; },\n/* harmony export */ createResolutionConstraint: function() { return /* binding */ createResolutionConstraint; },\n/* harmony export */ createRotationConstraint: function() { return /* binding */ createRotationConstraint; },\n/* harmony export */ isNoopAnimation: function() { return /* binding */ isNoopAnimation; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Object.js */ \"./node_modules/ol/Object.js\");\n/* harmony import */ var _ViewHint_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ViewHint.js */ \"./node_modules/ol/ViewHint.js\");\n/* harmony import */ var _ViewProperty_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ViewProperty.js */ \"./node_modules/ol/ViewProperty.js\");\n/* harmony import */ var _tilegrid_common_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./tilegrid/common.js */ \"./node_modules/ol/tilegrid/common.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./proj.js */ \"./node_modules/ol/proj.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _coordinate_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./coordinate.js */ \"./node_modules/ol/coordinate.js\");\n/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./asserts.js */ \"./node_modules/ol/asserts.js\");\n/* harmony import */ var _centerconstraint_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./centerconstraint.js */ \"./node_modules/ol/centerconstraint.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./math.js */ \"./node_modules/ol/math.js\");\n/* harmony import */ var _resolutionconstraint_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./resolutionconstraint.js */ \"./node_modules/ol/resolutionconstraint.js\");\n/* harmony import */ var _rotationconstraint_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./rotationconstraint.js */ \"./node_modules/ol/rotationconstraint.js\");\n/* harmony import */ var _easing_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./easing.js */ \"./node_modules/ol/easing.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _geom_Polygon_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./geom/Polygon.js */ \"./node_modules/ol/geom/Polygon.js\");\n\n/**\n * @module ol/View\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * An animation configuration\n *\n * @typedef {Object} Animation\n * @property {import(\"./coordinate.js\").Coordinate} [sourceCenter] Source center.\n * @property {import(\"./coordinate.js\").Coordinate} [targetCenter] Target center.\n * @property {number} [sourceResolution] Source resolution.\n * @property {number} [targetResolution] Target resolution.\n * @property {number} [sourceRotation] Source rotation.\n * @property {number} [targetRotation] Target rotation.\n * @property {import(\"./coordinate.js\").Coordinate} [anchor] Anchor.\n * @property {number} start Start.\n * @property {number} duration Duration.\n * @property {boolean} complete Complete.\n * @property {function(number):number} easing Easing.\n * @property {function(boolean):void} callback Callback.\n */\n\n/**\n * @typedef {Object} Constraints\n * @property {import(\"./centerconstraint.js\").Type} center Center.\n * @property {import(\"./resolutionconstraint.js\").Type} resolution Resolution.\n * @property {import(\"./rotationconstraint.js\").Type} rotation Rotation.\n */\n\n/**\n * @typedef {Object} FitOptions\n * @property {import(\"./size.js\").Size} [size] The size in pixels of the box to\n * fit the extent into. Defaults to the size of the map the view is associated with.\n * If no map or multiple maps are connected to the view, provide the desired box size\n * (e.g. `map.getSize()`).\n * @property {!Array<number>} [padding=[0, 0, 0, 0]] Padding (in pixels) to be\n * cleared inside the view. Values in the array are top, right, bottom and left\n * padding.\n * @property {boolean} [nearest=false] If the view `constrainResolution` option is `true`,\n * get the nearest extent instead of the closest that actually fits the view.\n * @property {number} [minResolution=0] Minimum resolution that we zoom to.\n * @property {number} [maxZoom] Maximum zoom level that we zoom to. If\n * `minResolution` is given, this property is ignored.\n * @property {number} [duration] The duration of the animation in milliseconds.\n * By default, there is no animation to the target extent.\n * @property {function(number):number} [easing] The easing function used during\n * the animation (defaults to {@link module:ol/easing.inAndOut}).\n * The function will be called for each frame with a number representing a\n * fraction of the animation's duration. The function should return a number\n * between 0 and 1 representing the progress toward the destination state.\n * @property {function(boolean):void} [callback] Function called when the view is in\n * its final position. The callback will be called with `true` if the animation\n * series completed on its own or `false` if it was cancelled.\n */\n\n/**\n * @typedef {Object} ViewOptions\n * @property {import(\"./coordinate.js\").Coordinate} [center] The initial center for\n * the view. If a user projection is not set, the coordinate system for the center is\n * specified with the `projection` option. Layer sources will not be fetched if this\n * is not set, but the center can be set later with {@link #setCenter}.\n * @property {boolean|number} [constrainRotation=true] Rotation constraint.\n * `false` means no constraint. `true` means no constraint, but snap to zero\n * near zero. A number constrains the rotation to that number of values. For\n * example, `4` will constrain the rotation to 0, 90, 180, and 270 degrees.\n * @property {boolean} [enableRotation=true] Enable rotation.\n * If `false`, a rotation constraint that always sets the rotation to zero is\n * used. The `constrainRotation` option has no effect if `enableRotation` is\n * `false`.\n * @property {import(\"./extent.js\").Extent} [extent] The extent that constrains the\n * view, in other words, nothing outside of this extent can be visible on the map.\n * @property {boolean} [constrainOnlyCenter=false] If true, the extent\n * constraint will only apply to the view center and not the whole extent.\n * @property {boolean} [smoothExtentConstraint=true] If true, the extent\n * constraint will be applied smoothly, i.e. allow the view to go slightly outside\n * of the given `extent`.\n * @property {number} [maxResolution] The maximum resolution used to determine\n * the resolution constraint. It is used together with `minResolution` (or\n * `maxZoom`) and `zoomFactor`. If unspecified it is calculated in such a way\n * that the projection's validity extent fits in a 256x256 px tile. If the\n * projection is Spherical Mercator (the default) then `maxResolution` defaults\n * to `40075016.68557849 / 256 = 156543.03392804097`.\n * @property {number} [minResolution] The minimum resolution used to determine\n * the resolution constraint. It is used together with `maxResolution` (or\n * `minZoom`) and `zoomFactor`. If unspecified it is calculated assuming 29\n * zoom levels (with a factor of 2). If the projection is Spherical Mercator\n * (the default) then `minResolution` defaults to\n * `40075016.68557849 / 256 / Math.pow(2, 28) = 0.0005831682455839253`.\n * @property {number} [maxZoom=28] The maximum zoom level used to determine the\n * resolution constraint. It is used together with `minZoom` (or\n * `maxResolution`) and `zoomFactor`. Note that if `minResolution` is also\n * provided, it is given precedence over `maxZoom`.\n * @property {number} [minZoom=0] The minimum zoom level used to determine the\n * resolution constraint. It is used together with `maxZoom` (or\n * `minResolution`) and `zoomFactor`. Note that if `maxResolution` is also\n * provided, it is given precedence over `minZoom`.\n * @property {boolean} [multiWorld=false] If `false` the view is constrained so\n * only one world is visible, and you cannot pan off the edge. If `true` the map\n * may show multiple worlds at low zoom levels. Only used if the `projection` is\n * global. Note that if `extent` is also provided it is given precedence.\n * @property {boolean} [constrainResolution=false] If true, the view will always\n * animate to the closest zoom level after an interaction; false means\n * intermediary zoom levels are allowed.\n * @property {boolean} [smoothResolutionConstraint=true] If true, the resolution\n * min/max values will be applied smoothly, i. e. allow the view to exceed slightly\n * the given resolution or zoom bounds.\n * @property {boolean} [showFullExtent=false] Allow the view to be zoomed out to\n * show the full configured extent. By default, when a view is configured with an\n * extent, users will not be able to zoom out so the viewport exceeds the extent in\n * either dimension. This means the full extent may not be visible if the viewport\n * is taller or wider than the aspect ratio of the configured extent. If\n * showFullExtent is true, the user will be able to zoom out so that the viewport\n * exceeds the height or width of the configured extent, but not both, allowing the\n * full extent to be shown.\n * @property {import(\"./proj.js\").ProjectionLike} [projection='EPSG:3857'] The\n * projection. The default is Spherical Mercator.\n * @property {number} [resolution] The initial resolution for the view. The\n * units are `projection` units per pixel (e.g. meters per pixel). An\n * alternative to setting this is to set `zoom`. Layer sources will not be\n * fetched if neither this nor `zoom` are defined, but they can be set later\n * with {@link #setZoom} or {@link #setResolution}.\n * @property {Array<number>} [resolutions] Resolutions that determine the\n * zoom levels if specified. The index in the array corresponds to the zoom level,\n * therefore the resolution values have to be in descending order. It also constrains\n * the resolution by the minimum and maximum value. If set the `maxResolution`,\n * `minResolution`, `minZoom`, `maxZoom`, and `zoomFactor` options are ignored.\n * @property {number} [rotation=0] The initial rotation for the view in radians\n * (positive rotation clockwise, 0 means North).\n * @property {number} [zoom] Only used if `resolution` is not defined. Zoom\n * level used to calculate the initial resolution for the view.\n * @property {number} [zoomFactor=2] The zoom factor used to compute the\n * corresponding resolution.\n * @property {!Array<number>} [padding=[0, 0, 0, 0]] Padding (in css pixels).\n * If the map viewport is partially covered with other content (overlays) along\n * its edges, this setting allows to shift the center of the viewport away from\n * that content. The order of the values is top, right, bottom, left.\n */\n\n/**\n * @typedef {Object} AnimationOptions\n * @property {import(\"./coordinate.js\").Coordinate} [center] The center of the view at the end of\n * the animation.\n * @property {number} [zoom] The zoom level of the view at the end of the\n * animation. This takes precedence over `resolution`.\n * @property {number} [resolution] The resolution of the view at the end\n * of the animation. If `zoom` is also provided, this option will be ignored.\n * @property {number} [rotation] The rotation of the view at the end of\n * the animation.\n * @property {import(\"./coordinate.js\").Coordinate} [anchor] Optional anchor to remain fixed\n * during a rotation or resolution animation.\n * @property {number} [duration=1000] The duration of the animation in milliseconds.\n * @property {function(number):number} [easing] The easing function used\n * during the animation (defaults to {@link module:ol/easing.inAndOut}).\n * The function will be called for each frame with a number representing a\n * fraction of the animation's duration. The function should return a number\n * between 0 and 1 representing the progress toward the destination state.\n */\n\n/**\n * @typedef {Object} State\n * @property {import(\"./coordinate.js\").Coordinate} center Center (in view projection coordinates).\n * @property {import(\"./proj/Projection.js\").default} projection Projection.\n * @property {number} resolution Resolution.\n * @property {import(\"./coordinate.js\").Coordinate} [nextCenter] The next center during an animation series.\n * @property {number} [nextResolution] The next resolution during an animation series.\n * @property {number} [nextRotation] The next rotation during an animation series.\n * @property {number} rotation Rotation.\n * @property {number} zoom Zoom.\n */\n\n/**\n * Like {@link import(\"./Map.js\").FrameState}, but just `viewState` and `extent`.\n * @typedef {Object} ViewStateLayerStateExtent\n * @property {State} viewState View state.\n * @property {import(\"./extent.js\").Extent} extent Extent (in user projection coordinates).\n * @property {Array<import(\"./layer/Layer.js\").State>} [layerStatesArray] Layer states.\n */\n\n/**\n * Default min zoom level for the map view.\n * @type {number}\n */\nconst DEFAULT_MIN_ZOOM = 0;\n\n/**\n * @typedef {import(\"./ObjectEventType\").Types|'change:center'|'change:resolution'|'change:rotation'} ViewObjectEventTypes\n */\n\n/***\n * @template Return\n * @typedef {import(\"./Observable\").OnSignature<import(\"./Observable\").EventTypes, import(\"./events/Event.js\").default, Return> &\n * import(\"./Observable\").OnSignature<ViewObjectEventTypes, import(\"./Object\").ObjectEvent, Return> &\n * import(\"./Observable\").CombinedOnSignature<import(\"./Observable\").EventTypes|ViewObjectEventTypes, Return>} ViewOnSignature\n */\n\n/**\n * @classdesc\n * A View object represents a simple 2D view of the map.\n *\n * This is the object to act upon to change the center, resolution,\n * and rotation of the map.\n *\n * A View has a `projection`. The projection determines the\n * coordinate system of the center, and its units determine the units of the\n * resolution (projection units per pixel). The default projection is\n * Web Mercator (EPSG:3857).\n *\n * ### The view states\n *\n * A View is determined by three states: `center`, `resolution`,\n * and `rotation`. Each state has a corresponding getter and setter, e.g.\n * `getCenter` and `setCenter` for the `center` state.\n *\n * The `zoom` state is actually not saved on the view: all computations\n * internally use the `resolution` state. Still, the `setZoom` and `getZoom`\n * methods are available, as well as `getResolutionForZoom` and\n * `getZoomForResolution` to switch from one system to the other.\n *\n * ### The constraints\n *\n * `setCenter`, `setResolution` and `setRotation` can be used to change the\n * states of the view, but any constraint defined in the constructor will\n * be applied along the way.\n *\n * A View object can have a *resolution constraint*, a *rotation constraint*\n * and a *center constraint*.\n *\n * The *resolution constraint* typically restricts min/max values and\n * snaps to specific resolutions. It is determined by the following\n * options: `resolutions`, `maxResolution`, `maxZoom` and `zoomFactor`.\n * If `resolutions` is set, the other three options are ignored. See\n * documentation for each option for more information. By default, the view\n * only has a min/max restriction and allow intermediary zoom levels when\n * pinch-zooming for example.\n *\n * The *rotation constraint* snaps to specific angles. It is determined\n * by the following options: `enableRotation` and `constrainRotation`.\n * By default rotation is allowed and its value is snapped to zero when approaching the\n * horizontal.\n *\n * The *center constraint* is determined by the `extent` option. By\n * default the view center is not constrained at all.\n *\n * ### Changing the view state\n *\n * It is important to note that `setZoom`, `setResolution`, `setCenter` and\n * `setRotation` are subject to the above mentioned constraints. As such, it\n * may sometimes not be possible to know in advance the resulting state of the\n * View. For example, calling `setResolution(10)` does not guarantee that\n * `getResolution()` will return `10`.\n *\n * A consequence of this is that, when applying a delta on the view state, one\n * should use `adjustCenter`, `adjustRotation`, `adjustZoom` and `adjustResolution`\n * rather than the corresponding setters. This will let view do its internal\n * computations. Besides, the `adjust*` methods also take an `anchor`\n * argument which allows specifying an origin for the transformation.\n *\n * ### Interacting with the view\n *\n * View constraints are usually only applied when the view is *at rest*, meaning that\n * no interaction or animation is ongoing. As such, if the user puts the view in a\n * state that is not equivalent to a constrained one (e.g. rotating the view when\n * the snap angle is 0), an animation will be triggered at the interaction end to\n * put back the view to a stable state;\n *\n * @api\n */\nclass View extends _Object_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n /**\n * @param {ViewOptions} [options] View options.\n */\n constructor(options) {\n super();\n\n /***\n * @type {ViewOnSignature<import(\"./events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {ViewOnSignature<import(\"./events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {ViewOnSignature<void>}\n */\n this.un;\n options = Object.assign({}, options);\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.hints_ = [0, 0];\n\n /**\n * @private\n * @type {Array<Array<Animation>>}\n */\n this.animations_ = [];\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.updateAnimationKey_;\n\n /**\n * @private\n * @const\n * @type {import(\"./proj/Projection.js\").default}\n */\n this.projection_ = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.createProjection)(options.projection, 'EPSG:3857');\n\n /**\n * @private\n * @type {import(\"./size.js\").Size}\n */\n this.viewportSize_ = [100, 100];\n\n /**\n * @private\n * @type {import(\"./coordinate.js\").Coordinate|undefined}\n */\n this.targetCenter_ = null;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.targetResolution_;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.targetRotation_;\n\n /**\n * @private\n * @type {import(\"./coordinate.js\").Coordinate}\n */\n this.nextCenter_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.nextResolution_;\n\n /**\n * @private\n * @type {number}\n */\n this.nextRotation_;\n\n /**\n * @private\n * @type {import(\"./coordinate.js\").Coordinate|undefined}\n */\n this.cancelAnchor_ = undefined;\n if (options.projection) {\n (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.disableCoordinateWarning)();\n }\n if (options.center) {\n options.center = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(options.center, this.projection_);\n }\n if (options.extent) {\n options.extent = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserExtent)(options.extent, this.projection_);\n }\n this.applyOptions_(options);\n }\n\n /**\n * Set up the view with the given options.\n * @param {ViewOptions} options View options.\n */\n applyOptions_(options) {\n const properties = Object.assign({}, options);\n for (const key in _ViewProperty_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]) {\n delete properties[key];\n }\n this.setProperties(properties, true);\n const resolutionConstraintInfo = createResolutionConstraint(options);\n\n /**\n * @private\n * @type {number}\n */\n this.maxResolution_ = resolutionConstraintInfo.maxResolution;\n\n /**\n * @private\n * @type {number}\n */\n this.minResolution_ = resolutionConstraintInfo.minResolution;\n\n /**\n * @private\n * @type {number}\n */\n this.zoomFactor_ = resolutionConstraintInfo.zoomFactor;\n\n /**\n * @private\n * @type {Array<number>|undefined}\n */\n this.resolutions_ = options.resolutions;\n\n /**\n * @type {Array<number>|undefined}\n * @private\n */\n this.padding_ = options.padding;\n\n /**\n * @private\n * @type {number}\n */\n this.minZoom_ = resolutionConstraintInfo.minZoom;\n const centerConstraint = createCenterConstraint(options);\n const resolutionConstraint = resolutionConstraintInfo.constraint;\n const rotationConstraint = createRotationConstraint(options);\n\n /**\n * @private\n * @type {Constraints}\n */\n this.constraints_ = {\n center: centerConstraint,\n resolution: resolutionConstraint,\n rotation: rotationConstraint\n };\n this.setRotation(options.rotation !== undefined ? options.rotation : 0);\n this.setCenterInternal(options.center !== undefined ? options.center : null);\n if (options.resolution !== undefined) {\n this.setResolution(options.resolution);\n } else if (options.zoom !== undefined) {\n this.setZoom(options.zoom);\n }\n }\n\n /**\n * Padding (in css pixels).\n * If the map viewport is partially covered with other content (overlays) along\n * its edges, this setting allows to shift the center of the viewport away from that\n * content. The order of the values in the array is top, right, bottom, left.\n * The default is no padding, which is equivalent to `[0, 0, 0, 0]`.\n * @type {Array<number>|undefined}\n * @api\n */\n get padding() {\n return this.padding_;\n }\n set padding(padding) {\n let oldPadding = this.padding_;\n this.padding_ = padding;\n const center = this.getCenterInternal();\n if (center) {\n const newPadding = padding || [0, 0, 0, 0];\n oldPadding = oldPadding || [0, 0, 0, 0];\n const resolution = this.getResolution();\n const offsetX = resolution / 2 * (newPadding[3] - oldPadding[3] + oldPadding[1] - newPadding[1]);\n const offsetY = resolution / 2 * (newPadding[0] - oldPadding[0] + oldPadding[2] - newPadding[2]);\n this.setCenterInternal([center[0] + offsetX, center[1] - offsetY]);\n }\n }\n\n /**\n * Get an updated version of the view options used to construct the view. The\n * current resolution (or zoom), center, and rotation are applied to any stored\n * options. The provided options can be used to apply new min/max zoom or\n * resolution limits.\n * @param {ViewOptions} newOptions New options to be applied.\n * @return {ViewOptions} New options updated with the current view state.\n */\n getUpdatedOptions_(newOptions) {\n const options = this.getProperties();\n\n // preserve resolution (or zoom)\n if (options.resolution !== undefined) {\n options.resolution = this.getResolution();\n } else {\n options.zoom = this.getZoom();\n }\n\n // preserve center\n options.center = this.getCenterInternal();\n\n // preserve rotation\n options.rotation = this.getRotation();\n return Object.assign({}, options, newOptions);\n }\n\n /**\n * Animate the view. The view's center, zoom (or resolution), and rotation\n * can be animated for smooth transitions between view states. For example,\n * to animate the view to a new zoom level:\n *\n * view.animate({zoom: view.getZoom() + 1});\n *\n * By default, the animation lasts one second and uses in-and-out easing. You\n * can customize this behavior by including `duration` (in milliseconds) and\n * `easing` options (see {@link module:ol/easing}).\n *\n * To chain together multiple animations, call the method with multiple\n * animation objects. For example, to first zoom and then pan:\n *\n * view.animate({zoom: 10}, {center: [0, 0]});\n *\n * If you provide a function as the last argument to the animate method, it\n * will get called at the end of an animation series. The callback will be\n * called with `true` if the animation series completed on its own or `false`\n * if it was cancelled.\n *\n * Animations are cancelled by user interactions (e.g. dragging the map) or by\n * calling `view.setCenter()`, `view.setResolution()`, or `view.setRotation()`\n * (or another method that calls one of these).\n *\n * @param {...(AnimationOptions|function(boolean): void)} var_args Animation\n * options. Multiple animations can be run in series by passing multiple\n * options objects. To run multiple animations in parallel, call the method\n * multiple times. An optional callback can be provided as a final\n * argument. The callback will be called with a boolean indicating whether\n * the animation completed without being cancelled.\n * @api\n */\n animate(var_args) {\n if (this.isDef() && !this.getAnimating()) {\n this.resolveConstraints(0);\n }\n const args = new Array(arguments.length);\n for (let i = 0; i < args.length; ++i) {\n let options = arguments[i];\n if (options.center) {\n options = Object.assign({}, options);\n options.center = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(options.center, this.getProjection());\n }\n if (options.anchor) {\n options = Object.assign({}, options);\n options.anchor = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(options.anchor, this.getProjection());\n }\n args[i] = options;\n }\n this.animateInternal.apply(this, args);\n }\n\n /**\n * @param {...(AnimationOptions|function(boolean): void)} var_args Animation options.\n */\n animateInternal(var_args) {\n let animationCount = arguments.length;\n let callback;\n if (animationCount > 1 && typeof arguments[animationCount - 1] === 'function') {\n callback = arguments[animationCount - 1];\n --animationCount;\n }\n let i = 0;\n for (; i < animationCount && !this.isDef(); ++i) {\n // if view properties are not yet set, shortcut to the final state\n const state = arguments[i];\n if (state.center) {\n this.setCenterInternal(state.center);\n }\n if (state.zoom !== undefined) {\n this.setZoom(state.zoom);\n } else if (state.resolution) {\n this.setResolution(state.resolution);\n }\n if (state.rotation !== undefined) {\n this.setRotation(state.rotation);\n }\n }\n if (i === animationCount) {\n if (callback) {\n animationCallback(callback, true);\n }\n return;\n }\n let start = Date.now();\n let center = this.targetCenter_.slice();\n let resolution = this.targetResolution_;\n let rotation = this.targetRotation_;\n const series = [];\n for (; i < animationCount; ++i) {\n const options = /** @type {AnimationOptions} */arguments[i];\n const animation = {\n start: start,\n complete: false,\n anchor: options.anchor,\n duration: options.duration !== undefined ? options.duration : 1000,\n easing: options.easing || _easing_js__WEBPACK_IMPORTED_MODULE_4__.inAndOut,\n callback: callback\n };\n if (options.center) {\n animation.sourceCenter = center;\n animation.targetCenter = options.center.slice();\n center = animation.targetCenter;\n }\n if (options.zoom !== undefined) {\n animation.sourceResolution = resolution;\n animation.targetResolution = this.getResolutionForZoom(options.zoom);\n resolution = animation.targetResolution;\n } else if (options.resolution) {\n animation.sourceResolution = resolution;\n animation.targetResolution = options.resolution;\n resolution = animation.targetResolution;\n }\n if (options.rotation !== undefined) {\n animation.sourceRotation = rotation;\n const delta = (0,_math_js__WEBPACK_IMPORTED_MODULE_5__.modulo)(options.rotation - rotation + Math.PI, 2 * Math.PI) - Math.PI;\n animation.targetRotation = rotation + delta;\n rotation = animation.targetRotation;\n }\n\n // check if animation is a no-op\n if (isNoopAnimation(animation)) {\n animation.complete = true;\n // we still push it onto the series for callback handling\n } else {\n start += animation.duration;\n }\n series.push(animation);\n }\n this.animations_.push(series);\n this.setHint(_ViewHint_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].ANIMATING, 1);\n this.updateAnimations_();\n }\n\n /**\n * Determine if the view is being animated.\n * @return {boolean} The view is being animated.\n * @api\n */\n getAnimating() {\n return this.hints_[_ViewHint_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].ANIMATING] > 0;\n }\n\n /**\n * Determine if the user is interacting with the view, such as panning or zooming.\n * @return {boolean} The view is being interacted with.\n * @api\n */\n getInteracting() {\n return this.hints_[_ViewHint_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INTERACTING] > 0;\n }\n\n /**\n * Cancel any ongoing animations.\n * @api\n */\n cancelAnimations() {\n this.setHint(_ViewHint_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].ANIMATING, -this.hints_[_ViewHint_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].ANIMATING]);\n let anchor;\n for (let i = 0, ii = this.animations_.length; i < ii; ++i) {\n const series = this.animations_[i];\n if (series[0].callback) {\n animationCallback(series[0].callback, false);\n }\n if (!anchor) {\n for (let j = 0, jj = series.length; j < jj; ++j) {\n const animation = series[j];\n if (!animation.complete) {\n anchor = animation.anchor;\n break;\n }\n }\n }\n }\n this.animations_.length = 0;\n this.cancelAnchor_ = anchor;\n this.nextCenter_ = null;\n this.nextResolution_ = NaN;\n this.nextRotation_ = NaN;\n }\n\n /**\n * Update all animations.\n */\n updateAnimations_() {\n if (this.updateAnimationKey_ !== undefined) {\n cancelAnimationFrame(this.updateAnimationKey_);\n this.updateAnimationKey_ = undefined;\n }\n if (!this.getAnimating()) {\n return;\n }\n const now = Date.now();\n let more = false;\n for (let i = this.animations_.length - 1; i >= 0; --i) {\n const series = this.animations_[i];\n let seriesComplete = true;\n for (let j = 0, jj = series.length; j < jj; ++j) {\n const animation = series[j];\n if (animation.complete) {\n continue;\n }\n const elapsed = now - animation.start;\n let fraction = animation.duration > 0 ? elapsed / animation.duration : 1;\n if (fraction >= 1) {\n animation.complete = true;\n fraction = 1;\n } else {\n seriesComplete = false;\n }\n const progress = animation.easing(fraction);\n if (animation.sourceCenter) {\n const x0 = animation.sourceCenter[0];\n const y0 = animation.sourceCenter[1];\n const x1 = animation.targetCenter[0];\n const y1 = animation.targetCenter[1];\n this.nextCenter_ = animation.targetCenter;\n const x = x0 + progress * (x1 - x0);\n const y = y0 + progress * (y1 - y0);\n this.targetCenter_ = [x, y];\n }\n if (animation.sourceResolution && animation.targetResolution) {\n const resolution = progress === 1 ? animation.targetResolution : animation.sourceResolution + progress * (animation.targetResolution - animation.sourceResolution);\n if (animation.anchor) {\n const size = this.getViewportSize_(this.getRotation());\n const constrainedResolution = this.constraints_.resolution(resolution, 0, size, true);\n this.targetCenter_ = this.calculateCenterZoom(constrainedResolution, animation.anchor);\n }\n this.nextResolution_ = animation.targetResolution;\n this.targetResolution_ = resolution;\n this.applyTargetState_(true);\n }\n if (animation.sourceRotation !== undefined && animation.targetRotation !== undefined) {\n const rotation = progress === 1 ? (0,_math_js__WEBPACK_IMPORTED_MODULE_5__.modulo)(animation.targetRotation + Math.PI, 2 * Math.PI) - Math.PI : animation.sourceRotation + progress * (animation.targetRotation - animation.sourceRotation);\n if (animation.anchor) {\n const constrainedRotation = this.constraints_.rotation(rotation, true);\n this.targetCenter_ = this.calculateCenterRotate(constrainedRotation, animation.anchor);\n }\n this.nextRotation_ = animation.targetRotation;\n this.targetRotation_ = rotation;\n }\n this.applyTargetState_(true);\n more = true;\n if (!animation.complete) {\n break;\n }\n }\n if (seriesComplete) {\n this.animations_[i] = null;\n this.setHint(_ViewHint_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].ANIMATING, -1);\n this.nextCenter_ = null;\n this.nextResolution_ = NaN;\n this.nextRotation_ = NaN;\n const callback = series[0].callback;\n if (callback) {\n animationCallback(callback, true);\n }\n }\n }\n // prune completed series\n this.animations_ = this.animations_.filter(Boolean);\n if (more && this.updateAnimationKey_ === undefined) {\n this.updateAnimationKey_ = requestAnimationFrame(this.updateAnimations_.bind(this));\n }\n }\n\n /**\n * @param {number} rotation Target rotation.\n * @param {import(\"./coordinate.js\").Coordinate} anchor Rotation anchor.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Center for rotation and anchor.\n */\n calculateCenterRotate(rotation, anchor) {\n let center;\n const currentCenter = this.getCenterInternal();\n if (currentCenter !== undefined) {\n center = [currentCenter[0] - anchor[0], currentCenter[1] - anchor[1]];\n (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_7__.rotate)(center, rotation - this.getRotation());\n (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_7__.add)(center, anchor);\n }\n return center;\n }\n\n /**\n * @param {number} resolution Target resolution.\n * @param {import(\"./coordinate.js\").Coordinate} anchor Zoom anchor.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Center for resolution and anchor.\n */\n calculateCenterZoom(resolution, anchor) {\n let center;\n const currentCenter = this.getCenterInternal();\n const currentResolution = this.getResolution();\n if (currentCenter !== undefined && currentResolution !== undefined) {\n const x = anchor[0] - resolution * (anchor[0] - currentCenter[0]) / currentResolution;\n const y = anchor[1] - resolution * (anchor[1] - currentCenter[1]) / currentResolution;\n center = [x, y];\n }\n return center;\n }\n\n /**\n * Returns the current viewport size.\n * @private\n * @param {number} [rotation] Take into account the rotation of the viewport when giving the size\n * @return {import(\"./size.js\").Size} Viewport size or `[100, 100]` when no viewport is found.\n */\n getViewportSize_(rotation) {\n const size = this.viewportSize_;\n if (rotation) {\n const w = size[0];\n const h = size[1];\n return [Math.abs(w * Math.cos(rotation)) + Math.abs(h * Math.sin(rotation)), Math.abs(w * Math.sin(rotation)) + Math.abs(h * Math.cos(rotation))];\n }\n return size;\n }\n\n /**\n * Stores the viewport size on the view. The viewport size is not read every time from the DOM\n * to avoid performance hit and layout reflow.\n * This should be done on map size change.\n * Note: the constraints are not resolved during an animation to avoid stopping it\n * @param {import(\"./size.js\").Size} [size] Viewport size; if undefined, [100, 100] is assumed\n */\n setViewportSize(size) {\n this.viewportSize_ = Array.isArray(size) ? size.slice() : [100, 100];\n if (!this.getAnimating()) {\n this.resolveConstraints(0);\n }\n }\n\n /**\n * Get the view center.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} The center of the view.\n * @observable\n * @api\n */\n getCenter() {\n const center = this.getCenterInternal();\n if (!center) {\n return center;\n }\n return (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserCoordinate)(center, this.getProjection());\n }\n\n /**\n * Get the view center without transforming to user projection.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} The center of the view.\n */\n getCenterInternal() {\n return /** @type {import(\"./coordinate.js\").Coordinate|undefined} */this.get(_ViewProperty_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].CENTER);\n }\n\n /**\n * @return {Constraints} Constraints.\n */\n getConstraints() {\n return this.constraints_;\n }\n\n /**\n * @return {boolean} Resolution constraint is set\n */\n getConstrainResolution() {\n return this.get('constrainResolution');\n }\n\n /**\n * @param {Array<number>} [hints] Destination array.\n * @return {Array<number>} Hint.\n */\n getHints(hints) {\n if (hints !== undefined) {\n hints[0] = this.hints_[0];\n hints[1] = this.hints_[1];\n return hints;\n }\n return this.hints_.slice();\n }\n\n /**\n * Calculate the extent for the current view state and the passed box size.\n * @param {import(\"./size.js\").Size} [size] The pixel dimensions of the box\n * into which the calculated extent should fit. Defaults to the size of the\n * map the view is associated with.\n * If no map or multiple maps are connected to the view, provide the desired\n * box size (e.g. `map.getSize()`).\n * @return {import(\"./extent.js\").Extent} Extent.\n * @api\n */\n calculateExtent(size) {\n const extent = this.calculateExtentInternal(size);\n return (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserExtent)(extent, this.getProjection());\n }\n\n /**\n * @param {import(\"./size.js\").Size} [size] Box pixel size. If not provided,\n * the map's last known viewport size will be used.\n * @return {import(\"./extent.js\").Extent} Extent.\n */\n calculateExtentInternal(size) {\n size = size || this.getViewportSizeMinusPadding_();\n const center = /** @type {!import(\"./coordinate.js\").Coordinate} */\n this.getCenterInternal();\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_8__.assert)(center, 'The view center is not defined');\n const resolution = /** @type {!number} */this.getResolution();\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_8__.assert)(resolution !== undefined, 'The view resolution is not defined');\n const rotation = /** @type {!number} */this.getRotation();\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_8__.assert)(rotation !== undefined, 'The view rotation is not defined');\n return (0,_extent_js__WEBPACK_IMPORTED_MODULE_9__.getForViewAndSize)(center, resolution, rotation, size);\n }\n\n /**\n * Get the maximum resolution of the view.\n * @return {number} The maximum resolution of the view.\n * @api\n */\n getMaxResolution() {\n return this.maxResolution_;\n }\n\n /**\n * Get the minimum resolution of the view.\n * @return {number} The minimum resolution of the view.\n * @api\n */\n getMinResolution() {\n return this.minResolution_;\n }\n\n /**\n * Get the maximum zoom level for the view.\n * @return {number} The maximum zoom level.\n * @api\n */\n getMaxZoom() {\n return /** @type {number} */this.getZoomForResolution(this.minResolution_);\n }\n\n /**\n * Set a new maximum zoom level for the view.\n * @param {number} zoom The maximum zoom level.\n * @api\n */\n setMaxZoom(zoom) {\n this.applyOptions_(this.getUpdatedOptions_({\n maxZoom: zoom\n }));\n }\n\n /**\n * Get the minimum zoom level for the view.\n * @return {number} The minimum zoom level.\n * @api\n */\n getMinZoom() {\n return /** @type {number} */this.getZoomForResolution(this.maxResolution_);\n }\n\n /**\n * Set a new minimum zoom level for the view.\n * @param {number} zoom The minimum zoom level.\n * @api\n */\n setMinZoom(zoom) {\n this.applyOptions_(this.getUpdatedOptions_({\n minZoom: zoom\n }));\n }\n\n /**\n * Set whether the view should allow intermediary zoom levels.\n * @param {boolean} enabled Whether the resolution is constrained.\n * @api\n */\n setConstrainResolution(enabled) {\n this.applyOptions_(this.getUpdatedOptions_({\n constrainResolution: enabled\n }));\n }\n\n /**\n * Get the view projection.\n * @return {import(\"./proj/Projection.js\").default} The projection of the view.\n * @api\n */\n getProjection() {\n return this.projection_;\n }\n\n /**\n * Get the view resolution.\n * @return {number|undefined} The resolution of the view.\n * @observable\n * @api\n */\n getResolution() {\n return /** @type {number|undefined} */this.get(_ViewProperty_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].RESOLUTION);\n }\n\n /**\n * Get the resolutions for the view. This returns the array of resolutions\n * passed to the constructor of the View, or undefined if none were given.\n * @return {Array<number>|undefined} The resolutions of the view.\n * @api\n */\n getResolutions() {\n return this.resolutions_;\n }\n\n /**\n * Get the resolution for a provided extent (in map units) and size (in pixels).\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {import(\"./size.js\").Size} [size] Box pixel size.\n * @return {number} The resolution at which the provided extent will render at\n * the given size.\n * @api\n */\n getResolutionForExtent(extent, size) {\n return this.getResolutionForExtentInternal((0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserExtent)(extent, this.getProjection()), size);\n }\n\n /**\n * Get the resolution for a provided extent (in map units) and size (in pixels).\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {import(\"./size.js\").Size} [size] Box pixel size.\n * @return {number} The resolution at which the provided extent will render at\n * the given size.\n */\n getResolutionForExtentInternal(extent, size) {\n size = size || this.getViewportSizeMinusPadding_();\n const xResolution = (0,_extent_js__WEBPACK_IMPORTED_MODULE_9__.getWidth)(extent) / size[0];\n const yResolution = (0,_extent_js__WEBPACK_IMPORTED_MODULE_9__.getHeight)(extent) / size[1];\n return Math.max(xResolution, yResolution);\n }\n\n /**\n * Return a function that returns a value between 0 and 1 for a\n * resolution. Exponential scaling is assumed.\n * @param {number} [power] Power.\n * @return {function(number): number} Resolution for value function.\n */\n getResolutionForValueFunction(power) {\n power = power || 2;\n const maxResolution = this.getConstrainedResolution(this.maxResolution_);\n const minResolution = this.minResolution_;\n const max = Math.log(maxResolution / minResolution) / Math.log(power);\n return (\n /**\n * @param {number} value Value.\n * @return {number} Resolution.\n */\n function (value) {\n const resolution = maxResolution / Math.pow(power, value * max);\n return resolution;\n }\n );\n }\n\n /**\n * Get the view rotation.\n * @return {number} The rotation of the view in radians.\n * @observable\n * @api\n */\n getRotation() {\n return /** @type {number} */this.get(_ViewProperty_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ROTATION);\n }\n\n /**\n * Return a function that returns a resolution for a value between\n * 0 and 1. Exponential scaling is assumed.\n * @param {number} [power] Power.\n * @return {function(number): number} Value for resolution function.\n */\n getValueForResolutionFunction(power) {\n const logPower = Math.log(power || 2);\n const maxResolution = this.getConstrainedResolution(this.maxResolution_);\n const minResolution = this.minResolution_;\n const max = Math.log(maxResolution / minResolution) / logPower;\n return (\n /**\n * @param {number} resolution Resolution.\n * @return {number} Value.\n */\n function (resolution) {\n const value = Math.log(maxResolution / resolution) / logPower / max;\n return value;\n }\n );\n }\n\n /**\n * Returns the size of the viewport minus padding.\n * @private\n * @param {number} [rotation] Take into account the rotation of the viewport when giving the size\n * @return {import(\"./size.js\").Size} Viewport size reduced by the padding.\n */\n getViewportSizeMinusPadding_(rotation) {\n let size = this.getViewportSize_(rotation);\n const padding = this.padding_;\n if (padding) {\n size = [size[0] - padding[1] - padding[3], size[1] - padding[0] - padding[2]];\n }\n return size;\n }\n\n /**\n * @return {State} View state.\n */\n getState() {\n const projection = this.getProjection();\n const resolution = this.getResolution();\n const rotation = this.getRotation();\n let center = /** @type {import(\"./coordinate.js\").Coordinate} */\n this.getCenterInternal();\n const padding = this.padding_;\n if (padding) {\n const reducedSize = this.getViewportSizeMinusPadding_();\n center = calculateCenterOn(center, this.getViewportSize_(), [reducedSize[0] / 2 + padding[3], reducedSize[1] / 2 + padding[0]], resolution, rotation);\n }\n return {\n center: center.slice(0),\n projection: projection !== undefined ? projection : null,\n resolution: resolution,\n nextCenter: this.nextCenter_,\n nextResolution: this.nextResolution_,\n nextRotation: this.nextRotation_,\n rotation: rotation,\n zoom: this.getZoom()\n };\n }\n\n /**\n * @return {ViewStateLayerStateExtent} Like `FrameState`, but just `viewState` and `extent`.\n */\n getViewStateAndExtent() {\n return {\n viewState: this.getState(),\n extent: this.calculateExtent()\n };\n }\n\n /**\n * Get the current zoom level. This method may return non-integer zoom levels\n * if the view does not constrain the resolution, or if an interaction or\n * animation is underway.\n * @return {number|undefined} Zoom.\n * @api\n */\n getZoom() {\n let zoom;\n const resolution = this.getResolution();\n if (resolution !== undefined) {\n zoom = this.getZoomForResolution(resolution);\n }\n return zoom;\n }\n\n /**\n * Get the zoom level for a resolution.\n * @param {number} resolution The resolution.\n * @return {number|undefined} The zoom level for the provided resolution.\n * @api\n */\n getZoomForResolution(resolution) {\n let offset = this.minZoom_ || 0;\n let max, zoomFactor;\n if (this.resolutions_) {\n const nearest = (0,_array_js__WEBPACK_IMPORTED_MODULE_10__.linearFindNearest)(this.resolutions_, resolution, 1);\n offset = nearest;\n max = this.resolutions_[nearest];\n if (nearest == this.resolutions_.length - 1) {\n zoomFactor = 2;\n } else {\n zoomFactor = max / this.resolutions_[nearest + 1];\n }\n } else {\n max = this.maxResolution_;\n zoomFactor = this.zoomFactor_;\n }\n return offset + Math.log(max / resolution) / Math.log(zoomFactor);\n }\n\n /**\n * Get the resolution for a zoom level.\n * @param {number} zoom Zoom level.\n * @return {number} The view resolution for the provided zoom level.\n * @api\n */\n getResolutionForZoom(zoom) {\n if (this.resolutions_) {\n if (this.resolutions_.length <= 1) {\n return 0;\n }\n const baseLevel = (0,_math_js__WEBPACK_IMPORTED_MODULE_5__.clamp)(Math.floor(zoom), 0, this.resolutions_.length - 2);\n const zoomFactor = this.resolutions_[baseLevel] / this.resolutions_[baseLevel + 1];\n return this.resolutions_[baseLevel] / Math.pow(zoomFactor, (0,_math_js__WEBPACK_IMPORTED_MODULE_5__.clamp)(zoom - baseLevel, 0, 1));\n }\n return this.maxResolution_ / Math.pow(this.zoomFactor_, zoom - this.minZoom_);\n }\n\n /**\n * Fit the given geometry or extent based on the given map size and border.\n * The size is pixel dimensions of the box to fit the extent into.\n * In most cases you will want to use the map size, that is `map.getSize()`.\n * Takes care of the map angle.\n * @param {import(\"./geom/SimpleGeometry.js\").default|import(\"./extent.js\").Extent} geometryOrExtent The geometry or\n * extent to fit the view to.\n * @param {FitOptions} [options] Options.\n * @api\n */\n fit(geometryOrExtent, options) {\n /** @type {import(\"./geom/SimpleGeometry.js\").default} */\n let geometry;\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_8__.assert)(Array.isArray(geometryOrExtent) || typeof (/** @type {?} */geometryOrExtent.getSimplifiedGeometry) === 'function', 'Invalid extent or geometry provided as `geometry`');\n if (Array.isArray(geometryOrExtent)) {\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_8__.assert)(!(0,_extent_js__WEBPACK_IMPORTED_MODULE_9__.isEmpty)(geometryOrExtent), 'Cannot fit empty extent provided as `geometry`');\n const extent = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserExtent)(geometryOrExtent, this.getProjection());\n geometry = (0,_geom_Polygon_js__WEBPACK_IMPORTED_MODULE_11__.fromExtent)(extent);\n } else if (geometryOrExtent.getType() === 'Circle') {\n const extent = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserExtent)(geometryOrExtent.getExtent(), this.getProjection());\n geometry = (0,_geom_Polygon_js__WEBPACK_IMPORTED_MODULE_11__.fromExtent)(extent);\n geometry.rotate(this.getRotation(), (0,_extent_js__WEBPACK_IMPORTED_MODULE_9__.getCenter)(extent));\n } else {\n const userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getUserProjection)();\n if (userProjection) {\n geometry = /** @type {import(\"./geom/SimpleGeometry.js\").default} */\n geometryOrExtent.clone().transform(userProjection, this.getProjection());\n } else {\n geometry = geometryOrExtent;\n }\n }\n this.fitInternal(geometry, options);\n }\n\n /**\n * Calculate rotated extent\n * @param {import(\"./geom/SimpleGeometry.js\").default} geometry The geometry.\n * @return {import(\"./extent\").Extent} The rotated extent for the geometry.\n */\n rotatedExtentForGeometry(geometry) {\n const rotation = this.getRotation();\n const cosAngle = Math.cos(rotation);\n const sinAngle = Math.sin(-rotation);\n const coords = geometry.getFlatCoordinates();\n const stride = geometry.getStride();\n let minRotX = +Infinity;\n let minRotY = +Infinity;\n let maxRotX = -Infinity;\n let maxRotY = -Infinity;\n for (let i = 0, ii = coords.length; i < ii; i += stride) {\n const rotX = coords[i] * cosAngle - coords[i + 1] * sinAngle;\n const rotY = coords[i] * sinAngle + coords[i + 1] * cosAngle;\n minRotX = Math.min(minRotX, rotX);\n minRotY = Math.min(minRotY, rotY);\n maxRotX = Math.max(maxRotX, rotX);\n maxRotY = Math.max(maxRotY, rotY);\n }\n return [minRotX, minRotY, maxRotX, maxRotY];\n }\n\n /**\n * @param {import(\"./geom/SimpleGeometry.js\").default} geometry The geometry.\n * @param {FitOptions} [options] Options.\n */\n fitInternal(geometry, options) {\n options = options || {};\n let size = options.size;\n if (!size) {\n size = this.getViewportSizeMinusPadding_();\n }\n const padding = options.padding !== undefined ? options.padding : [0, 0, 0, 0];\n const nearest = options.nearest !== undefined ? options.nearest : false;\n let minResolution;\n if (options.minResolution !== undefined) {\n minResolution = options.minResolution;\n } else if (options.maxZoom !== undefined) {\n minResolution = this.getResolutionForZoom(options.maxZoom);\n } else {\n minResolution = 0;\n }\n const rotatedExtent = this.rotatedExtentForGeometry(geometry);\n\n // calculate resolution\n let resolution = this.getResolutionForExtentInternal(rotatedExtent, [size[0] - padding[1] - padding[3], size[1] - padding[0] - padding[2]]);\n resolution = isNaN(resolution) ? minResolution : Math.max(resolution, minResolution);\n resolution = this.getConstrainedResolution(resolution, nearest ? 0 : 1);\n\n // calculate center\n const rotation = this.getRotation();\n const sinAngle = Math.sin(rotation);\n const cosAngle = Math.cos(rotation);\n const centerRot = (0,_extent_js__WEBPACK_IMPORTED_MODULE_9__.getCenter)(rotatedExtent);\n centerRot[0] += (padding[1] - padding[3]) / 2 * resolution;\n centerRot[1] += (padding[0] - padding[2]) / 2 * resolution;\n const centerX = centerRot[0] * cosAngle - centerRot[1] * sinAngle;\n const centerY = centerRot[1] * cosAngle + centerRot[0] * sinAngle;\n const center = this.getConstrainedCenter([centerX, centerY], resolution);\n const callback = options.callback ? options.callback : _functions_js__WEBPACK_IMPORTED_MODULE_12__.VOID;\n if (options.duration !== undefined) {\n this.animateInternal({\n resolution: resolution,\n center: center,\n duration: options.duration,\n easing: options.easing\n }, callback);\n } else {\n this.targetResolution_ = resolution;\n this.targetCenter_ = center;\n this.applyTargetState_(false, true);\n animationCallback(callback, true);\n }\n }\n\n /**\n * Center on coordinate and view position.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"./size.js\").Size} size Box pixel size.\n * @param {import(\"./pixel.js\").Pixel} position Position on the view to center on.\n * @api\n */\n centerOn(coordinate, size, position) {\n this.centerOnInternal((0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(coordinate, this.getProjection()), size, position);\n }\n\n /**\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"./size.js\").Size} size Box pixel size.\n * @param {import(\"./pixel.js\").Pixel} position Position on the view to center on.\n */\n centerOnInternal(coordinate, size, position) {\n this.setCenterInternal(calculateCenterOn(coordinate, size, position, this.getResolution(), this.getRotation()));\n }\n\n /**\n * Calculates the shift between map and viewport center.\n * @param {import(\"./coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {import(\"./size.js\").Size} size Size.\n * @return {Array<number>|undefined} Center shift.\n */\n calculateCenterShift(center, resolution, rotation, size) {\n let centerShift;\n const padding = this.padding_;\n if (padding && center) {\n const reducedSize = this.getViewportSizeMinusPadding_(-rotation);\n const shiftedCenter = calculateCenterOn(center, size, [reducedSize[0] / 2 + padding[3], reducedSize[1] / 2 + padding[0]], resolution, rotation);\n centerShift = [center[0] - shiftedCenter[0], center[1] - shiftedCenter[1]];\n }\n return centerShift;\n }\n\n /**\n * @return {boolean} Is defined.\n */\n isDef() {\n return !!this.getCenterInternal() && this.getResolution() !== undefined;\n }\n\n /**\n * Adds relative coordinates to the center of the view. Any extent constraint will apply.\n * @param {import(\"./coordinate.js\").Coordinate} deltaCoordinates Relative value to add.\n * @api\n */\n adjustCenter(deltaCoordinates) {\n const center = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserCoordinate)(this.targetCenter_, this.getProjection());\n this.setCenter([center[0] + deltaCoordinates[0], center[1] + deltaCoordinates[1]]);\n }\n\n /**\n * Adds relative coordinates to the center of the view. Any extent constraint will apply.\n * @param {import(\"./coordinate.js\").Coordinate} deltaCoordinates Relative value to add.\n */\n adjustCenterInternal(deltaCoordinates) {\n const center = this.targetCenter_;\n this.setCenterInternal([center[0] + deltaCoordinates[0], center[1] + deltaCoordinates[1]]);\n }\n\n /**\n * Multiply the view resolution by a ratio, optionally using an anchor. Any resolution\n * constraint will apply.\n * @param {number} ratio The ratio to apply on the view resolution.\n * @param {import(\"./coordinate.js\").Coordinate} [anchor] The origin of the transformation.\n * @api\n */\n adjustResolution(ratio, anchor) {\n anchor = anchor && (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(anchor, this.getProjection());\n this.adjustResolutionInternal(ratio, anchor);\n }\n\n /**\n * Multiply the view resolution by a ratio, optionally using an anchor. Any resolution\n * constraint will apply.\n * @param {number} ratio The ratio to apply on the view resolution.\n * @param {import(\"./coordinate.js\").Coordinate} [anchor] The origin of the transformation.\n */\n adjustResolutionInternal(ratio, anchor) {\n const isMoving = this.getAnimating() || this.getInteracting();\n const size = this.getViewportSize_(this.getRotation());\n const newResolution = this.constraints_.resolution(this.targetResolution_ * ratio, 0, size, isMoving);\n if (anchor) {\n this.targetCenter_ = this.calculateCenterZoom(newResolution, anchor);\n }\n this.targetResolution_ *= ratio;\n this.applyTargetState_();\n }\n\n /**\n * Adds a value to the view zoom level, optionally using an anchor. Any resolution\n * constraint will apply.\n * @param {number} delta Relative value to add to the zoom level.\n * @param {import(\"./coordinate.js\").Coordinate} [anchor] The origin of the transformation.\n * @api\n */\n adjustZoom(delta, anchor) {\n this.adjustResolution(Math.pow(this.zoomFactor_, -delta), anchor);\n }\n\n /**\n * Adds a value to the view rotation, optionally using an anchor. Any rotation\n * constraint will apply.\n * @param {number} delta Relative value to add to the zoom rotation, in radians.\n * @param {import(\"./coordinate.js\").Coordinate} [anchor] The rotation center.\n * @api\n */\n adjustRotation(delta, anchor) {\n if (anchor) {\n anchor = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(anchor, this.getProjection());\n }\n this.adjustRotationInternal(delta, anchor);\n }\n\n /**\n * @param {number} delta Relative value to add to the zoom rotation, in radians.\n * @param {import(\"./coordinate.js\").Coordinate} [anchor] The rotation center.\n */\n adjustRotationInternal(delta, anchor) {\n const isMoving = this.getAnimating() || this.getInteracting();\n const newRotation = this.constraints_.rotation(this.targetRotation_ + delta, isMoving);\n if (anchor) {\n this.targetCenter_ = this.calculateCenterRotate(newRotation, anchor);\n }\n this.targetRotation_ += delta;\n this.applyTargetState_();\n }\n\n /**\n * Set the center of the current view. Any extent constraint will apply.\n * @param {import(\"./coordinate.js\").Coordinate|undefined} center The center of the view.\n * @observable\n * @api\n */\n setCenter(center) {\n this.setCenterInternal(center ? (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(center, this.getProjection()) : center);\n }\n\n /**\n * Set the center using the view projection (not the user projection).\n * @param {import(\"./coordinate.js\").Coordinate|undefined} center The center of the view.\n */\n setCenterInternal(center) {\n this.targetCenter_ = center;\n this.applyTargetState_();\n }\n\n /**\n * @param {import(\"./ViewHint.js\").default} hint Hint.\n * @param {number} delta Delta.\n * @return {number} New value.\n */\n setHint(hint, delta) {\n this.hints_[hint] += delta;\n this.changed();\n return this.hints_[hint];\n }\n\n /**\n * Set the resolution for this view. Any resolution constraint will apply.\n * @param {number|undefined} resolution The resolution of the view.\n * @observable\n * @api\n */\n setResolution(resolution) {\n this.targetResolution_ = resolution;\n this.applyTargetState_();\n }\n\n /**\n * Set the rotation for this view. Any rotation constraint will apply.\n * @param {number} rotation The rotation of the view in radians.\n * @observable\n * @api\n */\n setRotation(rotation) {\n this.targetRotation_ = rotation;\n this.applyTargetState_();\n }\n\n /**\n * Zoom to a specific zoom level. Any resolution constrain will apply.\n * @param {number} zoom Zoom level.\n * @api\n */\n setZoom(zoom) {\n this.setResolution(this.getResolutionForZoom(zoom));\n }\n\n /**\n * Recompute rotation/resolution/center based on target values.\n * Note: we have to compute rotation first, then resolution and center considering that\n * parameters can influence one another in case a view extent constraint is present.\n * @param {boolean} [doNotCancelAnims] Do not cancel animations.\n * @param {boolean} [forceMoving] Apply constraints as if the view is moving.\n * @private\n */\n applyTargetState_(doNotCancelAnims, forceMoving) {\n const isMoving = this.getAnimating() || this.getInteracting() || forceMoving;\n\n // compute rotation\n const newRotation = this.constraints_.rotation(this.targetRotation_, isMoving);\n const size = this.getViewportSize_(newRotation);\n const newResolution = this.constraints_.resolution(this.targetResolution_, 0, size, isMoving);\n const newCenter = this.constraints_.center(this.targetCenter_, newResolution, size, isMoving, this.calculateCenterShift(this.targetCenter_, newResolution, newRotation, size));\n if (this.get(_ViewProperty_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ROTATION) !== newRotation) {\n this.set(_ViewProperty_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ROTATION, newRotation);\n }\n if (this.get(_ViewProperty_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].RESOLUTION) !== newResolution) {\n this.set(_ViewProperty_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].RESOLUTION, newResolution);\n this.set('zoom', this.getZoom(), true);\n }\n if (!newCenter || !this.get(_ViewProperty_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].CENTER) || !(0,_coordinate_js__WEBPACK_IMPORTED_MODULE_7__.equals)(this.get(_ViewProperty_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].CENTER), newCenter)) {\n this.set(_ViewProperty_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].CENTER, newCenter);\n }\n if (this.getAnimating() && !doNotCancelAnims) {\n this.cancelAnimations();\n }\n this.cancelAnchor_ = undefined;\n }\n\n /**\n * If any constraints need to be applied, an animation will be triggered.\n * This is typically done on interaction end.\n * Note: calling this with a duration of 0 will apply the constrained values straight away,\n * without animation.\n * @param {number} [duration] The animation duration in ms.\n * @param {number} [resolutionDirection] Which direction to zoom.\n * @param {import(\"./coordinate.js\").Coordinate} [anchor] The origin of the transformation.\n */\n resolveConstraints(duration, resolutionDirection, anchor) {\n duration = duration !== undefined ? duration : 200;\n const direction = resolutionDirection || 0;\n const newRotation = this.constraints_.rotation(this.targetRotation_);\n const size = this.getViewportSize_(newRotation);\n const newResolution = this.constraints_.resolution(this.targetResolution_, direction, size);\n const newCenter = this.constraints_.center(this.targetCenter_, newResolution, size, false, this.calculateCenterShift(this.targetCenter_, newResolution, newRotation, size));\n if (duration === 0 && !this.cancelAnchor_) {\n this.targetResolution_ = newResolution;\n this.targetRotation_ = newRotation;\n this.targetCenter_ = newCenter;\n this.applyTargetState_();\n return;\n }\n anchor = anchor || (duration === 0 ? this.cancelAnchor_ : undefined);\n this.cancelAnchor_ = undefined;\n if (this.getResolution() !== newResolution || this.getRotation() !== newRotation || !this.getCenterInternal() || !(0,_coordinate_js__WEBPACK_IMPORTED_MODULE_7__.equals)(this.getCenterInternal(), newCenter)) {\n if (this.getAnimating()) {\n this.cancelAnimations();\n }\n this.animateInternal({\n rotation: newRotation,\n center: newCenter,\n resolution: newResolution,\n duration: duration,\n easing: _easing_js__WEBPACK_IMPORTED_MODULE_4__.easeOut,\n anchor: anchor\n });\n }\n }\n\n /**\n * Notify the View that an interaction has started.\n * The view state will be resolved to a stable one if needed\n * (depending on its constraints).\n * @api\n */\n beginInteraction() {\n this.resolveConstraints(0);\n this.setHint(_ViewHint_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INTERACTING, 1);\n }\n\n /**\n * Notify the View that an interaction has ended. The view state will be resolved\n * to a stable one if needed (depending on its constraints).\n * @param {number} [duration] Animation duration in ms.\n * @param {number} [resolutionDirection] Which direction to zoom.\n * @param {import(\"./coordinate.js\").Coordinate} [anchor] The origin of the transformation.\n * @api\n */\n endInteraction(duration, resolutionDirection, anchor) {\n anchor = anchor && (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(anchor, this.getProjection());\n this.endInteractionInternal(duration, resolutionDirection, anchor);\n }\n\n /**\n * Notify the View that an interaction has ended. The view state will be resolved\n * to a stable one if needed (depending on its constraints).\n * @param {number} [duration] Animation duration in ms.\n * @param {number} [resolutionDirection] Which direction to zoom.\n * @param {import(\"./coordinate.js\").Coordinate} [anchor] The origin of the transformation.\n */\n endInteractionInternal(duration, resolutionDirection, anchor) {\n if (!this.getInteracting()) {\n return;\n }\n this.setHint(_ViewHint_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].INTERACTING, -1);\n this.resolveConstraints(duration, resolutionDirection, anchor);\n }\n\n /**\n * Get a valid position for the view center according to the current constraints.\n * @param {import(\"./coordinate.js\").Coordinate|undefined} targetCenter Target center position.\n * @param {number} [targetResolution] Target resolution. If not supplied, the current one will be used.\n * This is useful to guess a valid center position at a different zoom level.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Valid center position.\n */\n getConstrainedCenter(targetCenter, targetResolution) {\n const size = this.getViewportSize_(this.getRotation());\n return this.constraints_.center(targetCenter, targetResolution || this.getResolution(), size);\n }\n\n /**\n * Get a valid zoom level according to the current view constraints.\n * @param {number|undefined} targetZoom Target zoom.\n * @param {number} [direction=0] Indicate which resolution should be used\n * by a renderer if the view resolution does not match any resolution of the tile source.\n * If 0, the nearest resolution will be used. If 1, the nearest lower resolution\n * will be used. If -1, the nearest higher resolution will be used.\n * @return {number|undefined} Valid zoom level.\n */\n getConstrainedZoom(targetZoom, direction) {\n const targetRes = this.getResolutionForZoom(targetZoom);\n return this.getZoomForResolution(this.getConstrainedResolution(targetRes, direction));\n }\n\n /**\n * Get a valid resolution according to the current view constraints.\n * @param {number|undefined} targetResolution Target resolution.\n * @param {number} [direction=0] Indicate which resolution should be used\n * by a renderer if the view resolution does not match any resolution of the tile source.\n * If 0, the nearest resolution will be used. If 1, the nearest lower resolution\n * will be used. If -1, the nearest higher resolution will be used.\n * @return {number|undefined} Valid resolution.\n */\n getConstrainedResolution(targetResolution, direction) {\n direction = direction || 0;\n const size = this.getViewportSize_(this.getRotation());\n return this.constraints_.resolution(targetResolution, direction, size);\n }\n}\n\n/**\n * @param {Function} callback Callback.\n * @param {*} returnValue Return value.\n */\nfunction animationCallback(callback, returnValue) {\n setTimeout(function () {\n callback(returnValue);\n }, 0);\n}\n\n/**\n * @param {ViewOptions} options View options.\n * @return {import(\"./centerconstraint.js\").Type} The constraint.\n */\nfunction createCenterConstraint(options) {\n if (options.extent !== undefined) {\n const smooth = options.smoothExtentConstraint !== undefined ? options.smoothExtentConstraint : true;\n return (0,_centerconstraint_js__WEBPACK_IMPORTED_MODULE_13__.createExtent)(options.extent, options.constrainOnlyCenter, smooth);\n }\n const projection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.createProjection)(options.projection, 'EPSG:3857');\n if (options.multiWorld !== true && projection.isGlobal()) {\n const extent = projection.getExtent().slice();\n extent[0] = -Infinity;\n extent[2] = Infinity;\n return (0,_centerconstraint_js__WEBPACK_IMPORTED_MODULE_13__.createExtent)(extent, false, false);\n }\n return _centerconstraint_js__WEBPACK_IMPORTED_MODULE_13__.none;\n}\n\n/**\n * @param {ViewOptions} options View options.\n * @return {{constraint: import(\"./resolutionconstraint.js\").Type, maxResolution: number,\n * minResolution: number, minZoom: number, zoomFactor: number}} The constraint.\n */\nfunction createResolutionConstraint(options) {\n let resolutionConstraint;\n let maxResolution;\n let minResolution;\n\n // TODO: move these to be ol constants\n // see https://github.com/openlayers/openlayers/issues/2076\n const defaultMaxZoom = 28;\n const defaultZoomFactor = 2;\n let minZoom = options.minZoom !== undefined ? options.minZoom : DEFAULT_MIN_ZOOM;\n let maxZoom = options.maxZoom !== undefined ? options.maxZoom : defaultMaxZoom;\n const zoomFactor = options.zoomFactor !== undefined ? options.zoomFactor : defaultZoomFactor;\n const multiWorld = options.multiWorld !== undefined ? options.multiWorld : false;\n const smooth = options.smoothResolutionConstraint !== undefined ? options.smoothResolutionConstraint : true;\n const showFullExtent = options.showFullExtent !== undefined ? options.showFullExtent : false;\n const projection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.createProjection)(options.projection, 'EPSG:3857');\n const projExtent = projection.getExtent();\n let constrainOnlyCenter = options.constrainOnlyCenter;\n let extent = options.extent;\n if (!multiWorld && !extent && projection.isGlobal()) {\n constrainOnlyCenter = false;\n extent = projExtent;\n }\n if (options.resolutions !== undefined) {\n const resolutions = options.resolutions;\n maxResolution = resolutions[minZoom];\n minResolution = resolutions[maxZoom] !== undefined ? resolutions[maxZoom] : resolutions[resolutions.length - 1];\n if (options.constrainResolution) {\n resolutionConstraint = (0,_resolutionconstraint_js__WEBPACK_IMPORTED_MODULE_14__.createSnapToResolutions)(resolutions, smooth, !constrainOnlyCenter && extent, showFullExtent);\n } else {\n resolutionConstraint = (0,_resolutionconstraint_js__WEBPACK_IMPORTED_MODULE_14__.createMinMaxResolution)(maxResolution, minResolution, smooth, !constrainOnlyCenter && extent, showFullExtent);\n }\n } else {\n // calculate the default min and max resolution\n const size = !projExtent ?\n // use an extent that can fit the whole world if need be\n 360 * _proj_js__WEBPACK_IMPORTED_MODULE_1__.METERS_PER_UNIT.degrees / projection.getMetersPerUnit() : Math.max((0,_extent_js__WEBPACK_IMPORTED_MODULE_9__.getWidth)(projExtent), (0,_extent_js__WEBPACK_IMPORTED_MODULE_9__.getHeight)(projExtent));\n const defaultMaxResolution = size / _tilegrid_common_js__WEBPACK_IMPORTED_MODULE_15__.DEFAULT_TILE_SIZE / Math.pow(defaultZoomFactor, DEFAULT_MIN_ZOOM);\n const defaultMinResolution = defaultMaxResolution / Math.pow(defaultZoomFactor, defaultMaxZoom - DEFAULT_MIN_ZOOM);\n\n // user provided maxResolution takes precedence\n maxResolution = options.maxResolution;\n if (maxResolution !== undefined) {\n minZoom = 0;\n } else {\n maxResolution = defaultMaxResolution / Math.pow(zoomFactor, minZoom);\n }\n\n // user provided minResolution takes precedence\n minResolution = options.minResolution;\n if (minResolution === undefined) {\n if (options.maxZoom !== undefined) {\n if (options.maxResolution !== undefined) {\n minResolution = maxResolution / Math.pow(zoomFactor, maxZoom);\n } else {\n minResolution = defaultMaxResolution / Math.pow(zoomFactor, maxZoom);\n }\n } else {\n minResolution = defaultMinResolution;\n }\n }\n\n // given discrete zoom levels, minResolution may be different than provided\n maxZoom = minZoom + Math.floor(Math.log(maxResolution / minResolution) / Math.log(zoomFactor));\n minResolution = maxResolution / Math.pow(zoomFactor, maxZoom - minZoom);\n if (options.constrainResolution) {\n resolutionConstraint = (0,_resolutionconstraint_js__WEBPACK_IMPORTED_MODULE_14__.createSnapToPower)(zoomFactor, maxResolution, minResolution, smooth, !constrainOnlyCenter && extent, showFullExtent);\n } else {\n resolutionConstraint = (0,_resolutionconstraint_js__WEBPACK_IMPORTED_MODULE_14__.createMinMaxResolution)(maxResolution, minResolution, smooth, !constrainOnlyCenter && extent, showFullExtent);\n }\n }\n return {\n constraint: resolutionConstraint,\n maxResolution: maxResolution,\n minResolution: minResolution,\n minZoom: minZoom,\n zoomFactor: zoomFactor\n };\n}\n\n/**\n * @param {ViewOptions} options View options.\n * @return {import(\"./rotationconstraint.js\").Type} Rotation constraint.\n */\nfunction createRotationConstraint(options) {\n const enableRotation = options.enableRotation !== undefined ? options.enableRotation : true;\n if (enableRotation) {\n const constrainRotation = options.constrainRotation;\n if (constrainRotation === undefined || constrainRotation === true) {\n return (0,_rotationconstraint_js__WEBPACK_IMPORTED_MODULE_16__.createSnapToZero)();\n }\n if (constrainRotation === false) {\n return _rotationconstraint_js__WEBPACK_IMPORTED_MODULE_16__.none;\n }\n if (typeof constrainRotation === 'number') {\n return (0,_rotationconstraint_js__WEBPACK_IMPORTED_MODULE_16__.createSnapToN)(constrainRotation);\n }\n return _rotationconstraint_js__WEBPACK_IMPORTED_MODULE_16__.none;\n }\n return _rotationconstraint_js__WEBPACK_IMPORTED_MODULE_16__.disable;\n}\n\n/**\n * Determine if an animation involves no view change.\n * @param {Animation} animation The animation.\n * @return {boolean} The animation involves no view change.\n */\nfunction isNoopAnimation(animation) {\n if (animation.sourceCenter && animation.targetCenter) {\n if (!(0,_coordinate_js__WEBPACK_IMPORTED_MODULE_7__.equals)(animation.sourceCenter, animation.targetCenter)) {\n return false;\n }\n }\n if (animation.sourceResolution !== animation.targetResolution) {\n return false;\n }\n if (animation.sourceRotation !== animation.targetRotation) {\n return false;\n }\n return true;\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"./size.js\").Size} size Box pixel size.\n * @param {import(\"./pixel.js\").Pixel} position Position on the view to center on.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @return {import(\"./coordinate.js\").Coordinate} Shifted center.\n */\nfunction calculateCenterOn(coordinate, size, position, resolution, rotation) {\n // calculate rotated position\n const cosAngle = Math.cos(-rotation);\n let sinAngle = Math.sin(-rotation);\n let rotX = coordinate[0] * cosAngle - coordinate[1] * sinAngle;\n let rotY = coordinate[1] * cosAngle + coordinate[0] * sinAngle;\n rotX += (size[0] / 2 - position[0]) * resolution;\n rotY += (position[1] - size[1] / 2) * resolution;\n\n // go back to original angle\n sinAngle = -sinAngle; // go back to original rotation\n const centerX = rotX * cosAngle - rotY * sinAngle;\n const centerY = rotY * cosAngle + rotX * sinAngle;\n return [centerX, centerY];\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (View);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/View.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/ViewHint.js":
|
||
/*!*************************************!*\
|
||
!*** ./node_modules/ol/ViewHint.js ***!
|
||
\*************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/ViewHint\n */\n\n/**\n * @enum {number}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ANIMATING: 0,\n INTERACTING: 1\n});\n\n//# sourceURL=webpack://complexes/./node_modules/ol/ViewHint.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/ViewProperty.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ol/ViewProperty.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/ViewProperty\n */\n\n/**\n * @enum {string}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n CENTER: 'center',\n RESOLUTION: 'resolution',\n ROTATION: 'rotation'\n});\n\n//# sourceURL=webpack://complexes/./node_modules/ol/ViewProperty.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/array.js":
|
||
/*!**********************************!*\
|
||
!*** ./node_modules/ol/array.js ***!
|
||
\**********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ascending: function() { return /* binding */ ascending; },\n/* harmony export */ binarySearch: function() { return /* binding */ binarySearch; },\n/* harmony export */ descending: function() { return /* binding */ descending; },\n/* harmony export */ equals: function() { return /* binding */ equals; },\n/* harmony export */ extend: function() { return /* binding */ extend; },\n/* harmony export */ isSorted: function() { return /* binding */ isSorted; },\n/* harmony export */ linearFindNearest: function() { return /* binding */ linearFindNearest; },\n/* harmony export */ remove: function() { return /* binding */ remove; },\n/* harmony export */ reverseSubArray: function() { return /* binding */ reverseSubArray; },\n/* harmony export */ stableSort: function() { return /* binding */ stableSort; }\n/* harmony export */ });\n/**\n * @module ol/array\n */\n\n/**\n * 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.\n * https://github.com/darkskyapp/binary-search\n *\n * @param {Array<*>} haystack Items to search through.\n * @param {*} needle The item to look for.\n * @param {Function} [comparator] Comparator function.\n * @return {number} The index of the item if found, -1 if not.\n */\nfunction binarySearch(haystack, needle, comparator) {\n let mid, cmp;\n comparator = comparator || ascending;\n let low = 0;\n let high = haystack.length;\n let found = false;\n while (low < high) {\n /* Note that \"(low + high) >>> 1\" may overflow, and results in a typecast\n * to double (which gives the wrong results). */\n mid = low + (high - low >> 1);\n cmp = +comparator(haystack[mid], needle);\n if (cmp < 0.0) {\n /* Too low. */\n low = mid + 1;\n } else {\n /* Key found or too high */\n high = mid;\n found = !cmp;\n }\n }\n\n /* Key not found. */\n return found ? low : ~low;\n}\n\n/**\n * Compare function sorting arrays in ascending order. Safe to use for numeric values.\n * @param {*} a The first object to be compared.\n * @param {*} b The second object to be compared.\n * @return {number} A negative number, zero, or a positive number as the first\n * argument is less than, equal to, or greater than the second.\n */\nfunction ascending(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n}\n\n/**\n * Compare function sorting arrays in descending order. Safe to use for numeric values.\n * @param {*} a The first object to be compared.\n * @param {*} b The second object to be compared.\n * @return {number} A negative number, zero, or a positive number as the first\n * argument is greater than, equal to, or less than the second.\n */\nfunction descending(a, b) {\n return a < b ? 1 : a > b ? -1 : 0;\n}\n\n/**\n * {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution} can use a function\n * of this type to determine which nearest resolution to use.\n *\n * This function takes a `{number}` representing a value between two array entries,\n * a `{number}` representing the value of the nearest higher entry and\n * a `{number}` representing the value of the nearest lower entry\n * as arguments and returns a `{number}`. If a negative number or zero is returned\n * the lower value will be used, if a positive number is returned the higher value\n * will be used.\n * @typedef {function(number, number, number): number} NearestDirectionFunction\n * @api\n */\n\n/**\n * @param {Array<number>} arr Array in descending order.\n * @param {number} target Target.\n * @param {number|NearestDirectionFunction} direction\n * 0 means return the nearest,\n * > 0 means return the largest nearest,\n * < 0 means return the smallest nearest.\n * @return {number} Index.\n */\nfunction linearFindNearest(arr, target, direction) {\n if (arr[0] <= target) {\n return 0;\n }\n const n = arr.length;\n if (target <= arr[n - 1]) {\n return n - 1;\n }\n if (typeof direction === 'function') {\n for (let i = 1; i < n; ++i) {\n const candidate = arr[i];\n if (candidate === target) {\n return i;\n }\n if (candidate < target) {\n if (direction(target, arr[i - 1], candidate) > 0) {\n return i - 1;\n }\n return i;\n }\n }\n return n - 1;\n }\n if (direction > 0) {\n for (let i = 1; i < n; ++i) {\n if (arr[i] < target) {\n return i - 1;\n }\n }\n return n - 1;\n }\n if (direction < 0) {\n for (let i = 1; i < n; ++i) {\n if (arr[i] <= target) {\n return i;\n }\n }\n return n - 1;\n }\n for (let i = 1; i < n; ++i) {\n if (arr[i] == target) {\n return i;\n }\n if (arr[i] < target) {\n if (arr[i - 1] - target < target - arr[i]) {\n return i - 1;\n }\n return i;\n }\n }\n return n - 1;\n}\n\n/**\n * @param {Array<*>} arr Array.\n * @param {number} begin Begin index.\n * @param {number} end End index.\n */\nfunction reverseSubArray(arr, begin, end) {\n while (begin < end) {\n const tmp = arr[begin];\n arr[begin] = arr[end];\n arr[end] = tmp;\n ++begin;\n --end;\n }\n}\n\n/**\n * @param {Array<VALUE>} arr The array to modify.\n * @param {!Array<VALUE>|VALUE} data The elements or arrays of elements to add to arr.\n * @template VALUE\n */\nfunction extend(arr, data) {\n const extension = Array.isArray(data) ? data : [data];\n const length = extension.length;\n for (let i = 0; i < length; i++) {\n arr[arr.length] = extension[i];\n }\n}\n\n/**\n * @param {Array<VALUE>} arr The array to modify.\n * @param {VALUE} obj The element to remove.\n * @template VALUE\n * @return {boolean} If the element was removed.\n */\nfunction remove(arr, obj) {\n const i = arr.indexOf(obj);\n const found = i > -1;\n if (found) {\n arr.splice(i, 1);\n }\n return found;\n}\n\n/**\n * @param {Array<any>|Uint8ClampedArray} arr1 The first array to compare.\n * @param {Array<any>|Uint8ClampedArray} arr2 The second array to compare.\n * @return {boolean} Whether the two arrays are equal.\n */\nfunction equals(arr1, arr2) {\n const len1 = arr1.length;\n if (len1 !== arr2.length) {\n return false;\n }\n for (let i = 0; i < len1; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Sort the passed array such that the relative order of equal elements is preserved.\n * See https://en.wikipedia.org/wiki/Sorting_algorithm#Stability for details.\n * @param {Array<*>} arr The array to sort (modifies original).\n * @param {!function(*, *): number} compareFnc Comparison function.\n * @api\n */\nfunction stableSort(arr, compareFnc) {\n const length = arr.length;\n const tmp = Array(arr.length);\n let i;\n for (i = 0; i < length; i++) {\n tmp[i] = {\n index: i,\n value: arr[i]\n };\n }\n tmp.sort(function (a, b) {\n return compareFnc(a.value, b.value) || a.index - b.index;\n });\n for (i = 0; i < arr.length; i++) {\n arr[i] = tmp[i].value;\n }\n}\n\n/**\n * @param {Array<*>} arr The array to test.\n * @param {Function} [func] Comparison function.\n * @param {boolean} [strict] Strictly sorted (default false).\n * @return {boolean} Return index.\n */\nfunction isSorted(arr, func, strict) {\n const compare = func || ascending;\n return arr.every(function (currentVal, index) {\n if (index === 0) {\n return true;\n }\n const res = compare(arr[index - 1], currentVal);\n return !(res > 0 || strict && res === 0);\n });\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/array.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/asserts.js":
|
||
/*!************************************!*\
|
||
!*** ./node_modules/ol/asserts.js ***!
|
||
\************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ assert: function() { return /* binding */ assert; }\n/* harmony export */ });\n/**\n * @module ol/asserts\n */\n\n/**\n * @param {*} assertion Assertion we expected to be truthy.\n * @param {string} errorMessage Error message.\n */\nfunction assert(assertion, errorMessage) {\n if (!assertion) {\n throw new Error(errorMessage);\n }\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/asserts.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/centerconstraint.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ol/centerconstraint.js ***!
|
||
\*********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createExtent: function() { return /* binding */ createExtent; },\n/* harmony export */ none: function() { return /* binding */ none; }\n/* harmony export */ });\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ \"./node_modules/ol/math.js\");\n/**\n * @module ol/centerconstraint\n */\n\n\n/**\n * @typedef {function((import(\"./coordinate.js\").Coordinate|undefined), number, import(\"./size.js\").Size, boolean=, Array<number>=): (import(\"./coordinate.js\").Coordinate|undefined)} Type\n */\n\n/**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {boolean} onlyCenter If true, the constraint will only apply to the view center.\n * @param {boolean} smooth If true, the view will be able to go slightly out of the given extent\n * (only during interaction and animation).\n * @return {Type} The constraint.\n */\nfunction createExtent(extent, onlyCenter, smooth) {\n return (\n /**\n * @param {import(\"./coordinate.js\").Coordinate|undefined} center Center.\n * @param {number|undefined} resolution Resolution.\n * @param {import(\"./size.js\").Size} size Viewport size; unused if `onlyCenter` was specified.\n * @param {boolean} [isMoving] True if an interaction or animation is in progress.\n * @param {Array<number>} [centerShift] Shift between map center and viewport center.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Center.\n */\n function (center, resolution, size, isMoving, centerShift) {\n if (!center) {\n return undefined;\n }\n if (!resolution && !onlyCenter) {\n return center;\n }\n const viewWidth = onlyCenter ? 0 : size[0] * resolution;\n const viewHeight = onlyCenter ? 0 : size[1] * resolution;\n const shiftX = centerShift ? centerShift[0] : 0;\n const shiftY = centerShift ? centerShift[1] : 0;\n let minX = extent[0] + viewWidth / 2 + shiftX;\n let maxX = extent[2] - viewWidth / 2 + shiftX;\n let minY = extent[1] + viewHeight / 2 + shiftY;\n let maxY = extent[3] - viewHeight / 2 + shiftY;\n\n // note: when zooming out of bounds, min and max values for x and y may\n // end up inverted (min > max); this has to be accounted for\n if (minX > maxX) {\n minX = (maxX + minX) / 2;\n maxX = minX;\n }\n if (minY > maxY) {\n minY = (maxY + minY) / 2;\n maxY = minY;\n }\n let x = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.clamp)(center[0], minX, maxX);\n let y = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.clamp)(center[1], minY, maxY);\n\n // during an interaction, allow some overscroll\n if (isMoving && smooth && resolution) {\n const ratio = 30 * resolution;\n x += -ratio * Math.log(1 + Math.max(0, minX - center[0]) / ratio) + ratio * Math.log(1 + Math.max(0, center[0] - maxX) / ratio);\n y += -ratio * Math.log(1 + Math.max(0, minY - center[1]) / ratio) + ratio * Math.log(1 + Math.max(0, center[1] - maxY) / ratio);\n }\n return [x, y];\n }\n );\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} [center] Center.\n * @return {import(\"./coordinate.js\").Coordinate|undefined} Center.\n */\nfunction none(center) {\n return center;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/centerconstraint.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/color.js":
|
||
/*!**********************************!*\
|
||
!*** ./node_modules/ol/color.js ***!
|
||
\**********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ asArray: function() { return /* binding */ asArray; },\n/* harmony export */ asString: function() { return /* binding */ asString; },\n/* harmony export */ fromString: function() { return /* binding */ fromString; },\n/* harmony export */ isStringColor: function() { return /* binding */ isStringColor; },\n/* harmony export */ lchaToRgba: function() { return /* binding */ lchaToRgba; },\n/* harmony export */ normalize: function() { return /* binding */ normalize; },\n/* harmony export */ rgbaToLcha: function() { return /* binding */ rgbaToLcha; },\n/* harmony export */ toString: function() { return /* binding */ toString; },\n/* harmony export */ withAlpha: function() { return /* binding */ withAlpha; }\n/* harmony export */ });\n/* harmony import */ var color_space_lchuv_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! color-space/lchuv.js */ \"./node_modules/color-space/lchuv.js\");\n/* harmony import */ var color_rgba__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! color-rgba */ \"./node_modules/color-rgba/index.js\");\n/* harmony import */ var color_space_rgb_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! color-space/rgb.js */ \"./node_modules/color-space/rgb.js\");\n/* harmony import */ var color_space_xyz_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! color-space/xyz.js */ \"./node_modules/color-space/xyz.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./math.js */ \"./node_modules/ol/math.js\");\n/**\n * @module ol/color\n */\n\n\n\n\n\n\n/**\n * A color represented as a short array [red, green, blue, alpha].\n * red, green, and blue should be integers in the range 0..255 inclusive.\n * alpha should be a float in the range 0..1 inclusive. If no alpha value is\n * given then `1` will be used.\n * @typedef {Array<number>} Color\n * @api\n */\n\n/**\n * Return the color as an rgba string.\n * @param {Color|string} color Color.\n * @return {string} Rgba string.\n * @api\n */\nfunction asString(color) {\n if (typeof color === 'string') {\n return color;\n }\n return toString(color);\n}\n\n/**\n * @type {number}\n */\nconst MAX_CACHE_SIZE = 1024;\n\n/**\n * We maintain a small cache of parsed strings. Whenever the cache grows too large,\n * we delete an arbitrary set of the entries.\n *\n * @type {Object<string, Color>}\n */\nconst cache = {};\n\n/**\n * @type {number}\n */\nlet cacheSize = 0;\n\n/**\n * @param {Color} color A color that may or may not have an alpha channel.\n * @return {Color} The input color with an alpha channel. If the input color has\n * an alpha channel, the input color will be returned unchanged. Otherwise, a new\n * array will be returned with the input color and an alpha channel of 1.\n */\nfunction withAlpha(color) {\n if (color.length === 4) {\n return color;\n }\n const output = color.slice();\n output[3] = 1;\n return output;\n}\n\n/**\n * @param {Color} color RGBA color.\n * @return {Color} LCHuv color with alpha.\n */\nfunction rgbaToLcha(color) {\n const output = color_space_xyz_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].lchuv(color_space_rgb_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].xyz(color));\n output[3] = color[3];\n return output;\n}\n\n/**\n * @param {Color} color LCHuv color with alpha.\n * @return {Color} RGBA color.\n */\nfunction lchaToRgba(color) {\n const output = color_space_xyz_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].rgb(color_space_lchuv_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].xyz(color));\n output[3] = color[3];\n return output;\n}\n\n/**\n * @param {string} s String.\n * @return {Color} Color.\n */\nfunction fromString(s) {\n if (cache.hasOwnProperty(s)) {\n return cache[s];\n }\n if (cacheSize >= MAX_CACHE_SIZE) {\n let i = 0;\n for (const key in cache) {\n if ((i++ & 3) === 0) {\n delete cache[key];\n --cacheSize;\n }\n }\n }\n const color = (0,color_rgba__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(s);\n if (color.length !== 4) {\n throw new Error('Failed to parse \"' + s + '\" as color');\n }\n for (const c of color) {\n if (isNaN(c)) {\n throw new Error('Failed to parse \"' + s + '\" as color');\n }\n }\n normalize(color);\n cache[s] = color;\n ++cacheSize;\n return color;\n}\n\n/**\n * Return the color as an array. This function maintains a cache of calculated\n * arrays which means the result should not be modified.\n * @param {Color|string} color Color.\n * @return {Color} Color.\n * @api\n */\nfunction asArray(color) {\n if (Array.isArray(color)) {\n return color;\n }\n return fromString(color);\n}\n\n/**\n * Exported for the tests.\n * @param {Color} color Color.\n * @return {Color} Clamped color.\n */\nfunction normalize(color) {\n color[0] = (0,_math_js__WEBPACK_IMPORTED_MODULE_4__.clamp)(color[0] + 0.5 | 0, 0, 255);\n color[1] = (0,_math_js__WEBPACK_IMPORTED_MODULE_4__.clamp)(color[1] + 0.5 | 0, 0, 255);\n color[2] = (0,_math_js__WEBPACK_IMPORTED_MODULE_4__.clamp)(color[2] + 0.5 | 0, 0, 255);\n color[3] = (0,_math_js__WEBPACK_IMPORTED_MODULE_4__.clamp)(color[3], 0, 1);\n return color;\n}\n\n/**\n * @param {Color} color Color.\n * @return {string} String.\n */\nfunction toString(color) {\n let r = color[0];\n if (r != (r | 0)) {\n r = r + 0.5 | 0;\n }\n let g = color[1];\n if (g != (g | 0)) {\n g = g + 0.5 | 0;\n }\n let b = color[2];\n if (b != (b | 0)) {\n b = b + 0.5 | 0;\n }\n const a = color[3] === undefined ? 1 : Math.round(color[3] * 100) / 100;\n return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')';\n}\n\n/**\n * @param {string} s String.\n * @return {boolean} Whether the string is actually a valid color\n */\nfunction isStringColor(s) {\n try {\n fromString(s);\n return true;\n } catch (_) {\n return false;\n }\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/color.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/colorlike.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/ol/colorlike.js ***!
|
||
\**************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ asColorLike: function() { return /* binding */ asColorLike; }\n/* harmony export */ });\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ \"./node_modules/ol/color.js\");\n/**\n * @module ol/colorlike\n */\n\n\n/**\n * A type accepted by CanvasRenderingContext2D.fillStyle\n * or CanvasRenderingContext2D.strokeStyle.\n * Represents a color, pattern, or gradient. The origin for patterns and\n * gradients as fill style is an increment of 512 css pixels from map coordinate\n * `[0, 0]`. For seamless repeat patterns, width and height of the pattern image\n * must be a factor of two (2, 4, 8, ..., 512).\n *\n * @typedef {string|CanvasPattern|CanvasGradient} ColorLike\n * @api\n */\n\n/**\n * @param {import(\"./color.js\").Color|ColorLike} color Color.\n * @return {ColorLike} The color as an {@link ol/colorlike~ColorLike}.\n * @api\n */\nfunction asColorLike(color) {\n if (Array.isArray(color)) {\n return (0,_color_js__WEBPACK_IMPORTED_MODULE_0__.toString)(color);\n }\n return color;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/colorlike.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/console.js":
|
||
/*!************************************!*\
|
||
!*** ./node_modules/ol/console.js ***!
|
||
\************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ error: function() { return /* binding */ error; },\n/* harmony export */ log: function() { return /* binding */ log; },\n/* harmony export */ setLevel: function() { return /* binding */ setLevel; },\n/* harmony export */ warn: function() { return /* binding */ warn; }\n/* harmony export */ });\n/**\n * @module ol/console\n */\n\n/**\n * @typedef {'info'|'warn'|'error'|'none'} Level\n */\n\n/**\n * @type {Object<Level, number>}\n */\nconst levels = {\n info: 1,\n warn: 2,\n error: 3,\n none: 4\n};\n\n/**\n * @type {number}\n */\nlet level = levels.info;\n\n/**\n * Set the logging level. By default, the level is set to 'info' and all\n * messages will be logged. Set to 'warn' to only display warnings and errors.\n * Set to 'error' to only display errors. Set to 'none' to silence all messages.\n *\n * @param {Level} l The new level.\n */\nfunction setLevel(l) {\n level = levels[l];\n}\n\n/**\n * @param {...any} args Arguments to log\n */\nfunction log(...args) {\n if (level > levels.info) {\n return;\n }\n console.log(...args); // eslint-disable-line no-console\n}\n\n/**\n * @param {...any} args Arguments to log\n */\nfunction warn(...args) {\n if (level > levels.warn) {\n return;\n }\n console.warn(...args); // eslint-disable-line no-console\n}\n\n/**\n * @param {...any} args Arguments to log\n */\nfunction error(...args) {\n if (level > levels.error) {\n return;\n }\n console.error(...args); // eslint-disable-line no-console\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/console.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/control/Attribution.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ol/control/Attribution.js ***!
|
||
\************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.set.difference.v2.js */ \"./node_modules/core-js/modules/es.set.difference.v2.js\");\n/* harmony import */ var core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.set.intersection.v2.js */ \"./node_modules/core-js/modules/es.set.intersection.v2.js\");\n/* harmony import */ var core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.set.is-disjoint-from.v2.js */ \"./node_modules/core-js/modules/es.set.is-disjoint-from.v2.js\");\n/* harmony import */ var core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.set.is-subset-of.v2.js */ \"./node_modules/core-js/modules/es.set.is-subset-of.v2.js\");\n/* harmony import */ var core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.set.is-superset-of.v2.js */ \"./node_modules/core-js/modules/es.set.is-superset-of.v2.js\");\n/* harmony import */ var core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.set.symmetric-difference.v2.js */ \"./node_modules/core-js/modules/es.set.symmetric-difference.v2.js\");\n/* harmony import */ var core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.set.union.v2.js */ \"./node_modules/core-js/modules/es.set.union.v2.js\");\n/* harmony import */ var _Control_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Control.js */ \"./node_modules/ol/control/Control.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _css_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../css.js */ \"./node_modules/ol/css.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../dom.js */ \"./node_modules/ol/dom.js\");\n\n\n\n\n\n\n\n/**\n * @module ol/control/Attribution\n */\n\n\n\n\n\n\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-attribution'] CSS class name.\n * @property {HTMLElement|string} [target] Specify a target if you\n * want the control to be rendered outside of the map's\n * viewport.\n * @property {boolean} [collapsible] Specify if attributions can\n * be collapsed. If not specified, sources control this behavior with their\n * `attributionsCollapsible` setting.\n * @property {boolean} [collapsed=true] Specify if attributions should\n * be collapsed at startup.\n * @property {string} [tipLabel='Attributions'] Text label to use for the button tip.\n * @property {string|HTMLElement} [label='i'] Text label to use for the\n * collapsed attributions button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string} [expandClassName=className + '-expand'] CSS class name for the\n * collapsed attributions button.\n * @property {string|HTMLElement} [collapseLabel='›'] Text label to use\n * for the expanded attributions button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string} [collapseClassName=className + '-collapse'] CSS class name for the\n * expanded attributions button.\n * @property {function(import(\"../MapEvent.js\").default):void} [render] Function called when\n * the control should be re-rendered. This is called in a `requestAnimationFrame`\n * callback.\n */\n\n/**\n * @classdesc\n * Control to show all the attributions associated with the layer sources\n * in the map. This control is one of the default controls included in maps.\n * By default it will show in the bottom right portion of the map, but this can\n * be changed by using a css selector for `.ol-attribution`.\n *\n * @api\n */\nclass Attribution extends _Control_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"] {\n /**\n * @param {Options} [options] Attribution options.\n */\n constructor(options) {\n options = options ? options : {};\n super({\n element: document.createElement('div'),\n render: options.render,\n target: options.target\n });\n\n /**\n * @private\n * @type {HTMLElement}\n */\n this.ulElement_ = document.createElement('ul');\n\n /**\n * @private\n * @type {boolean}\n */\n this.collapsed_ = options.collapsed !== undefined ? options.collapsed : true;\n\n /**\n * @private\n * @type {boolean}\n */\n this.userCollapsed_ = this.collapsed_;\n\n /**\n * @private\n * @type {boolean}\n */\n this.overrideCollapsible_ = options.collapsible !== undefined;\n\n /**\n * @private\n * @type {boolean}\n */\n this.collapsible_ = options.collapsible !== undefined ? options.collapsible : true;\n if (!this.collapsible_) {\n this.collapsed_ = false;\n }\n const className = options.className !== undefined ? options.className : 'ol-attribution';\n const tipLabel = options.tipLabel !== undefined ? options.tipLabel : 'Attributions';\n const expandClassName = options.expandClassName !== undefined ? options.expandClassName : className + '-expand';\n const collapseLabel = options.collapseLabel !== undefined ? options.collapseLabel : '\\u203A';\n const collapseClassName = options.collapseClassName !== undefined ? options.collapseClassName : className + '-collapse';\n if (typeof collapseLabel === 'string') {\n /**\n * @private\n * @type {HTMLElement}\n */\n this.collapseLabel_ = document.createElement('span');\n this.collapseLabel_.textContent = collapseLabel;\n this.collapseLabel_.className = collapseClassName;\n } else {\n this.collapseLabel_ = collapseLabel;\n }\n const label = options.label !== undefined ? options.label : 'i';\n if (typeof label === 'string') {\n /**\n * @private\n * @type {HTMLElement}\n */\n this.label_ = document.createElement('span');\n this.label_.textContent = label;\n this.label_.className = expandClassName;\n } else {\n this.label_ = label;\n }\n const activeLabel = this.collapsible_ && !this.collapsed_ ? this.collapseLabel_ : this.label_;\n\n /**\n * @private\n * @type {HTMLElement}\n */\n this.toggleButton_ = document.createElement('button');\n this.toggleButton_.setAttribute('type', 'button');\n this.toggleButton_.setAttribute('aria-expanded', String(!this.collapsed_));\n this.toggleButton_.title = tipLabel;\n this.toggleButton_.appendChild(activeLabel);\n this.toggleButton_.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"].CLICK, this.handleClick_.bind(this), false);\n const cssClasses = className + ' ' + _css_js__WEBPACK_IMPORTED_MODULE_9__.CLASS_UNSELECTABLE + ' ' + _css_js__WEBPACK_IMPORTED_MODULE_9__.CLASS_CONTROL + (this.collapsed_ && this.collapsible_ ? ' ' + _css_js__WEBPACK_IMPORTED_MODULE_9__.CLASS_COLLAPSED : '') + (this.collapsible_ ? '' : ' ol-uncollapsible');\n const element = this.element;\n element.className = cssClasses;\n element.appendChild(this.toggleButton_);\n element.appendChild(this.ulElement_);\n\n /**\n * A list of currently rendered resolutions.\n * @type {Array<string>}\n * @private\n */\n this.renderedAttributions_ = [];\n\n /**\n * @private\n * @type {boolean}\n */\n this.renderedVisible_ = true;\n }\n\n /**\n * Collect a list of visible attributions and set the collapsible state.\n * @param {import(\"../Map.js\").FrameState} frameState Frame state.\n * @return {Array<string>} Attributions.\n * @private\n */\n collectSourceAttributions_(frameState) {\n const visibleAttributions = Array.from(new Set(this.getMap().getAllLayers().flatMap(layer => layer.getAttributions(frameState))));\n const collapsible = !this.getMap().getAllLayers().some(layer => layer.getSource() && layer.getSource().getAttributionsCollapsible() === false);\n if (!this.overrideCollapsible_) {\n this.setCollapsible(collapsible);\n }\n return visibleAttributions;\n }\n\n /**\n * @private\n * @param {?import(\"../Map.js\").FrameState} frameState Frame state.\n */\n updateElement_(frameState) {\n if (!frameState) {\n if (this.renderedVisible_) {\n this.element.style.display = 'none';\n this.renderedVisible_ = false;\n }\n return;\n }\n const attributions = this.collectSourceAttributions_(frameState);\n const visible = attributions.length > 0;\n if (this.renderedVisible_ != visible) {\n this.element.style.display = visible ? '' : 'none';\n this.renderedVisible_ = visible;\n }\n if ((0,_array_js__WEBPACK_IMPORTED_MODULE_10__.equals)(attributions, this.renderedAttributions_)) {\n return;\n }\n (0,_dom_js__WEBPACK_IMPORTED_MODULE_11__.removeChildren)(this.ulElement_);\n\n // append the attributions\n for (let i = 0, ii = attributions.length; i < ii; ++i) {\n const element = document.createElement('li');\n element.innerHTML = attributions[i];\n this.ulElement_.appendChild(element);\n }\n this.renderedAttributions_ = attributions;\n }\n\n /**\n * @param {MouseEvent} event The event to handle\n * @private\n */\n handleClick_(event) {\n event.preventDefault();\n this.handleToggle_();\n this.userCollapsed_ = this.collapsed_;\n }\n\n /**\n * @private\n */\n handleToggle_() {\n this.element.classList.toggle(_css_js__WEBPACK_IMPORTED_MODULE_9__.CLASS_COLLAPSED);\n if (this.collapsed_) {\n (0,_dom_js__WEBPACK_IMPORTED_MODULE_11__.replaceNode)(this.collapseLabel_, this.label_);\n } else {\n (0,_dom_js__WEBPACK_IMPORTED_MODULE_11__.replaceNode)(this.label_, this.collapseLabel_);\n }\n this.collapsed_ = !this.collapsed_;\n this.toggleButton_.setAttribute('aria-expanded', String(!this.collapsed_));\n }\n\n /**\n * Return `true` if the attribution is collapsible, `false` otherwise.\n * @return {boolean} True if the widget is collapsible.\n * @api\n */\n getCollapsible() {\n return this.collapsible_;\n }\n\n /**\n * Set whether the attribution should be collapsible.\n * @param {boolean} collapsible True if the widget is collapsible.\n * @api\n */\n setCollapsible(collapsible) {\n if (this.collapsible_ === collapsible) {\n return;\n }\n this.collapsible_ = collapsible;\n this.element.classList.toggle('ol-uncollapsible');\n if (this.userCollapsed_) {\n this.handleToggle_();\n }\n }\n\n /**\n * Collapse or expand the attribution according to the passed parameter. Will\n * not do anything if the attribution isn't collapsible or if the current\n * collapsed state is already the one requested.\n * @param {boolean} collapsed True if the widget is collapsed.\n * @api\n */\n setCollapsed(collapsed) {\n this.userCollapsed_ = collapsed;\n if (!this.collapsible_ || this.collapsed_ === collapsed) {\n return;\n }\n this.handleToggle_();\n }\n\n /**\n * Return `true` when the attribution is currently collapsed or `false`\n * otherwise.\n * @return {boolean} True if the widget is collapsed.\n * @api\n */\n getCollapsed() {\n return this.collapsed_;\n }\n\n /**\n * Update the attribution element.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @override\n */\n render(mapEvent) {\n this.updateElement_(mapEvent.frameState);\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Attribution);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/control/Attribution.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/control/Control.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/control/Control.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Object.js */ \"./node_modules/ol/Object.js\");\n/* harmony import */ var _MapEventType_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../MapEventType.js */ \"./node_modules/ol/MapEventType.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../events.js */ \"./node_modules/ol/events.js\");\n/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dom.js */ \"./node_modules/ol/dom.js\");\n\n/**\n * @module ol/control/Control\n */\n\n\n\n\n\n\n/**\n * @typedef {Object} Options\n * @property {HTMLElement} [element] The element is the control's\n * container element. This only needs to be specified if you're developing\n * a custom control.\n * @property {function(import(\"../MapEvent.js\").default):void} [render] Function called when\n * the control should be re-rendered. This is called in a `requestAnimationFrame`\n * callback.\n * @property {HTMLElement|string} [target] Specify a target if you want\n * the control to be rendered outside of the map's viewport.\n */\n\n/**\n * @classdesc\n * A control is a visible widget with a DOM element in a fixed position on the\n * screen. They can involve user input (buttons), or be informational only;\n * the position is determined using CSS. By default these are placed in the\n * container with CSS class name `ol-overlaycontainer-stopevent`, but can use\n * any outside DOM element.\n *\n * This is the base class for controls. You can use it for simple custom\n * controls by creating the element with listeners, creating an instance:\n * ```js\n * const myControl = new Control({element: myElement});\n * ```\n * and then adding this to the map.\n *\n * The main advantage of having this as a control rather than a simple separate\n * DOM element is that preventing propagation is handled for you. Controls\n * will also be objects in a {@link module:ol/Collection~Collection}, so you can use their methods.\n *\n * You can also extend this base for your own control class. See\n * examples/custom-controls for an example of how to do this.\n *\n * @api\n */\nclass Control extends _Object_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {Options} options Control options.\n */\n constructor(options) {\n super();\n const element = options.element;\n if (element && !options.target && !element.style.pointerEvents) {\n element.style.pointerEvents = 'auto';\n }\n\n /**\n * @protected\n * @type {HTMLElement}\n */\n this.element = element ? element : null;\n\n /**\n * @private\n * @type {HTMLElement}\n */\n this.target_ = null;\n\n /**\n * @private\n * @type {import(\"../Map.js\").default|null}\n */\n this.map_ = null;\n\n /**\n * @protected\n * @type {!Array<import(\"../events.js\").EventsKey>}\n */\n this.listenerKeys = [];\n if (options.render) {\n this.render = options.render;\n }\n if (options.target) {\n this.setTarget(options.target);\n }\n }\n\n /**\n * Clean up.\n */\n disposeInternal() {\n (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.removeNode)(this.element);\n super.disposeInternal();\n }\n\n /**\n * Get the map associated with this control.\n * @return {import(\"../Map.js\").default|null} Map.\n * @api\n */\n getMap() {\n return this.map_;\n }\n\n /**\n * Remove the control from its current map and attach it to the new map.\n * Pass `null` to just remove the control from the current map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../Map.js\").default|null} map Map.\n * @api\n */\n setMap(map) {\n if (this.map_) {\n (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.removeNode)(this.element);\n }\n for (let i = 0, ii = this.listenerKeys.length; i < ii; ++i) {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_3__.unlistenByKey)(this.listenerKeys[i]);\n }\n this.listenerKeys.length = 0;\n this.map_ = map;\n if (map) {\n const target = this.target_ ? this.target_ : map.getOverlayContainerStopEvent();\n target.appendChild(this.element);\n if (this.render !== _functions_js__WEBPACK_IMPORTED_MODULE_4__.VOID) {\n this.listenerKeys.push((0,_events_js__WEBPACK_IMPORTED_MODULE_3__.listen)(map, _MapEventType_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].POSTRENDER, this.render, this));\n }\n map.render();\n }\n }\n\n /**\n * Renders the control.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @api\n */\n render(mapEvent) {}\n\n /**\n * This function is used to set a target element for the control. It has no\n * effect if it is called after the control has been added to the map (i.e.\n * after `setMap` is called on the control). If no `target` is set in the\n * options passed to the control constructor and if `setTarget` is not called\n * then the control is added to the map's overlay container.\n * @param {HTMLElement|string} target Target.\n * @api\n */\n setTarget(target) {\n this.target_ = typeof target === 'string' ? document.getElementById(target) : target;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Control);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/control/Control.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/control/Rotate.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/ol/control/Rotate.js ***!
|
||
\*******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Control_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Control.js */ \"./node_modules/ol/control/Control.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _css_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../css.js */ \"./node_modules/ol/css.js\");\n/* harmony import */ var _easing_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../easing.js */ \"./node_modules/ol/easing.js\");\n/**\n * @module ol/control/Rotate\n */\n\n\n\n\n\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-rotate'] CSS class name.\n * @property {string|HTMLElement} [label='⇧'] Text label to use for the rotate button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string} [tipLabel='Reset rotation'] Text label to use for the rotate tip.\n * @property {string} [compassClassName='ol-compass'] CSS class name for the compass.\n * @property {number} [duration=250] Animation duration in milliseconds.\n * @property {boolean} [autoHide=true] Hide the control when rotation is 0.\n * @property {function(import(\"../MapEvent.js\").default):void} [render] Function called when the control should\n * be re-rendered. This is called in a `requestAnimationFrame` callback.\n * @property {function():void} [resetNorth] Function called when the control is clicked.\n * This will override the default `resetNorth`.\n * @property {HTMLElement|string} [target] Specify a target if you want the control to be\n * rendered outside of the map's viewport.\n */\n\n/**\n * @classdesc\n * A button control to reset rotation to 0.\n * To style this control use css selector `.ol-rotate`. A `.ol-hidden` css\n * selector is added to the button when the rotation is 0.\n *\n * @api\n */\nclass Rotate extends _Control_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Rotate options.\n */\n constructor(options) {\n options = options ? options : {};\n super({\n element: document.createElement('div'),\n render: options.render,\n target: options.target\n });\n const className = options.className !== undefined ? options.className : 'ol-rotate';\n const label = options.label !== undefined ? options.label : '\\u21E7';\n const compassClassName = options.compassClassName !== undefined ? options.compassClassName : 'ol-compass';\n\n /**\n * @type {HTMLElement}\n * @private\n */\n this.label_ = null;\n if (typeof label === 'string') {\n this.label_ = document.createElement('span');\n this.label_.className = compassClassName;\n this.label_.textContent = label;\n } else {\n this.label_ = label;\n this.label_.classList.add(compassClassName);\n }\n const tipLabel = options.tipLabel ? options.tipLabel : 'Reset rotation';\n const button = document.createElement('button');\n button.className = className + '-reset';\n button.setAttribute('type', 'button');\n button.title = tipLabel;\n button.appendChild(this.label_);\n button.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].CLICK, this.handleClick_.bind(this), false);\n const cssClasses = className + ' ' + _css_js__WEBPACK_IMPORTED_MODULE_2__.CLASS_UNSELECTABLE + ' ' + _css_js__WEBPACK_IMPORTED_MODULE_2__.CLASS_CONTROL;\n const element = this.element;\n element.className = cssClasses;\n element.appendChild(button);\n this.callResetNorth_ = options.resetNorth ? options.resetNorth : undefined;\n\n /**\n * @type {number}\n * @private\n */\n this.duration_ = options.duration !== undefined ? options.duration : 250;\n\n /**\n * @type {boolean}\n * @private\n */\n this.autoHide_ = options.autoHide !== undefined ? options.autoHide : true;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.rotation_ = undefined;\n if (this.autoHide_) {\n this.element.classList.add(_css_js__WEBPACK_IMPORTED_MODULE_2__.CLASS_HIDDEN);\n }\n }\n\n /**\n * @param {MouseEvent} event The event to handle\n * @private\n */\n handleClick_(event) {\n event.preventDefault();\n if (this.callResetNorth_ !== undefined) {\n this.callResetNorth_();\n } else {\n this.resetNorth_();\n }\n }\n\n /**\n * @private\n */\n resetNorth_() {\n const map = this.getMap();\n const view = map.getView();\n if (!view) {\n // the map does not have a view, so we can't act\n // upon it\n return;\n }\n const rotation = view.getRotation();\n if (rotation !== undefined) {\n if (this.duration_ > 0 && rotation % (2 * Math.PI) !== 0) {\n view.animate({\n rotation: 0,\n duration: this.duration_,\n easing: _easing_js__WEBPACK_IMPORTED_MODULE_3__.easeOut\n });\n } else {\n view.setRotation(0);\n }\n }\n }\n\n /**\n * Update the rotate control element.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @override\n */\n render(mapEvent) {\n const frameState = mapEvent.frameState;\n if (!frameState) {\n return;\n }\n const rotation = frameState.viewState.rotation;\n if (rotation != this.rotation_) {\n const transform = 'rotate(' + rotation + 'rad)';\n if (this.autoHide_) {\n const contains = this.element.classList.contains(_css_js__WEBPACK_IMPORTED_MODULE_2__.CLASS_HIDDEN);\n if (!contains && rotation === 0) {\n this.element.classList.add(_css_js__WEBPACK_IMPORTED_MODULE_2__.CLASS_HIDDEN);\n } else if (contains && rotation !== 0) {\n this.element.classList.remove(_css_js__WEBPACK_IMPORTED_MODULE_2__.CLASS_HIDDEN);\n }\n }\n this.label_.style.transform = transform;\n }\n this.rotation_ = rotation;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Rotate);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/control/Rotate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/control/Zoom.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ol/control/Zoom.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Control_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Control.js */ \"./node_modules/ol/control/Control.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _css_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../css.js */ \"./node_modules/ol/css.js\");\n/* harmony import */ var _easing_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../easing.js */ \"./node_modules/ol/easing.js\");\n/**\n * @module ol/control/Zoom\n */\n\n\n\n\n\n/**\n * @typedef {Object} Options\n * @property {number} [duration=250] Animation duration in milliseconds.\n * @property {string} [className='ol-zoom'] CSS class name.\n * @property {string} [zoomInClassName=className + '-in'] CSS class name for the zoom-in button.\n * @property {string} [zoomOutClassName=className + '-out'] CSS class name for the zoom-out button.\n * @property {string|HTMLElement} [zoomInLabel='+'] Text label to use for the zoom-in\n * button. Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string|HTMLElement} [zoomOutLabel='–'] Text label to use for the zoom-out button.\n * Instead of text, also an element (e.g. a `span` element) can be used.\n * @property {string} [zoomInTipLabel='Zoom in'] Text label to use for the button tip.\n * @property {string} [zoomOutTipLabel='Zoom out'] Text label to use for the button tip.\n * @property {number} [delta=1] The zoom delta applied on each click.\n * @property {HTMLElement|string} [target] Specify a target if you want the control to be\n * rendered outside of the map's viewport.\n */\n\n/**\n * @classdesc\n * A control with 2 buttons, one for zoom in and one for zoom out.\n * This control is one of the default controls of a map. To style this control\n * use css selectors `.ol-zoom-in` and `.ol-zoom-out`.\n *\n * @api\n */\nclass Zoom extends _Control_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Zoom options.\n */\n constructor(options) {\n options = options ? options : {};\n super({\n element: document.createElement('div'),\n target: options.target\n });\n const className = options.className !== undefined ? options.className : 'ol-zoom';\n const delta = options.delta !== undefined ? options.delta : 1;\n const zoomInClassName = options.zoomInClassName !== undefined ? options.zoomInClassName : className + '-in';\n const zoomOutClassName = options.zoomOutClassName !== undefined ? options.zoomOutClassName : className + '-out';\n const zoomInLabel = options.zoomInLabel !== undefined ? options.zoomInLabel : '+';\n const zoomOutLabel = options.zoomOutLabel !== undefined ? options.zoomOutLabel : '\\u2013';\n const zoomInTipLabel = options.zoomInTipLabel !== undefined ? options.zoomInTipLabel : 'Zoom in';\n const zoomOutTipLabel = options.zoomOutTipLabel !== undefined ? options.zoomOutTipLabel : 'Zoom out';\n const inElement = document.createElement('button');\n inElement.className = zoomInClassName;\n inElement.setAttribute('type', 'button');\n inElement.title = zoomInTipLabel;\n inElement.appendChild(typeof zoomInLabel === 'string' ? document.createTextNode(zoomInLabel) : zoomInLabel);\n inElement.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].CLICK, this.handleClick_.bind(this, delta), false);\n const outElement = document.createElement('button');\n outElement.className = zoomOutClassName;\n outElement.setAttribute('type', 'button');\n outElement.title = zoomOutTipLabel;\n outElement.appendChild(typeof zoomOutLabel === 'string' ? document.createTextNode(zoomOutLabel) : zoomOutLabel);\n outElement.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].CLICK, this.handleClick_.bind(this, -delta), false);\n const cssClasses = className + ' ' + _css_js__WEBPACK_IMPORTED_MODULE_2__.CLASS_UNSELECTABLE + ' ' + _css_js__WEBPACK_IMPORTED_MODULE_2__.CLASS_CONTROL;\n const element = this.element;\n element.className = cssClasses;\n element.appendChild(inElement);\n element.appendChild(outElement);\n\n /**\n * @type {number}\n * @private\n */\n this.duration_ = options.duration !== undefined ? options.duration : 250;\n }\n\n /**\n * @param {number} delta Zoom delta.\n * @param {MouseEvent} event The event to handle\n * @private\n */\n handleClick_(delta, event) {\n event.preventDefault();\n this.zoomByDelta_(delta);\n }\n\n /**\n * @param {number} delta Zoom delta.\n * @private\n */\n zoomByDelta_(delta) {\n const map = this.getMap();\n const view = map.getView();\n if (!view) {\n // the map does not have a view, so we can't act\n // upon it\n return;\n }\n const currentZoom = view.getZoom();\n if (currentZoom !== undefined) {\n const newZoom = view.getConstrainedZoom(currentZoom + delta);\n if (this.duration_ > 0) {\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n view.animate({\n zoom: newZoom,\n duration: this.duration_,\n easing: _easing_js__WEBPACK_IMPORTED_MODULE_3__.easeOut\n });\n } else {\n view.setZoom(newZoom);\n }\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Zoom);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/control/Zoom.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/control/ZoomSlider.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ol/control/ZoomSlider.js ***!
|
||
\***********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Control_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Control.js */ \"./node_modules/ol/control/Control.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _pointer_EventType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../pointer/EventType.js */ \"./node_modules/ol/pointer/EventType.js\");\n/* harmony import */ var _css_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../css.js */ \"./node_modules/ol/css.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../math.js */ \"./node_modules/ol/math.js\");\n/* harmony import */ var _easing_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../easing.js */ \"./node_modules/ol/easing.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../events.js */ \"./node_modules/ol/events.js\");\n/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../events/Event.js */ \"./node_modules/ol/events/Event.js\");\n\n/**\n * @module ol/control/ZoomSlider\n */\n\n\n\n\n\n\n\n\n\n\n/**\n * The enum for available directions.\n *\n * @enum {number}\n */\nconst Direction = {\n VERTICAL: 0,\n HORIZONTAL: 1\n};\n\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-zoomslider'] CSS class name.\n * @property {number} [duration=200] Animation duration in milliseconds.\n * @property {function(import(\"../MapEvent.js\").default):void} [render] Function called when the control\n * should be re-rendered. This is called in a `requestAnimationFrame` callback.\n * @property {HTMLElement|string} [target] Specify a target if you want the control to be\n * rendered outside of the map's viewport.\n */\n\n/**\n * @classdesc\n * A slider type of control for zooming.\n *\n * Example:\n *\n * map.addControl(new ZoomSlider());\n *\n * @api\n */\nclass ZoomSlider extends _Control_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {Options} [options] Zoom slider options.\n */\n constructor(options) {\n options = options ? options : {};\n super({\n target: options.target,\n element: document.createElement('div'),\n render: options.render\n });\n\n /**\n * @type {!Array<import(\"../events.js\").EventsKey>}\n * @private\n */\n this.dragListenerKeys_ = [];\n\n /**\n * Will hold the current resolution of the view.\n *\n * @type {number|undefined}\n * @private\n */\n this.currentResolution_ = undefined;\n\n /**\n * The direction of the slider. Will be determined from actual display of the\n * container and defaults to Direction.VERTICAL.\n *\n * @type {Direction}\n * @private\n */\n this.direction_ = Direction.VERTICAL;\n\n /**\n * @type {boolean}\n * @private\n */\n this.dragging_;\n\n /**\n * @type {number}\n * @private\n */\n this.heightLimit_ = 0;\n\n /**\n * @type {number}\n * @private\n */\n this.widthLimit_ = 0;\n\n /**\n * @type {number|undefined}\n * @private\n */\n this.startX_;\n\n /**\n * @type {number|undefined}\n * @private\n */\n this.startY_;\n\n /**\n * The calculated thumb size (border box plus margins). Set when initSlider_\n * is called.\n * @type {import(\"../size.js\").Size}\n * @private\n */\n this.thumbSize_ = null;\n\n /**\n * Whether the slider is initialized.\n * @type {boolean}\n * @private\n */\n this.sliderInitialized_ = false;\n\n /**\n * @type {number}\n * @private\n */\n this.duration_ = options.duration !== undefined ? options.duration : 200;\n const className = options.className !== undefined ? options.className : 'ol-zoomslider';\n const thumbElement = document.createElement('button');\n thumbElement.setAttribute('type', 'button');\n thumbElement.className = className + '-thumb ' + _css_js__WEBPACK_IMPORTED_MODULE_2__.CLASS_UNSELECTABLE;\n const containerElement = this.element;\n containerElement.className = className + ' ' + _css_js__WEBPACK_IMPORTED_MODULE_2__.CLASS_UNSELECTABLE + ' ' + _css_js__WEBPACK_IMPORTED_MODULE_2__.CLASS_CONTROL;\n containerElement.appendChild(thumbElement);\n containerElement.addEventListener(_pointer_EventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].POINTERDOWN, this.handleDraggerStart_.bind(this), false);\n containerElement.addEventListener(_pointer_EventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].POINTERMOVE, this.handleDraggerDrag_.bind(this), false);\n containerElement.addEventListener(_pointer_EventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].POINTERUP, this.handleDraggerEnd_.bind(this), false);\n containerElement.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CLICK, this.handleContainerClick_.bind(this), false);\n thumbElement.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CLICK, _events_Event_js__WEBPACK_IMPORTED_MODULE_5__.stopPropagation, false);\n }\n\n /**\n * Remove the control from its current map and attach it to the new map.\n * Pass `null` to just remove the control from the current map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../Map.js\").default|null} map Map.\n * @api\n */\n setMap(map) {\n super.setMap(map);\n if (map) {\n map.render();\n }\n }\n\n /**\n * Initializes the slider element. This will determine and set this controls\n * direction_ and also constrain the dragging of the thumb to always be within\n * the bounds of the container.\n *\n * @return {boolean} Initialization successful\n * @private\n */\n initSlider_() {\n const container = this.element;\n let containerWidth = container.offsetWidth;\n let containerHeight = container.offsetHeight;\n if (containerWidth === 0 && containerHeight === 0) {\n return this.sliderInitialized_ = false;\n }\n const containerStyle = getComputedStyle(container);\n containerWidth -= parseFloat(containerStyle['paddingRight']) + parseFloat(containerStyle['paddingLeft']);\n containerHeight -= parseFloat(containerStyle['paddingTop']) + parseFloat(containerStyle['paddingBottom']);\n const thumb = /** @type {HTMLElement} */container.firstElementChild;\n const thumbStyle = getComputedStyle(thumb);\n const thumbWidth = thumb.offsetWidth + parseFloat(thumbStyle['marginRight']) + parseFloat(thumbStyle['marginLeft']);\n const thumbHeight = thumb.offsetHeight + parseFloat(thumbStyle['marginTop']) + parseFloat(thumbStyle['marginBottom']);\n this.thumbSize_ = [thumbWidth, thumbHeight];\n if (containerWidth > containerHeight) {\n this.direction_ = Direction.HORIZONTAL;\n this.widthLimit_ = containerWidth - thumbWidth;\n } else {\n this.direction_ = Direction.VERTICAL;\n this.heightLimit_ = containerHeight - thumbHeight;\n }\n return this.sliderInitialized_ = true;\n }\n\n /**\n * @param {PointerEvent} event The browser event to handle.\n * @private\n */\n handleContainerClick_(event) {\n const view = this.getMap().getView();\n const relativePosition = this.getRelativePosition_(event.offsetX - this.thumbSize_[0] / 2, event.offsetY - this.thumbSize_[1] / 2);\n const resolution = this.getResolutionForPosition_(relativePosition);\n const zoom = view.getConstrainedZoom(view.getZoomForResolution(resolution));\n view.animateInternal({\n zoom: zoom,\n duration: this.duration_,\n easing: _easing_js__WEBPACK_IMPORTED_MODULE_6__.easeOut\n });\n }\n\n /**\n * Handle dragger start events.\n * @param {PointerEvent} event The drag event.\n * @private\n */\n handleDraggerStart_(event) {\n if (!this.dragging_ && event.target === this.element.firstElementChild) {\n const element = /** @type {HTMLElement} */\n this.element.firstElementChild;\n this.getMap().getView().beginInteraction();\n this.startX_ = event.clientX - parseFloat(element.style.left);\n this.startY_ = event.clientY - parseFloat(element.style.top);\n this.dragging_ = true;\n if (this.dragListenerKeys_.length === 0) {\n const drag = this.handleDraggerDrag_;\n const end = this.handleDraggerEnd_;\n const doc = this.getMap().getOwnerDocument();\n this.dragListenerKeys_.push((0,_events_js__WEBPACK_IMPORTED_MODULE_7__.listen)(doc, _pointer_EventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].POINTERMOVE, drag, this), (0,_events_js__WEBPACK_IMPORTED_MODULE_7__.listen)(doc, _pointer_EventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].POINTERUP, end, this));\n }\n }\n }\n\n /**\n * Handle dragger drag events.\n *\n * @param {PointerEvent} event The drag event.\n * @private\n */\n handleDraggerDrag_(event) {\n if (this.dragging_) {\n const deltaX = event.clientX - this.startX_;\n const deltaY = event.clientY - this.startY_;\n const relativePosition = this.getRelativePosition_(deltaX, deltaY);\n this.currentResolution_ = this.getResolutionForPosition_(relativePosition);\n this.getMap().getView().setResolution(this.currentResolution_);\n }\n }\n\n /**\n * Handle dragger end events.\n * @param {PointerEvent} event The drag event.\n * @private\n */\n handleDraggerEnd_(event) {\n if (this.dragging_) {\n const view = this.getMap().getView();\n view.endInteraction();\n this.dragging_ = false;\n this.startX_ = undefined;\n this.startY_ = undefined;\n this.dragListenerKeys_.forEach(_events_js__WEBPACK_IMPORTED_MODULE_7__.unlistenByKey);\n this.dragListenerKeys_.length = 0;\n }\n }\n\n /**\n * Positions the thumb inside its container according to the given resolution.\n *\n * @param {number} res The res.\n * @private\n */\n setThumbPosition_(res) {\n const position = this.getPositionForResolution_(res);\n const thumb = /** @type {HTMLElement} */this.element.firstElementChild;\n if (this.direction_ == Direction.HORIZONTAL) {\n thumb.style.left = this.widthLimit_ * position + 'px';\n } else {\n thumb.style.top = this.heightLimit_ * position + 'px';\n }\n }\n\n /**\n * Calculates the relative position of the thumb given x and y offsets. The\n * relative position scales from 0 to 1. The x and y offsets are assumed to be\n * in pixel units within the dragger limits.\n *\n * @param {number} x Pixel position relative to the left of the slider.\n * @param {number} y Pixel position relative to the top of the slider.\n * @return {number} The relative position of the thumb.\n * @private\n */\n getRelativePosition_(x, y) {\n let amount;\n if (this.direction_ === Direction.HORIZONTAL) {\n amount = x / this.widthLimit_;\n } else {\n amount = y / this.heightLimit_;\n }\n return (0,_math_js__WEBPACK_IMPORTED_MODULE_8__.clamp)(amount, 0, 1);\n }\n\n /**\n * Calculates the corresponding resolution of the thumb given its relative\n * position (where 0 is the minimum and 1 is the maximum).\n *\n * @param {number} position The relative position of the thumb.\n * @return {number} The corresponding resolution.\n * @private\n */\n getResolutionForPosition_(position) {\n const fn = this.getMap().getView().getResolutionForValueFunction();\n return fn(1 - position);\n }\n\n /**\n * Determines the relative position of the slider for the given resolution. A\n * relative position of 0 corresponds to the minimum view resolution. A\n * relative position of 1 corresponds to the maximum view resolution.\n *\n * @param {number} res The resolution.\n * @return {number} The relative position value (between 0 and 1).\n * @private\n */\n getPositionForResolution_(res) {\n const fn = this.getMap().getView().getValueForResolutionFunction();\n return (0,_math_js__WEBPACK_IMPORTED_MODULE_8__.clamp)(1 - fn(res), 0, 1);\n }\n\n /**\n * Update the zoomslider element.\n * @param {import(\"../MapEvent.js\").default} mapEvent Map event.\n * @override\n */\n render(mapEvent) {\n if (!mapEvent.frameState) {\n return;\n }\n if (!this.sliderInitialized_ && !this.initSlider_()) {\n return;\n }\n const res = mapEvent.frameState.viewState.resolution;\n this.currentResolution_ = res;\n this.setThumbPosition_(res);\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (ZoomSlider);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/control/ZoomSlider.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/control/defaults.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ol/control/defaults.js ***!
|
||
\*********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ defaults: function() { return /* binding */ defaults; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Attribution_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Attribution.js */ \"./node_modules/ol/control/Attribution.js\");\n/* harmony import */ var _Collection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Collection.js */ \"./node_modules/ol/Collection.js\");\n/* harmony import */ var _Rotate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Rotate.js */ \"./node_modules/ol/control/Rotate.js\");\n/* harmony import */ var _Zoom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Zoom.js */ \"./node_modules/ol/control/Zoom.js\");\n\n/**\n * @module ol/control/defaults\n */\n\n\n\n\n\n/**\n * @typedef {Object} DefaultsOptions\n * @property {boolean} [attribution=true] Include\n * {@link module:ol/control/Attribution~Attribution}.\n * @property {import(\"./Attribution.js\").Options} [attributionOptions]\n * Options for {@link module:ol/control/Attribution~Attribution}.\n * @property {boolean} [rotate=true] Include\n * {@link module:ol/control/Rotate~Rotate}.\n * @property {import(\"./Rotate.js\").Options} [rotateOptions] Options\n * for {@link module:ol/control/Rotate~Rotate}.\n * @property {boolean} [zoom] Include {@link module:ol/control/Zoom~Zoom}.\n * @property {import(\"./Zoom.js\").Options} [zoomOptions] Options for\n * {@link module:ol/control/Zoom~Zoom}.\n */\n\n/**\n * Set of controls included in maps by default. Unless configured otherwise,\n * this returns a collection containing an instance of each of the following\n * controls:\n * * {@link module:ol/control/Zoom~Zoom}\n * * {@link module:ol/control/Rotate~Rotate}\n * * {@link module:ol/control/Attribution~Attribution}\n *\n * @param {DefaultsOptions} [options] Options for the default controls.\n * @return {Collection<import(\"./Control.js\").default>} A collection of controls\n * to be used with the {@link module:ol/Map~Map} constructor's `controls` option.\n * @api\n */\nfunction defaults(options) {\n options = options ? options : {};\n\n /** @type {Collection<import(\"./Control.js\").default>} */\n const controls = new _Collection_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n const zoomControl = options.zoom !== undefined ? options.zoom : true;\n if (zoomControl) {\n controls.push(new _Zoom_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](options.zoomOptions));\n }\n const rotateControl = options.rotate !== undefined ? options.rotate : true;\n if (rotateControl) {\n controls.push(new _Rotate_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"](options.rotateOptions));\n }\n const attributionControl = options.attribution !== undefined ? options.attribution : true;\n if (attributionControl) {\n controls.push(new _Attribution_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"](options.attributionOptions));\n }\n return controls;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/control/defaults.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/coordinate.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/coordinate.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ add: function() { return /* binding */ add; },\n/* harmony export */ closestOnCircle: function() { return /* binding */ closestOnCircle; },\n/* harmony export */ closestOnSegment: function() { return /* binding */ closestOnSegment; },\n/* harmony export */ createStringXY: function() { return /* binding */ createStringXY; },\n/* harmony export */ degreesToStringHDMS: function() { return /* binding */ degreesToStringHDMS; },\n/* harmony export */ distance: function() { return /* binding */ distance; },\n/* harmony export */ equals: function() { return /* binding */ equals; },\n/* harmony export */ format: function() { return /* binding */ format; },\n/* harmony export */ getWorldsAway: function() { return /* binding */ getWorldsAway; },\n/* harmony export */ rotate: function() { return /* binding */ rotate; },\n/* harmony export */ scale: function() { return /* binding */ scale; },\n/* harmony export */ squaredDistance: function() { return /* binding */ squaredDistance; },\n/* harmony export */ squaredDistanceToSegment: function() { return /* binding */ squaredDistanceToSegment; },\n/* harmony export */ toStringHDMS: function() { return /* binding */ toStringHDMS; },\n/* harmony export */ toStringXY: function() { return /* binding */ toStringXY; },\n/* harmony export */ wrapX: function() { return /* binding */ wrapX; }\n/* harmony export */ });\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ \"./node_modules/ol/math.js\");\n/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./string.js */ \"./node_modules/ol/string.js\");\n/**\n * @module ol/coordinate\n */\n\n\n\n\n/**\n * An array of numbers representing an `xy`, `xyz` or `xyzm` coordinate.\n * Example: `[16, 48]`.\n * @typedef {Array<number>} Coordinate\n * @api\n */\n\n/**\n * A function that takes a {@link module:ol/coordinate~Coordinate} and\n * transforms it into a `{string}`.\n *\n * @typedef {function((Coordinate|undefined)): string} CoordinateFormat\n * @api\n */\n\n/**\n * Add `delta` to `coordinate`. `coordinate` is modified in place and returned\n * by the function.\n *\n * Example:\n *\n * import {add} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * add(coord, [-2, 4]);\n * // coord is now [5.85, 51.983333]\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {Coordinate} delta Delta.\n * @return {Coordinate} The input coordinate adjusted by\n * the given delta.\n * @api\n */\nfunction add(coordinate, delta) {\n coordinate[0] += +delta[0];\n coordinate[1] += +delta[1];\n return coordinate;\n}\n\n/**\n * Calculates the point closest to the passed coordinate on the passed circle.\n *\n * @param {Coordinate} coordinate The coordinate.\n * @param {import(\"./geom/Circle.js\").default} circle The circle.\n * @return {Coordinate} Closest point on the circumference.\n */\nfunction closestOnCircle(coordinate, circle) {\n const r = circle.getRadius();\n const center = circle.getCenter();\n const x0 = center[0];\n const y0 = center[1];\n const x1 = coordinate[0];\n const y1 = coordinate[1];\n let dx = x1 - x0;\n const dy = y1 - y0;\n if (dx === 0 && dy === 0) {\n dx = 1;\n }\n const d = Math.sqrt(dx * dx + dy * dy);\n const x = x0 + r * dx / d;\n const y = y0 + r * dy / d;\n return [x, y];\n}\n\n/**\n * Calculates the point closest to the passed coordinate on the passed segment.\n * This is the foot of the perpendicular of the coordinate to the segment when\n * the foot is on the segment, or the closest segment coordinate when the foot\n * is outside the segment.\n *\n * @param {Coordinate} coordinate The coordinate.\n * @param {Array<Coordinate>} segment The two coordinates\n * of the segment.\n * @return {Coordinate} The foot of the perpendicular of\n * the coordinate to the segment.\n */\nfunction closestOnSegment(coordinate, segment) {\n const x0 = coordinate[0];\n const y0 = coordinate[1];\n const start = segment[0];\n const end = segment[1];\n const x1 = start[0];\n const y1 = start[1];\n const x2 = end[0];\n const y2 = end[1];\n const dx = x2 - x1;\n const dy = y2 - y1;\n const along = dx === 0 && dy === 0 ? 0 : (dx * (x0 - x1) + dy * (y0 - y1)) / (dx * dx + dy * dy || 0);\n let x, y;\n if (along <= 0) {\n x = x1;\n y = y1;\n } else if (along >= 1) {\n x = x2;\n y = y2;\n } else {\n x = x1 + along * dx;\n y = y1 + along * dy;\n }\n return [x, y];\n}\n\n/**\n * Returns a {@link module:ol/coordinate~CoordinateFormat} function that can be\n * used to format\n * a {Coordinate} to a string.\n *\n * Example without specifying the fractional digits:\n *\n * import {createStringXY} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const stringifyFunc = createStringXY();\n * const out = stringifyFunc(coord);\n * // out is now '8, 48'\n *\n * Example with explicitly specifying 2 fractional digits:\n *\n * import {createStringXY} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const stringifyFunc = createStringXY(2);\n * const out = stringifyFunc(coord);\n * // out is now '7.85, 47.98'\n *\n * @param {number} [fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {CoordinateFormat} Coordinate format.\n * @api\n */\nfunction createStringXY(fractionDigits) {\n return (\n /**\n * @param {Coordinate} coordinate Coordinate.\n * @return {string} String XY.\n */\n function (coordinate) {\n return toStringXY(coordinate, fractionDigits);\n }\n );\n}\n\n/**\n * @param {string} hemispheres Hemispheres.\n * @param {number} degrees Degrees.\n * @param {number} [fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} String.\n */\nfunction degreesToStringHDMS(hemispheres, degrees, fractionDigits) {\n const normalizedDegrees = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.modulo)(degrees + 180, 360) - 180;\n const x = Math.abs(3600 * normalizedDegrees);\n const decimals = fractionDigits || 0;\n let deg = Math.floor(x / 3600);\n let min = Math.floor((x - deg * 3600) / 60);\n let sec = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.toFixed)(x - deg * 3600 - min * 60, decimals);\n if (sec >= 60) {\n sec = 0;\n min += 1;\n }\n if (min >= 60) {\n min = 0;\n deg += 1;\n }\n let hdms = deg + '\\u00b0';\n if (min !== 0 || sec !== 0) {\n hdms += ' ' + (0,_string_js__WEBPACK_IMPORTED_MODULE_1__.padNumber)(min, 2) + '\\u2032';\n }\n if (sec !== 0) {\n hdms += ' ' + (0,_string_js__WEBPACK_IMPORTED_MODULE_1__.padNumber)(sec, 2, decimals) + '\\u2033';\n }\n if (normalizedDegrees !== 0) {\n hdms += ' ' + hemispheres.charAt(normalizedDegrees < 0 ? 1 : 0);\n }\n return hdms;\n}\n\n/**\n * Transforms the given {@link module:ol/coordinate~Coordinate} to a string\n * using the given string template. The strings `{x}` and `{y}` in the template\n * will be replaced with the first and second coordinate values respectively.\n *\n * Example without specifying the fractional digits:\n *\n * import {format} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const template = 'Coordinate is ({x}|{y}).';\n * const out = format(coord, template);\n * // out is now 'Coordinate is (8|48).'\n *\n * Example explicitly specifying the fractional digits:\n *\n * import {format} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const template = 'Coordinate is ({x}|{y}).';\n * const out = format(coord, template, 2);\n * // out is now 'Coordinate is (7.85|47.98).'\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {string} template A template string with `{x}` and `{y}` placeholders\n * that will be replaced by first and second coordinate values.\n * @param {number} [fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} Formatted coordinate.\n * @api\n */\nfunction format(coordinate, template, fractionDigits) {\n if (coordinate) {\n return template.replace('{x}', coordinate[0].toFixed(fractionDigits)).replace('{y}', coordinate[1].toFixed(fractionDigits));\n }\n return '';\n}\n\n/**\n * @param {Coordinate} coordinate1 First coordinate.\n * @param {Coordinate} coordinate2 Second coordinate.\n * @return {boolean} The two coordinates are equal.\n */\nfunction equals(coordinate1, coordinate2) {\n let equals = true;\n for (let i = coordinate1.length - 1; i >= 0; --i) {\n if (coordinate1[i] != coordinate2[i]) {\n equals = false;\n break;\n }\n }\n return equals;\n}\n\n/**\n * Rotate `coordinate` by `angle`. `coordinate` is modified in place and\n * returned by the function.\n *\n * Example:\n *\n * import {rotate} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const rotateRadians = Math.PI / 2; // 90 degrees\n * rotate(coord, rotateRadians);\n * // coord is now [-47.983333, 7.85]\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} angle Angle in radian.\n * @return {Coordinate} Coordinate.\n * @api\n */\nfunction rotate(coordinate, angle) {\n const cosAngle = Math.cos(angle);\n const sinAngle = Math.sin(angle);\n const x = coordinate[0] * cosAngle - coordinate[1] * sinAngle;\n const y = coordinate[1] * cosAngle + coordinate[0] * sinAngle;\n coordinate[0] = x;\n coordinate[1] = y;\n return coordinate;\n}\n\n/**\n * Scale `coordinate` by `scale`. `coordinate` is modified in place and returned\n * by the function.\n *\n * Example:\n *\n * import {scale as scaleCoordinate} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const scale = 1.2;\n * scaleCoordinate(coord, scale);\n * // coord is now [9.42, 57.5799996]\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} scale Scale factor.\n * @return {Coordinate} Coordinate.\n */\nfunction scale(coordinate, scale) {\n coordinate[0] *= scale;\n coordinate[1] *= scale;\n return coordinate;\n}\n\n/**\n * @param {Coordinate} coord1 First coordinate.\n * @param {Coordinate} coord2 Second coordinate.\n * @return {number} Squared distance between coord1 and coord2.\n */\nfunction squaredDistance(coord1, coord2) {\n const dx = coord1[0] - coord2[0];\n const dy = coord1[1] - coord2[1];\n return dx * dx + dy * dy;\n}\n\n/**\n * @param {Coordinate} coord1 First coordinate.\n * @param {Coordinate} coord2 Second coordinate.\n * @return {number} Distance between coord1 and coord2.\n */\nfunction distance(coord1, coord2) {\n return Math.sqrt(squaredDistance(coord1, coord2));\n}\n\n/**\n * Calculate the squared distance from a coordinate to a line segment.\n *\n * @param {Coordinate} coordinate Coordinate of the point.\n * @param {Array<Coordinate>} segment Line segment (2\n * coordinates).\n * @return {number} Squared distance from the point to the line segment.\n */\nfunction squaredDistanceToSegment(coordinate, segment) {\n return squaredDistance(coordinate, closestOnSegment(coordinate, segment));\n}\n\n/**\n * Format a geographic coordinate with the hemisphere, degrees, minutes, and\n * seconds.\n *\n * Example without specifying fractional digits:\n *\n * import {toStringHDMS} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const out = toStringHDMS(coord);\n * // out is now '47° 58′ 60″ N 7° 50′ 60″ E'\n *\n * Example explicitly specifying 1 fractional digit:\n *\n * import {toStringHDMS} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const out = toStringHDMS(coord, 1);\n * // out is now '47° 58′ 60.0″ N 7° 50′ 60.0″ E'\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} [fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} Hemisphere, degrees, minutes and seconds.\n * @api\n */\nfunction toStringHDMS(coordinate, fractionDigits) {\n if (coordinate) {\n return degreesToStringHDMS('NS', coordinate[1], fractionDigits) + ' ' + degreesToStringHDMS('EW', coordinate[0], fractionDigits);\n }\n return '';\n}\n\n/**\n * Format a coordinate as a comma delimited string.\n *\n * Example without specifying fractional digits:\n *\n * import {toStringXY} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const out = toStringXY(coord);\n * // out is now '8, 48'\n *\n * Example explicitly specifying 1 fractional digit:\n *\n * import {toStringXY} from 'ol/coordinate.js';\n *\n * const coord = [7.85, 47.983333];\n * const out = toStringXY(coord, 1);\n * // out is now '7.8, 48.0'\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {number} [fractionDigits] The number of digits to include\n * after the decimal point. Default is `0`.\n * @return {string} XY.\n * @api\n */\nfunction toStringXY(coordinate, fractionDigits) {\n return format(coordinate, '{x}, {y}', fractionDigits);\n}\n\n/**\n * Modifies the provided coordinate in-place to be within the real world\n * extent. The lower projection extent boundary is inclusive, the upper one\n * exclusive.\n *\n * @param {Coordinate} coordinate Coordinate.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @return {Coordinate} The coordinate within the real world extent.\n */\nfunction wrapX(coordinate, projection) {\n if (projection.canWrapX()) {\n const worldWidth = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getWidth)(projection.getExtent());\n const worldsAway = getWorldsAway(coordinate, projection, worldWidth);\n if (worldsAway) {\n coordinate[0] -= worldsAway * worldWidth;\n }\n }\n return coordinate;\n}\n/**\n * @param {Coordinate} coordinate Coordinate.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @param {number} [sourceExtentWidth] Width of the source extent.\n * @return {number} Offset in world widths.\n */\nfunction getWorldsAway(coordinate, projection, sourceExtentWidth) {\n const projectionExtent = projection.getExtent();\n let worldsAway = 0;\n if (projection.canWrapX() && (coordinate[0] < projectionExtent[0] || coordinate[0] > projectionExtent[2])) {\n sourceExtentWidth = sourceExtentWidth || (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getWidth)(projectionExtent);\n worldsAway = Math.floor((coordinate[0] - projectionExtent[0]) / sourceExtentWidth);\n }\n return worldsAway;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/coordinate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/css.js":
|
||
/*!********************************!*\
|
||
!*** ./node_modules/ol/css.js ***!
|
||
\********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CLASS_COLLAPSED: function() { return /* binding */ CLASS_COLLAPSED; },\n/* harmony export */ CLASS_CONTROL: function() { return /* binding */ CLASS_CONTROL; },\n/* harmony export */ CLASS_HIDDEN: function() { return /* binding */ CLASS_HIDDEN; },\n/* harmony export */ CLASS_SELECTABLE: function() { return /* binding */ CLASS_SELECTABLE; },\n/* harmony export */ CLASS_UNSELECTABLE: function() { return /* binding */ CLASS_UNSELECTABLE; },\n/* harmony export */ CLASS_UNSUPPORTED: function() { return /* binding */ CLASS_UNSUPPORTED; },\n/* harmony export */ getFontParameters: function() { return /* binding */ getFontParameters; }\n/* harmony export */ });\n/**\n * @module ol/css\n */\n\n/**\n * @typedef {Object} FontParameters\n * @property {string} style Style.\n * @property {string} variant Variant.\n * @property {string} weight Weight.\n * @property {string} size Size.\n * @property {string} lineHeight LineHeight.\n * @property {string} family Family.\n * @property {Array<string>} families Families.\n */\n\n/**\n * The CSS class for hidden feature.\n *\n * @const\n * @type {string}\n */\nconst CLASS_HIDDEN = 'ol-hidden';\n\n/**\n * The CSS class that we'll give the DOM elements to have them selectable.\n *\n * @const\n * @type {string}\n */\nconst CLASS_SELECTABLE = 'ol-selectable';\n\n/**\n * The CSS class that we'll give the DOM elements to have them unselectable.\n *\n * @const\n * @type {string}\n */\nconst CLASS_UNSELECTABLE = 'ol-unselectable';\n\n/**\n * The CSS class for unsupported feature.\n *\n * @const\n * @type {string}\n */\nconst CLASS_UNSUPPORTED = 'ol-unsupported';\n\n/**\n * The CSS class for controls.\n *\n * @const\n * @type {string}\n */\nconst CLASS_CONTROL = 'ol-control';\n\n/**\n * The CSS class that we'll give the DOM elements that are collapsed, i.e.\n * to those elements which usually can be expanded.\n *\n * @const\n * @type {string}\n */\nconst CLASS_COLLAPSED = 'ol-collapsed';\n\n/**\n * From https://stackoverflow.com/questions/10135697/regex-to-parse-any-css-font\n * @type {RegExp}\n */\nconst fontRegEx = new RegExp(['^\\\\s*(?=(?:(?:[-a-z]+\\\\s*){0,2}(italic|oblique))?)', '(?=(?:(?:[-a-z]+\\\\s*){0,2}(small-caps))?)', '(?=(?:(?:[-a-z]+\\\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)', '(?:(?:normal|\\\\1|\\\\2|\\\\3)\\\\s*){0,3}((?:xx?-)?', '(?:small|large)|medium|smaller|larger|[\\\\.\\\\d]+(?:\\\\%|in|[cem]m|ex|p[ctx]))', '(?:\\\\s*\\\\/\\\\s*(normal|[\\\\.\\\\d]+(?:\\\\%|in|[cem]m|ex|p[ctx])?))', '?\\\\s*([-,\\\\\"\\\\\\'\\\\sa-z]+?)\\\\s*$'].join(''), 'i');\n/** @type {Array<'style'|'variant'|'weight'|'size'|'lineHeight'|'family'>} */\nconst fontRegExMatchIndex = ['style', 'variant', 'weight', 'size', 'lineHeight', 'family'];\n\n/**\n * Get the list of font families from a font spec. Note that this doesn't work\n * for font families that have commas in them.\n * @param {string} fontSpec The CSS font property.\n * @return {FontParameters|null} The font parameters (or null if the input spec is invalid).\n */\nconst getFontParameters = function (fontSpec) {\n const match = fontSpec.match(fontRegEx);\n if (!match) {\n return null;\n }\n const style = /** @type {FontParameters} */{\n lineHeight: 'normal',\n size: '1.2em',\n style: 'normal',\n weight: 'normal',\n variant: 'normal'\n };\n for (let i = 0, ii = fontRegExMatchIndex.length; i < ii; ++i) {\n const value = match[i + 1];\n if (value !== undefined) {\n style[fontRegExMatchIndex[i]] = value;\n }\n }\n style.families = style.family.split(/,\\s?/);\n return style;\n};\n\n//# sourceURL=webpack://complexes/./node_modules/ol/css.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/dom.js":
|
||
/*!********************************!*\
|
||
!*** ./node_modules/ol/dom.js ***!
|
||
\********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createCanvasContext2D: function() { return /* binding */ createCanvasContext2D; },\n/* harmony export */ outerHeight: function() { return /* binding */ outerHeight; },\n/* harmony export */ outerWidth: function() { return /* binding */ outerWidth; },\n/* harmony export */ releaseCanvas: function() { return /* binding */ releaseCanvas; },\n/* harmony export */ removeChildren: function() { return /* binding */ removeChildren; },\n/* harmony export */ removeNode: function() { return /* binding */ removeNode; },\n/* harmony export */ replaceChildren: function() { return /* binding */ replaceChildren; },\n/* harmony export */ replaceNode: function() { return /* binding */ replaceNode; }\n/* harmony export */ });\n/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./has.js */ \"./node_modules/ol/has.js\");\n\n\n/**\n * @module ol/dom\n */\n\n//FIXME Move this function to the canvas module\n/**\n * Create an html canvas element and returns its 2d context.\n * @param {number} [width] Canvas width.\n * @param {number} [height] Canvas height.\n * @param {Array<HTMLCanvasElement>} [canvasPool] Canvas pool to take existing canvas from.\n * @param {CanvasRenderingContext2DSettings} [settings] CanvasRenderingContext2DSettings\n * @return {CanvasRenderingContext2D} The context.\n */\nfunction createCanvasContext2D(width, height, canvasPool, settings) {\n /** @type {HTMLCanvasElement|OffscreenCanvas} */\n let canvas;\n if (canvasPool && canvasPool.length) {\n canvas = /** @type {HTMLCanvasElement} */canvasPool.shift();\n } else if (_has_js__WEBPACK_IMPORTED_MODULE_0__.WORKER_OFFSCREEN_CANVAS) {\n canvas = new OffscreenCanvas(width || 300, height || 300);\n } else {\n canvas = document.createElement('canvas');\n }\n if (width) {\n canvas.width = width;\n }\n if (height) {\n canvas.height = height;\n }\n //FIXME Allow OffscreenCanvasRenderingContext2D as return type\n return /** @type {CanvasRenderingContext2D} */canvas.getContext('2d', settings);\n}\n\n/**\n * Releases canvas memory to avoid exceeding memory limits in Safari.\n * See https://pqina.nl/blog/total-canvas-memory-use-exceeds-the-maximum-limit/\n * @param {CanvasRenderingContext2D} context Context.\n */\nfunction releaseCanvas(context) {\n const canvas = context.canvas;\n canvas.width = 1;\n canvas.height = 1;\n context.clearRect(0, 0, 1, 1);\n}\n\n/**\n * Get the current computed width for the given element including margin,\n * padding and border.\n * Equivalent to jQuery's `$(el).outerWidth(true)`.\n * @param {!HTMLElement} element Element.\n * @return {number} The width.\n */\nfunction outerWidth(element) {\n let width = element.offsetWidth;\n const style = getComputedStyle(element);\n width += parseInt(style.marginLeft, 10) + parseInt(style.marginRight, 10);\n return width;\n}\n\n/**\n * Get the current computed height for the given element including margin,\n * padding and border.\n * Equivalent to jQuery's `$(el).outerHeight(true)`.\n * @param {!HTMLElement} element Element.\n * @return {number} The height.\n */\nfunction outerHeight(element) {\n let height = element.offsetHeight;\n const style = getComputedStyle(element);\n height += parseInt(style.marginTop, 10) + parseInt(style.marginBottom, 10);\n return height;\n}\n\n/**\n * @param {Node} newNode Node to replace old node\n * @param {Node} oldNode The node to be replaced\n */\nfunction replaceNode(newNode, oldNode) {\n const parent = oldNode.parentNode;\n if (parent) {\n parent.replaceChild(newNode, oldNode);\n }\n}\n\n/**\n * @param {Node} node The node to remove.\n * @return {Node|null} The node that was removed or null.\n */\nfunction removeNode(node) {\n return node && node.parentNode ? node.parentNode.removeChild(node) : null;\n}\n\n/**\n * @param {Node} node The node to remove the children from.\n */\nfunction removeChildren(node) {\n while (node.lastChild) {\n node.removeChild(node.lastChild);\n }\n}\n\n/**\n * Transform the children of a parent node so they match the\n * provided list of children. This function aims to efficiently\n * remove, add, and reorder child nodes while maintaining a simple\n * implementation (it is not guaranteed to minimize DOM operations).\n * @param {Node} node The parent node whose children need reworking.\n * @param {Array<Node>} children The desired children.\n */\nfunction replaceChildren(node, children) {\n const oldChildren = node.childNodes;\n for (let i = 0; true; ++i) {\n const oldChild = oldChildren[i];\n const newChild = children[i];\n\n // check if our work is done\n if (!oldChild && !newChild) {\n break;\n }\n\n // check if children match\n if (oldChild === newChild) {\n continue;\n }\n\n // check if a new child needs to be added\n if (!oldChild) {\n node.appendChild(newChild);\n continue;\n }\n\n // check if an old child needs to be removed\n if (!newChild) {\n node.removeChild(oldChild);\n --i;\n continue;\n }\n\n // reorder\n node.insertBefore(newChild, oldChild);\n }\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/dom.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/easing.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/ol/easing.js ***!
|
||
\***********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ easeIn: function() { return /* binding */ easeIn; },\n/* harmony export */ easeOut: function() { return /* binding */ easeOut; },\n/* harmony export */ inAndOut: function() { return /* binding */ inAndOut; },\n/* harmony export */ linear: function() { return /* binding */ linear; },\n/* harmony export */ upAndDown: function() { return /* binding */ upAndDown; }\n/* harmony export */ });\n/**\n * @module ol/easing\n */\n\n/**\n * Start slow and speed up.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nfunction easeIn(t) {\n return Math.pow(t, 3);\n}\n\n/**\n * Start fast and slow down.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nfunction easeOut(t) {\n return 1 - easeIn(1 - t);\n}\n\n/**\n * Start slow, speed up, and then slow down again.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nfunction inAndOut(t) {\n return 3 * t * t - 2 * t * t * t;\n}\n\n/**\n * Maintain a constant speed over time.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nfunction linear(t) {\n return t;\n}\n\n/**\n * Start slow, speed up, and at the very end slow down again. This has the\n * same general behavior as {@link module:ol/easing.inAndOut}, but the final\n * slowdown is delayed.\n * @param {number} t Input between 0 and 1.\n * @return {number} Output between 0 and 1.\n * @api\n */\nfunction upAndDown(t) {\n if (t < 0.5) {\n return inAndOut(2 * t);\n }\n return 1 - inAndOut(2 * (t - 0.5));\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/easing.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/events.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/ol/events.js ***!
|
||
\***********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ listen: function() { return /* binding */ listen; },\n/* harmony export */ listenOnce: function() { return /* binding */ listenOnce; },\n/* harmony export */ unlistenByKey: function() { return /* binding */ unlistenByKey; }\n/* harmony export */ });\n/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./obj.js */ \"./node_modules/ol/obj.js\");\n/**\n * @module ol/events\n */\n\n\n/**\n * Key to use with {@link module:ol/Observable.unByKey}.\n * @typedef {Object} EventsKey\n * @property {ListenerFunction} listener Listener.\n * @property {import(\"./events/Target.js\").EventTargetLike} target Target.\n * @property {string} type Type.\n * @api\n */\n\n/**\n * Listener function. This function is called with an event object as argument.\n * When the function returns `false`, event propagation will stop.\n *\n * @typedef {function((Event|import(\"./events/Event.js\").default)): (void|boolean)} ListenerFunction\n * @api\n */\n\n/**\n * @typedef {Object} ListenerObject\n * @property {ListenerFunction} handleEvent HandleEvent listener function.\n */\n\n/**\n * @typedef {ListenerFunction|ListenerObject} Listener\n */\n\n/**\n * Registers an event listener on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * This function efficiently binds a `listener` to a `this` object, and returns\n * a key for use with {@link module:ol/events.unlistenByKey}.\n *\n * @param {import(\"./events/Target.js\").EventTargetLike} target Event target.\n * @param {string} type Event type.\n * @param {ListenerFunction} listener Listener.\n * @param {Object} [thisArg] Object referenced by the `this` keyword in the\n * listener. Default is the `target`.\n * @param {boolean} [once] If true, add the listener as one-off listener.\n * @return {EventsKey} Unique key for the listener.\n */\nfunction listen(target, type, listener, thisArg, once) {\n if (thisArg && thisArg !== target) {\n listener = listener.bind(thisArg);\n }\n if (once) {\n const originalListener = listener;\n listener = function () {\n target.removeEventListener(type, listener);\n originalListener.apply(this, arguments);\n };\n }\n const eventsKey = {\n target: target,\n type: type,\n listener: listener\n };\n target.addEventListener(type, listener);\n return eventsKey;\n}\n\n/**\n * Registers a one-off event listener on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * This function efficiently binds a `listener` as self-unregistering listener\n * to a `this` object, and returns a key for use with\n * {@link module:ol/events.unlistenByKey} in case the listener needs to be\n * unregistered before it is called.\n *\n * When {@link module:ol/events.listen} is called with the same arguments after this\n * function, the self-unregistering listener will be turned into a permanent\n * listener.\n *\n * @param {import(\"./events/Target.js\").EventTargetLike} target Event target.\n * @param {string} type Event type.\n * @param {ListenerFunction} listener Listener.\n * @param {Object} [thisArg] Object referenced by the `this` keyword in the\n * listener. Default is the `target`.\n * @return {EventsKey} Key for unlistenByKey.\n */\nfunction listenOnce(target, type, listener, thisArg) {\n return listen(target, type, listener, thisArg, true);\n}\n\n/**\n * Unregisters event listeners on an event target. Inspired by\n * https://google.github.io/closure-library/api/source/closure/goog/events/events.js.src.html\n *\n * The argument passed to this function is the key returned from\n * {@link module:ol/events.listen} or {@link module:ol/events.listenOnce}.\n *\n * @param {EventsKey} key The key.\n */\nfunction unlistenByKey(key) {\n if (key && key.target) {\n key.target.removeEventListener(key.type, key.listener);\n (0,_obj_js__WEBPACK_IMPORTED_MODULE_0__.clear)(key);\n }\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/events.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/events/Event.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ol/events/Event.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ preventDefault: function() { return /* binding */ preventDefault; },\n/* harmony export */ stopPropagation: function() { return /* binding */ stopPropagation; }\n/* harmony export */ });\n/**\n * @module ol/events/Event\n */\n\n/**\n * @classdesc\n * Stripped down implementation of the W3C DOM Level 2 Event interface.\n * See https://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-interface.\n *\n * This implementation only provides `type` and `target` properties, and\n * `stopPropagation` and `preventDefault` methods. It is meant as base class\n * for higher level events defined in the library, and works with\n * {@link module:ol/events/Target~Target}.\n */\nclass BaseEvent {\n /**\n * @param {string} type Type.\n */\n constructor(type) {\n /**\n * @type {boolean}\n */\n this.propagationStopped;\n\n /**\n * @type {boolean}\n */\n this.defaultPrevented;\n\n /**\n * The event type.\n * @type {string}\n * @api\n */\n this.type = type;\n\n /**\n * The event target.\n * @type {Object}\n * @api\n */\n this.target = null;\n }\n\n /**\n * Prevent default. This means that no emulated `click`, `singleclick` or `doubleclick` events\n * will be fired.\n * @api\n */\n preventDefault() {\n this.defaultPrevented = true;\n }\n\n /**\n * Stop event propagation.\n * @api\n */\n stopPropagation() {\n this.propagationStopped = true;\n }\n}\n\n/**\n * @param {Event|import(\"./Event.js\").default} evt Event\n */\nfunction stopPropagation(evt) {\n evt.stopPropagation();\n}\n\n/**\n * @param {Event|import(\"./Event.js\").default} evt Event\n */\nfunction preventDefault(evt) {\n evt.preventDefault();\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (BaseEvent);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/events/Event.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/events/EventType.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ol/events/EventType.js ***!
|
||
\*********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/events/EventType\n */\n\n/**\n * @enum {string}\n * @const\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n /**\n * Generic change event. Triggered when the revision counter is increased.\n * @event module:ol/events/Event~BaseEvent#change\n * @api\n */\n CHANGE: 'change',\n /**\n * Generic error event. Triggered when an error occurs.\n * @event module:ol/events/Event~BaseEvent#error\n * @api\n */\n ERROR: 'error',\n BLUR: 'blur',\n CLEAR: 'clear',\n CONTEXTMENU: 'contextmenu',\n CLICK: 'click',\n DBLCLICK: 'dblclick',\n DRAGENTER: 'dragenter',\n DRAGOVER: 'dragover',\n DROP: 'drop',\n FOCUS: 'focus',\n KEYDOWN: 'keydown',\n KEYPRESS: 'keypress',\n LOAD: 'load',\n RESIZE: 'resize',\n TOUCHMOVE: 'touchmove',\n WHEEL: 'wheel'\n});\n\n//# sourceURL=webpack://complexes/./node_modules/ol/events/EventType.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/events/Key.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/events/Key.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/events/Key\n */\n\n/**\n * @enum {string}\n * @const\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n LEFT: 'ArrowLeft',\n UP: 'ArrowUp',\n RIGHT: 'ArrowRight',\n DOWN: 'ArrowDown'\n});\n\n//# sourceURL=webpack://complexes/./node_modules/ol/events/Key.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/events/SnapEvent.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ol/events/SnapEvent.js ***!
|
||
\*********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SnapEvent: function() { return /* binding */ SnapEvent; },\n/* harmony export */ SnapEventType: function() { return /* binding */ SnapEventType; }\n/* harmony export */ });\n/* harmony import */ var _Event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Event.js */ \"./node_modules/ol/events/Event.js\");\n/**\n * @module ol/events/SnapEvent\n */\n\n\n/**\n * @enum {string}\n */\nconst SnapEventType = {\n /**\n * Triggered upon snapping to vertex or edge\n * @event SnapEvent#snap\n * @api\n */\n SNAP: 'snap'\n};\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Snap~Snap} instances are instances of this\n */\nclass SnapEvent extends _Event_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {SnapEventType} type Type.\n * @param {Object} options Options.\n * @param {import(\"../coordinate.js\").Coordinate} options.vertex The snapped vertex.\n * @param {import(\"../coordinate.js\").Coordinate} options.vertexPixel The pixel of the snapped vertex.\n * @param {import(\"../Feature.js\").default} options.feature The feature being snapped.\n * @param {Array<import(\"../coordinate.js\").Coordinate>|null} options.segment Segment, or `null` if snapped to a vertex.\n */\n constructor(type, options) {\n super(type);\n /**\n * The Map coordinate of the snapped point.\n * @type {import(\"../coordinate.js\").Coordinate}\n * @api\n */\n this.vertex = options.vertex;\n /**\n * The Map pixel of the snapped point.\n * @type {Array<number>&Array<number>}\n * @api\n */\n this.vertexPixel = options.vertexPixel;\n /**\n * The feature closest to the snapped point.\n * @type {import(\"../Feature.js\").default<import(\"../geom/Geometry.js\").default>}\n * @api\n */\n this.feature = options.feature;\n /**\n * The segment closest to the snapped point, if snapped to a segment.\n * @type {Array<import(\"../coordinate.js\").Coordinate>|null}\n * @api\n */\n this.segment = options.segment;\n }\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/events/SnapEvent.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/events/Target.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ol/events/Target.js ***!
|
||
\******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Disposable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Disposable.js */ \"./node_modules/ol/Disposable.js\");\n/* harmony import */ var _Event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Event.js */ \"./node_modules/ol/events/Event.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../obj.js */ \"./node_modules/ol/obj.js\");\n\n/**\n * @module ol/events/Target\n */\n\n\n\n\n\n/**\n * @typedef {EventTarget|Target} EventTargetLike\n */\n\n/**\n * @classdesc\n * A simplified implementation of the W3C DOM Level 2 EventTarget interface.\n * See https://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-EventTarget.\n *\n * There are two important simplifications compared to the specification:\n *\n * 1. The handling of `useCapture` in `addEventListener` and\n * `removeEventListener`. There is no real capture model.\n * 2. The handling of `stopPropagation` and `preventDefault` on `dispatchEvent`.\n * There is no event target hierarchy. When a listener calls\n * `stopPropagation` or `preventDefault` on an event object, it means that no\n * more listeners after this one will be called. Same as when the listener\n * returns false.\n */\nclass Target extends _Disposable_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {*} [target] Default event target for dispatched events.\n */\n constructor(target) {\n super();\n\n /**\n * @private\n * @type {*}\n */\n this.eventTarget_ = target;\n\n /**\n * @private\n * @type {Object<string, number>|null}\n */\n this.pendingRemovals_ = null;\n\n /**\n * @private\n * @type {Object<string, number>|null}\n */\n this.dispatching_ = null;\n\n /**\n * @private\n * @type {Object<string, Array<import(\"../events.js\").Listener>>|null}\n */\n this.listeners_ = null;\n }\n\n /**\n * @param {string} type Type.\n * @param {import(\"../events.js\").Listener} listener Listener.\n */\n addEventListener(type, listener) {\n if (!type || !listener) {\n return;\n }\n const listeners = this.listeners_ || (this.listeners_ = {});\n const listenersForType = listeners[type] || (listeners[type] = []);\n if (!listenersForType.includes(listener)) {\n listenersForType.push(listener);\n }\n }\n\n /**\n * Dispatches an event and calls all listeners listening for events\n * of this type. The event parameter can either be a string or an\n * Object with a `type` property.\n *\n * @param {import(\"./Event.js\").default|string} event Event object.\n * @return {boolean|undefined} `false` if anyone called preventDefault on the\n * event object or if any of the listeners returned false.\n * @api\n */\n dispatchEvent(event) {\n const isString = typeof event === 'string';\n const type = isString ? event : event.type;\n const listeners = this.listeners_ && this.listeners_[type];\n if (!listeners) {\n return;\n }\n const evt = isString ? new _Event_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](event) : (/** @type {Event} */event);\n if (!evt.target) {\n evt.target = this.eventTarget_ || this;\n }\n const dispatching = this.dispatching_ || (this.dispatching_ = {});\n const pendingRemovals = this.pendingRemovals_ || (this.pendingRemovals_ = {});\n if (!(type in dispatching)) {\n dispatching[type] = 0;\n pendingRemovals[type] = 0;\n }\n ++dispatching[type];\n let propagate;\n for (let i = 0, ii = listeners.length; i < ii; ++i) {\n if ('handleEvent' in listeners[i]) {\n propagate = /** @type {import(\"../events.js\").ListenerObject} */listeners[i].handleEvent(evt);\n } else {\n propagate = /** @type {import(\"../events.js\").ListenerFunction} */listeners[i].call(this, evt);\n }\n if (propagate === false || evt.propagationStopped) {\n propagate = false;\n break;\n }\n }\n if (--dispatching[type] === 0) {\n let pr = pendingRemovals[type];\n delete pendingRemovals[type];\n while (pr--) {\n this.removeEventListener(type, _functions_js__WEBPACK_IMPORTED_MODULE_3__.VOID);\n }\n delete dispatching[type];\n }\n return propagate;\n }\n\n /**\n * Clean up.\n */\n disposeInternal() {\n this.listeners_ && (0,_obj_js__WEBPACK_IMPORTED_MODULE_4__.clear)(this.listeners_);\n }\n\n /**\n * Get the listeners for a specified event type. Listeners are returned in the\n * order that they will be called in.\n *\n * @param {string} type Type.\n * @return {Array<import(\"../events.js\").Listener>|undefined} Listeners.\n */\n getListeners(type) {\n return this.listeners_ && this.listeners_[type] || undefined;\n }\n\n /**\n * @param {string} [type] Type. If not provided,\n * `true` will be returned if this event target has any listeners.\n * @return {boolean} Has listeners.\n */\n hasListener(type) {\n if (!this.listeners_) {\n return false;\n }\n return type ? type in this.listeners_ : Object.keys(this.listeners_).length > 0;\n }\n\n /**\n * @param {string} type Type.\n * @param {import(\"../events.js\").Listener} listener Listener.\n */\n removeEventListener(type, listener) {\n if (!this.listeners_) {\n return;\n }\n const listeners = this.listeners_[type];\n if (!listeners) {\n return;\n }\n const index = listeners.indexOf(listener);\n if (index !== -1) {\n if (this.pendingRemovals_ && type in this.pendingRemovals_) {\n // make listener a no-op, and remove later in #dispatchEvent()\n listeners[index] = _functions_js__WEBPACK_IMPORTED_MODULE_3__.VOID;\n ++this.pendingRemovals_[type];\n } else {\n listeners.splice(index, 1);\n if (listeners.length === 0) {\n delete this.listeners_[type];\n }\n }\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Target);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/events/Target.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/events/condition.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ol/events/condition.js ***!
|
||
\*********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ all: function() { return /* binding */ all; },\n/* harmony export */ altKeyOnly: function() { return /* binding */ altKeyOnly; },\n/* harmony export */ altShiftKeysOnly: function() { return /* binding */ altShiftKeysOnly; },\n/* harmony export */ always: function() { return /* binding */ always; },\n/* harmony export */ click: function() { return /* binding */ click; },\n/* harmony export */ doubleClick: function() { return /* binding */ doubleClick; },\n/* harmony export */ focus: function() { return /* binding */ focus; },\n/* harmony export */ focusWithTabindex: function() { return /* binding */ focusWithTabindex; },\n/* harmony export */ mouseActionButton: function() { return /* binding */ mouseActionButton; },\n/* harmony export */ mouseOnly: function() { return /* binding */ mouseOnly; },\n/* harmony export */ never: function() { return /* binding */ never; },\n/* harmony export */ noModifierKeys: function() { return /* binding */ noModifierKeys; },\n/* harmony export */ penOnly: function() { return /* binding */ penOnly; },\n/* harmony export */ platformModifierKey: function() { return /* binding */ platformModifierKey; },\n/* harmony export */ platformModifierKeyOnly: function() { return /* binding */ platformModifierKeyOnly; },\n/* harmony export */ pointerMove: function() { return /* binding */ pointerMove; },\n/* harmony export */ primaryAction: function() { return /* binding */ primaryAction; },\n/* harmony export */ shiftKeyOnly: function() { return /* binding */ shiftKeyOnly; },\n/* harmony export */ singleClick: function() { return /* binding */ singleClick; },\n/* harmony export */ targetNotEditable: function() { return /* binding */ targetNotEditable; },\n/* harmony export */ touchOnly: function() { return /* binding */ touchOnly; }\n/* harmony export */ });\n/* harmony import */ var _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../MapBrowserEventType.js */ \"./node_modules/ol/MapBrowserEventType.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../has.js */ \"./node_modules/ol/has.js\");\n/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../asserts.js */ \"./node_modules/ol/asserts.js\");\n/**\n * @module ol/events/condition\n */\n\n\n\n\n\n/**\n * A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * `{boolean}`. If the condition is met, true should be returned.\n *\n * @typedef {function(this: ?, import(\"../MapBrowserEvent.js\").default): boolean} Condition\n */\n\n/**\n * Creates a condition function that passes when all provided conditions pass.\n * @param {...Condition} var_args Conditions to check.\n * @return {Condition} Condition function.\n */\nfunction all(var_args) {\n const conditions = arguments;\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n * @return {boolean} All conditions passed.\n */\n return function (event) {\n let pass = true;\n for (let i = 0, ii = conditions.length; i < ii; ++i) {\n pass = pass && conditions[i](event);\n if (!pass) {\n break;\n }\n }\n return pass;\n };\n}\n\n/**\n * Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when\n * additionally the shift-key is pressed).\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if only the alt key is pressed.\n * @api\n */\nconst altKeyOnly = function (mapBrowserEvent) {\n const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */\n mapBrowserEvent.originalEvent;\n return originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && !originalEvent.shiftKey;\n};\n\n/**\n * Return `true` if only the alt-key and shift-key is pressed, `false` otherwise\n * (e.g. when additionally the platform-modifier-key is pressed).\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if only the alt and shift keys are pressed.\n * @api\n */\nconst altShiftKeysOnly = function (mapBrowserEvent) {\n const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */\n mapBrowserEvent.originalEvent;\n return originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && originalEvent.shiftKey;\n};\n\n/**\n * Return `true` if the map has the focus. This condition requires a map target\n * element with a `tabindex` attribute, e.g. `<div id=\"map\" tabindex=\"1\">`.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} event Map browser event.\n * @return {boolean} The map has the focus.\n * @api\n */\nconst focus = function (event) {\n const targetElement = event.map.getTargetElement();\n const activeElement = event.map.getOwnerDocument().activeElement;\n return targetElement.contains(activeElement);\n};\n\n/**\n * Return `true` if the map has the focus or no 'tabindex' attribute set.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} event Map browser event.\n * @return {boolean} The map container has the focus or no 'tabindex' attribute.\n */\nconst focusWithTabindex = function (event) {\n return event.map.getTargetElement().hasAttribute('tabindex') ? focus(event) : true;\n};\n\n/**\n * Return always true.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True.\n * @api\n */\nconst always = _functions_js__WEBPACK_IMPORTED_MODULE_0__.TRUE;\n\n/**\n * Return `true` if the event is a `click` event, `false` otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event is a map `click` event.\n * @api\n */\nconst click = function (mapBrowserEvent) {\n return mapBrowserEvent.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].CLICK;\n};\n\n/**\n * Return `true` if the event has an \"action\"-producing mouse button.\n *\n * By definition, this includes left-click on windows/linux, and left-click\n * without the ctrl key on Macs.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} The result.\n */\nconst mouseActionButton = function (mapBrowserEvent) {\n const originalEvent = /** @type {MouseEvent} */\n mapBrowserEvent.originalEvent;\n return originalEvent.button == 0 && !(_has_js__WEBPACK_IMPORTED_MODULE_2__.WEBKIT && _has_js__WEBPACK_IMPORTED_MODULE_2__.MAC && originalEvent.ctrlKey);\n};\n\n/**\n * Return always false.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} False.\n * @api\n */\nconst never = _functions_js__WEBPACK_IMPORTED_MODULE_0__.FALSE;\n\n/**\n * Return `true` if the browser event is a `pointermove` event, `false`\n * otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the browser event is a `pointermove` event.\n * @api\n */\nconst pointerMove = function (mapBrowserEvent) {\n return mapBrowserEvent.type == 'pointermove';\n};\n\n/**\n * Return `true` if the event is a map `singleclick` event, `false` otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event is a map `singleclick` event.\n * @api\n */\nconst singleClick = function (mapBrowserEvent) {\n return mapBrowserEvent.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].SINGLECLICK;\n};\n\n/**\n * Return `true` if the event is a map `dblclick` event, `false` otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event is a map `dblclick` event.\n * @api\n */\nconst doubleClick = function (mapBrowserEvent) {\n return mapBrowserEvent.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].DBLCLICK;\n};\n\n/**\n * Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is\n * pressed.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True only if there no modifier keys are pressed.\n * @api\n */\nconst noModifierKeys = function (mapBrowserEvent) {\n const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */\n mapBrowserEvent.originalEvent;\n return !originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && !originalEvent.shiftKey;\n};\n\n/**\n * Return `true` if only the platform-modifier-key (the meta-key on Mac,\n * ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally\n * the shift-key is pressed).\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if only the platform modifier key is pressed.\n * @api\n */\nconst platformModifierKeyOnly = function (mapBrowserEvent) {\n const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */\n mapBrowserEvent.originalEvent;\n return !originalEvent.altKey && (_has_js__WEBPACK_IMPORTED_MODULE_2__.MAC ? originalEvent.metaKey : originalEvent.ctrlKey) && !originalEvent.shiftKey;\n};\n\n/**\n * Return `true` if the platform-modifier-key (the meta-key on Mac,\n * ctrl-key otherwise) is pressed.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the platform modifier key is pressed.\n * @api\n */\nconst platformModifierKey = function (mapBrowserEvent) {\n const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */\n mapBrowserEvent.originalEvent;\n return _has_js__WEBPACK_IMPORTED_MODULE_2__.MAC ? originalEvent.metaKey : originalEvent.ctrlKey;\n};\n\n/**\n * Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when\n * additionally the alt-key is pressed).\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if only the shift key is pressed.\n * @api\n */\nconst shiftKeyOnly = function (mapBrowserEvent) {\n const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */\n mapBrowserEvent.originalEvent;\n return !originalEvent.altKey && !(originalEvent.metaKey || originalEvent.ctrlKey) && originalEvent.shiftKey;\n};\n\n/**\n * Return `true` if the target element is not editable, i.e. not an `input`,\n * `select`, or `textarea` element and no `contenteditable` attribute is\n * set or inherited, `false` otherwise.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True only if the target element is not editable.\n * @api\n */\nconst targetNotEditable = function (mapBrowserEvent) {\n const originalEvent = /** @type {KeyboardEvent|MouseEvent|TouchEvent} */\n mapBrowserEvent.originalEvent;\n const tagName = /** @type {Element} */originalEvent.target.tagName;\n return tagName !== 'INPUT' && tagName !== 'SELECT' && tagName !== 'TEXTAREA' &&\n // `isContentEditable` is only available on `HTMLElement`, but it may also be a\n // different type like `SVGElement`.\n // @ts-ignore\n !originalEvent.target.isContentEditable;\n};\n\n/**\n * Return `true` if the event originates from a mouse device.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event originates from a mouse device.\n * @api\n */\nconst mouseOnly = function (mapBrowserEvent) {\n const pointerEvent = /** @type {import(\"../MapBrowserEvent\").default} */mapBrowserEvent.originalEvent;\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_3__.assert)(pointerEvent !== undefined, 'mapBrowserEvent must originate from a pointer event');\n // see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType\n return pointerEvent.pointerType == 'mouse';\n};\n\n/**\n * Return `true` if the event originates from a touchable device.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event originates from a touchable device.\n * @api\n */\nconst touchOnly = function (mapBrowserEvent) {\n const pointerEvt = /** @type {import(\"../MapBrowserEvent\").default} */mapBrowserEvent.originalEvent;\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_3__.assert)(pointerEvt !== undefined, 'mapBrowserEvent must originate from a pointer event');\n // see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType\n return pointerEvt.pointerType === 'touch';\n};\n\n/**\n * Return `true` if the event originates from a digital pen.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event originates from a digital pen.\n * @api\n */\nconst penOnly = function (mapBrowserEvent) {\n const pointerEvt = /** @type {import(\"../MapBrowserEvent\").default} */mapBrowserEvent.originalEvent;\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_3__.assert)(pointerEvt !== undefined, 'mapBrowserEvent must originate from a pointer event');\n // see https://www.w3.org/TR/pointerevents/#widl-PointerEvent-pointerType\n return pointerEvt.pointerType === 'pen';\n};\n\n/**\n * Return `true` if the event originates from a primary pointer in\n * contact with the surface or if the left mouse button is pressed.\n * See https://www.w3.org/TR/pointerevents/#button-states.\n *\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} True if the event originates from a primary pointer.\n * @api\n */\nconst primaryAction = function (mapBrowserEvent) {\n const pointerEvent = /** @type {import(\"../MapBrowserEvent\").default} */mapBrowserEvent.originalEvent;\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_3__.assert)(pointerEvent !== undefined, 'mapBrowserEvent must originate from a pointer event');\n return pointerEvent.isPrimary && pointerEvent.button === 0;\n};\n\n//# sourceURL=webpack://complexes/./node_modules/ol/events/condition.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/expr/cpu.js":
|
||
/*!*************************************!*\
|
||
!*** ./node_modules/ol/expr/cpu.js ***!
|
||
\*************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ buildExpression: function() { return /* binding */ buildExpression; },\n/* harmony export */ newEvaluationContext: function() { return /* binding */ newEvaluationContext; }\n/* harmony export */ });\n/* harmony import */ var _expression_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./expression.js */ \"./node_modules/ol/expr/expression.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../color.js */ \"./node_modules/ol/color.js\");\n/**\n * @module ol/expr/cpu\n */\n\n\n\n\n/**\n * @fileoverview This module includes functions to build expressions for evaluation on the CPU.\n * Building is composed of two steps: parsing and compiling. The parsing step takes an encoded\n * expression and returns an instance of one of the expression classes. The compiling step takes\n * the expression instance and returns a function that can be evaluated in to return a literal\n * value. The evaluator function should do as little allocation and work as possible.\n */\n\n/**\n * @typedef {Object} EvaluationContext\n * @property {Object} properties The values for properties used in 'get' expressions.\n * @property {Object} variables The values for variables used in 'var' expressions.\n * @property {number} resolution The map resolution.\n * @property {string|number|null} featureId The feature id.\n */\n\n/**\n * @return {EvaluationContext} A new evaluation context.\n */\nfunction newEvaluationContext() {\n return {\n variables: {},\n properties: {},\n resolution: NaN,\n featureId: null\n };\n}\n\n/**\n * @typedef {function(EvaluationContext):import(\"./expression.js\").LiteralValue} ExpressionEvaluator\n */\n\n/**\n * @typedef {function(EvaluationContext):boolean} BooleanEvaluator\n */\n\n/**\n * @typedef {function(EvaluationContext):number} NumberEvaluator\n */\n\n/**\n * @typedef {function(EvaluationContext):string} StringEvaluator\n */\n\n/**\n * @typedef {function(EvaluationContext):(Array<number>|string)} ColorLikeEvaluator\n */\n\n/**\n * @typedef {function(EvaluationContext):Array<number>} NumberArrayEvaluator\n */\n\n/**\n * @typedef {function(EvaluationContext):Array<number>} CoordinateEvaluator\n */\n\n/**\n * @typedef {function(EvaluationContext):(Array<number>|number)} SizeLikeEvaluator\n */\n\n/**\n * @param {import('./expression.js').EncodedExpression} encoded The encoded expression.\n * @param {number} type The expected type.\n * @param {import('./expression.js').ParsingContext} context The parsing context.\n * @return {ExpressionEvaluator} The expression evaluator.\n */\nfunction buildExpression(encoded, type, context) {\n const expression = (0,_expression_js__WEBPACK_IMPORTED_MODULE_0__.parse)(encoded, context);\n if (!(0,_expression_js__WEBPACK_IMPORTED_MODULE_0__.overlapsType)(type, expression.type)) {\n const expected = (0,_expression_js__WEBPACK_IMPORTED_MODULE_0__.typeName)(type);\n const actual = (0,_expression_js__WEBPACK_IMPORTED_MODULE_0__.typeName)(expression.type);\n throw new Error(`Expected expression to be of type ${expected}, got ${actual}`);\n }\n return compileExpression(expression, context);\n}\n\n/**\n * @param {import(\"./expression.js\").Expression} expression The expression.\n * @param {import('./expression.js').ParsingContext} context The parsing context.\n * @return {ExpressionEvaluator} The evaluator function.\n */\nfunction compileExpression(expression, context) {\n if (expression instanceof _expression_js__WEBPACK_IMPORTED_MODULE_0__.LiteralExpression) {\n // convert colors to array if possible\n if (expression.type === _expression_js__WEBPACK_IMPORTED_MODULE_0__.ColorType && typeof expression.value === 'string') {\n const colorValue = (0,_color_js__WEBPACK_IMPORTED_MODULE_1__.fromString)(expression.value);\n return function () {\n return colorValue;\n };\n }\n return function () {\n return expression.value;\n };\n }\n const operator = expression.operator;\n switch (operator) {\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Number:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.String:\n {\n return compileAssertionExpression(expression, context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Get:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Var:\n {\n return compileAccessorExpression(expression, context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Id:\n {\n return expression => expression.featureId;\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Concat:\n {\n const args = expression.args.map(e => compileExpression(e, context));\n return context => ''.concat(...args.map(arg => arg(context).toString()));\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Resolution:\n {\n return context => context.resolution;\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Any:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.All:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Not:\n {\n return compileLogicalExpression(expression, context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Equal:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.NotEqual:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.LessThan:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.LessThanOrEqualTo:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.GreaterThan:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.GreaterThanOrEqualTo:\n {\n return compileComparisonExpression(expression, context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Multiply:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Divide:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Add:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Subtract:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Clamp:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Mod:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Pow:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Abs:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Floor:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Ceil:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Round:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Sin:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Cos:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Atan:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Sqrt:\n {\n return compileNumericExpression(expression, context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Match:\n {\n return compileMatchExpression(expression, context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Interpolate:\n {\n return compileInterpolateExpression(expression, context);\n }\n default:\n {\n throw new Error(`Unsupported operator ${operator}`);\n }\n // TODO: unimplemented\n // Ops.GeometryType\n // Ops.Zoom\n // Ops.Time\n // Ops.Between\n // Ops.Case\n // Ops.In\n // Ops.Array\n // Ops.Color\n // Ops.Band\n // Ops.Palette\n }\n}\n\n/**\n * @param {import('./expression.js').CallExpression} expression The call expression.\n * @param {import('./expression.js').ParsingContext} context The parsing context.\n * @return {ExpressionEvaluator} The evaluator function.\n */\nfunction compileAssertionExpression(expression, context) {\n const type = expression.operator;\n const length = expression.args.length;\n const args = new Array(length);\n for (let i = 0; i < length; ++i) {\n args[i] = compileExpression(expression.args[i], context);\n }\n switch (type) {\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Number:\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.String:\n {\n return context => {\n for (let i = 0; i < length; ++i) {\n const value = args[i](context);\n if (typeof value === type) {\n return value;\n }\n }\n throw new Error(`Expected one of the values to be a ${type}`);\n };\n }\n default:\n {\n throw new Error(`Unsupported assertion operator ${type}`);\n }\n }\n}\n\n/**\n * @param {import('./expression.js').CallExpression} expression The call expression.\n * @param {import('./expression.js').ParsingContext} context The parsing context.\n * @return {ExpressionEvaluator} The evaluator function.\n */\nfunction compileAccessorExpression(expression, context) {\n const nameExpression = /** @type {LiteralExpression} */expression.args[0];\n const name = /** @type {string} */nameExpression.value;\n switch (expression.operator) {\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Get:\n {\n return context => context.properties[name];\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Var:\n {\n return context => context.variables[name];\n }\n default:\n {\n throw new Error(`Unsupported accessor operator ${expression.operator}`);\n }\n }\n}\n\n/**\n * @param {import('./expression.js').CallExpression} expression The call expression.\n * @param {import('./expression.js').ParsingContext} context The parsing context.\n * @return {BooleanEvaluator} The evaluator function.\n */\nfunction compileComparisonExpression(expression, context) {\n const op = expression.operator;\n const left = compileExpression(expression.args[0], context);\n const right = compileExpression(expression.args[1], context);\n switch (op) {\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Equal:\n {\n return context => left(context) === right(context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.NotEqual:\n {\n return context => left(context) !== right(context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.LessThan:\n {\n return context => left(context) < right(context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.LessThanOrEqualTo:\n {\n return context => left(context) <= right(context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.GreaterThan:\n {\n return context => left(context) > right(context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.GreaterThanOrEqualTo:\n {\n return context => left(context) >= right(context);\n }\n default:\n {\n throw new Error(`Unsupported comparison operator ${op}`);\n }\n }\n}\n\n/**\n * @param {import('./expression.js').CallExpression} expression The call expression.\n * @param {import('./expression.js').ParsingContext} context The parsing context.\n * @return {BooleanEvaluator} The evaluator function.\n */\nfunction compileLogicalExpression(expression, context) {\n const op = expression.operator;\n const length = expression.args.length;\n const args = new Array(length);\n for (let i = 0; i < length; ++i) {\n args[i] = compileExpression(expression.args[i], context);\n }\n switch (op) {\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Any:\n {\n return context => {\n for (let i = 0; i < length; ++i) {\n if (args[i](context)) {\n return true;\n }\n }\n return false;\n };\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.All:\n {\n return context => {\n for (let i = 0; i < length; ++i) {\n if (!args[i](context)) {\n return false;\n }\n }\n return true;\n };\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Not:\n {\n return context => !args[0](context);\n }\n default:\n {\n throw new Error(`Unsupported logical operator ${op}`);\n }\n }\n}\n\n/**\n * @param {import('./expression.js').CallExpression} expression The call expression.\n * @param {import('./expression.js').ParsingContext} context The parsing context.\n * @return {NumberEvaluator} The evaluator function.\n */\nfunction compileNumericExpression(expression, context) {\n const op = expression.operator;\n const length = expression.args.length;\n const args = new Array(length);\n for (let i = 0; i < length; ++i) {\n args[i] = compileExpression(expression.args[i], context);\n }\n switch (op) {\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Multiply:\n {\n return context => {\n let value = 1;\n for (let i = 0; i < length; ++i) {\n value *= args[i](context);\n }\n return value;\n };\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Divide:\n {\n return context => args[0](context) / args[1](context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Add:\n {\n return context => {\n let value = 0;\n for (let i = 0; i < length; ++i) {\n value += args[i](context);\n }\n return value;\n };\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Subtract:\n {\n return context => args[0](context) - args[1](context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Clamp:\n {\n return context => {\n const value = args[0](context);\n const min = args[1](context);\n if (value < min) {\n return min;\n }\n const max = args[2](context);\n if (value > max) {\n return max;\n }\n return value;\n };\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Mod:\n {\n return context => args[0](context) % args[1](context);\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Pow:\n {\n return context => Math.pow(args[0](context), args[1](context));\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Abs:\n {\n return context => Math.abs(args[0](context));\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Floor:\n {\n return context => Math.floor(args[0](context));\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Ceil:\n {\n return context => Math.ceil(args[0](context));\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Round:\n {\n return context => Math.round(args[0](context));\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Sin:\n {\n return context => Math.sin(args[0](context));\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Cos:\n {\n return context => Math.cos(args[0](context));\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Atan:\n {\n if (length === 2) {\n return context => Math.atan2(args[0](context), args[1](context));\n }\n return context => Math.atan(args[0](context));\n }\n case _expression_js__WEBPACK_IMPORTED_MODULE_0__.Ops.Sqrt:\n {\n return context => Math.sqrt(args[0](context));\n }\n default:\n {\n throw new Error(`Unsupported numeric operator ${op}`);\n }\n }\n}\n\n/**\n * @param {import('./expression.js').CallExpression} expression The call expression.\n * @param {import('./expression.js').ParsingContext} context The parsing context.\n * @return {ExpressionEvaluator} The evaluator function.\n */\nfunction compileMatchExpression(expression, context) {\n const length = expression.args.length;\n const args = new Array(length);\n for (let i = 0; i < length; ++i) {\n args[i] = compileExpression(expression.args[i], context);\n }\n return context => {\n const value = args[0](context);\n for (let i = 1; i < length; i += 2) {\n if (value === args[i](context)) {\n return args[i + 1](context);\n }\n }\n return args[length - 1](context);\n };\n}\n\n/**\n * @param {import('./expression.js').CallExpression} expression The call expression.\n * @param {import('./expression.js').ParsingContext} context The parsing context.\n * @return {ExpressionEvaluator} The evaluator function.\n */\nfunction compileInterpolateExpression(expression, context) {\n const length = expression.args.length;\n const args = new Array(length);\n for (let i = 0; i < length; ++i) {\n args[i] = compileExpression(expression.args[i], context);\n }\n return context => {\n const base = args[0](context);\n const value = args[1](context);\n let previousInput;\n let previousOutput;\n for (let i = 2; i < length; i += 2) {\n const input = args[i](context);\n let output = args[i + 1](context);\n const isColor = Array.isArray(output);\n if (isColor) {\n output = (0,_color_js__WEBPACK_IMPORTED_MODULE_1__.withAlpha)(output);\n }\n if (input >= value) {\n if (i === 2) {\n return output;\n }\n if (isColor) {\n return interpolateColor(base, value, previousInput, previousOutput, input, output);\n }\n return interpolateNumber(base, value, previousInput, previousOutput, input, output);\n }\n previousInput = input;\n previousOutput = output;\n }\n return previousOutput;\n };\n}\n\n/**\n * @param {number} base The base.\n * @param {number} value The value.\n * @param {number} input1 The first input value.\n * @param {number} output1 The first output value.\n * @param {number} input2 The second input value.\n * @param {number} output2 The second output value.\n * @return {number} The interpolated value.\n */\nfunction interpolateNumber(base, value, input1, output1, input2, output2) {\n const delta = input2 - input1;\n if (delta === 0) {\n return output1;\n }\n const along = value - input1;\n const factor = base === 1 ? along / delta : (Math.pow(base, along) - 1) / (Math.pow(base, delta) - 1);\n return output1 + factor * (output2 - output1);\n}\n\n/**\n * @param {number} base The base.\n * @param {number} value The value.\n * @param {number} input1 The first input value.\n * @param {import('../color.js').Color} rgba1 The first output value.\n * @param {number} input2 The second input value.\n * @param {import('../color.js').Color} rgba2 The second output value.\n * @return {import('../color.js').Color} The interpolated color.\n */\nfunction interpolateColor(base, value, input1, rgba1, input2, rgba2) {\n const delta = input2 - input1;\n if (delta === 0) {\n return rgba1;\n }\n const lcha1 = (0,_color_js__WEBPACK_IMPORTED_MODULE_1__.rgbaToLcha)(rgba1);\n const lcha2 = (0,_color_js__WEBPACK_IMPORTED_MODULE_1__.rgbaToLcha)(rgba2);\n let deltaHue = lcha2[2] - lcha1[2];\n if (deltaHue > 180) {\n deltaHue -= 360;\n } else if (deltaHue < -180) {\n deltaHue += 360;\n }\n const lcha = [interpolateNumber(base, value, input1, lcha1[0], input2, lcha2[0]), interpolateNumber(base, value, input1, lcha1[1], input2, lcha2[1]), lcha1[2] + interpolateNumber(base, value, input1, 0, input2, deltaHue), interpolateNumber(base, value, input1, rgba1[3], input2, rgba2[3])];\n return (0,_color_js__WEBPACK_IMPORTED_MODULE_1__.normalize)((0,_color_js__WEBPACK_IMPORTED_MODULE_1__.lchaToRgba)(lcha));\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/expr/cpu.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/expr/expression.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/expr/expression.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AnyType: function() { return /* binding */ AnyType; },\n/* harmony export */ BooleanType: function() { return /* binding */ BooleanType; },\n/* harmony export */ CallExpression: function() { return /* binding */ CallExpression; },\n/* harmony export */ ColorType: function() { return /* binding */ ColorType; },\n/* harmony export */ LiteralExpression: function() { return /* binding */ LiteralExpression; },\n/* harmony export */ NoneType: function() { return /* binding */ NoneType; },\n/* harmony export */ NumberArrayType: function() { return /* binding */ NumberArrayType; },\n/* harmony export */ NumberType: function() { return /* binding */ NumberType; },\n/* harmony export */ Ops: function() { return /* binding */ Ops; },\n/* harmony export */ StringType: function() { return /* binding */ StringType; },\n/* harmony export */ includesType: function() { return /* binding */ includesType; },\n/* harmony export */ isType: function() { return /* binding */ isType; },\n/* harmony export */ newParsingContext: function() { return /* binding */ newParsingContext; },\n/* harmony export */ overlapsType: function() { return /* binding */ overlapsType; },\n/* harmony export */ parse: function() { return /* binding */ parse; },\n/* harmony export */ typeName: function() { return /* binding */ typeName; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.set.difference.v2.js */ \"./node_modules/core-js/modules/es.set.difference.v2.js\");\n/* harmony import */ var core_js_modules_es_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.set.intersection.v2.js */ \"./node_modules/core-js/modules/es.set.intersection.v2.js\");\n/* harmony import */ var core_js_modules_es_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.set.is-disjoint-from.v2.js */ \"./node_modules/core-js/modules/es.set.is-disjoint-from.v2.js\");\n/* harmony import */ var core_js_modules_es_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.set.is-subset-of.v2.js */ \"./node_modules/core-js/modules/es.set.is-subset-of.v2.js\");\n/* harmony import */ var core_js_modules_es_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.set.is-superset-of.v2.js */ \"./node_modules/core-js/modules/es.set.is-superset-of.v2.js\");\n/* harmony import */ var core_js_modules_es_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.set.symmetric-difference.v2.js */ \"./node_modules/core-js/modules/es.set.symmetric-difference.v2.js\");\n/* harmony import */ var core_js_modules_es_set_union_v2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/es.set.union.v2.js */ \"./node_modules/core-js/modules/es.set.union.v2.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../color.js */ \"./node_modules/ol/color.js\");\n\n\n\n\n\n\n\n\n/**\n * @module ol/expr/expression\n */\n\n\n\n/**\n * @fileoverview This module includes types and functions for parsing array encoded expressions.\n * The result of parsing an encoded expression is one of the specific expression classes.\n * During parsing, information is added to the parsing context about the data accessed by the\n * expression.\n */\n\n/**\n * Base type used for literal style parameters; can be a number literal or the output of an operator,\n * which in turns takes {@link import(\"./expression.js\").ExpressionValue} arguments.\n *\n * The following operators can be used:\n *\n * * Reading operators:\n * * `['band', bandIndex, xOffset, yOffset]` For tile layers only. Fetches pixel values from band\n * `bandIndex` of the source's data. The first `bandIndex` of the source data is `1`. Fetched values\n * are in the 0..1 range. {@link import(\"../source/TileImage.js\").default} sources have 4 bands: red,\n * green, blue and alpha. {@link import(\"../source/DataTile.js\").default} sources can have any number\n * of bands, depending on the underlying data source and\n * {@link import(\"../source/GeoTIFF.js\").Options configuration}. `xOffset` and `yOffset` are optional\n * and allow specifying pixel offsets for x and y. This is used for sampling data from neighboring pixels.\n * * `['get', 'attributeName', typeHint]` fetches a feature property value, similar to `feature.get('attributeName')`\n * A type hint can optionally be specified, in case the resulting expression contains a type ambiguity which\n * will make it invalid. Type hints can be one of: 'string', 'color', 'number', 'boolean', 'number[]'\n * * `['geometry-type']` returns a feature's geometry type as string, either: 'LineString', 'Point' or 'Polygon'\n * `Multi*` values are returned as their singular equivalent\n * `Circle` geometries are returned as 'Polygon'\n * `GeometryCollection` geometries are returned as the type of the first geometry found in the collection\n * * `['resolution']` returns the current resolution\n * * `['time']` returns the time in seconds since the creation of the layer\n * * `['var', 'varName']` fetches a value from the style variables; will throw an error if that variable is undefined\n * * `['zoom']` returns the current zoom level\n *\n * * Math operators:\n * * `['*', value1, value2, ...]` multiplies the values (either numbers or colors)\n * * `['/', value1, value2]` divides `value1` by `value2`\n * * `['+', value1, value2, ...]` adds the values\n * * `['-', value1, value2]` subtracts `value2` from `value1`\n * * `['clamp', value, low, high]` clamps `value` between `low` and `high`\n * * `['%', value1, value2]` returns the result of `value1 % value2` (modulo)\n * * `['^', value1, value2]` returns the value of `value1` raised to the `value2` power\n * * `['abs', value1]` returns the absolute value of `value1`\n * * `['floor', value1]` returns the nearest integer less than or equal to `value1`\n * * `['round', value1]` returns the nearest integer to `value1`\n * * `['ceil', value1]` returns the nearest integer greater than or equal to `value1`\n * * `['sin', value1]` returns the sine of `value1`\n * * `['cos', value1]` returns the cosine of `value1`\n * * `['atan', value1, value2]` returns `atan2(value1, value2)`. If `value2` is not provided, returns `atan(value1)`\n * * `['sqrt', value1]` returns the square root of `value1`\n *\n * * Transform operators:\n * * `['case', condition1, output1, ...conditionN, outputN, fallback]` selects the first output whose corresponding\n * condition evaluates to `true`. If no match is found, returns the `fallback` value.\n * All conditions should be `boolean`, output and fallback can be any kind.\n * * `['match', input, match1, output1, ...matchN, outputN, fallback]` compares the `input` value against all\n * provided `matchX` values, returning the output associated with the first valid match. If no match is found,\n * returns the `fallback` value.\n * `input` and `matchX` values must all be of the same type, and can be `number` or `string`. `outputX` and\n * `fallback` values must be of the same type, and can be of any kind.\n * * `['interpolate', interpolation, input, stop1, output1, ...stopN, outputN]` returns a value by interpolating between\n * pairs of inputs and outputs; `interpolation` can either be `['linear']` or `['exponential', base]` where `base` is\n * the rate of increase from stop A to stop B (i.e. power to which the interpolation ratio is raised); a value\n * of 1 is equivalent to `['linear']`.\n * `input` and `stopX` values must all be of type `number`. `outputX` values can be `number` or `color` values.\n * Note: `input` will be clamped between `stop1` and `stopN`, meaning that all output values will be comprised\n * between `output1` and `outputN`.\n *\n * * Logical operators:\n * * `['<', value1, value2]` returns `true` if `value1` is strictly lower than `value2`, or `false` otherwise.\n * * `['<=', value1, value2]` returns `true` if `value1` is lower than or equals `value2`, or `false` otherwise.\n * * `['>', value1, value2]` returns `true` if `value1` is strictly greater than `value2`, or `false` otherwise.\n * * `['>=', value1, value2]` returns `true` if `value1` is greater than or equals `value2`, or `false` otherwise.\n * * `['==', value1, value2]` returns `true` if `value1` equals `value2`, or `false` otherwise.\n * * `['!=', value1, value2]` returns `true` if `value1` does not equal `value2`, or `false` otherwise.\n * * `['!', value1]` returns `false` if `value1` is `true` or greater than `0`, or `true` otherwise.\n * * `['all', value1, value2, ...]` returns `true` if all the inputs are `true`, `false` otherwise.\n * * `['any', value1, value2, ...]` returns `true` if any of the inputs are `true`, `false` otherwise.\n * * `['between', value1, value2, value3]` returns `true` if `value1` is contained between `value2` and `value3`\n * (inclusively), or `false` otherwise.\n * * `['in', needle, haystack]` returns `true` if `needle` is found in `haystack`, and\n * `false` otherwise.\n * This operator has the following limitations:\n * * `haystack` has to be an array of numbers or strings (searching for a substring in a string is not supported yet)\n * * Only literal arrays are supported as `haystack` for now; this means that `haystack` cannot be the result of an\n * expression. If `haystack` is an array of strings, use the `literal` operator to disambiguate from an expression:\n * `['literal', ['abc', 'def', 'ghi']]`\n *\n * * Conversion operators:\n * * `['array', value1, ...valueN]` creates a numerical array from `number` values; please note that the amount of\n * values can currently only be 2, 3 or 4.\n * * `['color', red, green, blue, alpha]` creates a `color` value from `number` values; the `alpha` parameter is\n * optional; if not specified, it will be set to 1.\n * Note: `red`, `green` and `blue` components must be values between 0 and 255; `alpha` between 0 and 1.\n * * `['palette', index, colors]` picks a `color` value from an array of colors using the given index; the `index`\n * expression must evaluate to a number; the items in the `colors` array must be strings with hex colors\n * (e.g. `'#86A136'`), colors using the rgba[a] functional notation (e.g. `'rgb(134, 161, 54)'` or `'rgba(134, 161, 54, 1)'`),\n * named colors (e.g. `'red'`), or array literals with 3 ([r, g, b]) or 4 ([r, g, b, a]) values (with r, g, and b\n * in the 0-255 range and a in the 0-1 range).\n *\n * Values can either be literals or another operator, as they will be evaluated recursively.\n * Literal values can be of the following types:\n * * `boolean`\n * * `number`\n * * `number[]` (number arrays can only have a length of 2, 3 or 4)\n * * `string`\n * * {@link module:ol/color~Color}\n *\n * @typedef {Array<*>|import(\"../color.js\").Color|string|number|boolean} ExpressionValue\n * @api\n */\n\nlet numTypes = 0;\nconst NoneType = 0;\nconst BooleanType = 1 << numTypes++;\nconst NumberType = 1 << numTypes++;\nconst StringType = 1 << numTypes++;\nconst ColorType = 1 << numTypes++;\nconst NumberArrayType = 1 << numTypes++;\nconst AnyType = Math.pow(2, numTypes) - 1;\nconst typeNames = {\n [BooleanType]: 'boolean',\n [NumberType]: 'number',\n [StringType]: 'string',\n [ColorType]: 'color',\n [NumberArrayType]: 'number[]'\n};\nconst namedTypes = Object.keys(typeNames).map(Number).sort(_array_js__WEBPACK_IMPORTED_MODULE_8__.ascending);\n\n/**\n * Get a string representation for a type.\n * @param {number} type The type.\n * @return {string} The type name.\n */\nfunction typeName(type) {\n const names = [];\n for (const namedType of namedTypes) {\n if (includesType(type, namedType)) {\n names.push(typeNames[namedType]);\n }\n }\n if (names.length === 0) {\n return 'untyped';\n }\n if (names.length < 3) {\n return names.join(' or ');\n }\n return names.slice(0, -1).join(', ') + ', or ' + names[names.length - 1];\n}\n\n/**\n * @param {number} broad The broad type.\n * @param {number} specific The specific type.\n * @return {boolean} The broad type includes the specific type.\n */\nfunction includesType(broad, specific) {\n return (broad & specific) === specific;\n}\n\n/**\n * @param {number} oneType One type.\n * @param {number} otherType Another type.\n * @return {boolean} The set of types overlap (share a common specific type)\n */\nfunction overlapsType(oneType, otherType) {\n return !!(oneType & otherType);\n}\n\n/**\n * @param {number} type The type.\n * @param {number} expected The expected type.\n * @return {boolean} The given type is exactly the expected type.\n */\nfunction isType(type, expected) {\n return type === expected;\n}\n\n/**\n * @typedef {boolean|number|string|Array<number>} LiteralValue\n */\n\nclass LiteralExpression {\n /**\n * @param {number} type The value type.\n * @param {LiteralValue} value The literal value.\n */\n constructor(type, value) {\n this.type = type;\n this.value = value;\n }\n}\nclass CallExpression {\n /**\n * @param {number} type The return type.\n * @param {string} operator The operator.\n * @param {...Expression} args The arguments.\n */\n constructor(type, operator, ...args) {\n this.type = type;\n this.operator = operator;\n this.args = args;\n }\n}\n\n/**\n * @typedef {LiteralExpression|CallExpression} Expression\n */\n\n/**\n * @typedef {Object} ParsingContext\n * @property {Set<string>} variables Variables referenced with the 'var' operator.\n * @property {Set<string>} properties Properties referenced with the 'get' operator.\n * @property {boolean} featureId The style uses the feature id.\n * @property {import(\"../style/flat.js\").FlatStyle|import(\"../style/webgl.js\").WebGLStyle} style The style being parsed\n */\n\n/**\n * @return {ParsingContext} A new parsing context.\n */\nfunction newParsingContext() {\n return {\n variables: new Set(),\n properties: new Set(),\n featureId: false,\n style: {}\n };\n}\n\n/**\n * @param {string} typeHint Type hint\n * @return {number} Resulting value type (will be a single type)\n */\nfunction getTypeFromHint(typeHint) {\n switch (typeHint) {\n case 'string':\n return StringType;\n case 'color':\n return ColorType;\n case 'number':\n return NumberType;\n case 'boolean':\n return BooleanType;\n case 'number[]':\n return NumberArrayType;\n default:\n throw new Error(`Unrecognized type hint: ${typeHint}`);\n }\n}\n\n/**\n * @typedef {LiteralValue|Array} EncodedExpression\n */\n\n/**\n * @param {EncodedExpression} encoded The encoded expression.\n * @param {ParsingContext} context The parsing context.\n * @param {number} [typeHint] Optional type hint\n * @return {Expression} The parsed expression result.\n */\nfunction parse(encoded, context, typeHint) {\n switch (typeof encoded) {\n case 'boolean':\n {\n return new LiteralExpression(BooleanType, encoded);\n }\n case 'number':\n {\n return new LiteralExpression(NumberType, encoded);\n }\n case 'string':\n {\n let type = StringType;\n if ((0,_color_js__WEBPACK_IMPORTED_MODULE_9__.isStringColor)(encoded)) {\n type |= ColorType;\n }\n // apply the given type hint only if it won't result in an empty type\n if (!isType(type & typeHint, NoneType)) {\n type &= typeHint;\n }\n return new LiteralExpression(type, encoded);\n }\n default:\n {\n // pass\n }\n }\n if (!Array.isArray(encoded)) {\n throw new Error('Expression must be an array or a primitive value');\n }\n if (encoded.length === 0) {\n throw new Error('Empty expression');\n }\n if (typeof encoded[0] === 'string') {\n return parseCallExpression(encoded, context, typeHint);\n }\n for (const item of encoded) {\n if (typeof item !== 'number') {\n throw new Error('Expected an array of numbers');\n }\n }\n let type = NumberArrayType;\n if (encoded.length === 3 || encoded.length === 4) {\n type |= ColorType;\n }\n if (typeHint) {\n type &= typeHint;\n }\n return new LiteralExpression(type, encoded);\n}\n\n/**\n * @type {Object<string, string>}\n */\nconst Ops = {\n Get: 'get',\n Var: 'var',\n Concat: 'concat',\n GeometryType: 'geometry-type',\n Any: 'any',\n All: 'all',\n Not: '!',\n Resolution: 'resolution',\n Zoom: 'zoom',\n Time: 'time',\n Equal: '==',\n NotEqual: '!=',\n GreaterThan: '>',\n GreaterThanOrEqualTo: '>=',\n LessThan: '<',\n LessThanOrEqualTo: '<=',\n Multiply: '*',\n Divide: '/',\n Add: '+',\n Subtract: '-',\n Clamp: 'clamp',\n Mod: '%',\n Pow: '^',\n Abs: 'abs',\n Floor: 'floor',\n Ceil: 'ceil',\n Round: 'round',\n Sin: 'sin',\n Cos: 'cos',\n Atan: 'atan',\n Sqrt: 'sqrt',\n Match: 'match',\n Between: 'between',\n Interpolate: 'interpolate',\n Case: 'case',\n In: 'in',\n Number: 'number',\n String: 'string',\n Array: 'array',\n Color: 'color',\n Id: 'id',\n Band: 'band',\n Palette: 'palette'\n};\n\n/**\n * @typedef {function(Array, ParsingContext, number):Expression} Parser\n * Third argument is a type hint\n */\n\n/**\n * @type {Object<string, Parser>}\n */\nconst parsers = {\n [Ops.Get]: createParser(([_, typeHint]) => {\n if (typeHint !== undefined) {\n return getTypeFromHint(/** @type {string} */\n /** @type {LiteralExpression} */typeHint.value);\n }\n return AnyType;\n }, withArgsCount(1, 2), withGetArgs),\n [Ops.Var]: createParser(([firstArg]) => firstArg.type, withArgsCount(1, 1), withVarArgs),\n [Ops.Id]: createParser(NumberType | StringType, withNoArgs, usesFeatureId),\n [Ops.Concat]: createParser(StringType, withArgsCount(2, Infinity), parseArgsOfType(AnyType)),\n [Ops.GeometryType]: createParser(StringType, withNoArgs),\n [Ops.Resolution]: createParser(NumberType, withNoArgs),\n [Ops.Zoom]: createParser(NumberType, withNoArgs),\n [Ops.Time]: createParser(NumberType, withNoArgs),\n [Ops.Any]: createParser(BooleanType, withArgsCount(2, Infinity), parseArgsOfType(BooleanType)),\n [Ops.All]: createParser(BooleanType, withArgsCount(2, Infinity), parseArgsOfType(BooleanType)),\n [Ops.Not]: createParser(BooleanType, withArgsCount(1, 1), parseArgsOfType(BooleanType)),\n [Ops.Equal]: createParser(BooleanType, withArgsCount(2, 2), parseArgsOfType(AnyType), narrowArgsType),\n [Ops.NotEqual]: createParser(BooleanType, withArgsCount(2, 2), parseArgsOfType(AnyType), narrowArgsType),\n [Ops.GreaterThan]: createParser(BooleanType, withArgsCount(2, 2), parseArgsOfType(AnyType), narrowArgsType),\n [Ops.GreaterThanOrEqualTo]: createParser(BooleanType, withArgsCount(2, 2), parseArgsOfType(AnyType), narrowArgsType),\n [Ops.LessThan]: createParser(BooleanType, withArgsCount(2, 2), parseArgsOfType(AnyType), narrowArgsType),\n [Ops.LessThanOrEqualTo]: createParser(BooleanType, withArgsCount(2, 2), parseArgsOfType(AnyType), narrowArgsType),\n [Ops.Multiply]: createParser(parsedArgs => {\n let outputType = NumberType | ColorType;\n for (let i = 0; i < parsedArgs.length; i++) {\n outputType &= parsedArgs[i].type;\n }\n return outputType;\n }, withArgsCount(2, Infinity), parseArgsOfType(NumberType | ColorType), narrowArgsType),\n [Ops.Divide]: createParser(NumberType, withArgsCount(2, 2), parseArgsOfType(NumberType)),\n [Ops.Add]: createParser(NumberType, withArgsCount(2, Infinity), parseArgsOfType(NumberType)),\n [Ops.Subtract]: createParser(NumberType, withArgsCount(2, 2), parseArgsOfType(NumberType)),\n [Ops.Clamp]: createParser(NumberType, withArgsCount(3, 3), parseArgsOfType(NumberType)),\n [Ops.Mod]: createParser(NumberType, withArgsCount(2, 2), parseArgsOfType(NumberType)),\n [Ops.Pow]: createParser(NumberType, withArgsCount(2, 2), parseArgsOfType(NumberType)),\n [Ops.Abs]: createParser(NumberType, withArgsCount(1, 1), parseArgsOfType(NumberType)),\n [Ops.Floor]: createParser(NumberType, withArgsCount(1, 1), parseArgsOfType(NumberType)),\n [Ops.Ceil]: createParser(NumberType, withArgsCount(1, 1), parseArgsOfType(NumberType)),\n [Ops.Round]: createParser(NumberType, withArgsCount(1, 1), parseArgsOfType(NumberType)),\n [Ops.Sin]: createParser(NumberType, withArgsCount(1, 1), parseArgsOfType(NumberType)),\n [Ops.Cos]: createParser(NumberType, withArgsCount(1, 1), parseArgsOfType(NumberType)),\n [Ops.Atan]: createParser(NumberType, withArgsCount(1, 2), parseArgsOfType(NumberType)),\n [Ops.Sqrt]: createParser(NumberType, withArgsCount(1, 1), parseArgsOfType(NumberType)),\n [Ops.Match]: createParser(parsedArgs => {\n let type = AnyType;\n for (let i = 2; i < parsedArgs.length; i += 2) {\n type &= parsedArgs[i].type;\n }\n type &= parsedArgs[parsedArgs.length - 1].type;\n return type;\n }, withArgsCount(4, Infinity), withEvenArgs, parseMatchArgs),\n [Ops.Between]: createParser(BooleanType, withArgsCount(3, 3), parseArgsOfType(NumberType)),\n [Ops.Interpolate]: createParser(parsedArgs => {\n let type = ColorType | NumberType;\n for (let i = 3; i < parsedArgs.length; i += 2) {\n type &= parsedArgs[i].type;\n }\n return type;\n }, withArgsCount(6, Infinity), withEvenArgs, parseInterpolateArgs),\n [Ops.Case]: createParser(parsedArgs => {\n let type = AnyType;\n for (let i = 1; i < parsedArgs.length; i += 2) {\n type &= parsedArgs[i].type;\n }\n type &= parsedArgs[parsedArgs.length - 1].type;\n return type;\n }, withArgsCount(3, Infinity), withOddArgs, parseCaseArgs),\n [Ops.In]: createParser(BooleanType, withArgsCount(2, 2), parseInArgs),\n [Ops.Number]: createParser(NumberType, withArgsCount(1, Infinity), parseArgsOfType(AnyType)),\n [Ops.String]: createParser(StringType, withArgsCount(1, Infinity), parseArgsOfType(AnyType)),\n [Ops.Array]: createParser(parsedArgs => {\n return parsedArgs.length === 3 || parsedArgs.length === 4 ? NumberArrayType | ColorType : NumberArrayType;\n }, withArgsCount(1, Infinity), parseArgsOfType(NumberType)),\n [Ops.Color]: createParser(ColorType, withArgsCount(3, 4), parseArgsOfType(NumberType)),\n [Ops.Band]: createParser(NumberType, withArgsCount(1, 3), parseArgsOfType(NumberType)),\n [Ops.Palette]: createParser(ColorType, withArgsCount(2, 2), parsePaletteArgs)\n};\n\n/**\n * @typedef {function(Array<EncodedExpression>, ParsingContext, Array<Expression>, number?):Array<Expression>|void} ArgValidator\n * An argument validator applies various checks to an encoded expression arguments\n * Returns the parsed arguments if any.\n * Third argument is the array of parsed arguments from previous validators\n * Fourth argument is an optional type hint\n */\n\n/**\n * @type ArgValidator\n */\nfunction withGetArgs(encoded, context) {\n const arg = parse(encoded[1], context);\n if (!(arg instanceof LiteralExpression)) {\n throw new Error('Expected a literal argument for get operation');\n }\n if (typeof arg.value !== 'string') {\n throw new Error('Expected a string argument for get operation');\n }\n context.properties.add(arg.value);\n if (encoded.length === 3) {\n const hint = parse(encoded[2], context);\n return [arg, hint];\n }\n return [arg];\n}\n\n/**\n * @type ArgValidator\n */\nfunction withVarArgs(encoded, context, parsedArgs, typeHint) {\n const varName = encoded[1];\n if (typeof varName !== 'string') {\n throw new Error('Expected a string argument for var operation');\n }\n context.variables.add(varName);\n if (!('variables' in context.style) || context.style.variables[varName] === undefined) {\n return [new LiteralExpression(AnyType, varName)];\n }\n const initialValue = context.style.variables[varName];\n const arg = /** @type {LiteralExpression} */parse(initialValue, context);\n arg.value = varName;\n if (typeHint && !overlapsType(typeHint, arg.type)) {\n throw new Error(`The variable ${varName} has type ${typeName(arg.type)} but the following type was expected: ${typeName(typeHint)}`);\n }\n return [arg];\n}\n\n/**\n * @type ArgValidator\n */\nfunction usesFeatureId(encoded, context) {\n context.featureId = true;\n}\n\n/**\n * @type ArgValidator\n */\nfunction withNoArgs(encoded, context) {\n const operation = encoded[0];\n if (encoded.length !== 1) {\n throw new Error(`Expected no arguments for ${operation} operation`);\n }\n return [];\n}\n\n/**\n * @param {number} minArgs The minimum number of arguments.\n * @param {number} maxArgs The maximum number of arguments.\n * @return {ArgValidator} The argument validator\n */\nfunction withArgsCount(minArgs, maxArgs) {\n return function (encoded, context) {\n const operation = encoded[0];\n const argCount = encoded.length - 1;\n if (minArgs === maxArgs) {\n if (argCount !== minArgs) {\n const plural = minArgs === 1 ? '' : 's';\n throw new Error(`Expected ${minArgs} argument${plural} for ${operation}, got ${argCount}`);\n }\n } else if (argCount < minArgs || argCount > maxArgs) {\n const range = maxArgs === Infinity ? `${minArgs} or more` : `${minArgs} to ${maxArgs}`;\n throw new Error(`Expected ${range} arguments for ${operation}, got ${argCount}`);\n }\n };\n}\n\n/**\n * @param {number} argType The argument type.\n * @return {ArgValidator} The argument validator\n */\nfunction parseArgsOfType(argType) {\n return function (encoded, context) {\n const operation = encoded[0];\n const argCount = encoded.length - 1;\n /**\n * @type {Array<Expression>}\n */\n const args = new Array(argCount);\n for (let i = 0; i < argCount; ++i) {\n const expression = parse(encoded[i + 1], context);\n if (!overlapsType(argType, expression.type)) {\n const gotType = typeName(argType);\n const expectedType = typeName(expression.type);\n throw new Error(`Unexpected type for argument ${i} of ${operation} operation` + `, got ${gotType} but expected ${expectedType}`);\n }\n expression.type &= argType;\n args[i] = expression;\n }\n return args;\n };\n}\n\n/**\n * @type {ArgValidator}\n */\nfunction narrowArgsType(encoded, context, parsedArgs) {\n const operation = encoded[0];\n const argCount = encoded.length - 1;\n\n // first pass to determine a narrowed down type\n let sameType = AnyType;\n for (let i = 0; i < parsedArgs.length; ++i) {\n sameType &= parsedArgs[i].type;\n }\n if (sameType === NoneType) {\n throw new Error(`No common type could be found for arguments of ${operation} operation`);\n }\n\n // re-parse args\n const args = new Array(argCount);\n for (let i = 0; i < argCount; ++i) {\n args[i] = parse(encoded[i + 1], context, sameType);\n }\n return args;\n}\n\n/**\n * @type {ArgValidator}\n */\nfunction withOddArgs(encoded, context) {\n const operation = encoded[0];\n const argCount = encoded.length - 1;\n if (argCount % 2 === 0) {\n throw new Error(`An odd amount of arguments was expected for operation ${operation}, got ${JSON.stringify(argCount)} instead`);\n }\n}\n\n/**\n * @type {ArgValidator}\n */\nfunction withEvenArgs(encoded, context) {\n const operation = encoded[0];\n const argCount = encoded.length - 1;\n if (argCount % 2 === 1) {\n throw new Error(`An even amount of arguments was expected for operation ${operation}, got ${JSON.stringify(argCount)} instead`);\n }\n}\n\n/**\n * @type ArgValidator\n */\nfunction parseMatchArgs(encoded, context, parsedArgs, typeHint) {\n const argsCount = encoded.length - 1;\n const input = parse(encoded[1], context);\n let inputType = input.type;\n const fallback = parse(encoded[encoded.length - 1], context);\n let outputType = typeHint !== undefined ? typeHint & fallback.type : fallback.type;\n\n // first parse args to figure out possible types\n const args = new Array(argsCount - 2);\n for (let i = 0; i < argsCount - 2; i += 2) {\n const match = parse(encoded[i + 2], context);\n const output = parse(encoded[i + 3], context);\n inputType &= match.type;\n outputType &= output.type;\n args[i] = match;\n args[i + 1] = output;\n }\n\n // check input and output types validity\n const expectedInputType = StringType | NumberType | BooleanType;\n if (!overlapsType(expectedInputType, inputType)) {\n throw new Error(`Expected an input of type ${typeName(expectedInputType)} for the interpolate operation` + `, got ${typeName(inputType)} instead`);\n }\n if (isType(outputType, NoneType)) {\n throw new Error(`Could not find a common output type for the following match operation: ` + JSON.stringify(encoded));\n }\n\n // parse again inputs and outputs with common type\n for (let i = 0; i < argsCount - 2; i += 2) {\n const match = parse(encoded[i + 2], context, inputType);\n const output = parse(encoded[i + 3], context, outputType);\n args[i] = match;\n args[i + 1] = output;\n }\n return [parse(encoded[1], context, inputType), ...args, parse(encoded[encoded.length - 1], context, outputType)];\n}\n\n/**\n * @type ArgValidator\n */\nfunction parseInterpolateArgs(encoded, context, parsedArgs, typeHint) {\n const interpolationType = encoded[1];\n let interpolation;\n switch (interpolationType[0]) {\n case 'linear':\n interpolation = 1;\n break;\n case 'exponential':\n interpolation = interpolationType[1];\n if (typeof interpolation !== 'number') {\n throw new Error(`Expected a number base for exponential interpolation` + `, got ${JSON.stringify(interpolation)} instead`);\n }\n break;\n default:\n interpolation = null;\n }\n if (!interpolation) {\n throw new Error(`Invalid interpolation type: ${JSON.stringify(interpolationType)}`);\n }\n interpolation = parse(interpolation, context);\n\n // check input types\n let input = parse(encoded[2], context);\n if (!overlapsType(NumberType, input.type)) {\n throw new Error(`Expected an input of type number for the interpolate operation` + `, got ${typeName(input.type)} instead`);\n }\n input = parse(encoded[2], context, NumberType); // parse again with narrower output\n\n const args = new Array(encoded.length - 3);\n for (let i = 0; i < args.length; i += 2) {\n let stop = parse(encoded[i + 3], context);\n if (!overlapsType(NumberType, stop.type)) {\n throw new Error(`Expected all stop input values in the interpolate operation to be of type number` + `, got ${typeName(stop.type)} at position ${i + 2} instead`);\n }\n let output = parse(encoded[i + 4], context);\n if (!overlapsType(NumberType | ColorType, output.type)) {\n throw new Error(`Expected all stop output values in the interpolate operation to be a number or color` + `, got ${typeName(output.type)} at position ${i + 3} instead`);\n }\n // parse again with narrower types\n stop = parse(encoded[i + 3], context, NumberType);\n output = parse(encoded[i + 4], context, NumberType | ColorType);\n args[i] = stop;\n args[i + 1] = output;\n }\n return [interpolation, input, ...args];\n}\n\n/**\n * @type ArgValidator\n */\nfunction parseCaseArgs(encoded, context, parsedArgs, typeHint) {\n const fallback = parse(encoded[encoded.length - 1], context);\n let outputType = typeHint !== undefined ? typeHint & fallback.type : fallback.type;\n\n // first parse args to figure out possible types\n const args = new Array(encoded.length - 1);\n for (let i = 0; i < args.length - 1; i += 2) {\n const condition = parse(encoded[i + 1], context);\n const output = parse(encoded[i + 2], context);\n if (!overlapsType(BooleanType, condition.type)) {\n throw new Error(`Expected all conditions in the case operation to be of type boolean` + `, got ${typeName(condition.type)} at position ${i} instead`);\n }\n outputType &= output.type;\n args[i] = condition;\n args[i + 1] = output;\n }\n if (isType(outputType, NoneType)) {\n throw new Error(`Could not find a common output type for the following case operation: ` + JSON.stringify(encoded));\n }\n\n // parse again args with common output type\n for (let i = 0; i < args.length - 1; i += 2) {\n args[i + 1] = parse(encoded[i + 2], context, outputType);\n }\n args[args.length - 1] = parse(encoded[encoded.length - 1], context, outputType);\n return args;\n}\n\n/**\n * @type ArgValidator\n */\nfunction parseInArgs(encoded, context) {\n /** @type {Array<number|string>} */\n let haystack = /** @type {any} */encoded[2];\n if (!Array.isArray(haystack)) {\n throw new Error(`The \"in\" operator was provided a literal value which was not an array as second argument.`);\n }\n if (typeof haystack[0] === 'string') {\n if (haystack[0] !== 'literal') {\n throw new Error(`For the \"in\" operator, a string array should be wrapped in a \"literal\" operator to disambiguate from expressions.`);\n }\n if (!Array.isArray(haystack[1])) {\n throw new Error(`The \"in\" operator was provided a literal value which was not an array as second argument.`);\n }\n haystack = haystack[1];\n }\n let needleType = StringType | NumberType;\n const args = new Array(haystack.length);\n for (let i = 0; i < args.length; i++) {\n const arg = parse(haystack[i], context);\n needleType &= arg.type;\n args[i] = arg;\n }\n if (isType(needleType, NoneType)) {\n throw new Error(`Could not find a common type for the following in operation: ` + JSON.stringify(encoded));\n }\n const needle = parse(encoded[1], context, needleType);\n return [needle, ...args];\n}\n\n/**\n * @type ArgValidator\n */\nfunction parsePaletteArgs(encoded, context) {\n const index = parse(encoded[1], context, NumberType);\n if (index.type !== NumberType) {\n throw new Error(`The first argument of palette must be an number, got ${typeName(index.type)} instead`);\n }\n const colors = encoded[2];\n if (!Array.isArray(colors)) {\n throw new Error('The second argument of palette must be an array');\n }\n const parsedColors = new Array(colors.length);\n for (let i = 0; i < parsedColors.length; i++) {\n const color = parse(colors[i], context, ColorType);\n if (!(color instanceof LiteralExpression)) {\n throw new Error(`The palette color at index ${i} must be a literal value`);\n }\n if (!overlapsType(color.type, ColorType)) {\n throw new Error(`The palette color at index ${i} should be of type color, got ${typeName(color.type)} instead`);\n }\n parsedColors[i] = color;\n }\n return [index, ...parsedColors];\n}\n\n/**\n * @param {number|function(Array<Expression>):number} returnType The return type of the operator; can be a fixed value or a callback taking the parsed\n * arguments\n * @param {Array<ArgValidator>} argValidators A chain of argument validators; the return value of the last validator\n * will be used as parsed arguments\n * @return {Parser} The parser.\n */\nfunction createParser(returnType, ...argValidators) {\n return function (encoded, context, typeHint) {\n const operator = encoded[0];\n let parsedArgs = [];\n for (let i = 0; i < argValidators.length; i++) {\n parsedArgs = argValidators[i](encoded, context, parsedArgs, typeHint) || parsedArgs;\n }\n let actualType = typeof returnType === 'function' ? returnType(parsedArgs) : returnType;\n if (typeHint !== undefined) {\n if (!overlapsType(actualType, typeHint)) {\n throw new Error(`The following expression was expected to return ${typeName(typeHint)}, but returns ${typeName(actualType)} instead: ${JSON.stringify(encoded)}`);\n }\n actualType &= typeHint;\n }\n if (actualType === NoneType) {\n throw new Error(`No matching type was found for the following expression: ${JSON.stringify(encoded)}`);\n }\n return new CallExpression(actualType, operator, ...parsedArgs);\n };\n}\n\n/**\n * @param {Array} encoded The encoded expression.\n * @param {ParsingContext} context The parsing context.\n * @param {number} [typeHint] Optional type hint\n * @return {Expression} The parsed expression.\n */\nfunction parseCallExpression(encoded, context, typeHint) {\n const operator = encoded[0];\n const parser = parsers[operator];\n if (!parser) {\n throw new Error(`Unknown operator: ${operator}`);\n }\n return parser(encoded, context, typeHint);\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/expr/expression.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/extent.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/ol/extent.js ***!
|
||
\***********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ applyTransform: function() { return /* binding */ applyTransform; },\n/* harmony export */ approximatelyEquals: function() { return /* binding */ approximatelyEquals; },\n/* harmony export */ boundingExtent: function() { return /* binding */ boundingExtent; },\n/* harmony export */ buffer: function() { return /* binding */ buffer; },\n/* harmony export */ clone: function() { return /* binding */ clone; },\n/* harmony export */ closestSquaredDistanceXY: function() { return /* binding */ closestSquaredDistanceXY; },\n/* harmony export */ containsCoordinate: function() { return /* binding */ containsCoordinate; },\n/* harmony export */ containsExtent: function() { return /* binding */ containsExtent; },\n/* harmony export */ containsXY: function() { return /* binding */ containsXY; },\n/* harmony export */ coordinateRelationship: function() { return /* binding */ coordinateRelationship; },\n/* harmony export */ createEmpty: function() { return /* binding */ createEmpty; },\n/* harmony export */ createOrUpdate: function() { return /* binding */ createOrUpdate; },\n/* harmony export */ createOrUpdateEmpty: function() { return /* binding */ createOrUpdateEmpty; },\n/* harmony export */ createOrUpdateFromCoordinate: function() { return /* binding */ createOrUpdateFromCoordinate; },\n/* harmony export */ createOrUpdateFromCoordinates: function() { return /* binding */ createOrUpdateFromCoordinates; },\n/* harmony export */ createOrUpdateFromFlatCoordinates: function() { return /* binding */ createOrUpdateFromFlatCoordinates; },\n/* harmony export */ createOrUpdateFromRings: function() { return /* binding */ createOrUpdateFromRings; },\n/* harmony export */ equals: function() { return /* binding */ equals; },\n/* harmony export */ extend: function() { return /* binding */ extend; },\n/* harmony export */ extendCoordinate: function() { return /* binding */ extendCoordinate; },\n/* harmony export */ extendCoordinates: function() { return /* binding */ extendCoordinates; },\n/* harmony export */ extendFlatCoordinates: function() { return /* binding */ extendFlatCoordinates; },\n/* harmony export */ extendRings: function() { return /* binding */ extendRings; },\n/* harmony export */ extendXY: function() { return /* binding */ extendXY; },\n/* harmony export */ forEachCorner: function() { return /* binding */ forEachCorner; },\n/* harmony export */ getArea: function() { return /* binding */ getArea; },\n/* harmony export */ getBottomLeft: function() { return /* binding */ getBottomLeft; },\n/* harmony export */ getBottomRight: function() { return /* binding */ getBottomRight; },\n/* harmony export */ getCenter: function() { return /* binding */ getCenter; },\n/* harmony export */ getCorner: function() { return /* binding */ getCorner; },\n/* harmony export */ getEnlargedArea: function() { return /* binding */ getEnlargedArea; },\n/* harmony export */ getForViewAndSize: function() { return /* binding */ getForViewAndSize; },\n/* harmony export */ getHeight: function() { return /* binding */ getHeight; },\n/* harmony export */ getIntersection: function() { return /* binding */ getIntersection; },\n/* harmony export */ getIntersectionArea: function() { return /* binding */ getIntersectionArea; },\n/* harmony export */ getMargin: function() { return /* binding */ getMargin; },\n/* harmony export */ getRotatedViewport: function() { return /* binding */ getRotatedViewport; },\n/* harmony export */ getSize: function() { return /* binding */ getSize; },\n/* harmony export */ getTopLeft: function() { return /* binding */ getTopLeft; },\n/* harmony export */ getTopRight: function() { return /* binding */ getTopRight; },\n/* harmony export */ getWidth: function() { return /* binding */ getWidth; },\n/* harmony export */ intersects: function() { return /* binding */ intersects; },\n/* harmony export */ intersectsSegment: function() { return /* binding */ intersectsSegment; },\n/* harmony export */ isEmpty: function() { return /* binding */ isEmpty; },\n/* harmony export */ returnOrUpdate: function() { return /* binding */ returnOrUpdate; },\n/* harmony export */ scaleFromCenter: function() { return /* binding */ scaleFromCenter; },\n/* harmony export */ wrapAndSliceX: function() { return /* binding */ wrapAndSliceX; },\n/* harmony export */ wrapX: function() { return /* binding */ wrapX; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./extent/Relationship.js */ \"./node_modules/ol/extent/Relationship.js\");\n\n/**\n * @module ol/extent\n */\n\n\n/**\n * An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.\n * @typedef {Array<number>} Extent\n * @api\n */\n\n/**\n * Extent corner.\n * @typedef {'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'} Corner\n */\n\n/**\n * Build an extent that includes all given coordinates.\n *\n * @param {Array<import(\"./coordinate.js\").Coordinate>} coordinates Coordinates.\n * @return {Extent} Bounding extent.\n * @api\n */\nfunction boundingExtent(coordinates) {\n const extent = createEmpty();\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\n extendCoordinate(extent, coordinates[i]);\n }\n return extent;\n}\n\n/**\n * @param {Array<number>} xs Xs.\n * @param {Array<number>} ys Ys.\n * @param {Extent} [dest] Destination extent.\n * @private\n * @return {Extent} Extent.\n */\nfunction _boundingExtentXYs(xs, ys, dest) {\n const minX = Math.min.apply(null, xs);\n const minY = Math.min.apply(null, ys);\n const maxX = Math.max.apply(null, xs);\n const maxY = Math.max.apply(null, ys);\n return createOrUpdate(minX, minY, maxX, maxY, dest);\n}\n\n/**\n * Return extent increased by the provided value.\n * @param {Extent} extent Extent.\n * @param {number} value The amount by which the extent should be buffered.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n * @api\n */\nfunction buffer(extent, value, dest) {\n if (dest) {\n dest[0] = extent[0] - value;\n dest[1] = extent[1] - value;\n dest[2] = extent[2] + value;\n dest[3] = extent[3] + value;\n return dest;\n }\n return [extent[0] - value, extent[1] - value, extent[2] + value, extent[3] + value];\n}\n\n/**\n * Creates a clone of an extent.\n *\n * @param {Extent} extent Extent to clone.\n * @param {Extent} [dest] Extent.\n * @return {Extent} The clone.\n */\nfunction clone(extent, dest) {\n if (dest) {\n dest[0] = extent[0];\n dest[1] = extent[1];\n dest[2] = extent[2];\n dest[3] = extent[3];\n return dest;\n }\n return extent.slice();\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {number} Closest squared distance.\n */\nfunction closestSquaredDistanceXY(extent, x, y) {\n let dx, dy;\n if (x < extent[0]) {\n dx = extent[0] - x;\n } else if (extent[2] < x) {\n dx = x - extent[2];\n } else {\n dx = 0;\n }\n if (y < extent[1]) {\n dy = extent[1] - y;\n } else if (extent[3] < y) {\n dy = y - extent[3];\n } else {\n dy = 0;\n }\n return dx * dx + dy * dy;\n}\n\n/**\n * Check if the passed coordinate is contained or on the edge of the extent.\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {boolean} The coordinate is contained in the extent.\n * @api\n */\nfunction containsCoordinate(extent, coordinate) {\n return containsXY(extent, coordinate[0], coordinate[1]);\n}\n\n/**\n * Check if one extent contains another.\n *\n * An extent is deemed contained if it lies completely within the other extent,\n * including if they share one or more edges.\n *\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {boolean} The second extent is contained by or on the edge of the\n * first.\n * @api\n */\nfunction containsExtent(extent1, extent2) {\n return extent1[0] <= extent2[0] && extent2[2] <= extent1[2] && extent1[1] <= extent2[1] && extent2[3] <= extent1[3];\n}\n\n/**\n * Check if the passed coordinate is contained or on the edge of the extent.\n *\n * @param {Extent} extent Extent.\n * @param {number} x X coordinate.\n * @param {number} y Y coordinate.\n * @return {boolean} The x, y values are contained in the extent.\n * @api\n */\nfunction containsXY(extent, x, y) {\n return extent[0] <= x && x <= extent[2] && extent[1] <= y && y <= extent[3];\n}\n\n/**\n * Get the relationship between a coordinate and extent.\n * @param {Extent} extent The extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate The coordinate.\n * @return {import(\"./extent/Relationship.js\").default} The relationship (bitwise compare with\n * import(\"./extent/Relationship.js\").Relationship).\n */\nfunction coordinateRelationship(extent, coordinate) {\n const minX = extent[0];\n const minY = extent[1];\n const maxX = extent[2];\n const maxY = extent[3];\n const x = coordinate[0];\n const y = coordinate[1];\n let relationship = _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].UNKNOWN;\n if (x < minX) {\n relationship = relationship | _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LEFT;\n } else if (x > maxX) {\n relationship = relationship | _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].RIGHT;\n }\n if (y < minY) {\n relationship = relationship | _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].BELOW;\n } else if (y > maxY) {\n relationship = relationship | _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ABOVE;\n }\n if (relationship === _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].UNKNOWN) {\n relationship = _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].INTERSECTING;\n }\n return relationship;\n}\n\n/**\n * Create an empty extent.\n * @return {Extent} Empty extent.\n * @api\n */\nfunction createEmpty() {\n return [Infinity, Infinity, -Infinity, -Infinity];\n}\n\n/**\n * Create a new extent or update the provided extent.\n * @param {number} minX Minimum X.\n * @param {number} minY Minimum Y.\n * @param {number} maxX Maximum X.\n * @param {number} maxY Maximum Y.\n * @param {Extent} [dest] Destination extent.\n * @return {Extent} Extent.\n */\nfunction createOrUpdate(minX, minY, maxX, maxY, dest) {\n if (dest) {\n dest[0] = minX;\n dest[1] = minY;\n dest[2] = maxX;\n dest[3] = maxY;\n return dest;\n }\n return [minX, minY, maxX, maxY];\n}\n\n/**\n * Create a new empty extent or make the provided one empty.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nfunction createOrUpdateEmpty(dest) {\n return createOrUpdate(Infinity, Infinity, -Infinity, -Infinity, dest);\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nfunction createOrUpdateFromCoordinate(coordinate, dest) {\n const x = coordinate[0];\n const y = coordinate[1];\n return createOrUpdate(x, y, x, y, dest);\n}\n\n/**\n * @param {Array<import(\"./coordinate.js\").Coordinate>} coordinates Coordinates.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nfunction createOrUpdateFromCoordinates(coordinates, dest) {\n const extent = createOrUpdateEmpty(dest);\n return extendCoordinates(extent, coordinates);\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nfunction createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end, stride, dest) {\n const extent = createOrUpdateEmpty(dest);\n return extendFlatCoordinates(extent, flatCoordinates, offset, end, stride);\n}\n\n/**\n * @param {Array<Array<import(\"./coordinate.js\").Coordinate>>} rings Rings.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nfunction createOrUpdateFromRings(rings, dest) {\n const extent = createOrUpdateEmpty(dest);\n return extendRings(extent, rings);\n}\n\n/**\n * Determine if two extents are equivalent.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {boolean} The two extents are equivalent.\n * @api\n */\nfunction equals(extent1, extent2) {\n return extent1[0] == extent2[0] && extent1[2] == extent2[2] && extent1[1] == extent2[1] && extent1[3] == extent2[3];\n}\n\n/**\n * Determine if two extents are approximately equivalent.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @param {number} tolerance Tolerance in extent coordinate units.\n * @return {boolean} The two extents differ by less than the tolerance.\n */\nfunction approximatelyEquals(extent1, extent2, tolerance) {\n return Math.abs(extent1[0] - extent2[0]) < tolerance && Math.abs(extent1[2] - extent2[2]) < tolerance && Math.abs(extent1[1] - extent2[1]) < tolerance && Math.abs(extent1[3] - extent2[3]) < tolerance;\n}\n\n/**\n * Modify an extent to include another extent.\n * @param {Extent} extent1 The extent to be modified.\n * @param {Extent} extent2 The extent that will be included in the first.\n * @return {Extent} A reference to the first (extended) extent.\n * @api\n */\nfunction extend(extent1, extent2) {\n if (extent2[0] < extent1[0]) {\n extent1[0] = extent2[0];\n }\n if (extent2[2] > extent1[2]) {\n extent1[2] = extent2[2];\n }\n if (extent2[1] < extent1[1]) {\n extent1[1] = extent2[1];\n }\n if (extent2[3] > extent1[3]) {\n extent1[3] = extent2[3];\n }\n return extent1;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n */\nfunction extendCoordinate(extent, coordinate) {\n if (coordinate[0] < extent[0]) {\n extent[0] = coordinate[0];\n }\n if (coordinate[0] > extent[2]) {\n extent[2] = coordinate[0];\n }\n if (coordinate[1] < extent[1]) {\n extent[1] = coordinate[1];\n }\n if (coordinate[1] > extent[3]) {\n extent[3] = coordinate[1];\n }\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Array<import(\"./coordinate.js\").Coordinate>} coordinates Coordinates.\n * @return {Extent} Extent.\n */\nfunction extendCoordinates(extent, coordinates) {\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\n extendCoordinate(extent, coordinates[i]);\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {Extent} Extent.\n */\nfunction extendFlatCoordinates(extent, flatCoordinates, offset, end, stride) {\n for (; offset < end; offset += stride) {\n extendXY(extent, flatCoordinates[offset], flatCoordinates[offset + 1]);\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Array<Array<import(\"./coordinate.js\").Coordinate>>} rings Rings.\n * @return {Extent} Extent.\n */\nfunction extendRings(extent, rings) {\n for (let i = 0, ii = rings.length; i < ii; ++i) {\n extendCoordinates(extent, rings[i]);\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {number} x X.\n * @param {number} y Y.\n */\nfunction extendXY(extent, x, y) {\n extent[0] = Math.min(extent[0], x);\n extent[1] = Math.min(extent[1], y);\n extent[2] = Math.max(extent[2], x);\n extent[3] = Math.max(extent[3], y);\n}\n\n/**\n * This function calls `callback` for each corner of the extent. If the\n * callback returns a truthy value the function returns that value\n * immediately. Otherwise the function returns `false`.\n * @param {Extent} extent Extent.\n * @param {function(import(\"./coordinate.js\").Coordinate): S} callback Callback.\n * @return {S|boolean} Value.\n * @template S\n */\nfunction forEachCorner(extent, callback) {\n let val;\n val = callback(getBottomLeft(extent));\n if (val) {\n return val;\n }\n val = callback(getBottomRight(extent));\n if (val) {\n return val;\n }\n val = callback(getTopRight(extent));\n if (val) {\n return val;\n }\n val = callback(getTopLeft(extent));\n if (val) {\n return val;\n }\n return false;\n}\n\n/**\n * Get the size of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Area.\n * @api\n */\nfunction getArea(extent) {\n let area = 0;\n if (!isEmpty(extent)) {\n area = getWidth(extent) * getHeight(extent);\n }\n return area;\n}\n\n/**\n * Get the bottom left coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Bottom left coordinate.\n * @api\n */\nfunction getBottomLeft(extent) {\n return [extent[0], extent[1]];\n}\n\n/**\n * Get the bottom right coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Bottom right coordinate.\n * @api\n */\nfunction getBottomRight(extent) {\n return [extent[2], extent[1]];\n}\n\n/**\n * Get the center coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Center.\n * @api\n */\nfunction getCenter(extent) {\n return [(extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2];\n}\n\n/**\n * Get a corner coordinate of an extent.\n * @param {Extent} extent Extent.\n * @param {Corner} corner Corner.\n * @return {import(\"./coordinate.js\").Coordinate} Corner coordinate.\n */\nfunction getCorner(extent, corner) {\n let coordinate;\n if (corner === 'bottom-left') {\n coordinate = getBottomLeft(extent);\n } else if (corner === 'bottom-right') {\n coordinate = getBottomRight(extent);\n } else if (corner === 'top-left') {\n coordinate = getTopLeft(extent);\n } else if (corner === 'top-right') {\n coordinate = getTopRight(extent);\n } else {\n throw new Error('Invalid corner');\n }\n return coordinate;\n}\n\n/**\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {number} Enlarged area.\n */\nfunction getEnlargedArea(extent1, extent2) {\n const minX = Math.min(extent1[0], extent2[0]);\n const minY = Math.min(extent1[1], extent2[1]);\n const maxX = Math.max(extent1[2], extent2[2]);\n const maxY = Math.max(extent1[3], extent2[3]);\n return (maxX - minX) * (maxY - minY);\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {import(\"./size.js\").Size} size Size.\n * @param {Extent} [dest] Destination extent.\n * @return {Extent} Extent.\n */\nfunction getForViewAndSize(center, resolution, rotation, size, dest) {\n const [x0, y0, x1, y1, x2, y2, x3, y3] = getRotatedViewport(center, resolution, rotation, size);\n 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), dest);\n}\n\n/**\n * @param {import(\"./coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {import(\"./size.js\").Size} size Size.\n * @return {Array<number>} Linear ring representing the viewport.\n */\nfunction getRotatedViewport(center, resolution, rotation, size) {\n const dx = resolution * size[0] / 2;\n const dy = resolution * size[1] / 2;\n const cosRotation = Math.cos(rotation);\n const sinRotation = Math.sin(rotation);\n const xCos = dx * cosRotation;\n const xSin = dx * sinRotation;\n const yCos = dy * cosRotation;\n const ySin = dy * sinRotation;\n const x = center[0];\n const y = center[1];\n return [x - xCos + ySin, y - xSin - yCos, x - xCos - ySin, y - xSin + yCos, x + xCos - ySin, y + xSin + yCos, x + xCos + ySin, y + xSin - yCos, x - xCos + ySin, y - xSin - yCos];\n}\n\n/**\n * Get the height of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Height.\n * @api\n */\nfunction getHeight(extent) {\n return extent[3] - extent[1];\n}\n\n/**\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @return {number} Intersection area.\n */\nfunction getIntersectionArea(extent1, extent2) {\n const intersection = getIntersection(extent1, extent2);\n return getArea(intersection);\n}\n\n/**\n * Get the intersection of two extents.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent 2.\n * @param {Extent} [dest] Optional extent to populate with intersection.\n * @return {Extent} Intersecting extent.\n * @api\n */\nfunction getIntersection(extent1, extent2, dest) {\n const intersection = dest ? dest : createEmpty();\n if (intersects(extent1, extent2)) {\n if (extent1[0] > extent2[0]) {\n intersection[0] = extent1[0];\n } else {\n intersection[0] = extent2[0];\n }\n if (extent1[1] > extent2[1]) {\n intersection[1] = extent1[1];\n } else {\n intersection[1] = extent2[1];\n }\n if (extent1[2] < extent2[2]) {\n intersection[2] = extent1[2];\n } else {\n intersection[2] = extent2[2];\n }\n if (extent1[3] < extent2[3]) {\n intersection[3] = extent1[3];\n } else {\n intersection[3] = extent2[3];\n }\n } else {\n createOrUpdateEmpty(intersection);\n }\n return intersection;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @return {number} Margin.\n */\nfunction getMargin(extent) {\n return getWidth(extent) + getHeight(extent);\n}\n\n/**\n * Get the size (width, height) of an extent.\n * @param {Extent} extent The extent.\n * @return {import(\"./size.js\").Size} The extent size.\n * @api\n */\nfunction getSize(extent) {\n return [extent[2] - extent[0], extent[3] - extent[1]];\n}\n\n/**\n * Get the top left coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Top left coordinate.\n * @api\n */\nfunction getTopLeft(extent) {\n return [extent[0], extent[3]];\n}\n\n/**\n * Get the top right coordinate of an extent.\n * @param {Extent} extent Extent.\n * @return {import(\"./coordinate.js\").Coordinate} Top right coordinate.\n * @api\n */\nfunction getTopRight(extent) {\n return [extent[2], extent[3]];\n}\n\n/**\n * Get the width of an extent.\n * @param {Extent} extent Extent.\n * @return {number} Width.\n * @api\n */\nfunction getWidth(extent) {\n return extent[2] - extent[0];\n}\n\n/**\n * Determine if one extent intersects another.\n * @param {Extent} extent1 Extent 1.\n * @param {Extent} extent2 Extent.\n * @return {boolean} The two extents intersect.\n * @api\n */\nfunction intersects(extent1, extent2) {\n return extent1[0] <= extent2[2] && extent1[2] >= extent2[0] && extent1[1] <= extent2[3] && extent1[3] >= extent2[1];\n}\n\n/**\n * Determine if an extent is empty.\n * @param {Extent} extent Extent.\n * @return {boolean} Is empty.\n * @api\n */\nfunction isEmpty(extent) {\n return extent[2] < extent[0] || extent[3] < extent[1];\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {Extent} [dest] Extent.\n * @return {Extent} Extent.\n */\nfunction returnOrUpdate(extent, dest) {\n if (dest) {\n dest[0] = extent[0];\n dest[1] = extent[1];\n dest[2] = extent[2];\n dest[3] = extent[3];\n return dest;\n }\n return extent;\n}\n\n/**\n * @param {Extent} extent Extent.\n * @param {number} value Value.\n */\nfunction scaleFromCenter(extent, value) {\n const deltaX = (extent[2] - extent[0]) / 2 * (value - 1);\n const deltaY = (extent[3] - extent[1]) / 2 * (value - 1);\n extent[0] -= deltaX;\n extent[2] += deltaX;\n extent[1] -= deltaY;\n extent[3] += deltaY;\n}\n\n/**\n * Determine if the segment between two coordinates intersects (crosses,\n * touches, or is contained by) the provided extent.\n * @param {Extent} extent The extent.\n * @param {import(\"./coordinate.js\").Coordinate} start Segment start coordinate.\n * @param {import(\"./coordinate.js\").Coordinate} end Segment end coordinate.\n * @return {boolean} The segment intersects the extent.\n */\nfunction intersectsSegment(extent, start, end) {\n let intersects = false;\n const startRel = coordinateRelationship(extent, start);\n const endRel = coordinateRelationship(extent, end);\n if (startRel === _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].INTERSECTING || endRel === _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].INTERSECTING) {\n intersects = true;\n } else {\n const minX = extent[0];\n const minY = extent[1];\n const maxX = extent[2];\n const maxY = extent[3];\n const startX = start[0];\n const startY = start[1];\n const endX = end[0];\n const endY = end[1];\n const slope = (endY - startY) / (endX - startX);\n let x, y;\n if (!!(endRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ABOVE) && !(startRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ABOVE)) {\n // potentially intersects top\n x = endX - (endY - maxY) / slope;\n intersects = x >= minX && x <= maxX;\n }\n if (!intersects && !!(endRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].RIGHT) && !(startRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].RIGHT)) {\n // potentially intersects right\n y = endY - (endX - maxX) * slope;\n intersects = y >= minY && y <= maxY;\n }\n if (!intersects && !!(endRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].BELOW) && !(startRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].BELOW)) {\n // potentially intersects bottom\n x = endX - (endY - minY) / slope;\n intersects = x >= minX && x <= maxX;\n }\n if (!intersects && !!(endRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LEFT) && !(startRel & _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LEFT)) {\n // potentially intersects left\n y = endY - (endX - minX) * slope;\n intersects = y >= minY && y <= maxY;\n }\n }\n return intersects;\n}\n\n/**\n * Apply a transform function to the extent.\n * @param {Extent} extent Extent.\n * @param {import(\"./proj.js\").TransformFunction} transformFn Transform function.\n * Called with `[minX, minY, maxX, maxY]` extent coordinates.\n * @param {Extent} [dest] Destination extent.\n * @param {number} [stops] Number of stops per side used for the transform.\n * By default only the corners are used.\n * @return {Extent} Extent.\n * @api\n */\nfunction applyTransform(extent, transformFn, dest, stops) {\n if (isEmpty(extent)) {\n return createOrUpdateEmpty(dest);\n }\n let coordinates = [];\n if (stops > 1) {\n const width = extent[2] - extent[0];\n const height = extent[3] - extent[1];\n for (let i = 0; i < stops; ++i) {\n coordinates.push(extent[0] + width * i / stops, extent[1], extent[2], extent[1] + height * i / stops, extent[2] - width * i / stops, extent[3], extent[0], extent[3] - height * i / stops);\n }\n } else {\n coordinates = [extent[0], extent[1], extent[2], extent[1], extent[2], extent[3], extent[0], extent[3]];\n }\n transformFn(coordinates, coordinates, 2);\n const xs = [];\n const ys = [];\n for (let i = 0, l = coordinates.length; i < l; i += 2) {\n xs.push(coordinates[i]);\n ys.push(coordinates[i + 1]);\n }\n return _boundingExtentXYs(xs, ys, dest);\n}\n\n/**\n * Modifies the provided extent in-place to be within the real world\n * extent.\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./proj/Projection.js\").default} projection Projection\n * @return {Extent} The extent within the real world extent.\n */\nfunction wrapX(extent, projection) {\n const projectionExtent = projection.getExtent();\n const center = getCenter(extent);\n if (projection.canWrapX() && (center[0] < projectionExtent[0] || center[0] >= projectionExtent[2])) {\n const worldWidth = getWidth(projectionExtent);\n const worldsAway = Math.floor((center[0] - projectionExtent[0]) / worldWidth);\n const offset = worldsAway * worldWidth;\n extent[0] -= offset;\n extent[2] -= offset;\n }\n return extent;\n}\n\n/**\n * Fits the extent to the real world\n *\n * If the extent does not cross the anti meridian, this will return the extent in an array\n * If the extent crosses the anti meridian, the extent will be sliced, so each part fits within the\n * real world\n *\n *\n * @param {Extent} extent Extent.\n * @param {import(\"./proj/Projection.js\").default} projection Projection\n * @return {Array<Extent>} The extent within the real world extent.\n */\nfunction wrapAndSliceX(extent, projection) {\n if (projection.canWrapX()) {\n const projectionExtent = projection.getExtent();\n if (!isFinite(extent[0]) || !isFinite(extent[2])) {\n return [[projectionExtent[0], extent[1], projectionExtent[2], extent[3]]];\n }\n wrapX(extent, projection);\n const worldWidth = getWidth(projectionExtent);\n if (getWidth(extent) > worldWidth) {\n // the extent wraps around on itself\n return [[projectionExtent[0], extent[1], projectionExtent[2], extent[3]]];\n }\n if (extent[0] < projectionExtent[0]) {\n // the extent crosses the anti meridian, so it needs to be sliced\n return [[extent[0] + worldWidth, extent[1], projectionExtent[2], extent[3]], [projectionExtent[0], extent[1], extent[2], extent[3]]];\n }\n if (extent[2] > projectionExtent[2]) {\n // the extent crosses the anti meridian, so it needs to be sliced\n return [[extent[0], extent[1], projectionExtent[2], extent[3]], [projectionExtent[0], extent[1], extent[2] - worldWidth, extent[3]]];\n }\n }\n return [extent];\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/extent.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/extent/Relationship.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ol/extent/Relationship.js ***!
|
||
\************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/extent/Relationship\n */\n\n/**\n * Relationship to an extent.\n * @enum {number}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n UNKNOWN: 0,\n INTERSECTING: 1,\n ABOVE: 2,\n RIGHT: 4,\n BELOW: 8,\n LEFT: 16\n});\n\n//# sourceURL=webpack://complexes/./node_modules/ol/extent/Relationship.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/featureloader.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ol/featureloader.js ***!
|
||
\******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadFeaturesXhr: function() { return /* binding */ loadFeaturesXhr; },\n/* harmony export */ setWithCredentials: function() { return /* binding */ setWithCredentials; },\n/* harmony export */ xhr: function() { return /* binding */ xhr; }\n/* harmony export */ });\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./functions.js */ \"./node_modules/ol/functions.js\");\n/**\n * @module ol/featureloader\n */\n\n\n/**\n *\n * @type {boolean}\n * @private\n */\nlet withCredentials = false;\n\n/**\n * {@link module:ol/source/Vector~VectorSource} sources use a function of this type to\n * load features.\n *\n * This function takes up to 5 arguments. These are an {@link module:ol/extent~Extent} representing\n * the area to be loaded, a `{number}` representing the resolution (map units per pixel), an\n * {@link module:ol/proj/Projection~Projection} for the projection, an optional success callback that should get\n * the loaded features passed as an argument and an optional failure callback with no arguments. If\n * the callbacks are not used, the corresponding vector source will not fire `'featuresloadend'` and\n * `'featuresloaderror'` events. `this` within the function is bound to the\n * {@link module:ol/source/Vector~VectorSource} it's called from.\n *\n * The function is responsible for loading the features and adding them to the\n * source.\n * @typedef {function(this:(import(\"./source/Vector\").default|import(\"./VectorTile.js\").default),\n * import(\"./extent.js\").Extent,\n * number,\n * import(\"./proj/Projection.js\").default,\n * function(Array<import(\"./Feature.js\").default>): void=,\n * function(): void=): void} FeatureLoader\n * @api\n */\n\n/**\n * {@link module:ol/source/Vector~VectorSource} sources use a function of this type to\n * get the url to load features from.\n *\n * This function takes an {@link module:ol/extent~Extent} representing the area\n * to be loaded, a `{number}` representing the resolution (map units per pixel)\n * and an {@link module:ol/proj/Projection~Projection} for the projection as\n * arguments and returns a `{string}` representing the URL.\n * @typedef {function(import(\"./extent.js\").Extent, number, import(\"./proj/Projection.js\").default): string} FeatureUrlFunction\n * @api\n */\n\n/**\n * @param {string|FeatureUrlFunction} url Feature URL service.\n * @param {import(\"./format/Feature.js\").default} format Feature format.\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @param {function(Array<import(\"./Feature.js\").default>, import(\"./proj/Projection.js\").default): void} success Success\n * Function called with the loaded features and optionally with the data projection.\n * @param {function(): void} failure Failure\n * Function called when loading failed.\n */\nfunction loadFeaturesXhr(url, format, extent, resolution, projection, success, failure) {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', typeof url === 'function' ? url(extent, resolution, projection) : url, true);\n if (format.getType() == 'arraybuffer') {\n xhr.responseType = 'arraybuffer';\n }\n xhr.withCredentials = withCredentials;\n /**\n * @param {Event} event Event.\n * @private\n */\n xhr.onload = function (event) {\n // status will be 0 for file:// urls\n if (!xhr.status || xhr.status >= 200 && xhr.status < 300) {\n const type = format.getType();\n /** @type {Document|Node|Object|string|undefined} */\n let source;\n if (type == 'json') {\n source = JSON.parse(xhr.responseText);\n } else if (type == 'text') {\n source = xhr.responseText;\n } else if (type == 'xml') {\n source = xhr.responseXML;\n if (!source) {\n source = new DOMParser().parseFromString(xhr.responseText, 'application/xml');\n }\n } else if (type == 'arraybuffer') {\n source = /** @type {ArrayBuffer} */xhr.response;\n }\n if (source) {\n success(/** @type {Array<import(\"./Feature.js\").default>} */\n\n format.readFeatures(source, {\n extent: extent,\n featureProjection: projection\n }), format.readProjection(source));\n } else {\n failure();\n }\n } else {\n failure();\n }\n };\n /**\n * @private\n */\n xhr.onerror = failure;\n xhr.send();\n}\n\n/**\n * Create an XHR feature loader for a `url` and `format`. The feature loader\n * loads features (with XHR), parses the features, and adds them to the\n * vector source.\n * @param {string|FeatureUrlFunction} url Feature URL service.\n * @param {import(\"./format/Feature.js\").default} format Feature format.\n * @return {FeatureLoader} The feature loader.\n * @api\n */\nfunction xhr(url, format) {\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"./proj/Projection.js\").default} projection Projection.\n * @param {function(Array<import(\"./Feature.js\").default>): void} [success] Success\n * Function called when loading succeeded.\n * @param {function(): void} [failure] Failure\n * Function called when loading failed.\n */\n return function (extent, resolution, projection, success, failure) {\n const source = /** @type {import(\"./source/Vector\").default} */this;\n loadFeaturesXhr(url, format, extent, resolution, projection,\n /**\n * @param {Array<import(\"./Feature.js\").default>} features The loaded features.\n * @param {import(\"./proj/Projection.js\").default} dataProjection Data\n * projection.\n */\n function (features, dataProjection) {\n source.addFeatures(features);\n if (success !== undefined) {\n success(features);\n }\n }, /* FIXME handle error */failure ? failure : _functions_js__WEBPACK_IMPORTED_MODULE_0__.VOID);\n };\n}\n\n/**\n * Setter for the withCredentials configuration for the XHR.\n *\n * @param {boolean} xhrWithCredentials The value of withCredentials to set.\n * Compare https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/\n * @api\n */\nfunction setWithCredentials(xhrWithCredentials) {\n withCredentials = xhrWithCredentials;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/featureloader.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/functions.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/ol/functions.js ***!
|
||
\**************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FALSE: function() { return /* binding */ FALSE; },\n/* harmony export */ TRUE: function() { return /* binding */ TRUE; },\n/* harmony export */ VOID: function() { return /* binding */ VOID; },\n/* harmony export */ memoizeOne: function() { return /* binding */ memoizeOne; },\n/* harmony export */ toPromise: function() { return /* binding */ toPromise; }\n/* harmony export */ });\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array.js */ \"./node_modules/ol/array.js\");\n/**\n * @module ol/functions\n */\n\n\n\n/**\n * Always returns true.\n * @return {boolean} true.\n */\nfunction TRUE() {\n return true;\n}\n\n/**\n * Always returns false.\n * @return {boolean} false.\n */\nfunction FALSE() {\n return false;\n}\n\n/**\n * A reusable function, used e.g. as a default for callbacks.\n *\n * @return {void} Nothing.\n */\nfunction VOID() {}\n\n/**\n * Wrap a function in another function that remembers the last return. If the\n * returned function is called twice in a row with the same arguments and the same\n * this object, it will return the value from the first call in the second call.\n *\n * @param {function(...any): ReturnType} fn The function to memoize.\n * @return {function(...any): ReturnType} The memoized function.\n * @template ReturnType\n */\nfunction memoizeOne(fn) {\n let called = false;\n\n /** @type {ReturnType} */\n let lastResult;\n\n /** @type {Array<any>} */\n let lastArgs;\n let lastThis;\n return function () {\n const nextArgs = Array.prototype.slice.call(arguments);\n if (!called || this !== lastThis || !(0,_array_js__WEBPACK_IMPORTED_MODULE_0__.equals)(nextArgs, lastArgs)) {\n called = true;\n lastThis = this;\n lastArgs = nextArgs;\n lastResult = fn.apply(this, arguments);\n }\n return lastResult;\n };\n}\n\n/**\n * @template T\n * @param {function(): (T | Promise<T>)} getter A function that returns a value or a promise for a value.\n * @return {Promise<T>} A promise for the value.\n */\nfunction toPromise(getter) {\n function promiseGetter() {\n let value;\n try {\n value = getter();\n } catch (err) {\n return Promise.reject(err);\n }\n if (value instanceof Promise) {\n return value;\n }\n return Promise.resolve(value);\n }\n return promiseGetter();\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/functions.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/Circle.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/ol/geom/Circle.js ***!
|
||
\****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SimpleGeometry.js */ \"./node_modules/ol/geom/SimpleGeometry.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _flat_deflate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flat/deflate.js */ \"./node_modules/ol/geom/flat/deflate.js\");\n/* harmony import */ var _flat_transform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./flat/transform.js */ \"./node_modules/ol/geom/flat/transform.js\");\n/**\n * @module ol/geom/Circle\n */\n\n\n\n\n\n/**\n * @classdesc\n * Circle geometry.\n *\n * @api\n */\nclass Circle extends _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {!import(\"../coordinate.js\").Coordinate} center Center.\n * For internal use, flat coordinates in combination with `layout` and no\n * `radius` are also accepted.\n * @param {number} [radius] Radius in units of the projection.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n */\n constructor(center, radius, layout) {\n super();\n if (layout !== undefined && radius === undefined) {\n this.setFlatCoordinates(layout, center);\n } else {\n radius = radius ? radius : 0;\n this.setCenterAndRadius(center, radius, layout);\n }\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!Circle} Clone.\n * @api\n */\n clone() {\n const circle = new Circle(this.flatCoordinates.slice(), undefined, this.layout);\n circle.applyProperties(this);\n return circle;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n const flatCoordinates = this.flatCoordinates;\n const dx = x - flatCoordinates[0];\n const dy = y - flatCoordinates[1];\n const squaredDistance = dx * dx + dy * dy;\n if (squaredDistance < minSquaredDistance) {\n if (squaredDistance === 0) {\n for (let i = 0; i < this.stride; ++i) {\n closestPoint[i] = flatCoordinates[i];\n }\n } else {\n const delta = this.getRadius() / Math.sqrt(squaredDistance);\n closestPoint[0] = flatCoordinates[0] + delta * dx;\n closestPoint[1] = flatCoordinates[1] + delta * dy;\n for (let i = 2; i < this.stride; ++i) {\n closestPoint[i] = flatCoordinates[i];\n }\n }\n closestPoint.length = this.stride;\n return squaredDistance;\n }\n return minSquaredDistance;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\n containsXY(x, y) {\n const flatCoordinates = this.flatCoordinates;\n const dx = x - flatCoordinates[0];\n const dy = y - flatCoordinates[1];\n return dx * dx + dy * dy <= this.getRadiusSquared_();\n }\n\n /**\n * Return the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.\n * @return {import(\"../coordinate.js\").Coordinate} Center.\n * @api\n */\n getCenter() {\n return this.flatCoordinates.slice(0, this.stride);\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n */\n computeExtent(extent) {\n const flatCoordinates = this.flatCoordinates;\n const radius = flatCoordinates[this.stride] - flatCoordinates[0];\n return (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.createOrUpdate)(flatCoordinates[0] - radius, flatCoordinates[1] - radius, flatCoordinates[0] + radius, flatCoordinates[1] + radius, extent);\n }\n\n /**\n * Return the radius of the circle.\n * @return {number} Radius.\n * @api\n */\n getRadius() {\n return Math.sqrt(this.getRadiusSquared_());\n }\n\n /**\n * @private\n * @return {number} Radius squared.\n */\n getRadiusSquared_() {\n const dx = this.flatCoordinates[this.stride] - this.flatCoordinates[0];\n const dy = this.flatCoordinates[this.stride + 1] - this.flatCoordinates[1];\n return dx * dx + dy * dy;\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n */\n getType() {\n return 'Circle';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n */\n intersectsExtent(extent) {\n const circleExtent = this.getExtent();\n if ((0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.intersects)(extent, circleExtent)) {\n const center = this.getCenter();\n if (extent[0] <= center[0] && extent[2] >= center[0]) {\n return true;\n }\n if (extent[1] <= center[1] && extent[3] >= center[1]) {\n return true;\n }\n return (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.forEachCorner)(extent, this.intersectsCoordinate.bind(this));\n }\n return false;\n }\n\n /**\n * Set the center of the circle as {@link module:ol/coordinate~Coordinate coordinate}.\n * @param {import(\"../coordinate.js\").Coordinate} center Center.\n * @api\n */\n setCenter(center) {\n const stride = this.stride;\n const radius = this.flatCoordinates[stride] - this.flatCoordinates[0];\n const flatCoordinates = center.slice();\n flatCoordinates[stride] = flatCoordinates[0] + radius;\n for (let i = 1; i < stride; ++i) {\n flatCoordinates[stride + i] = center[i];\n }\n this.setFlatCoordinates(this.layout, flatCoordinates);\n this.changed();\n }\n\n /**\n * Set the center (as {@link module:ol/coordinate~Coordinate coordinate}) and the radius (as\n * number) of the circle.\n * @param {!import(\"../coordinate.js\").Coordinate} center Center.\n * @param {number} radius Radius.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n */\n setCenterAndRadius(center, radius, layout) {\n this.setLayout(layout, center, 0);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n /** @type {Array<number>} */\n const flatCoordinates = this.flatCoordinates;\n let offset = (0,_flat_deflate_js__WEBPACK_IMPORTED_MODULE_2__.deflateCoordinate)(flatCoordinates, 0, center, this.stride);\n flatCoordinates[offset++] = flatCoordinates[0] + radius;\n for (let i = 1, ii = this.stride; i < ii; ++i) {\n flatCoordinates[offset++] = flatCoordinates[i];\n }\n flatCoordinates.length = offset;\n this.changed();\n }\n getCoordinates() {\n return null;\n }\n setCoordinates(coordinates, layout) {}\n\n /**\n * Set the radius of the circle. The radius is in the units of the projection.\n * @param {number} radius Radius.\n * @api\n */\n setRadius(radius) {\n this.flatCoordinates[this.stride] = this.flatCoordinates[0] + radius;\n this.changed();\n }\n\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @param {number} angle Rotation angle in counter-clockwise radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n */\n rotate(angle, anchor) {\n const center = this.getCenter();\n const stride = this.getStride();\n this.setCenter((0,_flat_transform_js__WEBPACK_IMPORTED_MODULE_3__.rotate)(center, 0, center.length, stride, angle, anchor, center));\n this.changed();\n }\n}\n\n/**\n * Transform each coordinate of the circle from one coordinate reference system\n * to another. The geometry is modified in place.\n * If you do not want the geometry modified in place, first clone() it and\n * then use this function on the clone.\n *\n * Internally a circle is currently represented by two points: the center of\n * the circle `[cx, cy]`, and the point to the right of the circle\n * `[cx + r, cy]`. This `transform` function just transforms these two points.\n * So the resulting geometry is also a circle, and that circle does not\n * correspond to the shape that would be obtained by transforming every point\n * of the original circle.\n *\n * @param {import(\"../proj.js\").ProjectionLike} source The current projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @param {import(\"../proj.js\").ProjectionLike} destination The desired projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @return {Circle} This geometry. Note that original geometry is\n * modified in place.\n * @function\n * @api\n */\nCircle.prototype.transform;\n/* harmony default export */ __webpack_exports__[\"default\"] = (Circle);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/Circle.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/Geometry.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ol/geom/Geometry.js ***!
|
||
\******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Object.js */ \"./node_modules/ol/Object.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../transform.js */ \"./node_modules/ol/transform.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../proj.js */ \"./node_modules/ol/proj.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _flat_transform_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flat/transform.js */ \"./node_modules/ol/geom/flat/transform.js\");\n/**\n * @module ol/geom/Geometry\n */\n\n\n\n\n\n\n\n\n/**\n * @typedef {'XY' | 'XYZ' | 'XYM' | 'XYZM'} GeometryLayout\n * The coordinate layout for geometries, indicating whether a 3rd or 4th z ('Z')\n * or measure ('M') coordinate is available.\n */\n\n/**\n * @typedef {'Point' | 'LineString' | 'LinearRing' | 'Polygon' | 'MultiPoint' | 'MultiLineString' | 'MultiPolygon' | 'GeometryCollection' | 'Circle'} Type\n * The geometry type. One of `'Point'`, `'LineString'`, `'LinearRing'`,\n * `'Polygon'`, `'MultiPoint'`, `'MultiLineString'`, `'MultiPolygon'`,\n * `'GeometryCollection'`, or `'Circle'`.\n */\n\n/**\n * @type {import(\"../transform.js\").Transform}\n */\nconst tmpTransform = (0,_transform_js__WEBPACK_IMPORTED_MODULE_1__.create)();\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Base class for vector geometries.\n *\n * To get notified of changes to the geometry, register a listener for the\n * generic `change` event on your geometry instance.\n *\n * @abstract\n * @api\n */\nclass Geometry extends _Object_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n constructor() {\n super();\n\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.extent_ = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.createEmpty)();\n\n /**\n * @private\n * @type {number}\n */\n this.extentRevision_ = -1;\n\n /**\n * @protected\n * @type {number}\n */\n this.simplifiedGeometryMaxMinSquaredTolerance = 0;\n\n /**\n * @protected\n * @type {number}\n */\n this.simplifiedGeometryRevision = 0;\n\n /**\n * Get a transformed and simplified version of the geometry.\n * @abstract\n * @param {number} revision The geometry revision.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [transform] Optional transform function.\n * @return {Geometry} Simplified geometry.\n */\n this.simplifyTransformedInternal = (0,_functions_js__WEBPACK_IMPORTED_MODULE_4__.memoizeOne)((revision, squaredTolerance, transform) => {\n if (!transform) {\n return this.getSimplifiedGeometry(squaredTolerance);\n }\n const clone = this.clone();\n clone.applyTransform(transform);\n return clone.getSimplifiedGeometry(squaredTolerance);\n });\n }\n\n /**\n * Get a transformed and simplified version of the geometry.\n * @abstract\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [transform] Optional transform function.\n * @return {Geometry} Simplified geometry.\n */\n simplifyTransformed(squaredTolerance, transform) {\n return this.simplifyTransformedInternal(this.getRevision(), squaredTolerance, transform);\n }\n\n /**\n * Make a complete copy of the geometry.\n * @abstract\n * @return {!Geometry} Clone.\n */\n clone() {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.abstract)();\n }\n\n /**\n * @abstract\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.abstract)();\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\n containsXY(x, y) {\n const coord = this.getClosestPoint([x, y]);\n return coord[0] === x && coord[1] === y;\n }\n\n /**\n * Return the closest point of the geometry to the passed point as\n * {@link module:ol/coordinate~Coordinate coordinate}.\n * @param {import(\"../coordinate.js\").Coordinate} point Point.\n * @param {import(\"../coordinate.js\").Coordinate} [closestPoint] Closest point.\n * @return {import(\"../coordinate.js\").Coordinate} Closest point.\n * @api\n */\n getClosestPoint(point, closestPoint) {\n closestPoint = closestPoint ? closestPoint : [NaN, NaN];\n this.closestPointXY(point[0], point[1], closestPoint, Infinity);\n return closestPoint;\n }\n\n /**\n * Returns true if this geometry includes the specified coordinate. If the\n * coordinate is on the boundary of the geometry, returns false.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {boolean} Contains coordinate.\n * @api\n */\n intersectsCoordinate(coordinate) {\n return this.containsXY(coordinate[0], coordinate[1]);\n }\n\n /**\n * @abstract\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n */\n computeExtent(extent) {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.abstract)();\n }\n\n /**\n * Get the extent of the geometry.\n * @param {import(\"../extent.js\").Extent} [extent] Extent.\n * @return {import(\"../extent.js\").Extent} extent Extent.\n * @api\n */\n getExtent(extent) {\n if (this.extentRevision_ != this.getRevision()) {\n const extent = this.computeExtent(this.extent_);\n if (isNaN(extent[0]) || isNaN(extent[1])) {\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.createOrUpdateEmpty)(extent);\n }\n this.extentRevision_ = this.getRevision();\n }\n return (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.returnOrUpdate)(this.extent_, extent);\n }\n\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @abstract\n * @param {number} angle Rotation angle in radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n */\n rotate(angle, anchor) {\n (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.abstract)();\n }\n\n /**\n * Scale the geometry (with an optional origin). This modifies the geometry\n * coordinates in place.\n * @abstract\n * @param {number} sx The scaling factor in the x-direction.\n * @param {number} [sy] The scaling factor in the y-direction (defaults to sx).\n * @param {import(\"../coordinate.js\").Coordinate} [anchor] The scale origin (defaults to the center\n * of the geometry extent).\n * @api\n */\n scale(sx, sy, anchor) {\n (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.abstract)();\n }\n\n /**\n * Create a simplified version of this geometry. For linestrings, this uses\n * the [Douglas Peucker](https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm)\n * algorithm. For polygons, a quantization-based\n * simplification is used to preserve topology.\n * @param {number} tolerance The tolerance distance for simplification.\n * @return {Geometry} A new, simplified version of the original geometry.\n * @api\n */\n simplify(tolerance) {\n return this.getSimplifiedGeometry(tolerance * tolerance);\n }\n\n /**\n * Create a simplified version of this geometry using the Douglas Peucker\n * algorithm.\n * See https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm.\n * @abstract\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Geometry} Simplified geometry.\n */\n getSimplifiedGeometry(squaredTolerance) {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.abstract)();\n }\n\n /**\n * Get the type of this geometry.\n * @abstract\n * @return {Type} Geometry type.\n */\n getType() {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.abstract)();\n }\n\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @abstract\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n * Called with a flat array of geometry coordinates.\n */\n applyTransform(transformFn) {\n (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.abstract)();\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @abstract\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n */\n intersectsExtent(extent) {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.abstract)();\n }\n\n /**\n * Translate the geometry. This modifies the geometry coordinates in place. If\n * instead you want a new geometry, first `clone()` this geometry.\n * @abstract\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @api\n */\n translate(deltaX, deltaY) {\n (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.abstract)();\n }\n\n /**\n * Transform each coordinate of the geometry from one coordinate reference\n * system to another. The geometry is modified in place.\n * For example, a line will be transformed to a line and a circle to a circle.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n *\n * @param {import(\"../proj.js\").ProjectionLike} source The current projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @param {import(\"../proj.js\").ProjectionLike} destination The desired projection. Can be a\n * string identifier or a {@link module:ol/proj/Projection~Projection} object.\n * @return {Geometry} This geometry. Note that original geometry is\n * modified in place.\n * @api\n */\n transform(source, destination) {\n /** @type {import(\"../proj/Projection.js\").default} */\n const sourceProj = (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.get)(source);\n const transformFn = sourceProj.getUnits() == 'tile-pixels' ? function (inCoordinates, outCoordinates, stride) {\n const pixelExtent = sourceProj.getExtent();\n const projectedExtent = sourceProj.getWorldExtent();\n const scale = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getHeight)(projectedExtent) / (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getHeight)(pixelExtent);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_1__.compose)(tmpTransform, projectedExtent[0], projectedExtent[3], scale, -scale, 0, 0, 0);\n (0,_flat_transform_js__WEBPACK_IMPORTED_MODULE_6__.transform2D)(inCoordinates, 0, inCoordinates.length, stride, tmpTransform, outCoordinates);\n return (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.getTransform)(sourceProj, destination)(inCoordinates, outCoordinates, stride);\n } : (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.getTransform)(sourceProj, destination);\n this.applyTransform(transformFn);\n return this;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Geometry);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/Geometry.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/GeometryCollection.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ol/geom/GeometryCollection.js ***!
|
||
\****************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _Geometry_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Geometry.js */ \"./node_modules/ol/geom/Geometry.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events.js */ \"./node_modules/ol/events.js\");\n\n/**\n * @module ol/geom/GeometryCollection\n */\n\n\n\n\n\n/**\n * @classdesc\n * An array of {@link module:ol/geom/Geometry~Geometry} objects.\n *\n * @api\n */\nclass GeometryCollection extends _Geometry_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {Array<Geometry>} [geometries] Geometries.\n */\n constructor(geometries) {\n super();\n\n /**\n * @private\n * @type {Array<Geometry>}\n */\n this.geometries_ = geometries ? geometries : null;\n\n /**\n * @type {Array<import(\"../events.js\").EventsKey>}\n */\n this.changeEventsKeys_ = [];\n this.listenGeometriesChange_();\n }\n\n /**\n * @private\n */\n unlistenGeometriesChange_() {\n this.changeEventsKeys_.forEach(_events_js__WEBPACK_IMPORTED_MODULE_2__.unlistenByKey);\n this.changeEventsKeys_.length = 0;\n }\n\n /**\n * @private\n */\n listenGeometriesChange_() {\n if (!this.geometries_) {\n return;\n }\n for (let i = 0, ii = this.geometries_.length; i < ii; ++i) {\n this.changeEventsKeys_.push((0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listen)(this.geometries_[i], _events_EventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].CHANGE, this.changed, this));\n }\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!GeometryCollection} Clone.\n * @api\n */\n clone() {\n const geometryCollection = new GeometryCollection(null);\n geometryCollection.setGeometries(this.geometries_);\n geometryCollection.applyProperties(this);\n return geometryCollection;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < (0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.closestSquaredDistanceXY)(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n minSquaredDistance = geometries[i].closestPointXY(x, y, closestPoint, minSquaredDistance);\n }\n return minSquaredDistance;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\n containsXY(x, y) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].containsXY(x, y)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n */\n computeExtent(extent) {\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.createOrUpdateEmpty)(extent);\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.extend)(extent, geometries[i].getExtent());\n }\n return extent;\n }\n\n /**\n * Return the geometries that make up this geometry collection.\n * @return {Array<Geometry>} Geometries.\n * @api\n */\n getGeometries() {\n return cloneGeometries(this.geometries_);\n }\n\n /**\n * @return {Array<Geometry>} Geometries.\n */\n getGeometriesArray() {\n return this.geometries_;\n }\n\n /**\n * @return {Array<Geometry>} Geometries.\n */\n getGeometriesArrayRecursive() {\n /** @type {Array<Geometry>} */\n let geometriesArray = [];\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].getType() === this.getType()) {\n geometriesArray = geometriesArray.concat(/** @type {GeometryCollection} */geometries[i].getGeometriesArrayRecursive());\n } else {\n geometriesArray.push(geometries[i]);\n }\n }\n return geometriesArray;\n }\n\n /**\n * Create a simplified version of this geometry using the Douglas Peucker algorithm.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {GeometryCollection} Simplified GeometryCollection.\n */\n getSimplifiedGeometry(squaredTolerance) {\n if (this.simplifiedGeometryRevision !== this.getRevision()) {\n this.simplifiedGeometryMaxMinSquaredTolerance = 0;\n this.simplifiedGeometryRevision = this.getRevision();\n }\n if (squaredTolerance < 0 || this.simplifiedGeometryMaxMinSquaredTolerance !== 0 && squaredTolerance < this.simplifiedGeometryMaxMinSquaredTolerance) {\n return this;\n }\n const simplifiedGeometries = [];\n const geometries = this.geometries_;\n let simplified = false;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n const geometry = geometries[i];\n const simplifiedGeometry = geometry.getSimplifiedGeometry(squaredTolerance);\n simplifiedGeometries.push(simplifiedGeometry);\n if (simplifiedGeometry !== geometry) {\n simplified = true;\n }\n }\n if (simplified) {\n const simplifiedGeometryCollection = new GeometryCollection(null);\n simplifiedGeometryCollection.setGeometriesArray(simplifiedGeometries);\n return simplifiedGeometryCollection;\n }\n this.simplifiedGeometryMaxMinSquaredTolerance = squaredTolerance;\n return this;\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n */\n getType() {\n return 'GeometryCollection';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n */\n intersectsExtent(extent) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n if (geometries[i].intersectsExtent(extent)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * @return {boolean} Is empty.\n */\n isEmpty() {\n return this.geometries_.length === 0;\n }\n\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @param {number} angle Rotation angle in radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n */\n rotate(angle, anchor) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].rotate(angle, anchor);\n }\n this.changed();\n }\n\n /**\n * Scale the geometry (with an optional origin). This modifies the geometry\n * coordinates in place.\n * @abstract\n * @param {number} sx The scaling factor in the x-direction.\n * @param {number} [sy] The scaling factor in the y-direction (defaults to sx).\n * @param {import(\"../coordinate.js\").Coordinate} [anchor] The scale origin (defaults to the center\n * of the geometry extent).\n * @api\n */\n scale(sx, sy, anchor) {\n if (!anchor) {\n anchor = (0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.getCenter)(this.getExtent());\n }\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].scale(sx, sy, anchor);\n }\n this.changed();\n }\n\n /**\n * Set the geometries that make up this geometry collection.\n * @param {Array<Geometry>} geometries Geometries.\n * @api\n */\n setGeometries(geometries) {\n this.setGeometriesArray(cloneGeometries(geometries));\n }\n\n /**\n * @param {Array<Geometry>} geometries Geometries.\n */\n setGeometriesArray(geometries) {\n this.unlistenGeometriesChange_();\n this.geometries_ = geometries;\n this.listenGeometriesChange_();\n this.changed();\n }\n\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n * Called with a flat array of geometry coordinates.\n * @api\n */\n applyTransform(transformFn) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].applyTransform(transformFn);\n }\n this.changed();\n }\n\n /**\n * Translate the geometry. This modifies the geometry coordinates in place. If\n * instead you want a new geometry, first `clone()` this geometry.\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @api\n */\n translate(deltaX, deltaY) {\n const geometries = this.geometries_;\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n geometries[i].translate(deltaX, deltaY);\n }\n this.changed();\n }\n\n /**\n * Clean up.\n */\n disposeInternal() {\n this.unlistenGeometriesChange_();\n super.disposeInternal();\n }\n}\n\n/**\n * @param {Array<Geometry>} geometries Geometries.\n * @return {Array<Geometry>} Cloned geometries.\n */\nfunction cloneGeometries(geometries) {\n const clonedGeometries = [];\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n clonedGeometries.push(geometries[i].clone());\n }\n return clonedGeometries;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (GeometryCollection);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/GeometryCollection.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/LineString.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/geom/LineString.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SimpleGeometry.js */ \"./node_modules/ol/geom/SimpleGeometry.js\");\n/* harmony import */ var _flat_closest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./flat/closest.js */ \"./node_modules/ol/geom/flat/closest.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _flat_deflate_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./flat/deflate.js */ \"./node_modules/ol/geom/flat/deflate.js\");\n/* harmony import */ var _flat_simplify_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flat/simplify.js */ \"./node_modules/ol/geom/flat/simplify.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _flat_segments_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./flat/segments.js */ \"./node_modules/ol/geom/flat/segments.js\");\n/* harmony import */ var _flat_inflate_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flat/inflate.js */ \"./node_modules/ol/geom/flat/inflate.js\");\n/* harmony import */ var _flat_interpolate_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flat/interpolate.js */ \"./node_modules/ol/geom/flat/interpolate.js\");\n/* harmony import */ var _flat_intersectsextent_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flat/intersectsextent.js */ \"./node_modules/ol/geom/flat/intersectsextent.js\");\n/* harmony import */ var _flat_length_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flat/length.js */ \"./node_modules/ol/geom/flat/length.js\");\n/**\n * @module ol/geom/LineString\n */\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Linestring geometry.\n *\n * @api\n */\nclass LineString extends _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Array<import(\"../coordinate.js\").Coordinate>|Array<number>} coordinates Coordinates.\n * For internal use, flat coordinates in combination with `layout` are also accepted.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n */\n constructor(coordinates, layout) {\n super();\n\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate|null}\n */\n this.flatMidpoint_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.flatMidpointRevision_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDelta_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDeltaRevision_ = -1;\n if (layout !== undefined && !Array.isArray(coordinates[0])) {\n this.setFlatCoordinates(layout, /** @type {Array<number>} */coordinates);\n } else {\n this.setCoordinates(/** @type {Array<import(\"../coordinate.js\").Coordinate>} */\n coordinates, layout);\n }\n }\n\n /**\n * Append the passed coordinate to the coordinates of the linestring.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @api\n */\n appendCoordinate(coordinate) {\n (0,_array_js__WEBPACK_IMPORTED_MODULE_1__.extend)(this.flatCoordinates, coordinate);\n this.changed();\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!LineString} Clone.\n * @api\n */\n clone() {\n const lineString = new LineString(this.flatCoordinates.slice(), this.layout);\n lineString.applyProperties(this);\n return lineString;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.closestSquaredDistanceXY)(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt((0,_flat_closest_js__WEBPACK_IMPORTED_MODULE_3__.maxSquaredDelta)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0));\n this.maxDeltaRevision_ = this.getRevision();\n }\n return (0,_flat_closest_js__WEBPACK_IMPORTED_MODULE_3__.assignClosestPoint)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, this.maxDelta_, false, x, y, closestPoint, minSquaredDistance);\n }\n\n /**\n * Iterate over each segment, calling the provided callback.\n * If the callback returns a truthy value the function returns that\n * value immediately. Otherwise the function returns `false`.\n *\n * @param {function(this: S, import(\"../coordinate.js\").Coordinate, import(\"../coordinate.js\").Coordinate): T} callback Function\n * called for each segment. The function will receive two arguments, the start and end coordinates of the segment.\n * @return {T|boolean} Value.\n * @template T,S\n * @api\n */\n forEachSegment(callback) {\n return (0,_flat_segments_js__WEBPACK_IMPORTED_MODULE_4__.forEach)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, callback);\n }\n\n /**\n * Returns the coordinate at `m` using linear interpolation, or `null` if no\n * such coordinate exists.\n *\n * `extrapolate` controls extrapolation beyond the range of Ms in the\n * MultiLineString. If `extrapolate` is `true` then Ms less than the first\n * M will return the first coordinate and Ms greater than the last M will\n * return the last coordinate.\n *\n * @param {number} m M.\n * @param {boolean} [extrapolate] Extrapolate. Default is `false`.\n * @return {import(\"../coordinate.js\").Coordinate|null} Coordinate.\n * @api\n */\n getCoordinateAtM(m, extrapolate) {\n if (this.layout != 'XYM' && this.layout != 'XYZM') {\n return null;\n }\n extrapolate = extrapolate !== undefined ? extrapolate : false;\n return (0,_flat_interpolate_js__WEBPACK_IMPORTED_MODULE_5__.lineStringCoordinateAtM)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, m, extrapolate);\n }\n\n /**\n * Return the coordinates of the linestring.\n * @return {Array<import(\"../coordinate.js\").Coordinate>} Coordinates.\n * @api\n */\n getCoordinates() {\n return (0,_flat_inflate_js__WEBPACK_IMPORTED_MODULE_6__.inflateCoordinates)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);\n }\n\n /**\n * Return the coordinate at the provided fraction along the linestring.\n * The `fraction` is a number between 0 and 1, where 0 is the start of the\n * linestring and 1 is the end.\n * @param {number} fraction Fraction.\n * @param {import(\"../coordinate.js\").Coordinate} [dest] Optional coordinate whose values will\n * be modified. If not provided, a new coordinate will be returned.\n * @return {import(\"../coordinate.js\").Coordinate} Coordinate of the interpolated point.\n * @api\n */\n getCoordinateAt(fraction, dest) {\n return (0,_flat_interpolate_js__WEBPACK_IMPORTED_MODULE_5__.interpolatePoint)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, fraction, dest, this.stride);\n }\n\n /**\n * Return the length of the linestring on projected plane.\n * @return {number} Length (on projected plane).\n * @api\n */\n getLength() {\n return (0,_flat_length_js__WEBPACK_IMPORTED_MODULE_7__.lineStringLength)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);\n }\n\n /**\n * @return {Array<number>} Flat midpoint.\n */\n getFlatMidpoint() {\n if (this.flatMidpointRevision_ != this.getRevision()) {\n this.flatMidpoint_ = this.getCoordinateAt(0.5, this.flatMidpoint_ ?? undefined);\n this.flatMidpointRevision_ = this.getRevision();\n }\n return /** @type {Array<number>} */this.flatMidpoint_;\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {LineString} Simplified LineString.\n * @protected\n */\n getSimplifiedGeometryInternal(squaredTolerance) {\n /** @type {Array<number>} */\n const simplifiedFlatCoordinates = [];\n simplifiedFlatCoordinates.length = (0,_flat_simplify_js__WEBPACK_IMPORTED_MODULE_8__.douglasPeucker)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, squaredTolerance, simplifiedFlatCoordinates, 0);\n return new LineString(simplifiedFlatCoordinates, 'XY');\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n */\n getType() {\n return 'LineString';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n */\n intersectsExtent(extent) {\n return (0,_flat_intersectsextent_js__WEBPACK_IMPORTED_MODULE_9__.intersectsLineString)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, extent);\n }\n\n /**\n * Set the coordinates of the linestring.\n * @param {!Array<import(\"../coordinate.js\").Coordinate>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 1);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = (0,_flat_deflate_js__WEBPACK_IMPORTED_MODULE_10__.deflateCoordinates)(this.flatCoordinates, 0, coordinates, this.stride);\n this.changed();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (LineString);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/LineString.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/LinearRing.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/geom/LinearRing.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SimpleGeometry.js */ \"./node_modules/ol/geom/SimpleGeometry.js\");\n/* harmony import */ var _flat_closest_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flat/closest.js */ \"./node_modules/ol/geom/flat/closest.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _flat_deflate_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flat/deflate.js */ \"./node_modules/ol/geom/flat/deflate.js\");\n/* harmony import */ var _flat_simplify_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flat/simplify.js */ \"./node_modules/ol/geom/flat/simplify.js\");\n/* harmony import */ var _flat_inflate_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./flat/inflate.js */ \"./node_modules/ol/geom/flat/inflate.js\");\n/* harmony import */ var _flat_area_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./flat/area.js */ \"./node_modules/ol/geom/flat/area.js\");\n/**\n * @module ol/geom/LinearRing\n */\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Linear ring geometry. Only used as part of polygon; cannot be rendered\n * on its own.\n *\n * @api\n */\nclass LinearRing extends _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Array<import(\"../coordinate.js\").Coordinate>|Array<number>} coordinates Coordinates.\n * For internal use, flat coordinates in combination with `layout` are also accepted.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n */\n constructor(coordinates, layout) {\n super();\n\n /**\n * @private\n * @type {number}\n */\n this.maxDelta_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDeltaRevision_ = -1;\n if (layout !== undefined && !Array.isArray(coordinates[0])) {\n this.setFlatCoordinates(layout, /** @type {Array<number>} */coordinates);\n } else {\n this.setCoordinates(/** @type {Array<import(\"../coordinate.js\").Coordinate>} */\n coordinates, layout);\n }\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!LinearRing} Clone.\n * @api\n */\n clone() {\n return new LinearRing(this.flatCoordinates.slice(), this.layout);\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.closestSquaredDistanceXY)(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt((0,_flat_closest_js__WEBPACK_IMPORTED_MODULE_2__.maxSquaredDelta)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, 0));\n this.maxDeltaRevision_ = this.getRevision();\n }\n return (0,_flat_closest_js__WEBPACK_IMPORTED_MODULE_2__.assignClosestPoint)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, this.maxDelta_, true, x, y, closestPoint, minSquaredDistance);\n }\n\n /**\n * Return the area of the linear ring on projected plane.\n * @return {number} Area (on projected plane).\n * @api\n */\n getArea() {\n return (0,_flat_area_js__WEBPACK_IMPORTED_MODULE_3__.linearRing)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);\n }\n\n /**\n * Return the coordinates of the linear ring.\n * @return {Array<import(\"../coordinate.js\").Coordinate>} Coordinates.\n * @api\n */\n getCoordinates() {\n return (0,_flat_inflate_js__WEBPACK_IMPORTED_MODULE_4__.inflateCoordinates)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {LinearRing} Simplified LinearRing.\n * @protected\n */\n getSimplifiedGeometryInternal(squaredTolerance) {\n /** @type {Array<number>} */\n const simplifiedFlatCoordinates = [];\n simplifiedFlatCoordinates.length = (0,_flat_simplify_js__WEBPACK_IMPORTED_MODULE_5__.douglasPeucker)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, squaredTolerance, simplifiedFlatCoordinates, 0);\n return new LinearRing(simplifiedFlatCoordinates, 'XY');\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n */\n getType() {\n return 'LinearRing';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n */\n intersectsExtent(extent) {\n return false;\n }\n\n /**\n * Set the coordinates of the linear ring.\n * @param {!Array<import(\"../coordinate.js\").Coordinate>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 1);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = (0,_flat_deflate_js__WEBPACK_IMPORTED_MODULE_6__.deflateCoordinates)(this.flatCoordinates, 0, coordinates, this.stride);\n this.changed();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (LinearRing);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/LinearRing.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/MultiLineString.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/ol/geom/MultiLineString.js ***!
|
||
\*************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _LineString_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./LineString.js */ \"./node_modules/ol/geom/LineString.js\");\n/* harmony import */ var _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SimpleGeometry.js */ \"./node_modules/ol/geom/SimpleGeometry.js\");\n/* harmony import */ var _flat_closest_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./flat/closest.js */ \"./node_modules/ol/geom/flat/closest.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _flat_deflate_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./flat/deflate.js */ \"./node_modules/ol/geom/flat/deflate.js\");\n/* harmony import */ var _flat_simplify_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flat/simplify.js */ \"./node_modules/ol/geom/flat/simplify.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _flat_inflate_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flat/inflate.js */ \"./node_modules/ol/geom/flat/inflate.js\");\n/* harmony import */ var _flat_interpolate_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flat/interpolate.js */ \"./node_modules/ol/geom/flat/interpolate.js\");\n/* harmony import */ var _flat_intersectsextent_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flat/intersectsextent.js */ \"./node_modules/ol/geom/flat/intersectsextent.js\");\n\n/**\n * @module ol/geom/MultiLineString\n */\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Multi-linestring geometry.\n *\n * @api\n */\nclass MultiLineString extends _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {Array<Array<import(\"../coordinate.js\").Coordinate>|LineString>|Array<number>} coordinates\n * Coordinates or LineString geometries. (For internal use, flat coordinates in\n * combination with `layout` and `ends` are also accepted.)\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @param {Array<number>} [ends] Flat coordinate ends for internal use.\n */\n constructor(coordinates, layout, ends) {\n super();\n\n /**\n * @type {Array<number>}\n * @private\n */\n this.ends_ = [];\n\n /**\n * @private\n * @type {number}\n */\n this.maxDelta_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDeltaRevision_ = -1;\n if (Array.isArray(coordinates[0])) {\n this.setCoordinates(/** @type {Array<Array<import(\"../coordinate.js\").Coordinate>>} */\n coordinates, layout);\n } else if (layout !== undefined && ends) {\n this.setFlatCoordinates(layout, /** @type {Array<number>} */coordinates);\n this.ends_ = ends;\n } else {\n const lineStrings = /** @type {Array<LineString>} */coordinates;\n /** @type {Array<number>} */\n const flatCoordinates = [];\n const ends = [];\n for (let i = 0, ii = lineStrings.length; i < ii; ++i) {\n const lineString = lineStrings[i];\n (0,_array_js__WEBPACK_IMPORTED_MODULE_2__.extend)(flatCoordinates, lineString.getFlatCoordinates());\n ends.push(flatCoordinates.length);\n }\n const layout = lineStrings.length === 0 ? this.getLayout() : lineStrings[0].getLayout();\n this.setFlatCoordinates(layout, flatCoordinates);\n this.ends_ = ends;\n }\n }\n\n /**\n * Append the passed linestring to the multilinestring.\n * @param {LineString} lineString LineString.\n * @api\n */\n appendLineString(lineString) {\n (0,_array_js__WEBPACK_IMPORTED_MODULE_2__.extend)(this.flatCoordinates, lineString.getFlatCoordinates().slice());\n this.ends_.push(this.flatCoordinates.length);\n this.changed();\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!MultiLineString} Clone.\n * @api\n */\n clone() {\n const multiLineString = new MultiLineString(this.flatCoordinates.slice(), this.layout, this.ends_.slice());\n multiLineString.applyProperties(this);\n return multiLineString;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.closestSquaredDistanceXY)(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt((0,_flat_closest_js__WEBPACK_IMPORTED_MODULE_4__.arrayMaxSquaredDelta)(this.flatCoordinates, 0, this.ends_, this.stride, 0));\n this.maxDeltaRevision_ = this.getRevision();\n }\n return (0,_flat_closest_js__WEBPACK_IMPORTED_MODULE_4__.assignClosestArrayPoint)(this.flatCoordinates, 0, this.ends_, this.stride, this.maxDelta_, false, x, y, closestPoint, minSquaredDistance);\n }\n\n /**\n * Returns the coordinate at `m` using linear interpolation, or `null` if no\n * such coordinate exists.\n *\n * `extrapolate` controls extrapolation beyond the range of Ms in the\n * MultiLineString. If `extrapolate` is `true` then Ms less than the first\n * M will return the first coordinate and Ms greater than the last M will\n * return the last coordinate.\n *\n * `interpolate` controls interpolation between consecutive LineStrings\n * within the MultiLineString. If `interpolate` is `true` the coordinates\n * will be linearly interpolated between the last coordinate of one LineString\n * and the first coordinate of the next LineString. If `interpolate` is\n * `false` then the function will return `null` for Ms falling between\n * LineStrings.\n *\n * @param {number} m M.\n * @param {boolean} [extrapolate] Extrapolate. Default is `false`.\n * @param {boolean} [interpolate] Interpolate. Default is `false`.\n * @return {import(\"../coordinate.js\").Coordinate|null} Coordinate.\n * @api\n */\n getCoordinateAtM(m, extrapolate, interpolate) {\n if (this.layout != 'XYM' && this.layout != 'XYZM' || this.flatCoordinates.length === 0) {\n return null;\n }\n extrapolate = extrapolate !== undefined ? extrapolate : false;\n interpolate = interpolate !== undefined ? interpolate : false;\n return (0,_flat_interpolate_js__WEBPACK_IMPORTED_MODULE_5__.lineStringsCoordinateAtM)(this.flatCoordinates, 0, this.ends_, this.stride, m, extrapolate, interpolate);\n }\n\n /**\n * Return the coordinates of the multilinestring.\n * @return {Array<Array<import(\"../coordinate.js\").Coordinate>>} Coordinates.\n * @api\n */\n getCoordinates() {\n return (0,_flat_inflate_js__WEBPACK_IMPORTED_MODULE_6__.inflateCoordinatesArray)(this.flatCoordinates, 0, this.ends_, this.stride);\n }\n\n /**\n * @return {Array<number>} Ends.\n */\n getEnds() {\n return this.ends_;\n }\n\n /**\n * Return the linestring at the specified index.\n * @param {number} index Index.\n * @return {LineString} LineString.\n * @api\n */\n getLineString(index) {\n if (index < 0 || this.ends_.length <= index) {\n return null;\n }\n return new _LineString_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"](this.flatCoordinates.slice(index === 0 ? 0 : this.ends_[index - 1], this.ends_[index]), this.layout);\n }\n\n /**\n * Return the linestrings of this multilinestring.\n * @return {Array<LineString>} LineStrings.\n * @api\n */\n getLineStrings() {\n const flatCoordinates = this.flatCoordinates;\n const ends = this.ends_;\n const layout = this.layout;\n /** @type {Array<LineString>} */\n const lineStrings = [];\n let offset = 0;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const lineString = new _LineString_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"](flatCoordinates.slice(offset, end), layout);\n lineStrings.push(lineString);\n offset = end;\n }\n return lineStrings;\n }\n\n /**\n * @return {Array<number>} Flat midpoints.\n */\n getFlatMidpoints() {\n /** @type {Array<number>} */\n const midpoints = [];\n const flatCoordinates = this.flatCoordinates;\n let offset = 0;\n const ends = this.ends_;\n const stride = this.stride;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const midpoint = (0,_flat_interpolate_js__WEBPACK_IMPORTED_MODULE_5__.interpolatePoint)(flatCoordinates, offset, end, stride, 0.5);\n (0,_array_js__WEBPACK_IMPORTED_MODULE_2__.extend)(midpoints, midpoint);\n offset = end;\n }\n return midpoints;\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {MultiLineString} Simplified MultiLineString.\n * @protected\n */\n getSimplifiedGeometryInternal(squaredTolerance) {\n /** @type {Array<number>} */\n const simplifiedFlatCoordinates = [];\n /** @type {Array<number>} */\n const simplifiedEnds = [];\n simplifiedFlatCoordinates.length = (0,_flat_simplify_js__WEBPACK_IMPORTED_MODULE_8__.douglasPeuckerArray)(this.flatCoordinates, 0, this.ends_, this.stride, squaredTolerance, simplifiedFlatCoordinates, 0, simplifiedEnds);\n return new MultiLineString(simplifiedFlatCoordinates, 'XY', simplifiedEnds);\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n */\n getType() {\n return 'MultiLineString';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n */\n intersectsExtent(extent) {\n return (0,_flat_intersectsextent_js__WEBPACK_IMPORTED_MODULE_9__.intersectsLineStringArray)(this.flatCoordinates, 0, this.ends_, this.stride, extent);\n }\n\n /**\n * Set the coordinates of the multilinestring.\n * @param {!Array<Array<import(\"../coordinate.js\").Coordinate>>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 2);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n const ends = (0,_flat_deflate_js__WEBPACK_IMPORTED_MODULE_10__.deflateCoordinatesArray)(this.flatCoordinates, 0, coordinates, this.stride, this.ends_);\n this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];\n this.changed();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (MultiLineString);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/MultiLineString.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/MultiPoint.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/geom/MultiPoint.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Point_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Point.js */ \"./node_modules/ol/geom/Point.js\");\n/* harmony import */ var _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SimpleGeometry.js */ \"./node_modules/ol/geom/SimpleGeometry.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _flat_deflate_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flat/deflate.js */ \"./node_modules/ol/geom/flat/deflate.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _flat_inflate_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flat/inflate.js */ \"./node_modules/ol/geom/flat/inflate.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../math.js */ \"./node_modules/ol/math.js\");\n\n/**\n * @module ol/geom/MultiPoint\n */\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Multi-point geometry.\n *\n * @api\n */\nclass MultiPoint extends _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {Array<import(\"../coordinate.js\").Coordinate>|Array<number>} coordinates Coordinates.\n * For internal use, flat coordinates in combination with `layout` are also accepted.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n */\n constructor(coordinates, layout) {\n super();\n if (layout && !Array.isArray(coordinates[0])) {\n this.setFlatCoordinates(layout, /** @type {Array<number>} */coordinates);\n } else {\n this.setCoordinates(/** @type {Array<import(\"../coordinate.js\").Coordinate>} */\n coordinates, layout);\n }\n }\n\n /**\n * Append the passed point to this multipoint.\n * @param {Point} point Point.\n * @api\n */\n appendPoint(point) {\n (0,_array_js__WEBPACK_IMPORTED_MODULE_2__.extend)(this.flatCoordinates, point.getFlatCoordinates());\n this.changed();\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!MultiPoint} Clone.\n * @api\n */\n clone() {\n const multiPoint = new MultiPoint(this.flatCoordinates.slice(), this.layout);\n multiPoint.applyProperties(this);\n return multiPoint;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.closestSquaredDistanceXY)(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n const flatCoordinates = this.flatCoordinates;\n const stride = this.stride;\n for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {\n const squaredDistance = (0,_math_js__WEBPACK_IMPORTED_MODULE_4__.squaredDistance)(x, y, flatCoordinates[i], flatCoordinates[i + 1]);\n if (squaredDistance < minSquaredDistance) {\n minSquaredDistance = squaredDistance;\n for (let j = 0; j < stride; ++j) {\n closestPoint[j] = flatCoordinates[i + j];\n }\n closestPoint.length = stride;\n }\n }\n return minSquaredDistance;\n }\n\n /**\n * Return the coordinates of the multipoint.\n * @return {Array<import(\"../coordinate.js\").Coordinate>} Coordinates.\n * @api\n */\n getCoordinates() {\n return (0,_flat_inflate_js__WEBPACK_IMPORTED_MODULE_5__.inflateCoordinates)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride);\n }\n\n /**\n * Return the point at the specified index.\n * @param {number} index Index.\n * @return {Point} Point.\n * @api\n */\n getPoint(index) {\n const n = this.flatCoordinates.length / this.stride;\n if (index < 0 || n <= index) {\n return null;\n }\n return new _Point_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](this.flatCoordinates.slice(index * this.stride, (index + 1) * this.stride), this.layout);\n }\n\n /**\n * Return the points of this multipoint.\n * @return {Array<Point>} Points.\n * @api\n */\n getPoints() {\n const flatCoordinates = this.flatCoordinates;\n const layout = this.layout;\n const stride = this.stride;\n /** @type {Array<Point>} */\n const points = [];\n for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {\n const point = new _Point_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](flatCoordinates.slice(i, i + stride), layout);\n points.push(point);\n }\n return points;\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n */\n getType() {\n return 'MultiPoint';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n */\n intersectsExtent(extent) {\n const flatCoordinates = this.flatCoordinates;\n const stride = this.stride;\n for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {\n const x = flatCoordinates[i];\n const y = flatCoordinates[i + 1];\n if ((0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.containsXY)(extent, x, y)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Set the coordinates of the multipoint.\n * @param {!Array<import(\"../coordinate.js\").Coordinate>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 1);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = (0,_flat_deflate_js__WEBPACK_IMPORTED_MODULE_7__.deflateCoordinates)(this.flatCoordinates, 0, coordinates, this.stride);\n this.changed();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (MultiPoint);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/MultiPoint.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/MultiPolygon.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/ol/geom/MultiPolygon.js ***!
|
||
\**********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _MultiPoint_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./MultiPoint.js */ \"./node_modules/ol/geom/MultiPoint.js\");\n/* harmony import */ var _Polygon_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Polygon.js */ \"./node_modules/ol/geom/Polygon.js\");\n/* harmony import */ var _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SimpleGeometry.js */ \"./node_modules/ol/geom/SimpleGeometry.js\");\n/* harmony import */ var _flat_closest_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./flat/closest.js */ \"./node_modules/ol/geom/flat/closest.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _flat_deflate_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./flat/deflate.js */ \"./node_modules/ol/geom/flat/deflate.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _flat_interiorpoint_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./flat/interiorpoint.js */ \"./node_modules/ol/geom/flat/interiorpoint.js\");\n/* harmony import */ var _flat_inflate_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flat/inflate.js */ \"./node_modules/ol/geom/flat/inflate.js\");\n/* harmony import */ var _flat_intersectsextent_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./flat/intersectsextent.js */ \"./node_modules/ol/geom/flat/intersectsextent.js\");\n/* harmony import */ var _flat_orient_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flat/orient.js */ \"./node_modules/ol/geom/flat/orient.js\");\n/* harmony import */ var _flat_area_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flat/area.js */ \"./node_modules/ol/geom/flat/area.js\");\n/* harmony import */ var _flat_center_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flat/center.js */ \"./node_modules/ol/geom/flat/center.js\");\n/* harmony import */ var _flat_contains_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flat/contains.js */ \"./node_modules/ol/geom/flat/contains.js\");\n/* harmony import */ var _flat_simplify_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./flat/simplify.js */ \"./node_modules/ol/geom/flat/simplify.js\");\n\n/**\n * @module ol/geom/MultiPolygon\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Multi-polygon geometry.\n *\n * @api\n */\nclass MultiPolygon extends _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {Array<Array<Array<import(\"../coordinate.js\").Coordinate>>|Polygon>|Array<number>} coordinates Coordinates.\n * For internal use, flat coordinates in combination with `layout` and `endss` are also accepted.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @param {Array<Array<number>>} [endss] Array of ends for internal use with flat coordinates.\n */\n constructor(coordinates, layout, endss) {\n super();\n\n /**\n * @type {Array<Array<number>>}\n * @private\n */\n this.endss_ = [];\n\n /**\n * @private\n * @type {number}\n */\n this.flatInteriorPointsRevision_ = -1;\n\n /**\n * @private\n * @type {Array<number>|null}\n */\n this.flatInteriorPoints_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDelta_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDeltaRevision_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.orientedRevision_ = -1;\n\n /**\n * @private\n * @type {Array<number>|null}\n */\n this.orientedFlatCoordinates_ = null;\n if (!endss && !Array.isArray(coordinates[0])) {\n const polygons = /** @type {Array<Polygon>} */coordinates;\n /** @type {Array<number>} */\n const flatCoordinates = [];\n const thisEndss = [];\n for (let i = 0, ii = polygons.length; i < ii; ++i) {\n const polygon = polygons[i];\n const offset = flatCoordinates.length;\n const ends = polygon.getEnds();\n for (let j = 0, jj = ends.length; j < jj; ++j) {\n ends[j] += offset;\n }\n (0,_array_js__WEBPACK_IMPORTED_MODULE_2__.extend)(flatCoordinates, polygon.getFlatCoordinates());\n thisEndss.push(ends);\n }\n layout = polygons.length === 0 ? this.getLayout() : polygons[0].getLayout();\n coordinates = flatCoordinates;\n endss = thisEndss;\n }\n if (layout !== undefined && endss) {\n this.setFlatCoordinates(layout, /** @type {Array<number>} */coordinates);\n this.endss_ = endss;\n } else {\n this.setCoordinates(/** @type {Array<Array<Array<import(\"../coordinate.js\").Coordinate>>>} */\n coordinates, layout);\n }\n }\n\n /**\n * Append the passed polygon to this multipolygon.\n * @param {Polygon} polygon Polygon.\n * @api\n */\n appendPolygon(polygon) {\n /** @type {Array<number>} */\n let ends;\n if (!this.flatCoordinates) {\n this.flatCoordinates = polygon.getFlatCoordinates().slice();\n ends = polygon.getEnds().slice();\n this.endss_.push();\n } else {\n const offset = this.flatCoordinates.length;\n (0,_array_js__WEBPACK_IMPORTED_MODULE_2__.extend)(this.flatCoordinates, polygon.getFlatCoordinates());\n ends = polygon.getEnds().slice();\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n ends[i] += offset;\n }\n }\n this.endss_.push(ends);\n this.changed();\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!MultiPolygon} Clone.\n * @api\n */\n clone() {\n const len = this.endss_.length;\n const newEndss = new Array(len);\n for (let i = 0; i < len; ++i) {\n newEndss[i] = this.endss_[i].slice();\n }\n const multiPolygon = new MultiPolygon(this.flatCoordinates.slice(), this.layout, newEndss);\n multiPolygon.applyProperties(this);\n return multiPolygon;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.closestSquaredDistanceXY)(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt((0,_flat_closest_js__WEBPACK_IMPORTED_MODULE_4__.multiArrayMaxSquaredDelta)(this.flatCoordinates, 0, this.endss_, this.stride, 0));\n this.maxDeltaRevision_ = this.getRevision();\n }\n return (0,_flat_closest_js__WEBPACK_IMPORTED_MODULE_4__.assignClosestMultiArrayPoint)(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, this.maxDelta_, true, x, y, closestPoint, minSquaredDistance);\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\n containsXY(x, y) {\n return (0,_flat_contains_js__WEBPACK_IMPORTED_MODULE_5__.linearRingssContainsXY)(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, x, y);\n }\n\n /**\n * Return the area of the multipolygon on projected plane.\n * @return {number} Area (on projected plane).\n * @api\n */\n getArea() {\n return (0,_flat_area_js__WEBPACK_IMPORTED_MODULE_6__.linearRingss)(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride);\n }\n\n /**\n * Get the coordinate array for this geometry. This array has the structure\n * of a GeoJSON coordinate array for multi-polygons.\n *\n * @param {boolean} [right] Orient coordinates according to the right-hand\n * rule (counter-clockwise for exterior and clockwise for interior rings).\n * If `false`, coordinates will be oriented according to the left-hand rule\n * (clockwise for exterior and counter-clockwise for interior rings).\n * By default, coordinate orientation will depend on how the geometry was\n * constructed.\n * @return {Array<Array<Array<import(\"../coordinate.js\").Coordinate>>>} Coordinates.\n * @api\n */\n getCoordinates(right) {\n let flatCoordinates;\n if (right !== undefined) {\n flatCoordinates = this.getOrientedFlatCoordinates().slice();\n (0,_flat_orient_js__WEBPACK_IMPORTED_MODULE_7__.orientLinearRingsArray)(flatCoordinates, 0, this.endss_, this.stride, right);\n } else {\n flatCoordinates = this.flatCoordinates;\n }\n return (0,_flat_inflate_js__WEBPACK_IMPORTED_MODULE_8__.inflateMultiCoordinatesArray)(flatCoordinates, 0, this.endss_, this.stride);\n }\n\n /**\n * @return {Array<Array<number>>} Endss.\n */\n getEndss() {\n return this.endss_;\n }\n\n /**\n * @return {Array<number>} Flat interior points.\n */\n getFlatInteriorPoints() {\n if (this.flatInteriorPointsRevision_ != this.getRevision()) {\n const flatCenters = (0,_flat_center_js__WEBPACK_IMPORTED_MODULE_9__.linearRingss)(this.flatCoordinates, 0, this.endss_, this.stride);\n this.flatInteriorPoints_ = (0,_flat_interiorpoint_js__WEBPACK_IMPORTED_MODULE_10__.getInteriorPointsOfMultiArray)(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, flatCenters);\n this.flatInteriorPointsRevision_ = this.getRevision();\n }\n return /** @type {Array<number>} */this.flatInteriorPoints_;\n }\n\n /**\n * Return the interior points as {@link module:ol/geom/MultiPoint~MultiPoint multipoint}.\n * @return {MultiPoint} Interior points as XYM coordinates, where M is\n * the length of the horizontal intersection that the point belongs to.\n * @api\n */\n getInteriorPoints() {\n return new _MultiPoint_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"](this.getFlatInteriorPoints().slice(), 'XYM');\n }\n\n /**\n * @return {Array<number>} Oriented flat coordinates.\n */\n getOrientedFlatCoordinates() {\n if (this.orientedRevision_ != this.getRevision()) {\n const flatCoordinates = this.flatCoordinates;\n if ((0,_flat_orient_js__WEBPACK_IMPORTED_MODULE_7__.linearRingssAreOriented)(flatCoordinates, 0, this.endss_, this.stride)) {\n this.orientedFlatCoordinates_ = flatCoordinates;\n } else {\n this.orientedFlatCoordinates_ = flatCoordinates.slice();\n this.orientedFlatCoordinates_.length = (0,_flat_orient_js__WEBPACK_IMPORTED_MODULE_7__.orientLinearRingsArray)(this.orientedFlatCoordinates_, 0, this.endss_, this.stride);\n }\n this.orientedRevision_ = this.getRevision();\n }\n return /** @type {Array<number>} */this.orientedFlatCoordinates_;\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {MultiPolygon} Simplified MultiPolygon.\n * @protected\n */\n getSimplifiedGeometryInternal(squaredTolerance) {\n /** @type {Array<number>} */\n const simplifiedFlatCoordinates = [];\n /** @type {Array<Array<number>>} */\n const simplifiedEndss = [];\n simplifiedFlatCoordinates.length = (0,_flat_simplify_js__WEBPACK_IMPORTED_MODULE_12__.quantizeMultiArray)(this.flatCoordinates, 0, this.endss_, this.stride, Math.sqrt(squaredTolerance), simplifiedFlatCoordinates, 0, simplifiedEndss);\n return new MultiPolygon(simplifiedFlatCoordinates, 'XY', simplifiedEndss);\n }\n\n /**\n * Return the polygon at the specified index.\n * @param {number} index Index.\n * @return {Polygon} Polygon.\n * @api\n */\n getPolygon(index) {\n if (index < 0 || this.endss_.length <= index) {\n return null;\n }\n let offset;\n if (index === 0) {\n offset = 0;\n } else {\n const prevEnds = this.endss_[index - 1];\n offset = prevEnds[prevEnds.length - 1];\n }\n const ends = this.endss_[index].slice();\n const end = ends[ends.length - 1];\n if (offset !== 0) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n ends[i] -= offset;\n }\n }\n return new _Polygon_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"](this.flatCoordinates.slice(offset, end), this.layout, ends);\n }\n\n /**\n * Return the polygons of this multipolygon.\n * @return {Array<Polygon>} Polygons.\n * @api\n */\n getPolygons() {\n const layout = this.layout;\n const flatCoordinates = this.flatCoordinates;\n const endss = this.endss_;\n const polygons = [];\n let offset = 0;\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i].slice();\n const end = ends[ends.length - 1];\n if (offset !== 0) {\n for (let j = 0, jj = ends.length; j < jj; ++j) {\n ends[j] -= offset;\n }\n }\n const polygon = new _Polygon_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"](flatCoordinates.slice(offset, end), layout, ends);\n polygons.push(polygon);\n offset = end;\n }\n return polygons;\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n */\n getType() {\n return 'MultiPolygon';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n */\n intersectsExtent(extent) {\n return (0,_flat_intersectsextent_js__WEBPACK_IMPORTED_MODULE_14__.intersectsLinearRingMultiArray)(this.getOrientedFlatCoordinates(), 0, this.endss_, this.stride, extent);\n }\n\n /**\n * Set the coordinates of the multipolygon.\n * @param {!Array<Array<Array<import(\"../coordinate.js\").Coordinate>>>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 3);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n const endss = (0,_flat_deflate_js__WEBPACK_IMPORTED_MODULE_15__.deflateMultiCoordinatesArray)(this.flatCoordinates, 0, coordinates, this.stride, this.endss_);\n if (endss.length === 0) {\n this.flatCoordinates.length = 0;\n } else {\n const lastEnds = endss[endss.length - 1];\n this.flatCoordinates.length = lastEnds.length === 0 ? 0 : lastEnds[lastEnds.length - 1];\n }\n this.changed();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (MultiPolygon);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/MultiPolygon.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/Point.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/geom/Point.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SimpleGeometry.js */ \"./node_modules/ol/geom/SimpleGeometry.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _flat_deflate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./flat/deflate.js */ \"./node_modules/ol/geom/flat/deflate.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../math.js */ \"./node_modules/ol/math.js\");\n/**\n * @module ol/geom/Point\n */\n\n\n\n\n\n/**\n * @classdesc\n * Point geometry.\n *\n * @api\n */\nclass Point extends _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {import(\"../coordinate.js\").Coordinate} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n */\n constructor(coordinates, layout) {\n super();\n this.setCoordinates(coordinates, layout);\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!Point} Clone.\n * @api\n */\n clone() {\n const point = new Point(this.flatCoordinates.slice(), this.layout);\n point.applyProperties(this);\n return point;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n const flatCoordinates = this.flatCoordinates;\n const squaredDistance = (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.squaredDistance)(x, y, flatCoordinates[0], flatCoordinates[1]);\n if (squaredDistance < minSquaredDistance) {\n const stride = this.stride;\n for (let i = 0; i < stride; ++i) {\n closestPoint[i] = flatCoordinates[i];\n }\n closestPoint.length = stride;\n return squaredDistance;\n }\n return minSquaredDistance;\n }\n\n /**\n * Return the coordinate of the point.\n * @return {import(\"../coordinate.js\").Coordinate} Coordinates.\n * @api\n */\n getCoordinates() {\n return this.flatCoordinates.slice();\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n */\n computeExtent(extent) {\n return (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.createOrUpdateFromCoordinate)(this.flatCoordinates, extent);\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n */\n getType() {\n return 'Point';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n */\n intersectsExtent(extent) {\n return (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.containsXY)(extent, this.flatCoordinates[0], this.flatCoordinates[1]);\n }\n\n /**\n * @param {!Array<*>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 0);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n this.flatCoordinates.length = (0,_flat_deflate_js__WEBPACK_IMPORTED_MODULE_3__.deflateCoordinate)(this.flatCoordinates, 0, coordinates, this.stride);\n this.changed();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Point);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/Point.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/Polygon.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ol/geom/Polygon.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ circular: function() { return /* binding */ circular; },\n/* harmony export */ fromCircle: function() { return /* binding */ fromCircle; },\n/* harmony export */ fromExtent: function() { return /* binding */ fromExtent; },\n/* harmony export */ makeRegular: function() { return /* binding */ makeRegular; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _LinearRing_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./LinearRing.js */ \"./node_modules/ol/geom/LinearRing.js\");\n/* harmony import */ var _Point_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Point.js */ \"./node_modules/ol/geom/Point.js\");\n/* harmony import */ var _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SimpleGeometry.js */ \"./node_modules/ol/geom/SimpleGeometry.js\");\n/* harmony import */ var _flat_closest_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./flat/closest.js */ \"./node_modules/ol/geom/flat/closest.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _flat_deflate_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./flat/deflate.js */ \"./node_modules/ol/geom/flat/deflate.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _flat_interiorpoint_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./flat/interiorpoint.js */ \"./node_modules/ol/geom/flat/interiorpoint.js\");\n/* harmony import */ var _flat_inflate_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./flat/inflate.js */ \"./node_modules/ol/geom/flat/inflate.js\");\n/* harmony import */ var _flat_intersectsextent_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./flat/intersectsextent.js */ \"./node_modules/ol/geom/flat/intersectsextent.js\");\n/* harmony import */ var _flat_orient_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./flat/orient.js */ \"./node_modules/ol/geom/flat/orient.js\");\n/* harmony import */ var _flat_area_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flat/area.js */ \"./node_modules/ol/geom/flat/area.js\");\n/* harmony import */ var _flat_contains_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flat/contains.js */ \"./node_modules/ol/geom/flat/contains.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../math.js */ \"./node_modules/ol/math.js\");\n/* harmony import */ var _flat_simplify_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./flat/simplify.js */ \"./node_modules/ol/geom/flat/simplify.js\");\n/* harmony import */ var _sphere_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../sphere.js */ \"./node_modules/ol/sphere.js\");\n\n/**\n * @module ol/geom/Polygon\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Polygon geometry.\n *\n * @api\n */\nclass Polygon extends _SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {!Array<Array<import(\"../coordinate.js\").Coordinate>>|!Array<number>} coordinates\n * Array of linear rings that define the polygon. The first linear ring of the\n * array defines the outer-boundary or surface of the polygon. Each subsequent\n * linear ring defines a hole in the surface of the polygon. A linear ring is\n * an array of vertices' coordinates where the first coordinate and the last are\n * equivalent. (For internal use, flat coordinates in combination with\n * `layout` and `ends` are also accepted.)\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @param {Array<number>} [ends] Ends (for internal use with flat coordinates).\n */\n constructor(coordinates, layout, ends) {\n super();\n\n /**\n * @type {Array<number>}\n * @private\n */\n this.ends_ = [];\n\n /**\n * @private\n * @type {number}\n */\n this.flatInteriorPointRevision_ = -1;\n\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate|null}\n */\n this.flatInteriorPoint_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDelta_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDeltaRevision_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.orientedRevision_ = -1;\n\n /**\n * @private\n * @type {Array<number>|null}\n */\n this.orientedFlatCoordinates_ = null;\n if (layout !== undefined && ends) {\n this.setFlatCoordinates(layout, /** @type {Array<number>} */coordinates);\n this.ends_ = ends;\n } else {\n this.setCoordinates(/** @type {Array<Array<import(\"../coordinate.js\").Coordinate>>} */\n coordinates, layout);\n }\n }\n\n /**\n * Append the passed linear ring to this polygon.\n * @param {LinearRing} linearRing Linear ring.\n * @api\n */\n appendLinearRing(linearRing) {\n if (!this.flatCoordinates) {\n this.flatCoordinates = linearRing.getFlatCoordinates().slice();\n } else {\n (0,_array_js__WEBPACK_IMPORTED_MODULE_2__.extend)(this.flatCoordinates, linearRing.getFlatCoordinates());\n }\n this.ends_.push(this.flatCoordinates.length);\n this.changed();\n }\n\n /**\n * Make a complete copy of the geometry.\n * @return {!Polygon} Clone.\n * @api\n */\n clone() {\n const polygon = new Polygon(this.flatCoordinates.slice(), this.layout, this.ends_.slice());\n polygon.applyProperties(this);\n return polygon;\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../coordinate.js\").Coordinate} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @return {number} Minimum squared distance.\n */\n closestPointXY(x, y, closestPoint, minSquaredDistance) {\n if (minSquaredDistance < (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.closestSquaredDistanceXY)(this.getExtent(), x, y)) {\n return minSquaredDistance;\n }\n if (this.maxDeltaRevision_ != this.getRevision()) {\n this.maxDelta_ = Math.sqrt((0,_flat_closest_js__WEBPACK_IMPORTED_MODULE_4__.arrayMaxSquaredDelta)(this.flatCoordinates, 0, this.ends_, this.stride, 0));\n this.maxDeltaRevision_ = this.getRevision();\n }\n return (0,_flat_closest_js__WEBPACK_IMPORTED_MODULE_4__.assignClosestArrayPoint)(this.flatCoordinates, 0, this.ends_, this.stride, this.maxDelta_, true, x, y, closestPoint, minSquaredDistance);\n }\n\n /**\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\n containsXY(x, y) {\n return (0,_flat_contains_js__WEBPACK_IMPORTED_MODULE_5__.linearRingsContainsXY)(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, x, y);\n }\n\n /**\n * Return the area of the polygon on projected plane.\n * @return {number} Area (on projected plane).\n * @api\n */\n getArea() {\n return (0,_flat_area_js__WEBPACK_IMPORTED_MODULE_6__.linearRings)(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride);\n }\n\n /**\n * Get the coordinate array for this geometry. This array has the structure\n * of a GeoJSON coordinate array for polygons.\n *\n * @param {boolean} [right] Orient coordinates according to the right-hand\n * rule (counter-clockwise for exterior and clockwise for interior rings).\n * If `false`, coordinates will be oriented according to the left-hand rule\n * (clockwise for exterior and counter-clockwise for interior rings).\n * By default, coordinate orientation will depend on how the geometry was\n * constructed.\n * @return {Array<Array<import(\"../coordinate.js\").Coordinate>>} Coordinates.\n * @api\n */\n getCoordinates(right) {\n let flatCoordinates;\n if (right !== undefined) {\n flatCoordinates = this.getOrientedFlatCoordinates().slice();\n (0,_flat_orient_js__WEBPACK_IMPORTED_MODULE_7__.orientLinearRings)(flatCoordinates, 0, this.ends_, this.stride, right);\n } else {\n flatCoordinates = this.flatCoordinates;\n }\n return (0,_flat_inflate_js__WEBPACK_IMPORTED_MODULE_8__.inflateCoordinatesArray)(flatCoordinates, 0, this.ends_, this.stride);\n }\n\n /**\n * @return {Array<number>} Ends.\n */\n getEnds() {\n return this.ends_;\n }\n\n /**\n * @return {Array<number>} Interior point.\n */\n getFlatInteriorPoint() {\n if (this.flatInteriorPointRevision_ != this.getRevision()) {\n const flatCenter = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getCenter)(this.getExtent());\n this.flatInteriorPoint_ = (0,_flat_interiorpoint_js__WEBPACK_IMPORTED_MODULE_9__.getInteriorPointOfArray)(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, flatCenter, 0);\n this.flatInteriorPointRevision_ = this.getRevision();\n }\n return /** @type {import(\"../coordinate.js\").Coordinate} */this.flatInteriorPoint_;\n }\n\n /**\n * Return an interior point of the polygon.\n * @return {Point} Interior point as XYM coordinate, where M is the\n * length of the horizontal intersection that the point belongs to.\n * @api\n */\n getInteriorPoint() {\n return new _Point_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"](this.getFlatInteriorPoint(), 'XYM');\n }\n\n /**\n * Return the number of rings of the polygon, this includes the exterior\n * ring and any interior rings.\n *\n * @return {number} Number of rings.\n * @api\n */\n getLinearRingCount() {\n return this.ends_.length;\n }\n\n /**\n * Return the Nth linear ring of the polygon geometry. Return `null` if the\n * given index is out of range.\n * The exterior linear ring is available at index `0` and the interior rings\n * at index `1` and beyond.\n *\n * @param {number} index Index.\n * @return {LinearRing|null} Linear ring.\n * @api\n */\n getLinearRing(index) {\n if (index < 0 || this.ends_.length <= index) {\n return null;\n }\n return new _LinearRing_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"](this.flatCoordinates.slice(index === 0 ? 0 : this.ends_[index - 1], this.ends_[index]), this.layout);\n }\n\n /**\n * Return the linear rings of the polygon.\n * @return {Array<LinearRing>} Linear rings.\n * @api\n */\n getLinearRings() {\n const layout = this.layout;\n const flatCoordinates = this.flatCoordinates;\n const ends = this.ends_;\n const linearRings = [];\n let offset = 0;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const linearRing = new _LinearRing_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"](flatCoordinates.slice(offset, end), layout);\n linearRings.push(linearRing);\n offset = end;\n }\n return linearRings;\n }\n\n /**\n * @return {Array<number>} Oriented flat coordinates.\n */\n getOrientedFlatCoordinates() {\n if (this.orientedRevision_ != this.getRevision()) {\n const flatCoordinates = this.flatCoordinates;\n if ((0,_flat_orient_js__WEBPACK_IMPORTED_MODULE_7__.linearRingsAreOriented)(flatCoordinates, 0, this.ends_, this.stride)) {\n this.orientedFlatCoordinates_ = flatCoordinates;\n } else {\n this.orientedFlatCoordinates_ = flatCoordinates.slice();\n this.orientedFlatCoordinates_.length = (0,_flat_orient_js__WEBPACK_IMPORTED_MODULE_7__.orientLinearRings)(this.orientedFlatCoordinates_, 0, this.ends_, this.stride);\n }\n this.orientedRevision_ = this.getRevision();\n }\n return /** @type {Array<number>} */this.orientedFlatCoordinates_;\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {Polygon} Simplified Polygon.\n * @protected\n */\n getSimplifiedGeometryInternal(squaredTolerance) {\n /** @type {Array<number>} */\n const simplifiedFlatCoordinates = [];\n /** @type {Array<number>} */\n const simplifiedEnds = [];\n simplifiedFlatCoordinates.length = (0,_flat_simplify_js__WEBPACK_IMPORTED_MODULE_12__.quantizeArray)(this.flatCoordinates, 0, this.ends_, this.stride, Math.sqrt(squaredTolerance), simplifiedFlatCoordinates, 0, simplifiedEnds);\n return new Polygon(simplifiedFlatCoordinates, 'XY', simplifiedEnds);\n }\n\n /**\n * Get the type of this geometry.\n * @return {import(\"./Geometry.js\").Type} Geometry type.\n * @api\n */\n getType() {\n return 'Polygon';\n }\n\n /**\n * Test if the geometry and the passed extent intersect.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {boolean} `true` if the geometry and the extent intersect.\n * @api\n */\n intersectsExtent(extent) {\n return (0,_flat_intersectsextent_js__WEBPACK_IMPORTED_MODULE_13__.intersectsLinearRingArray)(this.getOrientedFlatCoordinates(), 0, this.ends_, this.stride, extent);\n }\n\n /**\n * Set the coordinates of the polygon.\n * @param {!Array<Array<import(\"../coordinate.js\").Coordinate>>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n * @api\n */\n setCoordinates(coordinates, layout) {\n this.setLayout(layout, coordinates, 2);\n if (!this.flatCoordinates) {\n this.flatCoordinates = [];\n }\n const ends = (0,_flat_deflate_js__WEBPACK_IMPORTED_MODULE_14__.deflateCoordinatesArray)(this.flatCoordinates, 0, coordinates, this.stride, this.ends_);\n this.flatCoordinates.length = ends.length === 0 ? 0 : ends[ends.length - 1];\n this.changed();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Polygon);\n\n/**\n * Create an approximation of a circle on the surface of a sphere.\n * @param {import(\"../coordinate.js\").Coordinate} center Center (`[lon, lat]` in degrees).\n * @param {number} radius The great-circle distance from the center to\n * the polygon vertices in meters.\n * @param {number} [n] Optional number of vertices for the resulting\n * polygon. Default is `32`.\n * @param {number} [sphereRadius] Optional radius for the sphere (defaults to\n * the Earth's mean radius using the WGS84 ellipsoid).\n * @return {Polygon} The \"circular\" polygon.\n * @api\n */\nfunction circular(center, radius, n, sphereRadius) {\n n = n ? n : 32;\n /** @type {Array<number>} */\n const flatCoordinates = [];\n for (let i = 0; i < n; ++i) {\n (0,_array_js__WEBPACK_IMPORTED_MODULE_2__.extend)(flatCoordinates, (0,_sphere_js__WEBPACK_IMPORTED_MODULE_15__.offset)(center, radius, 2 * Math.PI * i / n, sphereRadius));\n }\n flatCoordinates.push(flatCoordinates[0], flatCoordinates[1]);\n return new Polygon(flatCoordinates, 'XY', [flatCoordinates.length]);\n}\n\n/**\n * Create a polygon from an extent. The layout used is `XY`.\n * @param {import(\"../extent.js\").Extent} extent The extent.\n * @return {Polygon} The polygon.\n * @api\n */\nfunction fromExtent(extent) {\n if ((0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.isEmpty)(extent)) {\n throw new Error('Cannot create polygon from empty extent');\n }\n const minX = extent[0];\n const minY = extent[1];\n const maxX = extent[2];\n const maxY = extent[3];\n const flatCoordinates = [minX, minY, minX, maxY, maxX, maxY, maxX, minY, minX, minY];\n return new Polygon(flatCoordinates, 'XY', [flatCoordinates.length]);\n}\n\n/**\n * Create a regular polygon from a circle.\n * @param {import(\"./Circle.js\").default} circle Circle geometry.\n * @param {number} [sides] Number of sides of the polygon. Default is 32.\n * @param {number} [angle] Start angle for the first vertex of the polygon in\n * counter-clockwise radians. 0 means East. Default is 0.\n * @return {Polygon} Polygon geometry.\n * @api\n */\nfunction fromCircle(circle, sides, angle) {\n sides = sides ? sides : 32;\n const stride = circle.getStride();\n const layout = circle.getLayout();\n const center = circle.getCenter();\n const arrayLength = stride * (sides + 1);\n const flatCoordinates = new Array(arrayLength);\n for (let i = 0; i < arrayLength; i += stride) {\n flatCoordinates[i] = 0;\n flatCoordinates[i + 1] = 0;\n for (let j = 2; j < stride; j++) {\n flatCoordinates[i + j] = center[j];\n }\n }\n const ends = [flatCoordinates.length];\n const polygon = new Polygon(flatCoordinates, layout, ends);\n makeRegular(polygon, center, circle.getRadius(), angle);\n return polygon;\n}\n\n/**\n * Modify the coordinates of a polygon to make it a regular polygon.\n * @param {Polygon} polygon Polygon geometry.\n * @param {import(\"../coordinate.js\").Coordinate} center Center of the regular polygon.\n * @param {number} radius Radius of the regular polygon.\n * @param {number} [angle] Start angle for the first vertex of the polygon in\n * counter-clockwise radians. 0 means East. Default is 0.\n */\nfunction makeRegular(polygon, center, radius, angle) {\n const flatCoordinates = polygon.getFlatCoordinates();\n const stride = polygon.getStride();\n const sides = flatCoordinates.length / stride - 1;\n const startAngle = angle ? angle : 0;\n for (let i = 0; i <= sides; ++i) {\n const offset = i * stride;\n const angle = startAngle + (0,_math_js__WEBPACK_IMPORTED_MODULE_16__.modulo)(i, sides) * 2 * Math.PI / sides;\n flatCoordinates[offset] = center[0] + radius * Math.cos(angle);\n flatCoordinates[offset + 1] = center[1] + radius * Math.sin(angle);\n }\n polygon.changed();\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/Polygon.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/SimpleGeometry.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ol/geom/SimpleGeometry.js ***!
|
||
\************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getLayoutForStride: function() { return /* binding */ getLayoutForStride; },\n/* harmony export */ getStrideForLayout: function() { return /* binding */ getStrideForLayout; },\n/* harmony export */ transformGeom2D: function() { return /* binding */ transformGeom2D; }\n/* harmony export */ });\n/* harmony import */ var _Geometry_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Geometry.js */ \"./node_modules/ol/geom/Geometry.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _flat_transform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./flat/transform.js */ \"./node_modules/ol/geom/flat/transform.js\");\n/**\n * @module ol/geom/SimpleGeometry\n */\n\n\n\n\n\n/**\n * @classdesc\n * Abstract base class; only used for creating subclasses; do not instantiate\n * in apps, as cannot be rendered.\n *\n * @abstract\n * @api\n */\nclass SimpleGeometry extends _Geometry_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor() {\n super();\n\n /**\n * @protected\n * @type {import(\"./Geometry.js\").GeometryLayout}\n */\n this.layout = 'XY';\n\n /**\n * @protected\n * @type {number}\n */\n this.stride = 2;\n\n /**\n * @protected\n * @type {Array<number>}\n */\n this.flatCoordinates;\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @protected\n * @return {import(\"../extent.js\").Extent} extent Extent.\n */\n computeExtent(extent) {\n return (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.createOrUpdateFromFlatCoordinates)(this.flatCoordinates, 0, this.flatCoordinates.length, this.stride, extent);\n }\n\n /**\n * @abstract\n * @return {Array<*> | null} Coordinates.\n */\n getCoordinates() {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.abstract)();\n }\n\n /**\n * Return the first coordinate of the geometry.\n * @return {import(\"../coordinate.js\").Coordinate} First coordinate.\n * @api\n */\n getFirstCoordinate() {\n return this.flatCoordinates.slice(0, this.stride);\n }\n\n /**\n * @return {Array<number>} Flat coordinates.\n */\n getFlatCoordinates() {\n return this.flatCoordinates;\n }\n\n /**\n * Return the last coordinate of the geometry.\n * @return {import(\"../coordinate.js\").Coordinate} Last point.\n * @api\n */\n getLastCoordinate() {\n return this.flatCoordinates.slice(this.flatCoordinates.length - this.stride);\n }\n\n /**\n * Return the {@link import(\"./Geometry.js\").GeometryLayout layout} of the geometry.\n * @return {import(\"./Geometry.js\").GeometryLayout} Layout.\n * @api\n */\n getLayout() {\n return this.layout;\n }\n\n /**\n * Create a simplified version of this geometry using the Douglas Peucker algorithm.\n * @param {number} squaredTolerance Squared tolerance.\n * @return {SimpleGeometry} Simplified geometry.\n */\n getSimplifiedGeometry(squaredTolerance) {\n if (this.simplifiedGeometryRevision !== this.getRevision()) {\n this.simplifiedGeometryMaxMinSquaredTolerance = 0;\n this.simplifiedGeometryRevision = this.getRevision();\n }\n // If squaredTolerance is negative or if we know that simplification will not\n // have any effect then just return this.\n if (squaredTolerance < 0 || this.simplifiedGeometryMaxMinSquaredTolerance !== 0 && squaredTolerance <= this.simplifiedGeometryMaxMinSquaredTolerance) {\n return this;\n }\n const simplifiedGeometry = this.getSimplifiedGeometryInternal(squaredTolerance);\n const simplifiedFlatCoordinates = simplifiedGeometry.getFlatCoordinates();\n if (simplifiedFlatCoordinates.length < this.flatCoordinates.length) {\n return simplifiedGeometry;\n }\n // Simplification did not actually remove any coordinates. We now know\n // that any calls to getSimplifiedGeometry with a squaredTolerance less\n // than or equal to the current squaredTolerance will also not have any\n // effect. This allows us to short circuit simplification (saving CPU\n // cycles) and prevents the cache of simplified geometries from filling\n // up with useless identical copies of this geometry (saving memory).\n this.simplifiedGeometryMaxMinSquaredTolerance = squaredTolerance;\n return this;\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {SimpleGeometry} Simplified geometry.\n * @protected\n */\n getSimplifiedGeometryInternal(squaredTolerance) {\n return this;\n }\n\n /**\n * @return {number} Stride.\n */\n getStride() {\n return this.stride;\n }\n\n /**\n * @param {import(\"./Geometry.js\").GeometryLayout} layout Layout.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n */\n setFlatCoordinates(layout, flatCoordinates) {\n this.stride = getStrideForLayout(layout);\n this.layout = layout;\n this.flatCoordinates = flatCoordinates;\n }\n\n /**\n * @abstract\n * @param {!Array<*>} coordinates Coordinates.\n * @param {import(\"./Geometry.js\").GeometryLayout} [layout] Layout.\n */\n setCoordinates(coordinates, layout) {\n (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.abstract)();\n }\n\n /**\n * @param {import(\"./Geometry.js\").GeometryLayout|undefined} layout Layout.\n * @param {Array<*>} coordinates Coordinates.\n * @param {number} nesting Nesting.\n * @protected\n */\n setLayout(layout, coordinates, nesting) {\n let stride;\n if (layout) {\n stride = getStrideForLayout(layout);\n } else {\n for (let i = 0; i < nesting; ++i) {\n if (coordinates.length === 0) {\n this.layout = 'XY';\n this.stride = 2;\n return;\n }\n coordinates = /** @type {Array<unknown>} */coordinates[0];\n }\n stride = coordinates.length;\n layout = getLayoutForStride(stride);\n }\n this.layout = layout;\n this.stride = stride;\n }\n\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n * Called with a flat array of geometry coordinates.\n * @api\n */\n applyTransform(transformFn) {\n if (this.flatCoordinates) {\n transformFn(this.flatCoordinates, this.flatCoordinates, this.stride);\n this.changed();\n }\n }\n\n /**\n * Rotate the geometry around a given coordinate. This modifies the geometry\n * coordinates in place.\n * @param {number} angle Rotation angle in counter-clockwise radians.\n * @param {import(\"../coordinate.js\").Coordinate} anchor The rotation center.\n * @api\n */\n rotate(angle, anchor) {\n const flatCoordinates = this.getFlatCoordinates();\n if (flatCoordinates) {\n const stride = this.getStride();\n (0,_flat_transform_js__WEBPACK_IMPORTED_MODULE_3__.rotate)(flatCoordinates, 0, flatCoordinates.length, stride, angle, anchor, flatCoordinates);\n this.changed();\n }\n }\n\n /**\n * Scale the geometry (with an optional origin). This modifies the geometry\n * coordinates in place.\n * @param {number} sx The scaling factor in the x-direction.\n * @param {number} [sy] The scaling factor in the y-direction (defaults to sx).\n * @param {import(\"../coordinate.js\").Coordinate} [anchor] The scale origin (defaults to the center\n * of the geometry extent).\n * @api\n */\n scale(sx, sy, anchor) {\n if (sy === undefined) {\n sy = sx;\n }\n if (!anchor) {\n anchor = (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.getCenter)(this.getExtent());\n }\n const flatCoordinates = this.getFlatCoordinates();\n if (flatCoordinates) {\n const stride = this.getStride();\n (0,_flat_transform_js__WEBPACK_IMPORTED_MODULE_3__.scale)(flatCoordinates, 0, flatCoordinates.length, stride, sx, sy, anchor, flatCoordinates);\n this.changed();\n }\n }\n\n /**\n * Translate the geometry. This modifies the geometry coordinates in place. If\n * instead you want a new geometry, first `clone()` this geometry.\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @api\n */\n translate(deltaX, deltaY) {\n const flatCoordinates = this.getFlatCoordinates();\n if (flatCoordinates) {\n const stride = this.getStride();\n (0,_flat_transform_js__WEBPACK_IMPORTED_MODULE_3__.translate)(flatCoordinates, 0, flatCoordinates.length, stride, deltaX, deltaY, flatCoordinates);\n this.changed();\n }\n }\n}\n\n/**\n * @param {number} stride Stride.\n * @return {import(\"./Geometry.js\").GeometryLayout} layout Layout.\n */\nfunction getLayoutForStride(stride) {\n let layout;\n if (stride == 2) {\n layout = 'XY';\n } else if (stride == 3) {\n layout = 'XYZ';\n } else if (stride == 4) {\n layout = 'XYZM';\n }\n return /** @type {import(\"./Geometry.js\").GeometryLayout} */layout;\n}\n\n/**\n * @param {import(\"./Geometry.js\").GeometryLayout} layout Layout.\n * @return {number} Stride.\n */\nfunction getStrideForLayout(layout) {\n let stride;\n if (layout == 'XY') {\n stride = 2;\n } else if (layout == 'XYZ' || layout == 'XYM') {\n stride = 3;\n } else if (layout == 'XYZM') {\n stride = 4;\n }\n return /** @type {number} */stride;\n}\n\n/**\n * @param {SimpleGeometry} simpleGeometry Simple geometry.\n * @param {import(\"../transform.js\").Transform} transform Transform.\n * @param {Array<number>} [dest] Destination.\n * @return {Array<number>} Transformed flat coordinates.\n */\nfunction transformGeom2D(simpleGeometry, transform, dest) {\n const flatCoordinates = simpleGeometry.getFlatCoordinates();\n if (!flatCoordinates) {\n return null;\n }\n const stride = simpleGeometry.getStride();\n return (0,_flat_transform_js__WEBPACK_IMPORTED_MODULE_3__.transform2D)(flatCoordinates, 0, flatCoordinates.length, stride, transform, dest);\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (SimpleGeometry);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/SimpleGeometry.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/area.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/area.js ***!
|
||
\*******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ linearRing: function() { return /* binding */ linearRing; },\n/* harmony export */ linearRings: function() { return /* binding */ linearRings; },\n/* harmony export */ linearRingss: function() { return /* binding */ linearRingss; }\n/* harmony export */ });\n/**\n * @module ol/geom/flat/area\n */\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {number} Area.\n */\nfunction linearRing(flatCoordinates, offset, end, stride) {\n let twiceArea = 0;\n let x1 = flatCoordinates[end - stride];\n let y1 = flatCoordinates[end - stride + 1];\n for (; offset < end; offset += stride) {\n const x2 = flatCoordinates[offset];\n const y2 = flatCoordinates[offset + 1];\n twiceArea += y1 * x2 - x1 * y2;\n x1 = x2;\n y1 = y2;\n }\n return twiceArea / 2;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @return {number} Area.\n */\nfunction linearRings(flatCoordinates, offset, ends, stride) {\n let area = 0;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n area += linearRing(flatCoordinates, offset, end, stride);\n offset = end;\n }\n return area;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @return {number} Area.\n */\nfunction linearRingss(flatCoordinates, offset, endss, stride) {\n let area = 0;\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n area += linearRings(flatCoordinates, offset, ends, stride);\n offset = ends[ends.length - 1];\n }\n return area;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/area.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/center.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/center.js ***!
|
||
\*********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ linearRingss: function() { return /* binding */ linearRingss; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../extent.js */ \"./node_modules/ol/extent.js\");\n\n/**\n * @module ol/geom/flat/center\n */\n\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @return {Array<number>} Flat centers.\n */\nfunction linearRingss(flatCoordinates, offset, endss, stride) {\n const flatCenters = [];\n let extent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.createEmpty)();\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n extent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.createOrUpdateFromFlatCoordinates)(flatCoordinates, offset, ends[0], stride);\n flatCenters.push((extent[0] + extent[2]) / 2, (extent[1] + extent[3]) / 2);\n offset = ends[ends.length - 1];\n }\n return flatCenters;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/center.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/closest.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/closest.js ***!
|
||
\**********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ arrayMaxSquaredDelta: function() { return /* binding */ arrayMaxSquaredDelta; },\n/* harmony export */ assignClosestArrayPoint: function() { return /* binding */ assignClosestArrayPoint; },\n/* harmony export */ assignClosestMultiArrayPoint: function() { return /* binding */ assignClosestMultiArrayPoint; },\n/* harmony export */ assignClosestPoint: function() { return /* binding */ assignClosestPoint; },\n/* harmony export */ maxSquaredDelta: function() { return /* binding */ maxSquaredDelta; },\n/* harmony export */ multiArrayMaxSquaredDelta: function() { return /* binding */ multiArrayMaxSquaredDelta; }\n/* harmony export */ });\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../math.js */ \"./node_modules/ol/math.js\");\n/**\n * @module ol/geom/flat/closest\n */\n\n\n/**\n * Returns the point on the 2D line segment flatCoordinates[offset1] to\n * flatCoordinates[offset2] that is closest to the point (x, y). Extra\n * dimensions are linearly interpolated.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset1 Offset 1.\n * @param {number} offset2 Offset 2.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array<number>} closestPoint Closest point.\n */\nfunction assignClosest(flatCoordinates, offset1, offset2, stride, x, y, closestPoint) {\n const x1 = flatCoordinates[offset1];\n const y1 = flatCoordinates[offset1 + 1];\n const dx = flatCoordinates[offset2] - x1;\n const dy = flatCoordinates[offset2 + 1] - y1;\n let offset;\n if (dx === 0 && dy === 0) {\n offset = offset1;\n } else {\n const t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy);\n if (t > 1) {\n offset = offset2;\n } else if (t > 0) {\n for (let i = 0; i < stride; ++i) {\n closestPoint[i] = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.lerp)(flatCoordinates[offset1 + i], flatCoordinates[offset2 + i], t);\n }\n closestPoint.length = stride;\n return;\n } else {\n offset = offset1;\n }\n }\n for (let i = 0; i < stride; ++i) {\n closestPoint[i] = flatCoordinates[offset + i];\n }\n closestPoint.length = stride;\n}\n\n/**\n * Return the squared of the largest distance between any pair of consecutive\n * coordinates.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} max Max squared delta.\n * @return {number} Max squared delta.\n */\nfunction maxSquaredDelta(flatCoordinates, offset, end, stride, max) {\n let x1 = flatCoordinates[offset];\n let y1 = flatCoordinates[offset + 1];\n for (offset += stride; offset < end; offset += stride) {\n const x2 = flatCoordinates[offset];\n const y2 = flatCoordinates[offset + 1];\n const squaredDelta = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.squaredDistance)(x1, y1, x2, y2);\n if (squaredDelta > max) {\n max = squaredDelta;\n }\n x1 = x2;\n y1 = y2;\n }\n return max;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {number} max Max squared delta.\n * @return {number} Max squared delta.\n */\nfunction arrayMaxSquaredDelta(flatCoordinates, offset, ends, stride, max) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n max = maxSquaredDelta(flatCoordinates, offset, end, stride, max);\n offset = end;\n }\n return max;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} max Max squared delta.\n * @return {number} Max squared delta.\n */\nfunction multiArrayMaxSquaredDelta(flatCoordinates, offset, endss, stride, max) {\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n max = arrayMaxSquaredDelta(flatCoordinates, offset, ends, stride, max);\n offset = ends[ends.length - 1];\n }\n return max;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} maxDelta Max delta.\n * @param {boolean} isRing Is ring.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array<number>} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @param {Array<number>} [tmpPoint] Temporary point object.\n * @return {number} Minimum squared distance.\n */\nfunction assignClosestPoint(flatCoordinates, offset, end, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, tmpPoint) {\n if (offset == end) {\n return minSquaredDistance;\n }\n let i, squaredDistance;\n if (maxDelta === 0) {\n // All points are identical, so just test the first point.\n squaredDistance = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.squaredDistance)(x, y, flatCoordinates[offset], flatCoordinates[offset + 1]);\n if (squaredDistance < minSquaredDistance) {\n for (i = 0; i < stride; ++i) {\n closestPoint[i] = flatCoordinates[offset + i];\n }\n closestPoint.length = stride;\n return squaredDistance;\n }\n return minSquaredDistance;\n }\n tmpPoint = tmpPoint ? tmpPoint : [NaN, NaN];\n let index = offset + stride;\n while (index < end) {\n assignClosest(flatCoordinates, index - stride, index, stride, x, y, tmpPoint);\n squaredDistance = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.squaredDistance)(x, y, tmpPoint[0], tmpPoint[1]);\n if (squaredDistance < minSquaredDistance) {\n minSquaredDistance = squaredDistance;\n for (i = 0; i < stride; ++i) {\n closestPoint[i] = tmpPoint[i];\n }\n closestPoint.length = stride;\n index += stride;\n } else {\n // Skip ahead multiple points, because we know that all the skipped\n // points cannot be any closer than the closest point we have found so\n // far. We know this because we know how close the current point is, how\n // close the closest point we have found so far is, and the maximum\n // distance between consecutive points. For example, if we're currently\n // at distance 10, the best we've found so far is 3, and that the maximum\n // distance between consecutive points is 2, then we'll need to skip at\n // least (10 - 3) / 2 == 3 (rounded down) points to have any chance of\n // finding a closer point. We use Math.max(..., 1) to ensure that we\n // always advance at least one point, to avoid an infinite loop.\n index += stride * Math.max((Math.sqrt(squaredDistance) - Math.sqrt(minSquaredDistance)) / maxDelta | 0, 1);\n }\n }\n if (isRing) {\n // Check the closing segment.\n assignClosest(flatCoordinates, end - stride, offset, stride, x, y, tmpPoint);\n squaredDistance = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.squaredDistance)(x, y, tmpPoint[0], tmpPoint[1]);\n if (squaredDistance < minSquaredDistance) {\n minSquaredDistance = squaredDistance;\n for (i = 0; i < stride; ++i) {\n closestPoint[i] = tmpPoint[i];\n }\n closestPoint.length = stride;\n }\n }\n return minSquaredDistance;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {number} maxDelta Max delta.\n * @param {boolean} isRing Is ring.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array<number>} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @param {Array<number>} [tmpPoint] Temporary point object.\n * @return {number} Minimum squared distance.\n */\nfunction assignClosestArrayPoint(flatCoordinates, offset, ends, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, tmpPoint) {\n tmpPoint = tmpPoint ? tmpPoint : [NaN, NaN];\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n minSquaredDistance = assignClosestPoint(flatCoordinates, offset, end, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, tmpPoint);\n offset = end;\n }\n return minSquaredDistance;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} maxDelta Max delta.\n * @param {boolean} isRing Is ring.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {Array<number>} closestPoint Closest point.\n * @param {number} minSquaredDistance Minimum squared distance.\n * @param {Array<number>} [tmpPoint] Temporary point object.\n * @return {number} Minimum squared distance.\n */\nfunction assignClosestMultiArrayPoint(flatCoordinates, offset, endss, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, tmpPoint) {\n tmpPoint = tmpPoint ? tmpPoint : [NaN, NaN];\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n minSquaredDistance = assignClosestArrayPoint(flatCoordinates, offset, ends, stride, maxDelta, isRing, x, y, closestPoint, minSquaredDistance, tmpPoint);\n offset = ends[ends.length - 1];\n }\n return minSquaredDistance;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/closest.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/contains.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/contains.js ***!
|
||
\***********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ linearRingContainsExtent: function() { return /* binding */ linearRingContainsExtent; },\n/* harmony export */ linearRingContainsXY: function() { return /* binding */ linearRingContainsXY; },\n/* harmony export */ linearRingsContainsXY: function() { return /* binding */ linearRingsContainsXY; },\n/* harmony export */ linearRingssContainsXY: function() { return /* binding */ linearRingssContainsXY; }\n/* harmony export */ });\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../extent.js */ \"./node_modules/ol/extent.js\");\n/**\n * @module ol/geom/flat/contains\n */\n\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} Contains extent.\n */\nfunction linearRingContainsExtent(flatCoordinates, offset, end, stride, extent) {\n const outside = (0,_extent_js__WEBPACK_IMPORTED_MODULE_0__.forEachCorner)(extent,\n /**\n * @param {import(\"../../coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {boolean} Contains (x, y).\n */\n function (coordinate) {\n return !linearRingContainsXY(flatCoordinates, offset, end, stride, coordinate[0], coordinate[1]);\n });\n return !outside;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\nfunction linearRingContainsXY(flatCoordinates, offset, end, stride, x, y) {\n // https://geomalgorithms.com/a03-_inclusion.html\n // Copyright 2000 softSurfer, 2012 Dan Sunday\n // This code may be freely used and modified for any purpose\n // providing that this copyright notice is included with it.\n // SoftSurfer makes no warranty for this code, and cannot be held\n // liable for any real or imagined damage resulting from its use.\n // Users of this code must verify correctness for their application.\n let wn = 0;\n let x1 = flatCoordinates[end - stride];\n let y1 = flatCoordinates[end - stride + 1];\n for (; offset < end; offset += stride) {\n const x2 = flatCoordinates[offset];\n const y2 = flatCoordinates[offset + 1];\n if (y1 <= y) {\n if (y2 > y && (x2 - x1) * (y - y1) - (x - x1) * (y2 - y1) > 0) {\n wn++;\n }\n } else if (y2 <= y && (x2 - x1) * (y - y1) - (x - x1) * (y2 - y1) < 0) {\n wn--;\n }\n x1 = x2;\n y1 = y2;\n }\n return wn !== 0;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\nfunction linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y) {\n if (ends.length === 0) {\n return false;\n }\n if (!linearRingContainsXY(flatCoordinates, offset, ends[0], stride, x, y)) {\n return false;\n }\n for (let i = 1, ii = ends.length; i < ii; ++i) {\n if (linearRingContainsXY(flatCoordinates, ends[i - 1], ends[i], stride, x, y)) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} x X.\n * @param {number} y Y.\n * @return {boolean} Contains (x, y).\n */\nfunction linearRingssContainsXY(flatCoordinates, offset, endss, stride, x, y) {\n if (endss.length === 0) {\n return false;\n }\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n if (linearRingsContainsXY(flatCoordinates, offset, ends, stride, x, y)) {\n return true;\n }\n offset = ends[ends.length - 1];\n }\n return false;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/contains.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/deflate.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/deflate.js ***!
|
||
\**********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ deflateCoordinate: function() { return /* binding */ deflateCoordinate; },\n/* harmony export */ deflateCoordinates: function() { return /* binding */ deflateCoordinates; },\n/* harmony export */ deflateCoordinatesArray: function() { return /* binding */ deflateCoordinatesArray; },\n/* harmony export */ deflateMultiCoordinatesArray: function() { return /* binding */ deflateMultiCoordinatesArray; }\n/* harmony export */ });\n/**\n * @module ol/geom/flat/deflate\n */\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {import(\"../../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {number} stride Stride.\n * @return {number} offset Offset.\n */\nfunction deflateCoordinate(flatCoordinates, offset, coordinate, stride) {\n for (let i = 0, ii = coordinate.length; i < ii; ++i) {\n flatCoordinates[offset++] = coordinate[i];\n }\n return offset;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<import(\"../../coordinate.js\").Coordinate>} coordinates Coordinates.\n * @param {number} stride Stride.\n * @return {number} offset Offset.\n */\nfunction deflateCoordinates(flatCoordinates, offset, coordinates, stride) {\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\n const coordinate = coordinates[i];\n for (let j = 0; j < stride; ++j) {\n flatCoordinates[offset++] = coordinate[j];\n }\n }\n return offset;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<import(\"../../coordinate.js\").Coordinate>>} coordinatess Coordinatess.\n * @param {number} stride Stride.\n * @param {Array<number>} [ends] Ends.\n * @return {Array<number>} Ends.\n */\nfunction deflateCoordinatesArray(flatCoordinates, offset, coordinatess, stride, ends) {\n ends = ends ? ends : [];\n let i = 0;\n for (let j = 0, jj = coordinatess.length; j < jj; ++j) {\n const end = deflateCoordinates(flatCoordinates, offset, coordinatess[j], stride);\n ends[i++] = end;\n offset = end;\n }\n ends.length = i;\n return ends;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<Array<import(\"../../coordinate.js\").Coordinate>>>} coordinatesss Coordinatesss.\n * @param {number} stride Stride.\n * @param {Array<Array<number>>} [endss] Endss.\n * @return {Array<Array<number>>} Endss.\n */\nfunction deflateMultiCoordinatesArray(flatCoordinates, offset, coordinatesss, stride, endss) {\n endss = endss ? endss : [];\n let i = 0;\n for (let j = 0, jj = coordinatesss.length; j < jj; ++j) {\n const ends = deflateCoordinatesArray(flatCoordinates, offset, coordinatesss[j], stride, endss[i]);\n if (ends.length === 0) {\n ends[0] = offset;\n }\n endss[i++] = ends;\n offset = ends[ends.length - 1];\n }\n endss.length = i;\n return endss;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/deflate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/inflate.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/inflate.js ***!
|
||
\**********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ inflateCoordinates: function() { return /* binding */ inflateCoordinates; },\n/* harmony export */ inflateCoordinatesArray: function() { return /* binding */ inflateCoordinatesArray; },\n/* harmony export */ inflateMultiCoordinatesArray: function() { return /* binding */ inflateMultiCoordinatesArray; }\n/* harmony export */ });\n/**\n * @module ol/geom/flat/inflate\n */\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {Array<import(\"../../coordinate.js\").Coordinate>} [coordinates] Coordinates.\n * @return {Array<import(\"../../coordinate.js\").Coordinate>} Coordinates.\n */\nfunction inflateCoordinates(flatCoordinates, offset, end, stride, coordinates) {\n coordinates = coordinates !== undefined ? coordinates : [];\n let i = 0;\n for (let j = offset; j < end; j += stride) {\n coordinates[i++] = flatCoordinates.slice(j, j + stride);\n }\n coordinates.length = i;\n return coordinates;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {Array<Array<import(\"../../coordinate.js\").Coordinate>>} [coordinatess] Coordinatess.\n * @return {Array<Array<import(\"../../coordinate.js\").Coordinate>>} Coordinatess.\n */\nfunction inflateCoordinatesArray(flatCoordinates, offset, ends, stride, coordinatess) {\n coordinatess = coordinatess !== undefined ? coordinatess : [];\n let i = 0;\n for (let j = 0, jj = ends.length; j < jj; ++j) {\n const end = ends[j];\n coordinatess[i++] = inflateCoordinates(flatCoordinates, offset, end, stride, coordinatess[i]);\n offset = end;\n }\n coordinatess.length = i;\n return coordinatess;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {Array<Array<Array<import(\"../../coordinate.js\").Coordinate>>>} [coordinatesss]\n * Coordinatesss.\n * @return {Array<Array<Array<import(\"../../coordinate.js\").Coordinate>>>} Coordinatesss.\n */\nfunction inflateMultiCoordinatesArray(flatCoordinates, offset, endss, stride, coordinatesss) {\n coordinatesss = coordinatesss !== undefined ? coordinatesss : [];\n let i = 0;\n for (let j = 0, jj = endss.length; j < jj; ++j) {\n const ends = endss[j];\n coordinatesss[i++] = ends.length === 1 && ends[0] === offset ? [] : inflateCoordinatesArray(flatCoordinates, offset, ends, stride, coordinatesss[i]);\n offset = ends[ends.length - 1];\n }\n coordinatesss.length = i;\n return coordinatesss;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/inflate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/interiorpoint.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/interiorpoint.js ***!
|
||
\****************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getInteriorPointOfArray: function() { return /* binding */ getInteriorPointOfArray; },\n/* harmony export */ getInteriorPointsOfMultiArray: function() { return /* binding */ getInteriorPointsOfMultiArray; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./contains.js */ \"./node_modules/ol/geom/flat/contains.js\");\n\n/**\n * @module ol/geom/flat/interiorpoint\n */\n\n\n\n/**\n * Calculates a point that is likely to lie in the interior of the linear rings.\n * Inspired by JTS's com.vividsolutions.jts.geom.Geometry#getInteriorPoint.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {Array<number>} flatCenters Flat centers.\n * @param {number} flatCentersOffset Flat center offset.\n * @param {Array<number>} [dest] Destination.\n * @return {Array<number>} Destination point as XYM coordinate, where M is the\n * length of the horizontal intersection that the point belongs to.\n */\nfunction getInteriorPointOfArray(flatCoordinates, offset, ends, stride, flatCenters, flatCentersOffset, dest) {\n let i, ii, x, x1, x2, y1, y2;\n const y = flatCenters[flatCentersOffset + 1];\n /** @type {Array<number>} */\n const intersections = [];\n // Calculate intersections with the horizontal line\n for (let r = 0, rr = ends.length; r < rr; ++r) {\n const end = ends[r];\n x1 = flatCoordinates[end - stride];\n y1 = flatCoordinates[end - stride + 1];\n for (i = offset; i < end; i += stride) {\n x2 = flatCoordinates[i];\n y2 = flatCoordinates[i + 1];\n if (y <= y1 && y2 <= y || y1 <= y && y <= y2) {\n x = (y - y1) / (y2 - y1) * (x2 - x1) + x1;\n intersections.push(x);\n }\n x1 = x2;\n y1 = y2;\n }\n }\n // Find the longest segment of the horizontal line that has its center point\n // inside the linear ring.\n let pointX = NaN;\n let maxSegmentLength = -Infinity;\n intersections.sort(_array_js__WEBPACK_IMPORTED_MODULE_1__.ascending);\n x1 = intersections[0];\n for (i = 1, ii = intersections.length; i < ii; ++i) {\n x2 = intersections[i];\n const segmentLength = Math.abs(x2 - x1);\n if (segmentLength > maxSegmentLength) {\n x = (x1 + x2) / 2;\n if ((0,_contains_js__WEBPACK_IMPORTED_MODULE_2__.linearRingsContainsXY)(flatCoordinates, offset, ends, stride, x, y)) {\n pointX = x;\n maxSegmentLength = segmentLength;\n }\n }\n x1 = x2;\n }\n if (isNaN(pointX)) {\n // There is no horizontal line that has its center point inside the linear\n // ring. Use the center of the the linear ring's extent.\n pointX = flatCenters[flatCentersOffset];\n }\n if (dest) {\n dest.push(pointX, y, maxSegmentLength);\n return dest;\n }\n return [pointX, y, maxSegmentLength];\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {Array<number>} flatCenters Flat centers.\n * @return {Array<number>} Interior points as XYM coordinates, where M is the\n * length of the horizontal intersection that the point belongs to.\n */\nfunction getInteriorPointsOfMultiArray(flatCoordinates, offset, endss, stride, flatCenters) {\n /** @type {Array<number>} */\n let interiorPoints = [];\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n interiorPoints = getInteriorPointOfArray(flatCoordinates, offset, ends, stride, flatCenters, 2 * i, interiorPoints);\n offset = ends[ends.length - 1];\n }\n return interiorPoints;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/interiorpoint.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/interpolate.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/interpolate.js ***!
|
||
\**************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ interpolatePoint: function() { return /* binding */ interpolatePoint; },\n/* harmony export */ lineStringCoordinateAtM: function() { return /* binding */ lineStringCoordinateAtM; },\n/* harmony export */ lineStringsCoordinateAtM: function() { return /* binding */ lineStringsCoordinateAtM; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../math.js */ \"./node_modules/ol/math.js\");\n\n/**\n * @module ol/geom/flat/interpolate\n */\n\n\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} fraction Fraction.\n * @param {Array<number>} [dest] Destination.\n * @param {number} [dimension] Destination dimension (default is `2`)\n * @return {Array<number>} Destination.\n */\nfunction interpolatePoint(flatCoordinates, offset, end, stride, fraction, dest, dimension) {\n let o, t;\n const n = (end - offset) / stride;\n if (n === 1) {\n o = offset;\n } else if (n === 2) {\n o = offset;\n t = fraction;\n } else if (n !== 0) {\n let x1 = flatCoordinates[offset];\n let y1 = flatCoordinates[offset + 1];\n let length = 0;\n const cumulativeLengths = [0];\n for (let i = offset + stride; i < end; i += stride) {\n const x2 = flatCoordinates[i];\n const y2 = flatCoordinates[i + 1];\n length += Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n cumulativeLengths.push(length);\n x1 = x2;\n y1 = y2;\n }\n const target = fraction * length;\n const index = (0,_array_js__WEBPACK_IMPORTED_MODULE_1__.binarySearch)(cumulativeLengths, target);\n if (index < 0) {\n t = (target - cumulativeLengths[-index - 2]) / (cumulativeLengths[-index - 1] - cumulativeLengths[-index - 2]);\n o = offset + (-index - 2) * stride;\n } else {\n o = offset + index * stride;\n }\n }\n dimension = dimension > 1 ? dimension : 2;\n dest = dest ? dest : new Array(dimension);\n for (let i = 0; i < dimension; ++i) {\n dest[i] = o === undefined ? NaN : t === undefined ? flatCoordinates[o + i] : (0,_math_js__WEBPACK_IMPORTED_MODULE_2__.lerp)(flatCoordinates[o + i], flatCoordinates[o + stride + i], t);\n }\n return dest;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} m M.\n * @param {boolean} extrapolate Extrapolate.\n * @return {import(\"../../coordinate.js\").Coordinate|null} Coordinate.\n */\nfunction lineStringCoordinateAtM(flatCoordinates, offset, end, stride, m, extrapolate) {\n if (end == offset) {\n return null;\n }\n let coordinate;\n if (m < flatCoordinates[offset + stride - 1]) {\n if (extrapolate) {\n coordinate = flatCoordinates.slice(offset, offset + stride);\n coordinate[stride - 1] = m;\n return coordinate;\n }\n return null;\n }\n if (flatCoordinates[end - 1] < m) {\n if (extrapolate) {\n coordinate = flatCoordinates.slice(end - stride, end);\n coordinate[stride - 1] = m;\n return coordinate;\n }\n return null;\n }\n // FIXME use O(1) search\n if (m == flatCoordinates[offset + stride - 1]) {\n return flatCoordinates.slice(offset, offset + stride);\n }\n let lo = offset / stride;\n let hi = end / stride;\n while (lo < hi) {\n const mid = lo + hi >> 1;\n if (m < flatCoordinates[(mid + 1) * stride - 1]) {\n hi = mid;\n } else {\n lo = mid + 1;\n }\n }\n const m0 = flatCoordinates[lo * stride - 1];\n if (m == m0) {\n return flatCoordinates.slice((lo - 1) * stride, (lo - 1) * stride + stride);\n }\n const m1 = flatCoordinates[(lo + 1) * stride - 1];\n const t = (m - m0) / (m1 - m0);\n coordinate = [];\n for (let i = 0; i < stride - 1; ++i) {\n coordinate.push((0,_math_js__WEBPACK_IMPORTED_MODULE_2__.lerp)(flatCoordinates[(lo - 1) * stride + i], flatCoordinates[lo * stride + i], t));\n }\n coordinate.push(m);\n return coordinate;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {number} m M.\n * @param {boolean} extrapolate Extrapolate.\n * @param {boolean} interpolate Interpolate.\n * @return {import(\"../../coordinate.js\").Coordinate|null} Coordinate.\n */\nfunction lineStringsCoordinateAtM(flatCoordinates, offset, ends, stride, m, extrapolate, interpolate) {\n if (interpolate) {\n return lineStringCoordinateAtM(flatCoordinates, offset, ends[ends.length - 1], stride, m, extrapolate);\n }\n let coordinate;\n if (m < flatCoordinates[stride - 1]) {\n if (extrapolate) {\n coordinate = flatCoordinates.slice(0, stride);\n coordinate[stride - 1] = m;\n return coordinate;\n }\n return null;\n }\n if (flatCoordinates[flatCoordinates.length - 1] < m) {\n if (extrapolate) {\n coordinate = flatCoordinates.slice(flatCoordinates.length - stride);\n coordinate[stride - 1] = m;\n return coordinate;\n }\n return null;\n }\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n if (offset == end) {\n continue;\n }\n if (m < flatCoordinates[offset + stride - 1]) {\n return null;\n }\n if (m <= flatCoordinates[end - 1]) {\n return lineStringCoordinateAtM(flatCoordinates, offset, end, stride, m, false);\n }\n offset = end;\n }\n return null;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/interpolate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/intersectsextent.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/intersectsextent.js ***!
|
||
\*******************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ intersectsLineString: function() { return /* binding */ intersectsLineString; },\n/* harmony export */ intersectsLineStringArray: function() { return /* binding */ intersectsLineStringArray; },\n/* harmony export */ intersectsLinearRing: function() { return /* binding */ intersectsLinearRing; },\n/* harmony export */ intersectsLinearRingArray: function() { return /* binding */ intersectsLinearRingArray; },\n/* harmony export */ intersectsLinearRingMultiArray: function() { return /* binding */ intersectsLinearRingMultiArray; }\n/* harmony export */ });\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _segments_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./segments.js */ \"./node_modules/ol/geom/flat/segments.js\");\n/* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./contains.js */ \"./node_modules/ol/geom/flat/contains.js\");\n/**\n * @module ol/geom/flat/intersectsextent\n */\n\n\n\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nfunction intersectsLineString(flatCoordinates, offset, end, stride, extent) {\n const coordinatesExtent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_0__.extendFlatCoordinates)((0,_extent_js__WEBPACK_IMPORTED_MODULE_0__.createEmpty)(), flatCoordinates, offset, end, stride);\n if (!(0,_extent_js__WEBPACK_IMPORTED_MODULE_0__.intersects)(extent, coordinatesExtent)) {\n return false;\n }\n if ((0,_extent_js__WEBPACK_IMPORTED_MODULE_0__.containsExtent)(extent, coordinatesExtent)) {\n return true;\n }\n if (coordinatesExtent[0] >= extent[0] && coordinatesExtent[2] <= extent[2]) {\n return true;\n }\n if (coordinatesExtent[1] >= extent[1] && coordinatesExtent[3] <= extent[3]) {\n return true;\n }\n return (0,_segments_js__WEBPACK_IMPORTED_MODULE_1__.forEach)(flatCoordinates, offset, end, stride,\n /**\n * @param {import(\"../../coordinate.js\").Coordinate} point1 Start point.\n * @param {import(\"../../coordinate.js\").Coordinate} point2 End point.\n * @return {boolean} `true` if the segment and the extent intersect,\n * `false` otherwise.\n */\n function (point1, point2) {\n return (0,_extent_js__WEBPACK_IMPORTED_MODULE_0__.intersectsSegment)(extent, point1, point2);\n });\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nfunction intersectsLineStringArray(flatCoordinates, offset, ends, stride, extent) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n if (intersectsLineString(flatCoordinates, offset, ends[i], stride, extent)) {\n return true;\n }\n offset = ends[i];\n }\n return false;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nfunction intersectsLinearRing(flatCoordinates, offset, end, stride, extent) {\n if (intersectsLineString(flatCoordinates, offset, end, stride, extent)) {\n return true;\n }\n if ((0,_contains_js__WEBPACK_IMPORTED_MODULE_2__.linearRingContainsXY)(flatCoordinates, offset, end, stride, extent[0], extent[1])) {\n return true;\n }\n if ((0,_contains_js__WEBPACK_IMPORTED_MODULE_2__.linearRingContainsXY)(flatCoordinates, offset, end, stride, extent[0], extent[3])) {\n return true;\n }\n if ((0,_contains_js__WEBPACK_IMPORTED_MODULE_2__.linearRingContainsXY)(flatCoordinates, offset, end, stride, extent[2], extent[1])) {\n return true;\n }\n if ((0,_contains_js__WEBPACK_IMPORTED_MODULE_2__.linearRingContainsXY)(flatCoordinates, offset, end, stride, extent[2], extent[3])) {\n return true;\n }\n return false;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nfunction intersectsLinearRingArray(flatCoordinates, offset, ends, stride, extent) {\n if (!intersectsLinearRing(flatCoordinates, offset, ends[0], stride, extent)) {\n return false;\n }\n if (ends.length === 1) {\n return true;\n }\n for (let i = 1, ii = ends.length; i < ii; ++i) {\n if ((0,_contains_js__WEBPACK_IMPORTED_MODULE_2__.linearRingContainsExtent)(flatCoordinates, ends[i - 1], ends[i], stride, extent)) {\n if (!intersectsLineString(flatCoordinates, ends[i - 1], ends[i], stride, extent)) {\n return false;\n }\n }\n }\n return true;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @return {boolean} True if the geometry and the extent intersect.\n */\nfunction intersectsLinearRingMultiArray(flatCoordinates, offset, endss, stride, extent) {\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n if (intersectsLinearRingArray(flatCoordinates, offset, ends, stride, extent)) {\n return true;\n }\n offset = ends[ends.length - 1];\n }\n return false;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/intersectsextent.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/length.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/length.js ***!
|
||
\*********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ lineStringLength: function() { return /* binding */ lineStringLength; },\n/* harmony export */ linearRingLength: function() { return /* binding */ linearRingLength; }\n/* harmony export */ });\n/**\n * @module ol/geom/flat/length\n */\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {number} Length.\n */\nfunction lineStringLength(flatCoordinates, offset, end, stride) {\n let x1 = flatCoordinates[offset];\n let y1 = flatCoordinates[offset + 1];\n let length = 0;\n for (let i = offset + stride; i < end; i += stride) {\n const x2 = flatCoordinates[i];\n const y2 = flatCoordinates[i + 1];\n length += Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n x1 = x2;\n y1 = y2;\n }\n return length;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {number} Perimeter.\n */\nfunction linearRingLength(flatCoordinates, offset, end, stride) {\n let perimeter = lineStringLength(flatCoordinates, offset, end, stride);\n const dx = flatCoordinates[end - stride] - flatCoordinates[offset];\n const dy = flatCoordinates[end - stride + 1] - flatCoordinates[offset + 1];\n perimeter += Math.sqrt(dx * dx + dy * dy);\n return perimeter;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/length.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/linechunk.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/linechunk.js ***!
|
||
\************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ lineChunk: function() { return /* binding */ lineChunk; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../math.js */ \"./node_modules/ol/math.js\");\n\n\n\n/**\n * Creates chunks of equal length from a linestring\n * @param {number} chunkLength Length of each chunk.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Start offset of the `flatCoordinates`.\n * @param {number} end End offset of the `flatCoordinates`.\n * @param {number} stride Stride.\n * @return {Array<Array<number>>} Chunks of linestrings with stride 2.\n */\nfunction lineChunk(chunkLength, flatCoordinates, offset, end, stride) {\n const chunks = [];\n let cursor = offset;\n let chunkM = 0;\n let currentChunk = flatCoordinates.slice(offset, 2);\n while (chunkM < chunkLength && cursor + stride < end) {\n const [x1, y1] = currentChunk.slice(-2);\n const x2 = flatCoordinates[cursor + stride];\n const y2 = flatCoordinates[cursor + stride + 1];\n const segmentLength = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n chunkM += segmentLength;\n if (chunkM >= chunkLength) {\n const m = (chunkLength - chunkM + segmentLength) / segmentLength;\n const x = (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.lerp)(x1, x2, m);\n const y = (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.lerp)(y1, y2, m);\n currentChunk.push(x, y);\n chunks.push(currentChunk);\n currentChunk = [x, y];\n if (chunkM == chunkLength) {\n cursor += stride;\n }\n chunkM = 0;\n } else if (chunkM < chunkLength) {\n currentChunk.push(flatCoordinates[cursor + stride], flatCoordinates[cursor + stride + 1]);\n cursor += stride;\n } else {\n const missing = segmentLength - chunkM;\n const x = (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.lerp)(x1, x2, missing / segmentLength);\n const y = (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.lerp)(y1, y2, missing / segmentLength);\n currentChunk.push(x, y);\n chunks.push(currentChunk);\n currentChunk = [x, y];\n chunkM = 0;\n cursor += stride;\n }\n }\n if (chunkM > 0) {\n chunks.push(currentChunk);\n }\n return chunks;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/linechunk.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/orient.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/orient.js ***!
|
||
\*********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ inflateEnds: function() { return /* binding */ inflateEnds; },\n/* harmony export */ linearRingIsClockwise: function() { return /* binding */ linearRingIsClockwise; },\n/* harmony export */ linearRingsAreOriented: function() { return /* binding */ linearRingsAreOriented; },\n/* harmony export */ linearRingssAreOriented: function() { return /* binding */ linearRingssAreOriented; },\n/* harmony export */ orientLinearRings: function() { return /* binding */ orientLinearRings; },\n/* harmony export */ orientLinearRingsArray: function() { return /* binding */ orientLinearRingsArray; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _reverse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reverse.js */ \"./node_modules/ol/geom/flat/reverse.js\");\n\n/**\n * @module ol/geom/flat/orient\n */\n\n\n/**\n * Is the linear ring oriented clockwise in a coordinate system with a bottom-left\n * coordinate origin? For a coordinate system with a top-left coordinate origin,\n * the ring's orientation is clockwise when this function returns false.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {boolean|undefined} Is clockwise.\n */\nfunction linearRingIsClockwise(flatCoordinates, offset, end, stride) {\n // https://stackoverflow.com/q/1165647/clockwise-method#1165943\n // https://github.com/OSGeo/gdal/blob/master/gdal/ogr/ogrlinearring.cpp\n let edge = 0;\n let x1 = flatCoordinates[end - stride];\n let y1 = flatCoordinates[end - stride + 1];\n for (; offset < end; offset += stride) {\n const x2 = flatCoordinates[offset];\n const y2 = flatCoordinates[offset + 1];\n edge += (x2 - x1) * (y2 + y1);\n x1 = x2;\n y1 = y2;\n }\n return edge === 0 ? undefined : edge > 0;\n}\n\n/**\n * Determines if linear rings are oriented. By default, left-hand orientation\n * is tested (first ring must be clockwise, remaining rings counter-clockwise).\n * To test for right-hand orientation, use the `right` argument.\n *\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Array of end indexes.\n * @param {number} stride Stride.\n * @param {boolean} [right] Test for right-hand orientation\n * (counter-clockwise exterior ring and clockwise interior rings).\n * @return {boolean} Rings are correctly oriented.\n */\nfunction linearRingsAreOriented(flatCoordinates, offset, ends, stride, right) {\n right = right !== undefined ? right : false;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const isClockwise = linearRingIsClockwise(flatCoordinates, offset, end, stride);\n if (i === 0) {\n if (right && isClockwise || !right && !isClockwise) {\n return false;\n }\n } else {\n if (right && !isClockwise || !right && isClockwise) {\n return false;\n }\n }\n offset = end;\n }\n return true;\n}\n\n/**\n * Determines if linear rings are oriented. By default, left-hand orientation\n * is tested (first ring must be clockwise, remaining rings counter-clockwise).\n * To test for right-hand orientation, use the `right` argument.\n *\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Array of array of end indexes.\n * @param {number} stride Stride.\n * @param {boolean} [right] Test for right-hand orientation\n * (counter-clockwise exterior ring and clockwise interior rings).\n * @return {boolean} Rings are correctly oriented.\n */\nfunction linearRingssAreOriented(flatCoordinates, offset, endss, stride, right) {\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n if (!linearRingsAreOriented(flatCoordinates, offset, ends, stride, right)) {\n return false;\n }\n if (ends.length) {\n offset = ends[ends.length - 1];\n }\n }\n return true;\n}\n\n/**\n * Orient coordinates in a flat array of linear rings. By default, rings\n * are oriented following the left-hand rule (clockwise for exterior and\n * counter-clockwise for interior rings). To orient according to the\n * right-hand rule, use the `right` argument.\n *\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {boolean} [right] Follow the right-hand rule for orientation.\n * @return {number} End.\n */\nfunction orientLinearRings(flatCoordinates, offset, ends, stride, right) {\n right = right !== undefined ? right : false;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const isClockwise = linearRingIsClockwise(flatCoordinates, offset, end, stride);\n const reverse = i === 0 ? right && isClockwise || !right && !isClockwise : right && !isClockwise || !right && isClockwise;\n if (reverse) {\n (0,_reverse_js__WEBPACK_IMPORTED_MODULE_1__.coordinates)(flatCoordinates, offset, end, stride);\n }\n offset = end;\n }\n return offset;\n}\n\n/**\n * Orient coordinates in a flat array of linear rings. By default, rings\n * are oriented following the left-hand rule (clockwise for exterior and\n * counter-clockwise for interior rings). To orient according to the\n * right-hand rule, use the `right` argument.\n *\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Array of array of end indexes.\n * @param {number} stride Stride.\n * @param {boolean} [right] Follow the right-hand rule for orientation.\n * @return {number} End.\n */\nfunction orientLinearRingsArray(flatCoordinates, offset, endss, stride, right) {\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n offset = orientLinearRings(flatCoordinates, offset, endss[i], stride, right);\n }\n return offset;\n}\n\n/**\n * Return a two-dimensional endss\n * @param {Array<number>} flatCoordinates Flat coordinates\n * @param {Array<number>} ends Linear ring end indexes\n * @return {Array<Array<number>>} Two dimensional endss array that can\n * be used to construct a MultiPolygon\n */\nfunction inflateEnds(flatCoordinates, ends) {\n const endss = [];\n let offset = 0;\n let prevEndIndex = 0;\n let startOrientation;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n // classifies an array of rings into polygons with outer rings and holes\n const orientation = linearRingIsClockwise(flatCoordinates, offset, end, 2);\n if (startOrientation === undefined) {\n startOrientation = orientation;\n }\n if (orientation === startOrientation) {\n endss.push(ends.slice(prevEndIndex, i + 1));\n } else {\n if (endss.length === 0) {\n continue;\n }\n endss[endss.length - 1].push(ends[prevEndIndex]);\n }\n prevEndIndex = i + 1;\n offset = end;\n }\n return endss;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/orient.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/reverse.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/reverse.js ***!
|
||
\**********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ coordinates: function() { return /* binding */ coordinates; }\n/* harmony export */ });\n/**\n * @module ol/geom/flat/reverse\n */\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n */\nfunction coordinates(flatCoordinates, offset, end, stride) {\n while (offset < end - stride) {\n for (let i = 0; i < stride; ++i) {\n const tmp = flatCoordinates[offset + i];\n flatCoordinates[offset + i] = flatCoordinates[end - stride + i];\n flatCoordinates[end - stride + i] = tmp;\n }\n offset += stride;\n end -= stride;\n }\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/reverse.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/segments.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/segments.js ***!
|
||
\***********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ forEach: function() { return /* binding */ forEach; }\n/* harmony export */ });\n/**\n * @module ol/geom/flat/segments\n */\n\n/**\n * This function calls `callback` for each segment of the flat coordinates\n * array. If the callback returns a truthy value the function returns that\n * value immediately. Otherwise the function returns `false`.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {function(import(\"../../coordinate.js\").Coordinate, import(\"../../coordinate.js\").Coordinate): T} callback Function\n * called for each segment.\n * @return {T|boolean} Value.\n * @template T\n */\nfunction forEach(flatCoordinates, offset, end, stride, callback) {\n let ret;\n offset += stride;\n for (; offset < end; offset += stride) {\n ret = callback(flatCoordinates.slice(offset - stride, offset), flatCoordinates.slice(offset, offset + stride));\n if (ret) {\n return ret;\n }\n }\n return false;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/segments.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/simplify.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/simplify.js ***!
|
||
\***********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ douglasPeucker: function() { return /* binding */ douglasPeucker; },\n/* harmony export */ douglasPeuckerArray: function() { return /* binding */ douglasPeuckerArray; },\n/* harmony export */ douglasPeuckerMultiArray: function() { return /* binding */ douglasPeuckerMultiArray; },\n/* harmony export */ quantize: function() { return /* binding */ quantize; },\n/* harmony export */ quantizeArray: function() { return /* binding */ quantizeArray; },\n/* harmony export */ quantizeMultiArray: function() { return /* binding */ quantizeMultiArray; },\n/* harmony export */ radialDistance: function() { return /* binding */ radialDistance; },\n/* harmony export */ simplifyLineString: function() { return /* binding */ simplifyLineString; },\n/* harmony export */ snap: function() { return /* binding */ snap; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../math.js */ \"./node_modules/ol/math.js\");\n\n/**\n * @module ol/geom/flat/simplify\n */\n// Based on simplify-js https://github.com/mourner/simplify-js\n// Copyright (c) 2012, Vladimir Agafonkin\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are met:\n//\n// 1. Redistributions of source code must retain the above copyright notice,\n// this list of conditions and the following disclaimer.\n//\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n// POSSIBILITY OF SUCH DAMAGE.\n\n\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {boolean} highQuality Highest quality.\n * @param {Array<number>} [simplifiedFlatCoordinates] Simplified flat\n * coordinates.\n * @return {Array<number>} Simplified line string.\n */\nfunction simplifyLineString(flatCoordinates, offset, end, stride, squaredTolerance, highQuality, simplifiedFlatCoordinates) {\n simplifiedFlatCoordinates = simplifiedFlatCoordinates !== undefined ? simplifiedFlatCoordinates : [];\n if (!highQuality) {\n end = radialDistance(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, 0);\n flatCoordinates = simplifiedFlatCoordinates;\n offset = 0;\n stride = 2;\n }\n simplifiedFlatCoordinates.length = douglasPeucker(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, 0);\n return simplifiedFlatCoordinates;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @return {number} Simplified offset.\n */\nfunction douglasPeucker(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset) {\n const n = (end - offset) / stride;\n if (n < 3) {\n for (; offset < end; offset += stride) {\n simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset];\n simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset + 1];\n }\n return simplifiedOffset;\n }\n /** @type {Array<number>} */\n const markers = new Array(n);\n markers[0] = 1;\n markers[n - 1] = 1;\n /** @type {Array<number>} */\n const stack = [offset, end - stride];\n let index = 0;\n while (stack.length > 0) {\n const last = stack.pop();\n const first = stack.pop();\n let maxSquaredDistance = 0;\n const x1 = flatCoordinates[first];\n const y1 = flatCoordinates[first + 1];\n const x2 = flatCoordinates[last];\n const y2 = flatCoordinates[last + 1];\n for (let i = first + stride; i < last; i += stride) {\n const x = flatCoordinates[i];\n const y = flatCoordinates[i + 1];\n const squaredDistance = (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.squaredSegmentDistance)(x, y, x1, y1, x2, y2);\n if (squaredDistance > maxSquaredDistance) {\n index = i;\n maxSquaredDistance = squaredDistance;\n }\n }\n if (maxSquaredDistance > squaredTolerance) {\n markers[(index - offset) / stride] = 1;\n if (first + stride < index) {\n stack.push(first, index);\n }\n if (index + stride < last) {\n stack.push(index, last);\n }\n }\n }\n for (let i = 0; i < n; ++i) {\n if (markers[i]) {\n simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset + i * stride];\n simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset + i * stride + 1];\n }\n }\n return simplifiedOffset;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array<number>} simplifiedEnds Simplified ends.\n * @return {number} Simplified offset.\n */\nfunction douglasPeuckerArray(flatCoordinates, offset, ends, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n simplifiedOffset = douglasPeucker(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset);\n simplifiedEnds.push(simplifiedOffset);\n offset = end;\n }\n return simplifiedOffset;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array<Array<number>>} simplifiedEndss Simplified endss.\n * @return {number} Simplified offset.\n */\nfunction douglasPeuckerMultiArray(flatCoordinates, offset, endss, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEndss) {\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n /** @type {Array<number>} */\n const simplifiedEnds = [];\n simplifiedOffset = douglasPeuckerArray(flatCoordinates, offset, ends, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds);\n simplifiedEndss.push(simplifiedEnds);\n offset = ends[ends.length - 1];\n }\n return simplifiedOffset;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @return {number} Simplified offset.\n */\nfunction radialDistance(flatCoordinates, offset, end, stride, squaredTolerance, simplifiedFlatCoordinates, simplifiedOffset) {\n if (end <= offset + stride) {\n // zero or one point, no simplification possible, so copy and return\n for (; offset < end; offset += stride) {\n simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset];\n simplifiedFlatCoordinates[simplifiedOffset++] = flatCoordinates[offset + 1];\n }\n return simplifiedOffset;\n }\n let x1 = flatCoordinates[offset];\n let y1 = flatCoordinates[offset + 1];\n // copy first point\n simplifiedFlatCoordinates[simplifiedOffset++] = x1;\n simplifiedFlatCoordinates[simplifiedOffset++] = y1;\n let x2 = x1;\n let y2 = y1;\n for (offset += stride; offset < end; offset += stride) {\n x2 = flatCoordinates[offset];\n y2 = flatCoordinates[offset + 1];\n if ((0,_math_js__WEBPACK_IMPORTED_MODULE_1__.squaredDistance)(x1, y1, x2, y2) > squaredTolerance) {\n // copy point at offset\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n x1 = x2;\n y1 = y2;\n }\n }\n if (x2 != x1 || y2 != y1) {\n // copy last point\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n }\n return simplifiedOffset;\n}\n\n/**\n * @param {number} value Value.\n * @param {number} tolerance Tolerance.\n * @return {number} Rounded value.\n */\nfunction snap(value, tolerance) {\n return tolerance * Math.round(value / tolerance);\n}\n\n/**\n * Simplifies a line string using an algorithm designed by Tim Schaub.\n * Coordinates are snapped to the nearest value in a virtual grid and\n * consecutive duplicate coordinates are discarded. This effectively preserves\n * topology as the simplification of any subsection of a line string is\n * independent of the rest of the line string. This means that, for examples,\n * the common edge between two polygons will be simplified to the same line\n * string independently in both polygons. This implementation uses a single\n * pass over the coordinates and eliminates intermediate collinear points.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} tolerance Tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @return {number} Simplified offset.\n */\nfunction quantize(flatCoordinates, offset, end, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset) {\n // do nothing if the line is empty\n if (offset == end) {\n return simplifiedOffset;\n }\n // snap the first coordinate (P1)\n let x1 = snap(flatCoordinates[offset], tolerance);\n let y1 = snap(flatCoordinates[offset + 1], tolerance);\n offset += stride;\n // add the first coordinate to the output\n simplifiedFlatCoordinates[simplifiedOffset++] = x1;\n simplifiedFlatCoordinates[simplifiedOffset++] = y1;\n // find the next coordinate that does not snap to the same value as the first\n // coordinate (P2)\n let x2, y2;\n do {\n x2 = snap(flatCoordinates[offset], tolerance);\n y2 = snap(flatCoordinates[offset + 1], tolerance);\n offset += stride;\n if (offset == end) {\n // all coordinates snap to the same value, the line collapses to a point\n // push the last snapped value anyway to ensure that the output contains\n // at least two points\n // FIXME should we really return at least two points anyway?\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n return simplifiedOffset;\n }\n } while (x2 == x1 && y2 == y1);\n while (offset < end) {\n // snap the next coordinate (P3)\n const x3 = snap(flatCoordinates[offset], tolerance);\n const y3 = snap(flatCoordinates[offset + 1], tolerance);\n offset += stride;\n // skip P3 if it is equal to P2\n if (x3 == x2 && y3 == y2) {\n continue;\n }\n // calculate the delta between P1 and P2\n const dx1 = x2 - x1;\n const dy1 = y2 - y1;\n // calculate the delta between P3 and P1\n const dx2 = x3 - x1;\n const dy2 = y3 - y1;\n // if P1, P2, and P3 are colinear and P3 is further from P1 than P2 is from\n // P1 in the same direction then P2 is on the straight line between P1 and\n // P3\n if (dx1 * dy2 == dy1 * dx2 && (dx1 < 0 && dx2 < dx1 || dx1 == dx2 || dx1 > 0 && dx2 > dx1) && (dy1 < 0 && dy2 < dy1 || dy1 == dy2 || dy1 > 0 && dy2 > dy1)) {\n // discard P2 and set P2 = P3\n x2 = x3;\n y2 = y3;\n continue;\n }\n // either P1, P2, and P3 are not colinear, or they are colinear but P3 is\n // between P3 and P1 or on the opposite half of the line to P2. add P2,\n // and continue with P1 = P2 and P2 = P3\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n x1 = x2;\n y1 = y2;\n x2 = x3;\n y2 = y3;\n }\n // add the last point (P2)\n simplifiedFlatCoordinates[simplifiedOffset++] = x2;\n simplifiedFlatCoordinates[simplifiedOffset++] = y2;\n return simplifiedOffset;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {number} tolerance Tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array<number>} simplifiedEnds Simplified ends.\n * @return {number} Simplified offset.\n */\nfunction quantizeArray(flatCoordinates, offset, ends, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n simplifiedOffset = quantize(flatCoordinates, offset, end, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset);\n simplifiedEnds.push(simplifiedOffset);\n offset = end;\n }\n return simplifiedOffset;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<Array<number>>} endss Endss.\n * @param {number} stride Stride.\n * @param {number} tolerance Tolerance.\n * @param {Array<number>} simplifiedFlatCoordinates Simplified flat\n * coordinates.\n * @param {number} simplifiedOffset Simplified offset.\n * @param {Array<Array<number>>} simplifiedEndss Simplified endss.\n * @return {number} Simplified offset.\n */\nfunction quantizeMultiArray(flatCoordinates, offset, endss, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEndss) {\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n /** @type {Array<number>} */\n const simplifiedEnds = [];\n simplifiedOffset = quantizeArray(flatCoordinates, offset, ends, stride, tolerance, simplifiedFlatCoordinates, simplifiedOffset, simplifiedEnds);\n simplifiedEndss.push(simplifiedEnds);\n offset = ends[ends.length - 1];\n }\n return simplifiedOffset;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/simplify.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/straightchunk.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/straightchunk.js ***!
|
||
\****************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ matchingChunk: function() { return /* binding */ matchingChunk; }\n/* harmony export */ });\n/**\n * @module ol/geom/flat/straightchunk\n */\n\n/**\n * @param {number} maxAngle Maximum acceptable angle delta between segments.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @return {Array<number>} Start and end of the first suitable chunk of the\n * given `flatCoordinates`.\n */\nfunction matchingChunk(maxAngle, flatCoordinates, offset, end, stride) {\n let chunkStart = offset;\n let chunkEnd = offset;\n let chunkM = 0;\n let m = 0;\n let start = offset;\n let acos, i, m12, m23, x1, y1, x12, y12, x23, y23;\n for (i = offset; i < end; i += stride) {\n const x2 = flatCoordinates[i];\n const y2 = flatCoordinates[i + 1];\n if (x1 !== undefined) {\n x23 = x2 - x1;\n y23 = y2 - y1;\n m23 = Math.sqrt(x23 * x23 + y23 * y23);\n if (x12 !== undefined) {\n m += m12;\n acos = Math.acos((x12 * x23 + y12 * y23) / (m12 * m23));\n if (acos > maxAngle) {\n if (m > chunkM) {\n chunkM = m;\n chunkStart = start;\n chunkEnd = i;\n }\n m = 0;\n start = i - stride;\n }\n }\n m12 = m23;\n x12 = x23;\n y12 = y23;\n }\n x1 = x2;\n y1 = y2;\n }\n m += m23;\n return m > chunkM ? [start, i] : [chunkStart, chunkEnd];\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/straightchunk.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/textpath.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/textpath.js ***!
|
||
\***********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawTextOnPath: function() { return /* binding */ drawTextOnPath; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../math.js */ \"./node_modules/ol/math.js\");\n/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transform.js */ \"./node_modules/ol/geom/flat/transform.js\");\n\n/**\n * @module ol/geom/flat/textpath\n */\n\n\n\n/**\n * @param {Array<number>} flatCoordinates Path to put text on.\n * @param {number} offset Start offset of the `flatCoordinates`.\n * @param {number} end End offset of the `flatCoordinates`.\n * @param {number} stride Stride.\n * @param {string} text Text to place on the path.\n * @param {number} startM m along the path where the text starts.\n * @param {number} maxAngle Max angle between adjacent chars in radians.\n * @param {number} scale The product of the text scale and the device pixel ratio.\n * @param {function(string, string, Object<string, number>):number} measureAndCacheTextWidth Measure and cache text width.\n * @param {string} font The font.\n * @param {Object<string, number>} cache A cache of measured widths.\n * @param {number} rotation Rotation to apply to the flatCoordinates to determine whether text needs to be reversed.\n * @return {Array<Array<*>>|null} The result array (or null if `maxAngle` was\n * exceeded). Entries of the array are x, y, anchorX, angle, chunk.\n */\nfunction drawTextOnPath(flatCoordinates, offset, end, stride, text, startM, maxAngle, scale, measureAndCacheTextWidth, font, cache, rotation) {\n let x2 = flatCoordinates[offset];\n let y2 = flatCoordinates[offset + 1];\n let x1 = 0;\n let y1 = 0;\n let segmentLength = 0;\n let segmentM = 0;\n function advance() {\n x1 = x2;\n y1 = y2;\n offset += stride;\n x2 = flatCoordinates[offset];\n y2 = flatCoordinates[offset + 1];\n segmentM += segmentLength;\n segmentLength = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n }\n do {\n advance();\n } while (offset < end - stride && segmentM + segmentLength < startM);\n let interpolate = segmentLength === 0 ? 0 : (startM - segmentM) / segmentLength;\n const beginX = (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.lerp)(x1, x2, interpolate);\n const beginY = (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.lerp)(y1, y2, interpolate);\n const startOffset = offset - stride;\n const startLength = segmentM;\n const endM = startM + scale * measureAndCacheTextWidth(font, text, cache);\n while (offset < end - stride && segmentM + segmentLength < endM) {\n advance();\n }\n interpolate = segmentLength === 0 ? 0 : (endM - segmentM) / segmentLength;\n const endX = (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.lerp)(x1, x2, interpolate);\n const endY = (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.lerp)(y1, y2, interpolate);\n\n // Keep text upright\n let reverse;\n if (rotation) {\n const flat = [beginX, beginY, endX, endY];\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.rotate)(flat, 0, 4, 2, rotation, flat, flat);\n reverse = flat[0] > flat[2];\n } else {\n reverse = beginX > endX;\n }\n const PI = Math.PI;\n const result = [];\n const singleSegment = startOffset + stride === offset;\n offset = startOffset;\n segmentLength = 0;\n segmentM = startLength;\n x2 = flatCoordinates[offset];\n y2 = flatCoordinates[offset + 1];\n let previousAngle;\n // All on the same segment\n if (singleSegment) {\n advance();\n previousAngle = Math.atan2(y2 - y1, x2 - x1);\n if (reverse) {\n previousAngle += previousAngle > 0 ? -PI : PI;\n }\n const x = (endX + beginX) / 2;\n const y = (endY + beginY) / 2;\n result[0] = [x, y, (endM - startM) / 2, previousAngle, text];\n return result;\n }\n\n // rendering across line segments\n text = text.replace(/\\n/g, ' '); // ensure rendering in single-line as all calculations below don't handle multi-lines\n\n for (let i = 0, ii = text.length; i < ii;) {\n advance();\n let angle = Math.atan2(y2 - y1, x2 - x1);\n if (reverse) {\n angle += angle > 0 ? -PI : PI;\n }\n if (previousAngle !== undefined) {\n let delta = angle - previousAngle;\n delta += delta > PI ? -2 * PI : delta < -PI ? 2 * PI : 0;\n if (Math.abs(delta) > maxAngle) {\n return null;\n }\n }\n previousAngle = angle;\n const iStart = i;\n let charLength = 0;\n for (; i < ii; ++i) {\n const index = reverse ? ii - i - 1 : i;\n const len = scale * measureAndCacheTextWidth(font, text[index], cache);\n if (offset + stride < end && segmentM + segmentLength < startM + charLength + len / 2) {\n break;\n }\n charLength += len;\n }\n if (i === iStart) {\n continue;\n }\n const chars = reverse ? text.substring(ii - iStart, ii - i) : text.substring(iStart, i);\n interpolate = segmentLength === 0 ? 0 : (startM + charLength / 2 - segmentM) / segmentLength;\n const x = (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.lerp)(x1, x2, interpolate);\n const y = (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.lerp)(y1, y2, interpolate);\n result.push([x, y, charLength / 2, angle, chars]);\n startM += charLength;\n }\n return result;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/textpath.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/geom/flat/transform.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ol/geom/flat/transform.js ***!
|
||
\************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ rotate: function() { return /* binding */ rotate; },\n/* harmony export */ scale: function() { return /* binding */ scale; },\n/* harmony export */ transform2D: function() { return /* binding */ transform2D; },\n/* harmony export */ translate: function() { return /* binding */ translate; }\n/* harmony export */ });\n/**\n * @module ol/geom/flat/transform\n */\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {Array<number>} [dest] Destination.\n * @return {Array<number>} Transformed coordinates.\n */\nfunction transform2D(flatCoordinates, offset, end, stride, transform, dest) {\n dest = dest ? dest : [];\n let i = 0;\n for (let j = offset; j < end; j += stride) {\n const x = flatCoordinates[j];\n const y = flatCoordinates[j + 1];\n dest[i++] = transform[0] * x + transform[2] * y + transform[4];\n dest[i++] = transform[1] * x + transform[3] * y + transform[5];\n }\n if (dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} angle Angle.\n * @param {Array<number>} anchor Rotation anchor point.\n * @param {Array<number>} [dest] Destination.\n * @return {Array<number>} Transformed coordinates.\n */\nfunction rotate(flatCoordinates, offset, end, stride, angle, anchor, dest) {\n dest = dest ? dest : [];\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const anchorX = anchor[0];\n const anchorY = anchor[1];\n let i = 0;\n for (let j = offset; j < end; j += stride) {\n const deltaX = flatCoordinates[j] - anchorX;\n const deltaY = flatCoordinates[j + 1] - anchorY;\n dest[i++] = anchorX + deltaX * cos - deltaY * sin;\n dest[i++] = anchorY + deltaX * sin + deltaY * cos;\n for (let k = j + 2; k < j + stride; ++k) {\n dest[i++] = flatCoordinates[k];\n }\n }\n if (dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n\n/**\n * Scale the coordinates.\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} sx Scale factor in the x-direction.\n * @param {number} sy Scale factor in the y-direction.\n * @param {Array<number>} anchor Scale anchor point.\n * @param {Array<number>} [dest] Destination.\n * @return {Array<number>} Transformed coordinates.\n */\nfunction scale(flatCoordinates, offset, end, stride, sx, sy, anchor, dest) {\n dest = dest ? dest : [];\n const anchorX = anchor[0];\n const anchorY = anchor[1];\n let i = 0;\n for (let j = offset; j < end; j += stride) {\n const deltaX = flatCoordinates[j] - anchorX;\n const deltaY = flatCoordinates[j + 1] - anchorY;\n dest[i++] = anchorX + sx * deltaX;\n dest[i++] = anchorY + sy * deltaY;\n for (let k = j + 2; k < j + stride; ++k) {\n dest[i++] = flatCoordinates[k];\n }\n }\n if (dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n\n/**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {number} deltaX Delta X.\n * @param {number} deltaY Delta Y.\n * @param {Array<number>} [dest] Destination.\n * @return {Array<number>} Transformed coordinates.\n */\nfunction translate(flatCoordinates, offset, end, stride, deltaX, deltaY, dest) {\n dest = dest ? dest : [];\n let i = 0;\n for (let j = offset; j < end; j += stride) {\n dest[i++] = flatCoordinates[j] + deltaX;\n dest[i++] = flatCoordinates[j + 1] + deltaY;\n for (let k = j + 2; k < j + stride; ++k) {\n dest[i++] = flatCoordinates[k];\n }\n }\n if (dest && dest.length != i) {\n dest.length = i;\n }\n return dest;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/geom/flat/transform.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/has.js":
|
||
/*!********************************!*\
|
||
!*** ./node_modules/ol/has.js ***!
|
||
\********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CREATE_IMAGE_BITMAP: function() { return /* binding */ CREATE_IMAGE_BITMAP; },\n/* harmony export */ DEVICE_PIXEL_RATIO: function() { return /* binding */ DEVICE_PIXEL_RATIO; },\n/* harmony export */ FIREFOX: function() { return /* binding */ FIREFOX; },\n/* harmony export */ IMAGE_DECODE: function() { return /* binding */ IMAGE_DECODE; },\n/* harmony export */ MAC: function() { return /* binding */ MAC; },\n/* harmony export */ PASSIVE_EVENT_LISTENERS: function() { return /* binding */ PASSIVE_EVENT_LISTENERS; },\n/* harmony export */ SAFARI: function() { return /* binding */ SAFARI; },\n/* harmony export */ SAFARI_BUG_237906: function() { return /* binding */ SAFARI_BUG_237906; },\n/* harmony export */ WEBKIT: function() { return /* binding */ WEBKIT; },\n/* harmony export */ WORKER_OFFSCREEN_CANVAS: function() { return /* binding */ WORKER_OFFSCREEN_CANVAS; }\n/* harmony export */ });\n/**\n * @module ol/has\n */\n\nconst ua = typeof navigator !== 'undefined' && typeof navigator.userAgent !== 'undefined' ? navigator.userAgent.toLowerCase() : '';\n\n/**\n * User agent string says we are dealing with Firefox as browser.\n * @type {boolean}\n */\nconst FIREFOX = ua.includes('firefox');\n\n/**\n * User agent string says we are dealing with Safari as browser.\n * @type {boolean}\n */\nconst SAFARI = ua.includes('safari') && !ua.includes('chrom');\n\n/**\n * https://bugs.webkit.org/show_bug.cgi?id=237906\n * @type {boolean}\n */\nconst SAFARI_BUG_237906 = SAFARI && (ua.includes('version/15.4') || /cpu (os|iphone os) 15_4 like mac os x/.test(ua));\n\n/**\n * User agent string says we are dealing with a WebKit engine.\n * @type {boolean}\n */\nconst WEBKIT = ua.includes('webkit') && !ua.includes('edge');\n\n/**\n * User agent string says we are dealing with a Mac as platform.\n * @type {boolean}\n */\nconst MAC = ua.includes('macintosh');\n\n/**\n * The ratio between physical pixels and device-independent pixels\n * (dips) on the device (`window.devicePixelRatio`).\n * @const\n * @type {number}\n * @api\n */\nconst DEVICE_PIXEL_RATIO = typeof devicePixelRatio !== 'undefined' ? devicePixelRatio : 1;\n\n/**\n * The execution context is a worker with OffscreenCanvas available.\n * @const\n * @type {boolean}\n */\nconst WORKER_OFFSCREEN_CANVAS = typeof WorkerGlobalScope !== 'undefined' && typeof OffscreenCanvas !== 'undefined' && self instanceof WorkerGlobalScope; //eslint-disable-line\n\n/**\n * Image.prototype.decode() is supported.\n * @type {boolean}\n */\nconst IMAGE_DECODE = typeof Image !== 'undefined' && Image.prototype.decode;\n\n/**\n * createImageBitmap() is supported.\n * @type {boolean}\n */\nconst CREATE_IMAGE_BITMAP = typeof createImageBitmap === 'function';\n\n/**\n * @type {boolean}\n */\nconst PASSIVE_EVENT_LISTENERS = function () {\n let passive = false;\n try {\n const options = Object.defineProperty({}, 'passive', {\n get: function () {\n passive = true;\n }\n });\n\n // @ts-ignore Ignore invalid event type '_'\n window.addEventListener('_', null, options);\n // @ts-ignore Ignore invalid event type '_'\n window.removeEventListener('_', null, options);\n } catch (error) {\n // passive not supported\n }\n return passive;\n}();\n\n//# sourceURL=webpack://complexes/./node_modules/ol/has.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/DoubleClickZoom.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ol/interaction/DoubleClickZoom.js ***!
|
||
\********************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Interaction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Interaction.js */ \"./node_modules/ol/interaction/Interaction.js\");\n/* harmony import */ var _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../MapBrowserEventType.js */ \"./node_modules/ol/MapBrowserEventType.js\");\n/**\n * @module ol/interaction/DoubleClickZoom\n */\n\n\n\n/**\n * @typedef {Object} Options\n * @property {number} [duration=250] Animation duration in milliseconds.\n * @property {number} [delta=1] The zoom delta applied on each double click.\n */\n\n/**\n * @classdesc\n * Allows the user to zoom by double-clicking on the map.\n * @api\n */\nclass DoubleClickZoom extends _Interaction_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n super();\n options = options ? options : {};\n\n /**\n * @private\n * @type {number}\n */\n this.delta_ = options.delta ? options.delta : 1;\n\n /**\n * @private\n * @type {number}\n */\n this.duration_ = options.duration !== undefined ? options.duration : 250;\n }\n\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} (if it was a\n * doubleclick) and eventually zooms the map.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n */\n handleEvent(mapBrowserEvent) {\n let stopEvent = false;\n if (mapBrowserEvent.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].DBLCLICK) {\n const browserEvent = /** @type {MouseEvent} */\n mapBrowserEvent.originalEvent;\n const map = mapBrowserEvent.map;\n const anchor = mapBrowserEvent.coordinate;\n const delta = browserEvent.shiftKey ? -this.delta_ : this.delta_;\n const view = map.getView();\n (0,_Interaction_js__WEBPACK_IMPORTED_MODULE_0__.zoomByDelta)(view, delta, anchor, this.duration_);\n browserEvent.preventDefault();\n stopEvent = true;\n }\n return !stopEvent;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (DoubleClickZoom);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/DoubleClickZoom.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/DragBox.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ol/interaction/DragBox.js ***!
|
||
\************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DragBoxEvent: function() { return /* binding */ DragBoxEvent; }\n/* harmony export */ });\n/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../events/Event.js */ \"./node_modules/ol/events/Event.js\");\n/* harmony import */ var _Pointer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Pointer.js */ \"./node_modules/ol/interaction/Pointer.js\");\n/* harmony import */ var _render_Box_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../render/Box.js */ \"./node_modules/ol/render/Box.js\");\n/* harmony import */ var _events_condition_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../events/condition.js */ \"./node_modules/ol/events/condition.js\");\n/**\n * @module ol/interaction/DragBox\n */\n// FIXME draw drag box\n\n\n\n\n\n/**\n * A function that takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and two\n * {@link module:ol/pixel~Pixel}s and returns a `{boolean}`. If the condition is met,\n * true should be returned.\n * @typedef {function(this: ?, import(\"../MapBrowserEvent.js\").default, import(\"../pixel.js\").Pixel, import(\"../pixel.js\").Pixel):boolean} EndCondition\n */\n\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-dragbox'] CSS class name for styling the box.\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean\n * to indicate whether that event should be handled.\n * Default is {@link ol/events/condition~mouseActionButton}.\n * @property {number} [minArea=64] The minimum area of the box in pixel, this value is used by the default\n * `boxEndCondition` function.\n * @property {EndCondition} [boxEndCondition] A function that takes a {@link module:ol/MapBrowserEvent~MapBrowserEvent} and two\n * {@link module:ol/pixel~Pixel}s to indicate whether a `boxend` event should be fired.\n * Default is `true` if the area of the box is bigger than the `minArea` option.\n * @property {function(this:DragBox, import(\"../MapBrowserEvent.js\").default):void} [onBoxEnd] Code to execute just\n * before `boxend` is fired.\n */\n\n/**\n * @enum {string}\n */\nconst DragBoxEventType = {\n /**\n * Triggered upon drag box start.\n * @event DragBoxEvent#boxstart\n * @api\n */\n BOXSTART: 'boxstart',\n /**\n * Triggered on drag when box is active.\n * @event DragBoxEvent#boxdrag\n * @api\n */\n BOXDRAG: 'boxdrag',\n /**\n * Triggered upon drag box end.\n * @event DragBoxEvent#boxend\n * @api\n */\n BOXEND: 'boxend',\n /**\n * Triggered upon drag box canceled.\n * @event DragBoxEvent#boxcancel\n * @api\n */\n BOXCANCEL: 'boxcancel'\n};\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/DragBox~DragBox} instances are instances of\n * this type.\n */\nclass DragBoxEvent extends _events_Event_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {string} type The event type.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate The event coordinate.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Originating event.\n */\n constructor(type, coordinate, mapBrowserEvent) {\n super(type);\n\n /**\n * The coordinate of the drag event.\n * @const\n * @type {import(\"../coordinate.js\").Coordinate}\n * @api\n */\n this.coordinate = coordinate;\n\n /**\n * @const\n * @type {import(\"../MapBrowserEvent.js\").default}\n * @api\n */\n this.mapBrowserEvent = mapBrowserEvent;\n }\n}\n\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature<import(\"../Observable\").EventTypes, import(\"../events/Event.js\").default, Return> &\n * import(\"../Observable\").OnSignature<import(\"../ObjectEventType\").Types|\n * 'change:active', import(\"../Object\").ObjectEvent, Return> &\n * import(\"../Observable\").OnSignature<'boxcancel'|'boxdrag'|'boxend'|'boxstart', DragBoxEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature<import(\"../Observable\").EventTypes|import(\"../ObjectEventType\").Types|\n * 'change:active'|'boxcancel'|'boxdrag'|'boxend', Return>} DragBoxOnSignature\n */\n\n/**\n * @classdesc\n * Allows the user to draw a vector box by clicking and dragging on the map,\n * normally combined with an {@link module:ol/events/condition} that limits\n * it to when the shift or other key is held down. This is used, for example,\n * for zooming to a specific area of the map\n * (see {@link module:ol/interaction/DragZoom~DragZoom} and\n * {@link module:ol/interaction/DragRotateAndZoom~DragRotateAndZoom}).\n *\n * @fires DragBoxEvent\n * @api\n */\nclass DragBox extends _Pointer_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n super();\n\n /***\n * @type {DragBoxOnSignature<import(\"../events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {DragBoxOnSignature<import(\"../events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {DragBoxOnSignature<void>}\n */\n this.un;\n options = options ? options : {};\n\n /**\n * @type {import(\"../render/Box.js\").default}\n * @private\n */\n this.box_ = new _render_Box_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](options.className || 'ol-dragbox');\n\n /**\n * @type {number}\n * @private\n */\n this.minArea_ = options.minArea !== undefined ? options.minArea : 64;\n if (options.onBoxEnd) {\n this.onBoxEnd = options.onBoxEnd;\n }\n\n /**\n * @type {import(\"../pixel.js\").Pixel}\n * @private\n */\n this.startPixel_ = null;\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.condition_ = options.condition ? options.condition : _events_condition_js__WEBPACK_IMPORTED_MODULE_3__.mouseActionButton;\n\n /**\n * @private\n * @type {EndCondition}\n */\n this.boxEndCondition_ = options.boxEndCondition ? options.boxEndCondition : this.defaultBoxEndCondition;\n }\n\n /**\n * The default condition for determining whether the boxend event\n * should fire.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent The originating MapBrowserEvent\n * leading to the box end.\n * @param {import(\"../pixel.js\").Pixel} startPixel The starting pixel of the box.\n * @param {import(\"../pixel.js\").Pixel} endPixel The end pixel of the box.\n * @return {boolean} Whether or not the boxend condition should be fired.\n */\n defaultBoxEndCondition(mapBrowserEvent, startPixel, endPixel) {\n const width = endPixel[0] - startPixel[0];\n const height = endPixel[1] - startPixel[1];\n return width * width + height * height >= this.minArea_;\n }\n\n /**\n * Returns geometry of last drawn box.\n * @return {import(\"../geom/Polygon.js\").default} Geometry.\n * @api\n */\n getGeometry() {\n return this.box_.getGeometry();\n }\n\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n */\n handleDragEvent(mapBrowserEvent) {\n this.box_.setPixels(this.startPixel_, mapBrowserEvent.pixel);\n this.dispatchEvent(new DragBoxEvent(DragBoxEventType.BOXDRAG, mapBrowserEvent.coordinate, mapBrowserEvent));\n }\n\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n handleUpEvent(mapBrowserEvent) {\n this.box_.setMap(null);\n const completeBox = this.boxEndCondition_(mapBrowserEvent, this.startPixel_, mapBrowserEvent.pixel);\n if (completeBox) {\n this.onBoxEnd(mapBrowserEvent);\n }\n this.dispatchEvent(new DragBoxEvent(completeBox ? DragBoxEventType.BOXEND : DragBoxEventType.BOXCANCEL, mapBrowserEvent.coordinate, mapBrowserEvent));\n return false;\n }\n\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n handleDownEvent(mapBrowserEvent) {\n if (this.condition_(mapBrowserEvent)) {\n this.startPixel_ = mapBrowserEvent.pixel;\n this.box_.setMap(mapBrowserEvent.map);\n this.box_.setPixels(this.startPixel_, this.startPixel_);\n this.dispatchEvent(new DragBoxEvent(DragBoxEventType.BOXSTART, mapBrowserEvent.coordinate, mapBrowserEvent));\n return true;\n }\n return false;\n }\n\n /**\n * Function to execute just before `onboxend` is fired\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n */\n onBoxEnd(event) {}\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (DragBox);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/DragBox.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/DragPan.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ol/interaction/DragPan.js ***!
|
||
\************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Pointer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Pointer.js */ \"./node_modules/ol/interaction/Pointer.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _events_condition_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events/condition.js */ \"./node_modules/ol/events/condition.js\");\n/* harmony import */ var _easing_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../easing.js */ \"./node_modules/ol/easing.js\");\n/* harmony import */ var _coordinate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../coordinate.js */ \"./node_modules/ol/coordinate.js\");\n/**\n * @module ol/interaction/DragPan\n */\n\n\n\n\n\n\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean\n * to indicate whether that event should be handled.\n * Default is {@link module:ol/events/condition.noModifierKeys} and {@link module:ol/events/condition.primaryAction}.\n * @property {boolean} [onFocusOnly=false] When the map's target has a `tabindex` attribute set,\n * the interaction will only handle events when the map has the focus.\n * @property {import(\"../Kinetic.js\").default} [kinetic] Kinetic inertia to apply to the pan.\n */\n\n/**\n * @classdesc\n * Allows the user to pan the map by dragging the map.\n * @api\n */\nclass DragPan extends _Pointer_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n super({\n stopDown: _functions_js__WEBPACK_IMPORTED_MODULE_1__.FALSE\n });\n options = options ? options : {};\n\n /**\n * @private\n * @type {import(\"../Kinetic.js\").default|undefined}\n */\n this.kinetic_ = options.kinetic;\n\n /**\n * @type {import(\"../pixel.js\").Pixel}\n */\n this.lastCentroid = null;\n\n /**\n * @type {number}\n */\n this.lastPointersCount_;\n\n /**\n * @type {boolean}\n */\n this.panning_ = false;\n const condition = options.condition ? options.condition : (0,_events_condition_js__WEBPACK_IMPORTED_MODULE_2__.all)(_events_condition_js__WEBPACK_IMPORTED_MODULE_2__.noModifierKeys, _events_condition_js__WEBPACK_IMPORTED_MODULE_2__.primaryAction);\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.condition_ = options.onFocusOnly ? (0,_events_condition_js__WEBPACK_IMPORTED_MODULE_2__.all)(_events_condition_js__WEBPACK_IMPORTED_MODULE_2__.focusWithTabindex, condition) : condition;\n\n /**\n * @private\n * @type {boolean}\n */\n this.noKinetic_ = false;\n }\n\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n */\n handleDragEvent(mapBrowserEvent) {\n const map = mapBrowserEvent.map;\n if (!this.panning_) {\n this.panning_ = true;\n map.getView().beginInteraction();\n }\n const targetPointers = this.targetPointers;\n const centroid = map.getEventPixel((0,_Pointer_js__WEBPACK_IMPORTED_MODULE_0__.centroid)(targetPointers));\n if (targetPointers.length == this.lastPointersCount_) {\n if (this.kinetic_) {\n this.kinetic_.update(centroid[0], centroid[1]);\n }\n if (this.lastCentroid) {\n const delta = [this.lastCentroid[0] - centroid[0], centroid[1] - this.lastCentroid[1]];\n const map = mapBrowserEvent.map;\n const view = map.getView();\n (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_3__.scale)(delta, view.getResolution());\n (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_3__.rotate)(delta, view.getRotation());\n view.adjustCenterInternal(delta);\n }\n } else if (this.kinetic_) {\n // reset so we don't overestimate the kinetic energy after\n // after one finger down, tiny drag, second finger down\n this.kinetic_.begin();\n }\n this.lastCentroid = centroid;\n this.lastPointersCount_ = targetPointers.length;\n mapBrowserEvent.originalEvent.preventDefault();\n }\n\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n handleUpEvent(mapBrowserEvent) {\n const map = mapBrowserEvent.map;\n const view = map.getView();\n if (this.targetPointers.length === 0) {\n if (!this.noKinetic_ && this.kinetic_ && this.kinetic_.end()) {\n const distance = this.kinetic_.getDistance();\n const angle = this.kinetic_.getAngle();\n const center = view.getCenterInternal();\n const centerpx = map.getPixelFromCoordinateInternal(center);\n const dest = map.getCoordinateFromPixelInternal([centerpx[0] - distance * Math.cos(angle), centerpx[1] - distance * Math.sin(angle)]);\n view.animateInternal({\n center: view.getConstrainedCenter(dest),\n duration: 500,\n easing: _easing_js__WEBPACK_IMPORTED_MODULE_4__.easeOut\n });\n }\n if (this.panning_) {\n this.panning_ = false;\n view.endInteraction();\n }\n return false;\n }\n if (this.kinetic_) {\n // reset so we don't overestimate the kinetic energy after\n // after one finger up, tiny drag, second finger up\n this.kinetic_.begin();\n }\n this.lastCentroid = null;\n return true;\n }\n\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n handleDownEvent(mapBrowserEvent) {\n if (this.targetPointers.length > 0 && this.condition_(mapBrowserEvent)) {\n const map = mapBrowserEvent.map;\n const view = map.getView();\n this.lastCentroid = null;\n // stop any current animation\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n if (this.kinetic_) {\n this.kinetic_.begin();\n }\n // No kinetic as soon as more than one pointer on the screen is\n // detected. This is to prevent nasty pans after pinch.\n this.noKinetic_ = this.targetPointers.length > 1;\n return true;\n }\n return false;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (DragPan);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/DragPan.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/DragRotate.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/ol/interaction/DragRotate.js ***!
|
||
\***************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Pointer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Pointer.js */ \"./node_modules/ol/interaction/Pointer.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _events_condition_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events/condition.js */ \"./node_modules/ol/events/condition.js\");\n/* harmony import */ var _rotationconstraint_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../rotationconstraint.js */ \"./node_modules/ol/rotationconstraint.js\");\n/**\n * @module ol/interaction/DragRotate\n */\n\n\n\n\n\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that takes an\n * {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a boolean\n * to indicate whether that event should be handled.\n * Default is {@link module:ol/events/condition.altShiftKeysOnly}.\n * @property {number} [duration=250] Animation duration in milliseconds.\n */\n\n/**\n * @classdesc\n * Allows the user to rotate the map by clicking and dragging on the map,\n * normally combined with an {@link module:ol/events/condition} that limits\n * it to when the alt and shift keys are held down.\n *\n * This interaction is only supported for mouse devices.\n * @api\n */\nclass DragRotate extends _Pointer_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options ? options : {};\n super({\n stopDown: _functions_js__WEBPACK_IMPORTED_MODULE_1__.FALSE\n });\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.condition_ = options.condition ? options.condition : _events_condition_js__WEBPACK_IMPORTED_MODULE_2__.altShiftKeysOnly;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.lastAngle_ = undefined;\n\n /**\n * @private\n * @type {number}\n */\n this.duration_ = options.duration !== undefined ? options.duration : 250;\n }\n\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n */\n handleDragEvent(mapBrowserEvent) {\n if (!(0,_events_condition_js__WEBPACK_IMPORTED_MODULE_2__.mouseOnly)(mapBrowserEvent)) {\n return;\n }\n const map = mapBrowserEvent.map;\n const view = map.getView();\n if (view.getConstraints().rotation === _rotationconstraint_js__WEBPACK_IMPORTED_MODULE_3__.disable) {\n return;\n }\n const size = map.getSize();\n const offset = mapBrowserEvent.pixel;\n const theta = Math.atan2(size[1] / 2 - offset[1], offset[0] - size[0] / 2);\n if (this.lastAngle_ !== undefined) {\n const delta = theta - this.lastAngle_;\n view.adjustRotationInternal(-delta);\n }\n this.lastAngle_ = theta;\n }\n\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n handleUpEvent(mapBrowserEvent) {\n if (!(0,_events_condition_js__WEBPACK_IMPORTED_MODULE_2__.mouseOnly)(mapBrowserEvent)) {\n return true;\n }\n const map = mapBrowserEvent.map;\n const view = map.getView();\n view.endInteraction(this.duration_);\n return false;\n }\n\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n handleDownEvent(mapBrowserEvent) {\n if (!(0,_events_condition_js__WEBPACK_IMPORTED_MODULE_2__.mouseOnly)(mapBrowserEvent)) {\n return false;\n }\n if ((0,_events_condition_js__WEBPACK_IMPORTED_MODULE_2__.mouseActionButton)(mapBrowserEvent) && this.condition_(mapBrowserEvent)) {\n const map = mapBrowserEvent.map;\n map.getView().beginInteraction();\n this.lastAngle_ = undefined;\n return true;\n }\n return false;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (DragRotate);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/DragRotate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/DragZoom.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/ol/interaction/DragZoom.js ***!
|
||
\*************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _DragBox_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DragBox.js */ \"./node_modules/ol/interaction/DragBox.js\");\n/* harmony import */ var _easing_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../easing.js */ \"./node_modules/ol/easing.js\");\n/* harmony import */ var _events_condition_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events/condition.js */ \"./node_modules/ol/events/condition.js\");\n/**\n * @module ol/interaction/DragZoom\n */\n\n\n\n\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-dragzoom'] CSS class name for styling the\n * box.\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * Default is {@link module:ol/events/condition.shiftKeyOnly}.\n * @property {number} [duration=200] Animation duration in milliseconds.\n * @property {boolean} [out=false] Use interaction for zooming out.\n * @property {number} [minArea=64] The minimum area of the box in pixel, this value is used by the parent default\n * `boxEndCondition` function.\n */\n\n/**\n * @classdesc\n * Allows the user to zoom the map by clicking and dragging on the map,\n * normally combined with an {@link module:ol/events/condition} that limits\n * it to when a key, shift by default, is held down.\n *\n * To change the style of the box, use CSS and the `.ol-dragzoom` selector, or\n * your custom one configured with `className`.\n * @api\n */\nclass DragZoom extends _DragBox_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options ? options : {};\n const condition = options.condition ? options.condition : _events_condition_js__WEBPACK_IMPORTED_MODULE_1__.shiftKeyOnly;\n super({\n condition: condition,\n className: options.className || 'ol-dragzoom',\n minArea: options.minArea\n });\n\n /**\n * @private\n * @type {number}\n */\n this.duration_ = options.duration !== undefined ? options.duration : 200;\n\n /**\n * @private\n * @type {boolean}\n */\n this.out_ = options.out !== undefined ? options.out : false;\n }\n\n /**\n * Function to execute just before `onboxend` is fired\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n */\n onBoxEnd(event) {\n const map = this.getMap();\n const view = /** @type {!import(\"../View.js\").default} */map.getView();\n let geometry = this.getGeometry();\n if (this.out_) {\n const rotatedExtent = view.rotatedExtentForGeometry(geometry);\n const resolution = view.getResolutionForExtentInternal(rotatedExtent);\n const factor = view.getResolution() / resolution;\n geometry = geometry.clone();\n geometry.scale(factor * factor);\n }\n view.fitInternal(geometry, {\n duration: this.duration_,\n easing: _easing_js__WEBPACK_IMPORTED_MODULE_2__.easeOut\n });\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (DragZoom);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/DragZoom.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/Draw.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ol/interaction/Draw.js ***!
|
||
\*********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DrawEvent: function() { return /* binding */ DrawEvent; },\n/* harmony export */ createBox: function() { return /* binding */ createBox; },\n/* harmony export */ createRegularPolygon: function() { return /* binding */ createRegularPolygon; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _geom_Circle_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../geom/Circle.js */ \"./node_modules/ol/geom/Circle.js\");\n/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events/Event.js */ \"./node_modules/ol/events/Event.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _Feature_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../Feature.js */ \"./node_modules/ol/Feature.js\");\n/* harmony import */ var _geom_GeometryCollection_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geom/GeometryCollection.js */ \"./node_modules/ol/geom/GeometryCollection.js\");\n/* harmony import */ var _Property_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Property.js */ \"./node_modules/ol/interaction/Property.js\");\n/* harmony import */ var _geom_LineString_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geom/LineString.js */ \"./node_modules/ol/geom/LineString.js\");\n/* harmony import */ var _MapBrowserEvent_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../MapBrowserEvent.js */ \"./node_modules/ol/MapBrowserEvent.js\");\n/* harmony import */ var _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../MapBrowserEventType.js */ \"./node_modules/ol/MapBrowserEventType.js\");\n/* harmony import */ var _geom_MultiLineString_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geom/MultiLineString.js */ \"./node_modules/ol/geom/MultiLineString.js\");\n/* harmony import */ var _geom_MultiPoint_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../geom/MultiPoint.js */ \"./node_modules/ol/geom/MultiPoint.js\");\n/* harmony import */ var _geom_MultiPolygon_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geom/MultiPolygon.js */ \"./node_modules/ol/geom/MultiPolygon.js\");\n/* harmony import */ var _geom_Point_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geom/Point.js */ \"./node_modules/ol/geom/Point.js\");\n/* harmony import */ var _Pointer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Pointer.js */ \"./node_modules/ol/interaction/Pointer.js\");\n/* harmony import */ var _geom_Polygon_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geom/Polygon.js */ \"./node_modules/ol/geom/Polygon.js\");\n/* harmony import */ var _layer_Vector_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../layer/Vector.js */ \"./node_modules/ol/layer/Vector.js\");\n/* harmony import */ var _source_Vector_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../source/Vector.js */ \"./node_modules/ol/source/Vector.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _events_condition_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../events/condition.js */ \"./node_modules/ol/events/condition.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../math.js */ \"./node_modules/ol/math.js\");\n/* harmony import */ var _style_Style_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../style/Style.js */ \"./node_modules/ol/style/Style.js\");\n/* harmony import */ var _coordinate_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../coordinate.js */ \"./node_modules/ol/coordinate.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../proj.js */ \"./node_modules/ol/proj.js\");\n/* harmony import */ var _geom_SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../geom/SimpleGeometry.js */ \"./node_modules/ol/geom/SimpleGeometry.js\");\n\n/**\n * @module ol/interaction/Draw\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @typedef {Object} Options\n * @property {import(\"../geom/Geometry.js\").Type} type Geometry type of\n * the geometries being drawn with this instance.\n * @property {number} [clickTolerance=6] The maximum distance in pixels between\n * \"down\" and \"up\" for a \"up\" event to be considered a \"click\" event and\n * actually add a point/vertex to the geometry being drawn. The default of `6`\n * was chosen for the draw interaction to behave correctly on mouse as well as\n * on touch devices.\n * @property {import(\"../Collection.js\").default<Feature>} [features]\n * Destination collection for the drawn features.\n * @property {VectorSource} [source] Destination source for\n * the drawn features.\n * @property {number} [dragVertexDelay=500] Delay in milliseconds after pointerdown\n * before the current vertex can be dragged to its exact position.\n * @property {number} [snapTolerance=12] Pixel distance for snapping to the\n * drawing finish. Must be greater than `0`.\n * @property {boolean} [stopClick=false] Stop click, singleclick, and\n * doubleclick events from firing during drawing.\n * @property {number} [maxPoints] The number of points that can be drawn before\n * a polygon ring or line string is finished. By default there is no\n * restriction.\n * @property {number} [minPoints] The number of points that must be drawn\n * before a polygon ring or line string can be finished. Default is `3` for\n * polygon rings and `2` for line strings.\n * @property {import(\"../events/condition.js\").Condition} [finishCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether the drawing can be finished. Not used when drawing\n * POINT or MULTI_POINT geometries.\n * @property {import(\"../style/Style.js\").StyleLike|import(\"../style/flat.js\").FlatStyleLike} [style]\n * Style for sketch features. The draw interaction can have up to three sketch features, depending on the mode.\n * It will always contain a feature with a `Point` geometry that corresponds to the current cursor position.\n * If the mode is `LineString` or `Polygon`, and there is at least one drawn point, it will also contain a feature with\n * a `LineString` geometry that corresponds to the line between the already drawn points and the current cursor position.\n * If the mode is `Polygon`, and there is at least one drawn point, it will also contain a feature with a `Polygon`\n * geometry that corresponds to the polygon between the already drawn points and the current cursor position\n * (note that this polygon has only two points if only one point is drawn).\n * If the mode is `Circle`, and there is one point drawn, it will also contain a feature with a `Circle` geometry whose\n * center is the drawn point and the radius is determined by the distance between the drawn point and the cursor.\n * @property {GeometryFunction} [geometryFunction]\n * Function that is called when a geometry's coordinates are updated.\n * @property {string} [geometryName] Geometry name to use for features created\n * by the draw interaction.\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * By default {@link module:ol/events/condition.noModifierKeys}, i.e. a click,\n * adds a vertex or deactivates freehand drawing.\n * @property {boolean} [freehand=false] Operate in freehand mode for lines,\n * polygons, and circles. This makes the interaction always operate in freehand\n * mode and takes precedence over any `freehandCondition` option.\n * @property {import(\"../events/condition.js\").Condition} [freehandCondition]\n * Condition that activates freehand drawing for lines and polygons. This\n * function takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and\n * returns a boolean to indicate whether that event should be handled. The\n * default is {@link module:ol/events/condition.shiftKeyOnly}, meaning that the\n * Shift key activates freehand drawing.\n * @property {boolean|import(\"../events/condition.js\").Condition} [trace=false] Trace a portion of another geometry.\n * Ignored when in freehand mode.\n * @property {VectorSource} [traceSource] Source for features to trace. If tracing is active and a `traceSource` is\n * not provided, the interaction's `source` will be used. Tracing requires that the interaction is configured with\n * either a `traceSource` or a `source`.\n * @property {boolean} [wrapX=false] Wrap the world horizontally on the sketch\n * overlay.\n * @property {import(\"../geom/Geometry.js\").GeometryLayout} [geometryLayout='XY'] Layout of the\n * feature geometries created by the draw interaction.\n */\n\n/**\n * Coordinate type when drawing points.\n * @typedef {import(\"../coordinate.js\").Coordinate} PointCoordType\n */\n\n/**\n * Coordinate type when drawing lines.\n * @typedef {Array<import(\"../coordinate.js\").Coordinate>} LineCoordType\n */\n\n/**\n * Coordinate type when drawing polygons.\n * @typedef {Array<Array<import(\"../coordinate.js\").Coordinate>>} PolyCoordType\n */\n\n/**\n * Types used for drawing coordinates.\n * @typedef {PointCoordType|LineCoordType|PolyCoordType} SketchCoordType\n */\n\n/**\n * @typedef {Object} TraceState\n * @property {boolean} active Tracing active.\n * @property {import(\"../pixel.js\").Pixel} [startPx] The initially clicked pixel location.\n * @property {Array<TraceTarget>} [targets] Targets available for tracing.\n * @property {number} [targetIndex] The index of the currently traced target. A value of -1 indicates\n * that no trace target is active.\n */\n\n/**\n * @typedef {Object} TraceTarget\n * @property {Array<import(\"../coordinate.js\").Coordinate>} coordinates Target coordinates.\n * @property {boolean} ring The target coordinates are a linear ring.\n * @property {number} startIndex The index of first traced coordinate. A fractional index represents an\n * edge intersection. Index values for rings will wrap (may be negative or larger than coordinates length).\n * @property {number} endIndex The index of last traced coordinate. Details from startIndex also apply here.\n */\n\n/**\n * Function that takes an array of coordinates and an optional existing geometry\n * and a projection as arguments, and returns a geometry. The optional existing\n * geometry is the geometry that is returned when the function is called without\n * a second argument.\n * @typedef {function(!SketchCoordType, import(\"../geom/SimpleGeometry.js\").default,\n * import(\"../proj/Projection.js\").default):\n * import(\"../geom/SimpleGeometry.js\").default} GeometryFunction\n */\n\n/**\n * @typedef {'Point' | 'LineString' | 'Polygon' | 'Circle'} Mode\n * Draw mode. This collapses multi-part geometry types with their single-part\n * cousins.\n */\n\n/**\n * @enum {string}\n */\nconst DrawEventType = {\n /**\n * Triggered upon feature draw start\n * @event DrawEvent#drawstart\n * @api\n */\n DRAWSTART: 'drawstart',\n /**\n * Triggered upon feature draw end\n * @event DrawEvent#drawend\n * @api\n */\n DRAWEND: 'drawend',\n /**\n * Triggered upon feature draw abortion\n * @event DrawEvent#drawabort\n * @api\n */\n DRAWABORT: 'drawabort'\n};\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Draw~Draw} instances are\n * instances of this type.\n */\nclass DrawEvent extends _events_Event_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n /**\n * @param {DrawEventType} type Type.\n * @param {Feature} feature The feature drawn.\n */\n constructor(type, feature) {\n super(type);\n\n /**\n * The feature being drawn.\n * @type {Feature}\n * @api\n */\n this.feature = feature;\n }\n}\n\n/**\n * @param {import(\"../coordinate.js\").Coordinate} coordinate The coordinate.\n * @param {Array<Feature>} features The candidate features.\n * @return {Array<TraceTarget>} The trace targets.\n */\nfunction getTraceTargets(coordinate, features) {\n /**\n * @type {Array<TraceTarget>}\n */\n const targets = [];\n for (let i = 0; i < features.length; ++i) {\n const feature = features[i];\n const geometry = feature.getGeometry();\n appendGeometryTraceTargets(coordinate, geometry, targets);\n }\n return targets;\n}\n\n/**\n * @param {import(\"../coordinate.js\").Coordinate} a One coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} b Another coordinate.\n * @return {number} The squared distance between the two coordinates.\n */\nfunction getSquaredDistance(a, b) {\n return (0,_math_js__WEBPACK_IMPORTED_MODULE_3__.squaredDistance)(a[0], a[1], b[0], b[1]);\n}\n\n/**\n * @param {LineCoordType} coordinates The ring coordinates.\n * @param {number} index The index. May be wrapped.\n * @return {import(\"../coordinate.js\").Coordinate} The coordinate.\n */\nfunction getCoordinate(coordinates, index) {\n const count = coordinates.length;\n if (index < 0) {\n return coordinates[index + count];\n }\n if (index >= count) {\n return coordinates[index - count];\n }\n return coordinates[index];\n}\n\n/**\n * Get the cumulative squared distance along a ring path. The end index index may be \"wrapped\" and it may\n * be less than the start index to indicate the direction of travel. The start and end index may have\n * a fractional part to indicate a point between two coordinates.\n * @param {LineCoordType} coordinates Ring coordinates.\n * @param {number} startIndex The start index.\n * @param {number} endIndex The end index.\n * @return {number} The cumulative squared distance along the ring path.\n */\nfunction getCumulativeSquaredDistance(coordinates, startIndex, endIndex) {\n let lowIndex, highIndex;\n if (startIndex < endIndex) {\n lowIndex = startIndex;\n highIndex = endIndex;\n } else {\n lowIndex = endIndex;\n highIndex = startIndex;\n }\n const lowWholeIndex = Math.ceil(lowIndex);\n const highWholeIndex = Math.floor(highIndex);\n if (lowWholeIndex > highWholeIndex) {\n // both start and end are on the same segment\n const start = interpolateCoordinate(coordinates, lowIndex);\n const end = interpolateCoordinate(coordinates, highIndex);\n return getSquaredDistance(start, end);\n }\n let sd = 0;\n if (lowIndex < lowWholeIndex) {\n const start = interpolateCoordinate(coordinates, lowIndex);\n const end = getCoordinate(coordinates, lowWholeIndex);\n sd += getSquaredDistance(start, end);\n }\n if (highWholeIndex < highIndex) {\n const start = getCoordinate(coordinates, highWholeIndex);\n const end = interpolateCoordinate(coordinates, highIndex);\n sd += getSquaredDistance(start, end);\n }\n for (let i = lowWholeIndex; i < highWholeIndex - 1; ++i) {\n const start = getCoordinate(coordinates, i);\n const end = getCoordinate(coordinates, i + 1);\n sd += getSquaredDistance(start, end);\n }\n return sd;\n}\n\n/**\n * @param {import(\"../coordinate.js\").Coordinate} coordinate The coordinate.\n * @param {import(\"../geom/Geometry.js\").default} geometry The candidate geometry.\n * @param {Array<TraceTarget>} targets The trace targets.\n */\nfunction appendGeometryTraceTargets(coordinate, geometry, targets) {\n if (geometry instanceof _geom_LineString_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]) {\n appendTraceTarget(coordinate, geometry.getCoordinates(), false, targets);\n return;\n }\n if (geometry instanceof _geom_MultiLineString_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]) {\n const coordinates = geometry.getCoordinates();\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\n appendTraceTarget(coordinate, coordinates[i], false, targets);\n }\n return;\n }\n if (geometry instanceof _geom_Polygon_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]) {\n const coordinates = geometry.getCoordinates();\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\n appendTraceTarget(coordinate, coordinates[i], true, targets);\n }\n return;\n }\n if (geometry instanceof _geom_MultiPolygon_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]) {\n const polys = geometry.getCoordinates();\n for (let i = 0, ii = polys.length; i < ii; ++i) {\n const coordinates = polys[i];\n for (let j = 0, jj = coordinates.length; j < jj; ++j) {\n appendTraceTarget(coordinate, coordinates[j], true, targets);\n }\n }\n return;\n }\n if (geometry instanceof _geom_GeometryCollection_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"]) {\n const geometries = geometry.getGeometries();\n for (let i = 0; i < geometries.length; ++i) {\n appendGeometryTraceTargets(coordinate, geometries[i], targets);\n }\n return;\n }\n // other types cannot be traced\n}\n\n/**\n * @typedef {Object} TraceTargetUpdateInfo\n * @property {number} index The new target index.\n * @property {number} endIndex The new segment end index.\n */\n\n/**\n * @type {TraceTargetUpdateInfo}\n */\nconst sharedUpdateInfo = {\n index: -1,\n endIndex: NaN\n};\n\n/**\n * @param {import(\"../coordinate.js\").Coordinate} coordinate The coordinate.\n * @param {TraceState} traceState The trace state.\n * @param {import(\"../Map.js\").default} map The map.\n * @param {number} snapTolerance The snap tolerance.\n * @return {TraceTargetUpdateInfo} Information about the new trace target. The returned\n * object is reused between calls and must not be modified by the caller.\n */\nfunction getTraceTargetUpdate(coordinate, traceState, map, snapTolerance) {\n const x = coordinate[0];\n const y = coordinate[1];\n let closestTargetDistance = Infinity;\n let newTargetIndex = -1;\n let newEndIndex = NaN;\n for (let targetIndex = 0; targetIndex < traceState.targets.length; ++targetIndex) {\n const target = traceState.targets[targetIndex];\n const coordinates = target.coordinates;\n let minSegmentDistance = Infinity;\n let endIndex;\n for (let coordinateIndex = 0; coordinateIndex < coordinates.length - 1; ++coordinateIndex) {\n const start = coordinates[coordinateIndex];\n const end = coordinates[coordinateIndex + 1];\n const rel = getPointSegmentRelationship(x, y, start, end);\n if (rel.squaredDistance < minSegmentDistance) {\n minSegmentDistance = rel.squaredDistance;\n endIndex = coordinateIndex + rel.along;\n }\n }\n if (minSegmentDistance < closestTargetDistance) {\n closestTargetDistance = minSegmentDistance;\n if (target.ring && traceState.targetIndex === targetIndex) {\n // same target, maintain the same trace direction\n if (target.endIndex > target.startIndex) {\n // forward trace\n if (endIndex < target.startIndex) {\n endIndex += coordinates.length;\n }\n } else if (target.endIndex < target.startIndex) {\n // reverse trace\n if (endIndex > target.startIndex) {\n endIndex -= coordinates.length;\n }\n }\n }\n newEndIndex = endIndex;\n newTargetIndex = targetIndex;\n }\n }\n const newTarget = traceState.targets[newTargetIndex];\n let considerBothDirections = newTarget.ring;\n if (traceState.targetIndex === newTargetIndex && considerBothDirections) {\n // only consider switching trace direction if close to the start\n const newCoordinate = interpolateCoordinate(newTarget.coordinates, newEndIndex);\n const pixel = map.getPixelFromCoordinate(newCoordinate);\n if ((0,_coordinate_js__WEBPACK_IMPORTED_MODULE_9__.distance)(pixel, traceState.startPx) > snapTolerance) {\n considerBothDirections = false;\n }\n }\n if (considerBothDirections) {\n const coordinates = newTarget.coordinates;\n const count = coordinates.length;\n const startIndex = newTarget.startIndex;\n const endIndex = newEndIndex;\n if (startIndex < endIndex) {\n const forwardDistance = getCumulativeSquaredDistance(coordinates, startIndex, endIndex);\n const reverseDistance = getCumulativeSquaredDistance(coordinates, startIndex, endIndex - count);\n if (reverseDistance < forwardDistance) {\n newEndIndex -= count;\n }\n } else {\n const reverseDistance = getCumulativeSquaredDistance(coordinates, startIndex, endIndex);\n const forwardDistance = getCumulativeSquaredDistance(coordinates, startIndex, endIndex + count);\n if (forwardDistance < reverseDistance) {\n newEndIndex += count;\n }\n }\n }\n sharedUpdateInfo.index = newTargetIndex;\n sharedUpdateInfo.endIndex = newEndIndex;\n return sharedUpdateInfo;\n}\n\n/**\n * @param {import(\"../coordinate.js\").Coordinate} coordinate The clicked coordinate.\n * @param {Array<import(\"../coordinate.js\").Coordinate>} coordinates The geometry component coordinates.\n * @param {boolean} ring The coordinates represent a linear ring.\n * @param {Array<TraceTarget>} targets The trace targets.\n */\nfunction appendTraceTarget(coordinate, coordinates, ring, targets) {\n const x = coordinate[0];\n const y = coordinate[1];\n for (let i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n const start = coordinates[i];\n const end = coordinates[i + 1];\n const rel = getPointSegmentRelationship(x, y, start, end);\n if (rel.squaredDistance === 0) {\n const index = i + rel.along;\n targets.push({\n coordinates: coordinates,\n ring: ring,\n startIndex: index,\n endIndex: index\n });\n return;\n }\n }\n}\n\n/**\n * @typedef {Object} PointSegmentRelationship\n * @property {number} along The closest point expressed as a fraction along the segment length.\n * @property {number} squaredDistance The squared distance of the point to the segment.\n */\n\n/**\n * @type {PointSegmentRelationship}\n */\nconst sharedRel = {\n along: 0,\n squaredDistance: 0\n};\n\n/**\n * @param {number} x The point x.\n * @param {number} y The point y.\n * @param {import(\"../coordinate.js\").Coordinate} start The segment start.\n * @param {import(\"../coordinate.js\").Coordinate} end The segment end.\n * @return {PointSegmentRelationship} The point segment relationship. The returned object is\n * shared between calls and must not be modified by the caller.\n */\nfunction getPointSegmentRelationship(x, y, start, end) {\n const x1 = start[0];\n const y1 = start[1];\n const x2 = end[0];\n const y2 = end[1];\n const dx = x2 - x1;\n const dy = y2 - y1;\n let along = 0;\n let px = x1;\n let py = y1;\n if (dx !== 0 || dy !== 0) {\n along = (0,_math_js__WEBPACK_IMPORTED_MODULE_3__.clamp)(((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy), 0, 1);\n px += dx * along;\n py += dy * along;\n }\n sharedRel.along = along;\n sharedRel.squaredDistance = (0,_math_js__WEBPACK_IMPORTED_MODULE_3__.toFixed)((0,_math_js__WEBPACK_IMPORTED_MODULE_3__.squaredDistance)(x, y, px, py), 10);\n return sharedRel;\n}\n\n/**\n * @param {LineCoordType} coordinates The coordinates.\n * @param {number} index The index. May be fractional and may wrap.\n * @return {import(\"../coordinate.js\").Coordinate} The interpolated coordinate.\n */\nfunction interpolateCoordinate(coordinates, index) {\n const count = coordinates.length;\n let startIndex = Math.floor(index);\n const along = index - startIndex;\n if (startIndex >= count) {\n startIndex -= count;\n } else if (startIndex < 0) {\n startIndex += count;\n }\n let endIndex = startIndex + 1;\n if (endIndex >= count) {\n endIndex -= count;\n }\n const start = coordinates[startIndex];\n const x0 = start[0];\n const y0 = start[1];\n const end = coordinates[endIndex];\n const dx = end[0] - x0;\n const dy = end[1] - y0;\n return [x0 + dx * along, y0 + dy * along];\n}\n\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature<import(\"../Observable\").EventTypes, import(\"../events/Event.js\").default, Return> &\n * import(\"../Observable\").OnSignature<import(\"../ObjectEventType\").Types|\n * 'change:active', import(\"../Object\").ObjectEvent, Return> &\n * import(\"../Observable\").OnSignature<'drawabort'|'drawend'|'drawstart', DrawEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature<import(\"../Observable\").EventTypes|import(\"../ObjectEventType\").Types|\n * 'change:active'|'drawabort'|'drawend'|'drawstart', Return>} DrawOnSignature\n */\n\n/**\n * @classdesc\n * Interaction for drawing feature geometries.\n *\n * @fires DrawEvent\n * @api\n */\nclass Draw extends _Pointer_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"] {\n /**\n * @param {Options} options Options.\n */\n constructor(options) {\n const pointerOptions = /** @type {import(\"./Pointer.js\").Options} */\n options;\n if (!pointerOptions.stopDown) {\n pointerOptions.stopDown = _functions_js__WEBPACK_IMPORTED_MODULE_11__.FALSE;\n }\n super(pointerOptions);\n\n /***\n * @type {DrawOnSignature<import(\"../events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {DrawOnSignature<import(\"../events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {DrawOnSignature<void>}\n */\n this.un;\n\n /**\n * @type {boolean}\n * @private\n */\n this.shouldHandle_ = false;\n\n /**\n * @type {import(\"../pixel.js\").Pixel}\n * @private\n */\n this.downPx_ = null;\n\n /**\n * @type {ReturnType<typeof setTimeout>}\n * @private\n */\n this.downTimeout_;\n\n /**\n * @type {number|undefined}\n * @private\n */\n this.lastDragTime_;\n\n /**\n * Pointer type of the last pointermove event\n * @type {string}\n * @private\n */\n this.pointerType_;\n\n /**\n * @type {boolean}\n * @private\n */\n this.freehand_ = false;\n\n /**\n * Target source for drawn features.\n * @type {VectorSource|null}\n * @private\n */\n this.source_ = options.source ? options.source : null;\n\n /**\n * Target collection for drawn features.\n * @type {import(\"../Collection.js\").default<Feature>|null}\n * @private\n */\n this.features_ = options.features ? options.features : null;\n\n /**\n * Pixel distance for snapping.\n * @type {number}\n * @private\n */\n this.snapTolerance_ = options.snapTolerance ? options.snapTolerance : 12;\n\n /**\n * Geometry type.\n * @type {import(\"../geom/Geometry.js\").Type}\n * @private\n */\n this.type_ = /** @type {import(\"../geom/Geometry.js\").Type} */\n options.type;\n\n /**\n * Drawing mode (derived from geometry type.\n * @type {Mode}\n * @private\n */\n this.mode_ = getMode(this.type_);\n\n /**\n * Stop click, singleclick, and doubleclick events from firing during drawing.\n * Default is `false`.\n * @type {boolean}\n * @private\n */\n this.stopClick_ = !!options.stopClick;\n\n /**\n * The number of points that must be drawn before a polygon ring or line\n * string can be finished. The default is 3 for polygon rings and 2 for\n * line strings.\n * @type {number}\n * @private\n */\n this.minPoints_ = options.minPoints ? options.minPoints : this.mode_ === 'Polygon' ? 3 : 2;\n\n /**\n * The number of points that can be drawn before a polygon ring or line string\n * is finished. The default is no restriction.\n * @type {number}\n * @private\n */\n this.maxPoints_ = this.mode_ === 'Circle' ? 2 : options.maxPoints ? options.maxPoints : Infinity;\n\n /**\n * A function to decide if a potential finish coordinate is permissible\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.finishCondition_ = options.finishCondition ? options.finishCondition : _functions_js__WEBPACK_IMPORTED_MODULE_11__.TRUE;\n\n /**\n * @private\n * @type {import(\"../geom/Geometry.js\").GeometryLayout}\n */\n this.geometryLayout_ = options.geometryLayout ? options.geometryLayout : 'XY';\n let geometryFunction = options.geometryFunction;\n if (!geometryFunction) {\n const mode = this.mode_;\n if (mode === 'Circle') {\n /**\n * @param {!LineCoordType} coordinates The coordinates.\n * @param {import(\"../geom/SimpleGeometry.js\").default|undefined} geometry Optional geometry.\n * @param {import(\"../proj/Projection.js\").default} projection The view projection.\n * @return {import(\"../geom/SimpleGeometry.js\").default} A geometry.\n */\n geometryFunction = function (coordinates, geometry, projection) {\n const circle = geometry ? (/** @type {Circle} */geometry) : new _geom_Circle_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"]([NaN, NaN]);\n const center = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(coordinates[0], projection);\n const squaredLength = (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_9__.squaredDistance)(center, (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(coordinates[coordinates.length - 1], projection));\n circle.setCenterAndRadius(center, Math.sqrt(squaredLength), this.geometryLayout_);\n const userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getUserProjection)();\n if (userProjection) {\n circle.transform(projection, userProjection);\n }\n return circle;\n };\n } else {\n let Constructor;\n if (mode === 'Point') {\n Constructor = _geom_Point_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"];\n } else if (mode === 'LineString') {\n Constructor = _geom_LineString_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\n } else if (mode === 'Polygon') {\n Constructor = _geom_Polygon_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\n }\n /**\n * @param {!LineCoordType} coordinates The coordinates.\n * @param {import(\"../geom/SimpleGeometry.js\").default|undefined} geometry Optional geometry.\n * @param {import(\"../proj/Projection.js\").default} projection The view projection.\n * @return {import(\"../geom/SimpleGeometry.js\").default} A geometry.\n */\n geometryFunction = function (coordinates, geometry, projection) {\n if (geometry) {\n if (mode === 'Polygon') {\n if (coordinates[0].length) {\n // Add a closing coordinate to match the first\n geometry.setCoordinates([coordinates[0].concat([coordinates[0][0]])], this.geometryLayout_);\n } else {\n geometry.setCoordinates([], this.geometryLayout_);\n }\n } else {\n geometry.setCoordinates(coordinates, this.geometryLayout_);\n }\n } else {\n geometry = new Constructor(coordinates, this.geometryLayout_);\n }\n return geometry;\n };\n }\n }\n\n /**\n * @type {GeometryFunction}\n * @private\n */\n this.geometryFunction_ = geometryFunction;\n\n /**\n * @type {number}\n * @private\n */\n this.dragVertexDelay_ = options.dragVertexDelay !== undefined ? options.dragVertexDelay : 500;\n\n /**\n * Finish coordinate for the feature (first point for polygons, last point for\n * linestrings).\n * @type {import(\"../coordinate.js\").Coordinate}\n * @private\n */\n this.finishCoordinate_ = null;\n\n /**\n * Sketch feature.\n * @type {Feature<import('../geom/SimpleGeometry.js').default>}\n * @private\n */\n this.sketchFeature_ = null;\n\n /**\n * Sketch point.\n * @type {Feature<Point>}\n * @private\n */\n this.sketchPoint_ = null;\n\n /**\n * Sketch coordinates. Used when drawing a line or polygon.\n * @type {SketchCoordType}\n * @private\n */\n this.sketchCoords_ = null;\n\n /**\n * Sketch line. Used when drawing polygon.\n * @type {Feature<LineString>}\n * @private\n */\n this.sketchLine_ = null;\n\n /**\n * Sketch line coordinates. Used when drawing a polygon or circle.\n * @type {LineCoordType}\n * @private\n */\n this.sketchLineCoords_ = null;\n\n /**\n * Squared tolerance for handling up events. If the squared distance\n * between a down and up event is greater than this tolerance, up events\n * will not be handled.\n * @type {number}\n * @private\n */\n this.squaredClickTolerance_ = options.clickTolerance ? options.clickTolerance * options.clickTolerance : 36;\n\n /**\n * Draw overlay where our sketch features are drawn.\n * @type {VectorLayer}\n * @private\n */\n this.overlay_ = new _layer_Vector_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"]({\n source: new _source_Vector_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"]({\n useSpatialIndex: false,\n wrapX: options.wrapX ? options.wrapX : false\n }),\n style: options.style ? options.style : getDefaultStyleFunction(),\n updateWhileInteracting: true\n });\n\n /**\n * Name of the geometry attribute for newly created features.\n * @type {string|undefined}\n * @private\n */\n this.geometryName_ = options.geometryName;\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.condition_ = options.condition ? options.condition : _events_condition_js__WEBPACK_IMPORTED_MODULE_16__.noModifierKeys;\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.freehandCondition_;\n if (options.freehand) {\n this.freehandCondition_ = _events_condition_js__WEBPACK_IMPORTED_MODULE_16__.always;\n } else {\n this.freehandCondition_ = options.freehandCondition ? options.freehandCondition : _events_condition_js__WEBPACK_IMPORTED_MODULE_16__.shiftKeyOnly;\n }\n\n /**\n * @type {import(\"../events/condition.js\").Condition}\n * @private\n */\n this.traceCondition_;\n this.setTrace(options.trace || false);\n\n /**\n * @type {TraceState}\n * @private\n */\n this.traceState_ = {\n active: false\n };\n\n /**\n * @type {VectorSource|null}\n * @private\n */\n this.traceSource_ = options.traceSource || options.source || null;\n this.addChangeListener(_Property_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"].ACTIVE, this.updateState_);\n }\n\n /**\n * Toggle tracing mode or set a tracing condition.\n *\n * @param {boolean|import(\"../events/condition.js\").Condition} trace A boolean to toggle tracing mode or an event\n * condition that will be checked when a feature is clicked to determine if tracing should be active.\n */\n setTrace(trace) {\n let condition;\n if (!trace) {\n condition = _events_condition_js__WEBPACK_IMPORTED_MODULE_16__.never;\n } else if (trace === true) {\n condition = _events_condition_js__WEBPACK_IMPORTED_MODULE_16__.always;\n } else {\n condition = trace;\n }\n this.traceCondition_ = condition;\n }\n\n /**\n * Remove the interaction from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../Map.js\").default} map Map.\n */\n setMap(map) {\n super.setMap(map);\n this.updateState_();\n }\n\n /**\n * Get the overlay layer that this interaction renders sketch features to.\n * @return {VectorLayer} Overlay layer.\n * @api\n */\n getOverlay() {\n return this.overlay_;\n }\n\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} and may actually draw or finish the drawing.\n * @param {import(\"../MapBrowserEvent.js\").default} event Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @api\n */\n handleEvent(event) {\n if (event.originalEvent.type === _events_EventType_js__WEBPACK_IMPORTED_MODULE_18__[\"default\"].CONTEXTMENU) {\n // Avoid context menu for long taps when drawing on mobile\n event.originalEvent.preventDefault();\n }\n this.freehand_ = this.mode_ !== 'Point' && this.freehandCondition_(event);\n let move = event.type === _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"].POINTERMOVE;\n let pass = true;\n if (!this.freehand_ && this.lastDragTime_ && event.type === _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"].POINTERDRAG) {\n const now = Date.now();\n if (now - this.lastDragTime_ >= this.dragVertexDelay_) {\n this.downPx_ = event.pixel;\n this.shouldHandle_ = !this.freehand_;\n move = true;\n } else {\n this.lastDragTime_ = undefined;\n }\n if (this.shouldHandle_ && this.downTimeout_ !== undefined) {\n clearTimeout(this.downTimeout_);\n this.downTimeout_ = undefined;\n }\n }\n if (this.freehand_ && event.type === _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"].POINTERDRAG && this.sketchFeature_ !== null) {\n this.addToDrawing_(event.coordinate);\n pass = false;\n } else if (this.freehand_ && event.type === _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"].POINTERDOWN) {\n pass = false;\n } else if (move && this.getPointerCount() < 2) {\n pass = event.type === _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"].POINTERMOVE;\n if (pass && this.freehand_) {\n this.handlePointerMove_(event);\n if (this.shouldHandle_) {\n // Avoid page scrolling when freehand drawing on mobile\n event.originalEvent.preventDefault();\n }\n } else if (event.originalEvent.pointerType === 'mouse' || event.type === _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"].POINTERDRAG && this.downTimeout_ === undefined) {\n this.handlePointerMove_(event);\n }\n } else if (event.type === _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"].DBLCLICK) {\n pass = false;\n }\n return super.handleEvent(event) && pass;\n }\n\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n * @return {boolean} If the event was consumed.\n */\n handleDownEvent(event) {\n this.shouldHandle_ = !this.freehand_;\n if (this.freehand_) {\n this.downPx_ = event.pixel;\n if (!this.finishCoordinate_) {\n this.startDrawing_(event.coordinate);\n }\n return true;\n }\n if (!this.condition_(event)) {\n this.lastDragTime_ = undefined;\n return false;\n }\n this.lastDragTime_ = Date.now();\n this.downTimeout_ = setTimeout(() => {\n this.handlePointerMove_(new _MapBrowserEvent_js__WEBPACK_IMPORTED_MODULE_20__[\"default\"](_MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"].POINTERMOVE, event.map, event.originalEvent, false, event.frameState));\n }, this.dragVertexDelay_);\n this.downPx_ = event.pixel;\n return true;\n }\n\n /**\n * @private\n */\n deactivateTrace_() {\n this.traceState_ = {\n active: false\n };\n }\n\n /**\n * Activate or deactivate trace state based on a browser event.\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n * @private\n */\n toggleTraceState_(event) {\n if (!this.traceSource_ || !this.traceCondition_(event)) {\n return;\n }\n if (this.traceState_.active) {\n this.deactivateTrace_();\n return;\n }\n const map = this.getMap();\n const lowerLeft = map.getCoordinateFromPixel([event.pixel[0] - this.snapTolerance_, event.pixel[1] + this.snapTolerance_]);\n const upperRight = map.getCoordinateFromPixel([event.pixel[0] + this.snapTolerance_, event.pixel[1] - this.snapTolerance_]);\n const extent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_21__.boundingExtent)([lowerLeft, upperRight]);\n const features = this.traceSource_.getFeaturesInExtent(extent);\n if (features.length === 0) {\n return;\n }\n const targets = getTraceTargets(event.coordinate, features);\n if (targets.length) {\n this.traceState_ = {\n active: true,\n startPx: event.pixel.slice(),\n targets: targets,\n targetIndex: -1\n };\n }\n }\n\n /**\n * @param {TraceTarget} target The trace target.\n * @param {number} endIndex The new end index of the trace.\n * @private\n */\n addOrRemoveTracedCoordinates_(target, endIndex) {\n // three cases to handle:\n // 1. traced in the same direction and points need adding\n // 2. traced in the same direction and points need removing\n // 3. traced in a new direction\n const previouslyForward = target.startIndex <= target.endIndex;\n const currentlyForward = target.startIndex <= endIndex;\n if (previouslyForward === currentlyForward) {\n // same direction\n if (previouslyForward && endIndex > target.endIndex || !previouslyForward && endIndex < target.endIndex) {\n // case 1 - add new points\n this.addTracedCoordinates_(target, target.endIndex, endIndex);\n } else if (previouslyForward && endIndex < target.endIndex || !previouslyForward && endIndex > target.endIndex) {\n // case 2 - remove old points\n this.removeTracedCoordinates_(endIndex, target.endIndex);\n }\n } else {\n // case 3 - remove old points, add new points\n this.removeTracedCoordinates_(target.startIndex, target.endIndex);\n this.addTracedCoordinates_(target, target.startIndex, endIndex);\n }\n }\n\n /**\n * @param {number} fromIndex The start index.\n * @param {number} toIndex The end index.\n * @private\n */\n removeTracedCoordinates_(fromIndex, toIndex) {\n if (fromIndex === toIndex) {\n return;\n }\n let remove = 0;\n if (fromIndex < toIndex) {\n const start = Math.ceil(fromIndex);\n let end = Math.floor(toIndex);\n if (end === toIndex) {\n end -= 1;\n }\n remove = end - start + 1;\n } else {\n const start = Math.floor(fromIndex);\n let end = Math.ceil(toIndex);\n if (end === toIndex) {\n end += 1;\n }\n remove = start - end + 1;\n }\n if (remove > 0) {\n this.removeLastPoints_(remove);\n }\n }\n\n /**\n * @param {TraceTarget} target The trace target.\n * @param {number} fromIndex The start index.\n * @param {number} toIndex The end index.\n * @private\n */\n addTracedCoordinates_(target, fromIndex, toIndex) {\n if (fromIndex === toIndex) {\n return;\n }\n const coordinates = [];\n if (fromIndex < toIndex) {\n // forward trace\n const start = Math.ceil(fromIndex);\n let end = Math.floor(toIndex);\n if (end === toIndex) {\n // if end is snapped to a vertex, it will be added later\n end -= 1;\n }\n for (let i = start; i <= end; ++i) {\n coordinates.push(getCoordinate(target.coordinates, i));\n }\n } else {\n // reverse trace\n const start = Math.floor(fromIndex);\n let end = Math.ceil(toIndex);\n if (end === toIndex) {\n end += 1;\n }\n for (let i = start; i >= end; --i) {\n coordinates.push(getCoordinate(target.coordinates, i));\n }\n }\n if (coordinates.length) {\n this.appendCoordinates(coordinates);\n }\n }\n\n /**\n * Update the trace.\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n * @private\n */\n updateTrace_(event) {\n const traceState = this.traceState_;\n if (!traceState.active) {\n return;\n }\n if (traceState.targetIndex === -1) {\n // check if we are ready to pick a target\n if ((0,_coordinate_js__WEBPACK_IMPORTED_MODULE_9__.distance)(traceState.startPx, event.pixel) < this.snapTolerance_) {\n return;\n }\n }\n const updatedTraceTarget = getTraceTargetUpdate(event.coordinate, traceState, this.getMap(), this.snapTolerance_);\n if (traceState.targetIndex !== updatedTraceTarget.index) {\n // target changed\n if (traceState.targetIndex !== -1) {\n // remove points added during previous trace\n const oldTarget = traceState.targets[traceState.targetIndex];\n this.removeTracedCoordinates_(oldTarget.startIndex, oldTarget.endIndex);\n }\n // add points for the new target\n const newTarget = traceState.targets[updatedTraceTarget.index];\n this.addTracedCoordinates_(newTarget, newTarget.startIndex, updatedTraceTarget.endIndex);\n } else {\n // target stayed the same\n const target = traceState.targets[traceState.targetIndex];\n this.addOrRemoveTracedCoordinates_(target, updatedTraceTarget.endIndex);\n }\n\n // modify the state with updated info\n traceState.targetIndex = updatedTraceTarget.index;\n const target = traceState.targets[traceState.targetIndex];\n target.endIndex = updatedTraceTarget.endIndex;\n\n // update event coordinate and pixel to match end point of final segment\n const coordinate = interpolateCoordinate(target.coordinates, target.endIndex);\n const pixel = this.getMap().getPixelFromCoordinate(coordinate);\n event.coordinate = coordinate;\n event.pixel = [Math.round(pixel[0]), Math.round(pixel[1])];\n }\n\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} event Event.\n * @return {boolean} If the event was consumed.\n */\n handleUpEvent(event) {\n let pass = true;\n if (this.getPointerCount() === 0) {\n if (this.downTimeout_) {\n clearTimeout(this.downTimeout_);\n this.downTimeout_ = undefined;\n }\n this.handlePointerMove_(event);\n const tracing = this.traceState_.active;\n this.toggleTraceState_(event);\n if (this.shouldHandle_) {\n const startingToDraw = !this.finishCoordinate_;\n if (startingToDraw) {\n this.startDrawing_(event.coordinate);\n }\n if (!startingToDraw && this.freehand_) {\n this.finishDrawing();\n } else if (!this.freehand_ && (!startingToDraw || this.mode_ === 'Point')) {\n if (this.atFinish_(event.pixel, tracing)) {\n if (this.finishCondition_(event)) {\n this.finishDrawing();\n }\n } else {\n this.addToDrawing_(event.coordinate);\n }\n }\n pass = false;\n } else if (this.freehand_) {\n this.abortDrawing();\n }\n }\n if (!pass && this.stopClick_) {\n event.preventDefault();\n }\n return pass;\n }\n\n /**\n * Handle move events.\n * @param {import(\"../MapBrowserEvent.js\").default} event A move event.\n * @private\n */\n handlePointerMove_(event) {\n this.pointerType_ = event.originalEvent.pointerType;\n if (this.downPx_ && (!this.freehand_ && this.shouldHandle_ || this.freehand_ && !this.shouldHandle_)) {\n const downPx = this.downPx_;\n const clickPx = event.pixel;\n const dx = downPx[0] - clickPx[0];\n const dy = downPx[1] - clickPx[1];\n const squaredDistance = dx * dx + dy * dy;\n this.shouldHandle_ = this.freehand_ ? squaredDistance > this.squaredClickTolerance_ : squaredDistance <= this.squaredClickTolerance_;\n if (!this.shouldHandle_) {\n return;\n }\n }\n if (!this.finishCoordinate_) {\n this.createOrUpdateSketchPoint_(event.coordinate.slice());\n return;\n }\n this.updateTrace_(event);\n this.modifyDrawing_(event.coordinate);\n }\n\n /**\n * Determine if an event is within the snapping tolerance of the start coord.\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel.\n * @param {boolean} [tracing] Drawing in trace mode (only stop if at the starting point).\n * @return {boolean} The event is within the snapping tolerance of the start.\n * @private\n */\n atFinish_(pixel, tracing) {\n let at = false;\n if (this.sketchFeature_) {\n let potentiallyDone = false;\n let potentiallyFinishCoordinates = [this.finishCoordinate_];\n const mode = this.mode_;\n if (mode === 'Point') {\n at = true;\n } else if (mode === 'Circle') {\n at = this.sketchCoords_.length === 2;\n } else if (mode === 'LineString') {\n potentiallyDone = !tracing && this.sketchCoords_.length > this.minPoints_;\n } else if (mode === 'Polygon') {\n const sketchCoords = /** @type {PolyCoordType} */this.sketchCoords_;\n potentiallyDone = sketchCoords[0].length > this.minPoints_;\n potentiallyFinishCoordinates = [sketchCoords[0][0], sketchCoords[0][sketchCoords[0].length - 2]];\n if (tracing) {\n potentiallyFinishCoordinates = [sketchCoords[0][0]];\n } else {\n potentiallyFinishCoordinates = [sketchCoords[0][0], sketchCoords[0][sketchCoords[0].length - 2]];\n }\n }\n if (potentiallyDone) {\n const map = this.getMap();\n for (let i = 0, ii = potentiallyFinishCoordinates.length; i < ii; i++) {\n const finishCoordinate = potentiallyFinishCoordinates[i];\n const finishPixel = map.getPixelFromCoordinate(finishCoordinate);\n const dx = pixel[0] - finishPixel[0];\n const dy = pixel[1] - finishPixel[1];\n const snapTolerance = this.freehand_ ? 1 : this.snapTolerance_;\n at = Math.sqrt(dx * dx + dy * dy) <= snapTolerance;\n if (at) {\n this.finishCoordinate_ = finishCoordinate;\n break;\n }\n }\n }\n }\n return at;\n }\n\n /**\n * @param {import(\"../coordinate\").Coordinate} coordinates Coordinate.\n * @private\n */\n createOrUpdateSketchPoint_(coordinates) {\n if (!this.sketchPoint_) {\n this.sketchPoint_ = new _Feature_js__WEBPACK_IMPORTED_MODULE_22__[\"default\"](new _geom_Point_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"](coordinates));\n this.updateSketchFeatures_();\n } else {\n const sketchPointGeom = this.sketchPoint_.getGeometry();\n sketchPointGeom.setCoordinates(coordinates);\n }\n }\n\n /**\n * @param {import(\"../geom/Polygon.js\").default} geometry Polygon geometry.\n * @private\n */\n createOrUpdateCustomSketchLine_(geometry) {\n if (!this.sketchLine_) {\n this.sketchLine_ = new _Feature_js__WEBPACK_IMPORTED_MODULE_22__[\"default\"]();\n }\n const ring = geometry.getLinearRing(0);\n let sketchLineGeom = this.sketchLine_.getGeometry();\n if (!sketchLineGeom) {\n sketchLineGeom = new _geom_LineString_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"](ring.getFlatCoordinates(), ring.getLayout());\n this.sketchLine_.setGeometry(sketchLineGeom);\n } else {\n sketchLineGeom.setFlatCoordinates(ring.getLayout(), ring.getFlatCoordinates());\n sketchLineGeom.changed();\n }\n }\n\n /**\n * Start the drawing.\n * @param {import(\"../coordinate.js\").Coordinate} start Start coordinate.\n * @private\n */\n startDrawing_(start) {\n const projection = this.getMap().getView().getProjection();\n const stride = (0,_geom_SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_23__.getStrideForLayout)(this.geometryLayout_);\n while (start.length < stride) {\n start.push(0);\n }\n this.finishCoordinate_ = start;\n if (this.mode_ === 'Point') {\n this.sketchCoords_ = start.slice();\n } else if (this.mode_ === 'Polygon') {\n this.sketchCoords_ = [[start.slice(), start.slice()]];\n this.sketchLineCoords_ = this.sketchCoords_[0];\n } else {\n this.sketchCoords_ = [start.slice(), start.slice()];\n }\n if (this.sketchLineCoords_) {\n this.sketchLine_ = new _Feature_js__WEBPACK_IMPORTED_MODULE_22__[\"default\"](new _geom_LineString_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this.sketchLineCoords_));\n }\n const geometry = this.geometryFunction_(this.sketchCoords_, undefined, projection);\n this.sketchFeature_ = new _Feature_js__WEBPACK_IMPORTED_MODULE_22__[\"default\"]();\n if (this.geometryName_) {\n this.sketchFeature_.setGeometryName(this.geometryName_);\n }\n this.sketchFeature_.setGeometry(geometry);\n this.updateSketchFeatures_();\n this.dispatchEvent(new DrawEvent(DrawEventType.DRAWSTART, this.sketchFeature_));\n }\n\n /**\n * Modify the drawing.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @private\n */\n modifyDrawing_(coordinate) {\n const map = this.getMap();\n const geometry = this.sketchFeature_.getGeometry();\n const projection = map.getView().getProjection();\n const stride = (0,_geom_SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_23__.getStrideForLayout)(this.geometryLayout_);\n let coordinates, last;\n while (coordinate.length < stride) {\n coordinate.push(0);\n }\n if (this.mode_ === 'Point') {\n last = this.sketchCoords_;\n } else if (this.mode_ === 'Polygon') {\n coordinates = /** @type {PolyCoordType} */this.sketchCoords_[0];\n last = coordinates[coordinates.length - 1];\n if (this.atFinish_(map.getPixelFromCoordinate(coordinate))) {\n // snap to finish\n coordinate = this.finishCoordinate_.slice();\n }\n } else {\n coordinates = this.sketchCoords_;\n last = coordinates[coordinates.length - 1];\n }\n last[0] = coordinate[0];\n last[1] = coordinate[1];\n this.geometryFunction_(/** @type {!LineCoordType} */this.sketchCoords_, geometry, projection);\n if (this.sketchPoint_) {\n const sketchPointGeom = this.sketchPoint_.getGeometry();\n sketchPointGeom.setCoordinates(coordinate);\n }\n if (geometry.getType() === 'Polygon' && this.mode_ !== 'Polygon') {\n this.createOrUpdateCustomSketchLine_(/** @type {Polygon} */geometry);\n } else if (this.sketchLineCoords_) {\n const sketchLineGeom = this.sketchLine_.getGeometry();\n sketchLineGeom.setCoordinates(this.sketchLineCoords_);\n }\n this.updateSketchFeatures_();\n }\n\n /**\n * Add a new coordinate to the drawing.\n * @param {!PointCoordType} coordinate Coordinate\n * @private\n */\n addToDrawing_(coordinate) {\n const geometry = this.sketchFeature_.getGeometry();\n const projection = this.getMap().getView().getProjection();\n let done;\n let coordinates;\n const mode = this.mode_;\n if (mode === 'LineString' || mode === 'Circle') {\n this.finishCoordinate_ = coordinate.slice();\n coordinates = /** @type {LineCoordType} */this.sketchCoords_;\n if (coordinates.length >= this.maxPoints_) {\n if (this.freehand_) {\n coordinates.pop();\n } else {\n done = true;\n }\n }\n coordinates.push(coordinate.slice());\n this.geometryFunction_(coordinates, geometry, projection);\n } else if (mode === 'Polygon') {\n coordinates = /** @type {PolyCoordType} */this.sketchCoords_[0];\n if (coordinates.length >= this.maxPoints_) {\n if (this.freehand_) {\n coordinates.pop();\n } else {\n done = true;\n }\n }\n coordinates.push(coordinate.slice());\n if (done) {\n this.finishCoordinate_ = coordinates[0];\n }\n this.geometryFunction_(this.sketchCoords_, geometry, projection);\n }\n this.createOrUpdateSketchPoint_(coordinate.slice());\n this.updateSketchFeatures_();\n if (done) {\n this.finishDrawing();\n }\n }\n\n /**\n * @param {number} n The number of points to remove.\n */\n removeLastPoints_(n) {\n if (!this.sketchFeature_) {\n return;\n }\n const geometry = this.sketchFeature_.getGeometry();\n const projection = this.getMap().getView().getProjection();\n const mode = this.mode_;\n for (let i = 0; i < n; ++i) {\n let coordinates;\n if (mode === 'LineString' || mode === 'Circle') {\n coordinates = /** @type {LineCoordType} */this.sketchCoords_;\n coordinates.splice(-2, 1);\n if (coordinates.length >= 2) {\n this.finishCoordinate_ = coordinates[coordinates.length - 2].slice();\n const finishCoordinate = this.finishCoordinate_.slice();\n coordinates[coordinates.length - 1] = finishCoordinate;\n this.createOrUpdateSketchPoint_(finishCoordinate);\n }\n this.geometryFunction_(coordinates, geometry, projection);\n if (geometry.getType() === 'Polygon' && this.sketchLine_) {\n this.createOrUpdateCustomSketchLine_(/** @type {Polygon} */geometry);\n }\n } else if (mode === 'Polygon') {\n coordinates = /** @type {PolyCoordType} */this.sketchCoords_[0];\n coordinates.splice(-2, 1);\n const sketchLineGeom = this.sketchLine_.getGeometry();\n if (coordinates.length >= 2) {\n const finishCoordinate = coordinates[coordinates.length - 2].slice();\n coordinates[coordinates.length - 1] = finishCoordinate;\n this.createOrUpdateSketchPoint_(finishCoordinate);\n }\n sketchLineGeom.setCoordinates(coordinates);\n this.geometryFunction_(this.sketchCoords_, geometry, projection);\n }\n if (coordinates.length === 1) {\n this.abortDrawing();\n break;\n }\n }\n this.updateSketchFeatures_();\n }\n\n /**\n * Remove last point of the feature currently being drawn. Does not do anything when\n * drawing POINT or MULTI_POINT geometries.\n * @api\n */\n removeLastPoint() {\n this.removeLastPoints_(1);\n }\n\n /**\n * Stop drawing and add the sketch feature to the target layer.\n * The {@link module:ol/interaction/Draw~DrawEventType.DRAWEND} event is\n * dispatched before inserting the feature.\n * @api\n */\n finishDrawing() {\n const sketchFeature = this.abortDrawing_();\n if (!sketchFeature) {\n return;\n }\n let coordinates = this.sketchCoords_;\n const geometry = sketchFeature.getGeometry();\n const projection = this.getMap().getView().getProjection();\n if (this.mode_ === 'LineString') {\n // remove the redundant last point\n coordinates.pop();\n this.geometryFunction_(coordinates, geometry, projection);\n } else if (this.mode_ === 'Polygon') {\n // remove the redundant last point in ring\n /** @type {PolyCoordType} */\n coordinates[0].pop();\n this.geometryFunction_(coordinates, geometry, projection);\n coordinates = geometry.getCoordinates();\n }\n\n // cast multi-part geometries\n if (this.type_ === 'MultiPoint') {\n sketchFeature.setGeometry(new _geom_MultiPoint_js__WEBPACK_IMPORTED_MODULE_24__[\"default\"]([(/** @type {PointCoordType} */coordinates)]));\n } else if (this.type_ === 'MultiLineString') {\n sketchFeature.setGeometry(new _geom_MultiLineString_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]([(/** @type {LineCoordType} */coordinates)]));\n } else if (this.type_ === 'MultiPolygon') {\n sketchFeature.setGeometry(new _geom_MultiPolygon_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]([(/** @type {PolyCoordType} */coordinates)]));\n }\n\n // First dispatch event to allow full set up of feature\n this.dispatchEvent(new DrawEvent(DrawEventType.DRAWEND, sketchFeature));\n\n // Then insert feature\n if (this.features_) {\n this.features_.push(sketchFeature);\n }\n if (this.source_) {\n this.source_.addFeature(sketchFeature);\n }\n }\n\n /**\n * Stop drawing without adding the sketch feature to the target layer.\n * @return {Feature<import(\"../geom/SimpleGeometry.js\").default>|null} The sketch feature (or null if none).\n * @private\n */\n abortDrawing_() {\n this.finishCoordinate_ = null;\n const sketchFeature = this.sketchFeature_;\n this.sketchFeature_ = null;\n this.sketchPoint_ = null;\n this.sketchLine_ = null;\n this.overlay_.getSource().clear(true);\n this.deactivateTrace_();\n return sketchFeature;\n }\n\n /**\n * Stop drawing without adding the sketch feature to the target layer.\n * @api\n */\n abortDrawing() {\n const sketchFeature = this.abortDrawing_();\n if (sketchFeature) {\n this.dispatchEvent(new DrawEvent(DrawEventType.DRAWABORT, sketchFeature));\n }\n }\n\n /**\n * Append coordinates to the end of the geometry that is currently being drawn.\n * This can be used when drawing LineStrings or Polygons. Coordinates will\n * either be appended to the current LineString or the outer ring of the current\n * Polygon. If no geometry is being drawn, a new one will be created.\n * @param {!LineCoordType} coordinates Linear coordinates to be appended to\n * the coordinate array.\n * @api\n */\n appendCoordinates(coordinates) {\n const mode = this.mode_;\n const newDrawing = !this.sketchFeature_;\n if (newDrawing) {\n this.startDrawing_(coordinates[0]);\n }\n /** @type {LineCoordType} */\n let sketchCoords;\n if (mode === 'LineString' || mode === 'Circle') {\n sketchCoords = /** @type {LineCoordType} */this.sketchCoords_;\n } else if (mode === 'Polygon') {\n sketchCoords = this.sketchCoords_ && this.sketchCoords_.length ? /** @type {PolyCoordType} */this.sketchCoords_[0] : [];\n } else {\n return;\n }\n if (newDrawing) {\n sketchCoords.shift();\n }\n\n // Remove last coordinate from sketch drawing (this coordinate follows cursor position)\n sketchCoords.pop();\n\n // Append coordinate list\n for (let i = 0; i < coordinates.length; i++) {\n this.addToDrawing_(coordinates[i]);\n }\n const ending = coordinates[coordinates.length - 1];\n // Duplicate last coordinate for sketch drawing (cursor position)\n this.addToDrawing_(ending);\n this.modifyDrawing_(ending);\n }\n\n /**\n * Initiate draw mode by starting from an existing geometry which will\n * receive new additional points. This only works on features with\n * `LineString` geometries, where the interaction will extend lines by adding\n * points to the end of the coordinates array.\n * This will change the original feature, instead of drawing a copy.\n *\n * The function will dispatch a `drawstart` event.\n *\n * @param {!Feature<LineString>} feature Feature to be extended.\n * @api\n */\n extend(feature) {\n const geometry = feature.getGeometry();\n const lineString = geometry;\n this.sketchFeature_ = feature;\n this.sketchCoords_ = lineString.getCoordinates();\n const last = this.sketchCoords_[this.sketchCoords_.length - 1];\n this.finishCoordinate_ = last.slice();\n this.sketchCoords_.push(last.slice());\n this.sketchPoint_ = new _Feature_js__WEBPACK_IMPORTED_MODULE_22__[\"default\"](new _geom_Point_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"](last));\n this.updateSketchFeatures_();\n this.dispatchEvent(new DrawEvent(DrawEventType.DRAWSTART, this.sketchFeature_));\n }\n\n /**\n * Redraw the sketch features.\n * @private\n */\n updateSketchFeatures_() {\n const sketchFeatures = [];\n if (this.sketchFeature_) {\n sketchFeatures.push(this.sketchFeature_);\n }\n if (this.sketchLine_) {\n sketchFeatures.push(this.sketchLine_);\n }\n if (this.sketchPoint_) {\n sketchFeatures.push(this.sketchPoint_);\n }\n const overlaySource = this.overlay_.getSource();\n overlaySource.clear(true);\n overlaySource.addFeatures(sketchFeatures);\n }\n\n /**\n * @private\n */\n updateState_() {\n const map = this.getMap();\n const active = this.getActive();\n if (!map || !active) {\n this.abortDrawing();\n }\n this.overlay_.setMap(active ? map : null);\n }\n}\n\n/**\n * @return {import(\"../style/Style.js\").StyleFunction} Styles.\n */\nfunction getDefaultStyleFunction() {\n const styles = (0,_style_Style_js__WEBPACK_IMPORTED_MODULE_25__.createEditingStyle)();\n return function (feature, resolution) {\n return styles[feature.getGeometry().getType()];\n };\n}\n\n/**\n * Create a `geometryFunction` for `type: 'Circle'` that will create a regular\n * polygon with a user specified number of sides and start angle instead of a\n * {@link import(\"../geom/Circle.js\").Circle} geometry.\n * @param {number} [sides] Number of sides of the regular polygon.\n * Default is 32.\n * @param {number} [angle] Angle of the first point in counter-clockwise\n * radians. 0 means East.\n * Default is the angle defined by the heading from the center of the\n * regular polygon to the current pointer position.\n * @return {GeometryFunction} Function that draws a polygon.\n * @api\n */\nfunction createRegularPolygon(sides, angle) {\n return function (coordinates, geometry, projection) {\n const center = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(/** @type {LineCoordType} */coordinates[0], projection);\n const end = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(/** @type {LineCoordType} */coordinates[coordinates.length - 1], projection);\n const radius = Math.sqrt((0,_coordinate_js__WEBPACK_IMPORTED_MODULE_9__.squaredDistance)(center, end));\n geometry = geometry || (0,_geom_Polygon_js__WEBPACK_IMPORTED_MODULE_6__.fromCircle)(new _geom_Circle_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"](center), sides);\n let internalAngle = angle;\n if (!angle && angle !== 0) {\n const x = end[0] - center[0];\n const y = end[1] - center[1];\n internalAngle = Math.atan2(y, x);\n }\n (0,_geom_Polygon_js__WEBPACK_IMPORTED_MODULE_6__.makeRegular)(/** @type {Polygon} */geometry, center, radius, internalAngle);\n const userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getUserProjection)();\n if (userProjection) {\n geometry.transform(projection, userProjection);\n }\n return geometry;\n };\n}\n\n/**\n * Create a `geometryFunction` that will create a box-shaped polygon (aligned\n * with the coordinate system axes). Use this with the draw interaction and\n * `type: 'Circle'` to return a box instead of a circle geometry.\n * @return {GeometryFunction} Function that draws a box-shaped polygon.\n * @api\n */\nfunction createBox() {\n return function (coordinates, geometry, projection) {\n const extent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_21__.boundingExtent)(/** @type {LineCoordType} */[coordinates[0], coordinates[coordinates.length - 1]].map(function (coordinate) {\n return (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(coordinate, projection);\n }));\n const boxCoordinates = [[(0,_extent_js__WEBPACK_IMPORTED_MODULE_21__.getBottomLeft)(extent), (0,_extent_js__WEBPACK_IMPORTED_MODULE_21__.getBottomRight)(extent), (0,_extent_js__WEBPACK_IMPORTED_MODULE_21__.getTopRight)(extent), (0,_extent_js__WEBPACK_IMPORTED_MODULE_21__.getTopLeft)(extent), (0,_extent_js__WEBPACK_IMPORTED_MODULE_21__.getBottomLeft)(extent)]];\n if (geometry) {\n geometry.setCoordinates(boxCoordinates);\n } else {\n geometry = new _geom_Polygon_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](boxCoordinates);\n }\n const userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getUserProjection)();\n if (userProjection) {\n geometry.transform(projection, userProjection);\n }\n return geometry;\n };\n}\n\n/**\n * Get the drawing mode. The mode for multi-part geometries is the same as for\n * their single-part cousins.\n * @param {import(\"../geom/Geometry.js\").Type} type Geometry type.\n * @return {Mode} Drawing mode.\n */\nfunction getMode(type) {\n switch (type) {\n case 'Point':\n case 'MultiPoint':\n return 'Point';\n case 'LineString':\n case 'MultiLineString':\n return 'LineString';\n case 'Polygon':\n case 'MultiPolygon':\n return 'Polygon';\n case 'Circle':\n return 'Circle';\n default:\n throw new Error('Invalid type: ' + type);\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Draw);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/Draw.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/Interaction.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ol/interaction/Interaction.js ***!
|
||
\****************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ pan: function() { return /* binding */ pan; },\n/* harmony export */ zoomByDelta: function() { return /* binding */ zoomByDelta; }\n/* harmony export */ });\n/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Object.js */ \"./node_modules/ol/Object.js\");\n/* harmony import */ var _Property_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Property.js */ \"./node_modules/ol/interaction/Property.js\");\n/* harmony import */ var _easing_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../easing.js */ \"./node_modules/ol/easing.js\");\n/**\n * @module ol/interaction/Interaction\n */\n\n\n\n\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature<import(\"../Observable\").EventTypes, import(\"../events/Event.js\").default, Return> &\n * import(\"../Observable\").OnSignature<import(\"../ObjectEventType\").Types|\n * 'change:active', import(\"../Object\").ObjectEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature<import(\"../Observable\").EventTypes|import(\"../ObjectEventType\").Types|\n * 'change:active', Return>} InteractionOnSignature\n */\n\n/**\n * Object literal with config options for interactions.\n * @typedef {Object} InteractionOptions\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} handleEvent\n * Method called by the map to notify the interaction that a browser event was\n * dispatched to the map. If the function returns a falsy value, propagation of\n * the event to other interactions in the map's interactions chain will be\n * prevented (this includes functions with no explicit return). The interactions\n * are traversed in reverse order of the interactions collection of the map.\n */\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * User actions that change the state of the map. Some are similar to controls,\n * but are not associated with a DOM element.\n * For example, {@link module:ol/interaction/KeyboardZoom~KeyboardZoom} is\n * functionally the same as {@link module:ol/control/Zoom~Zoom}, but triggered\n * by a keyboard event not a button element event.\n * Although interactions do not have a DOM element, some of them do render\n * vectors and so are visible on the screen.\n * @api\n */\nclass Interaction extends _Object_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {InteractionOptions} [options] Options.\n */\n constructor(options) {\n super();\n\n /***\n * @type {InteractionOnSignature<import(\"../events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {InteractionOnSignature<import(\"../events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {InteractionOnSignature<void>}\n */\n this.un;\n if (options && options.handleEvent) {\n this.handleEvent = options.handleEvent;\n }\n\n /**\n * @private\n * @type {import(\"../Map.js\").default|null}\n */\n this.map_ = null;\n this.setActive(true);\n }\n\n /**\n * Return whether the interaction is currently active.\n * @return {boolean} `true` if the interaction is active, `false` otherwise.\n * @observable\n * @api\n */\n getActive() {\n return /** @type {boolean} */this.get(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ACTIVE);\n }\n\n /**\n * Get the map associated with this interaction.\n * @return {import(\"../Map.js\").default|null} Map.\n * @api\n */\n getMap() {\n return this.map_;\n }\n\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event}.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @api\n */\n handleEvent(mapBrowserEvent) {\n return true;\n }\n\n /**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @observable\n * @api\n */\n setActive(active) {\n this.set(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ACTIVE, active);\n }\n\n /**\n * Remove the interaction from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../Map.js\").default|null} map Map.\n */\n setMap(map) {\n this.map_ = map;\n }\n}\n\n/**\n * @param {import(\"../View.js\").default} view View.\n * @param {import(\"../coordinate.js\").Coordinate} delta Delta.\n * @param {number} [duration] Duration.\n */\nfunction pan(view, delta, duration) {\n const currentCenter = view.getCenterInternal();\n if (currentCenter) {\n const center = [currentCenter[0] + delta[0], currentCenter[1] + delta[1]];\n view.animateInternal({\n duration: duration !== undefined ? duration : 250,\n easing: _easing_js__WEBPACK_IMPORTED_MODULE_2__.linear,\n center: view.getConstrainedCenter(center)\n });\n }\n}\n\n/**\n * @param {import(\"../View.js\").default} view View.\n * @param {number} delta Delta from previous zoom level.\n * @param {import(\"../coordinate.js\").Coordinate} [anchor] Anchor coordinate in the user projection.\n * @param {number} [duration] Duration.\n */\nfunction zoomByDelta(view, delta, anchor, duration) {\n const currentZoom = view.getZoom();\n if (currentZoom === undefined) {\n return;\n }\n const newZoom = view.getConstrainedZoom(currentZoom + delta);\n const newResolution = view.getResolutionForZoom(newZoom);\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n view.animate({\n resolution: newResolution,\n anchor: anchor,\n duration: duration !== undefined ? duration : 250,\n easing: _easing_js__WEBPACK_IMPORTED_MODULE_2__.easeOut\n });\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Interaction);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/Interaction.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/KeyboardPan.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ol/interaction/KeyboardPan.js ***!
|
||
\****************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _Interaction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Interaction.js */ \"./node_modules/ol/interaction/Interaction.js\");\n/* harmony import */ var _events_Key_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../events/Key.js */ \"./node_modules/ol/events/Key.js\");\n/* harmony import */ var _events_condition_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events/condition.js */ \"./node_modules/ol/events/condition.js\");\n/* harmony import */ var _coordinate_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../coordinate.js */ \"./node_modules/ol/coordinate.js\");\n/**\n * @module ol/interaction/KeyboardPan\n */\n\n\n\n\n\n\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. Default is\n * {@link module:ol/events/condition.noModifierKeys} and\n * {@link module:ol/events/condition.targetNotEditable}.\n * @property {number} [duration=100] Animation duration in milliseconds.\n * @property {number} [pixelDelta=128] The amount of pixels to pan on each key\n * press.\n */\n\n/**\n * @classdesc\n * Allows the user to pan the map using keyboard arrows.\n * Note that, although this interaction is by default included in maps,\n * the keys can only be used when browser focus is on the element to which\n * the keyboard events are attached. By default, this is the map div,\n * though you can change this with the `keyboardEventTarget` in\n * {@link module:ol/Map~Map}. `document` never loses focus but, for any other\n * element, focus will have to be on, and returned to, this element if the keys\n * are to function.\n * See also {@link module:ol/interaction/KeyboardZoom~KeyboardZoom}.\n * @api\n */\nclass KeyboardPan extends _Interaction_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n super();\n options = options || {};\n\n /**\n * @private\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Browser event.\n * @return {boolean} Combined condition result.\n */\n this.defaultCondition_ = function (mapBrowserEvent) {\n return (0,_events_condition_js__WEBPACK_IMPORTED_MODULE_1__.noModifierKeys)(mapBrowserEvent) && (0,_events_condition_js__WEBPACK_IMPORTED_MODULE_1__.targetNotEditable)(mapBrowserEvent);\n };\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.condition_ = options.condition !== undefined ? options.condition : this.defaultCondition_;\n\n /**\n * @private\n * @type {number}\n */\n this.duration_ = options.duration !== undefined ? options.duration : 100;\n\n /**\n * @private\n * @type {number}\n */\n this.pixelDelta_ = options.pixelDelta !== undefined ? options.pixelDelta : 128;\n }\n\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} if it was a\n * `KeyEvent`, and decides the direction to pan to (if an arrow key was\n * pressed).\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n */\n handleEvent(mapBrowserEvent) {\n let stopEvent = false;\n if (mapBrowserEvent.type == _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].KEYDOWN) {\n const keyEvent = /** @type {KeyboardEvent} */\n mapBrowserEvent.originalEvent;\n const key = keyEvent.key;\n if (this.condition_(mapBrowserEvent) && (key == _events_Key_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].DOWN || key == _events_Key_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].LEFT || key == _events_Key_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].RIGHT || key == _events_Key_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].UP)) {\n const map = mapBrowserEvent.map;\n const view = map.getView();\n const mapUnitsDelta = view.getResolution() * this.pixelDelta_;\n let deltaX = 0,\n deltaY = 0;\n if (key == _events_Key_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].DOWN) {\n deltaY = -mapUnitsDelta;\n } else if (key == _events_Key_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].LEFT) {\n deltaX = -mapUnitsDelta;\n } else if (key == _events_Key_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].RIGHT) {\n deltaX = mapUnitsDelta;\n } else {\n deltaY = mapUnitsDelta;\n }\n const delta = [deltaX, deltaY];\n (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_4__.rotate)(delta, view.getRotation());\n (0,_Interaction_js__WEBPACK_IMPORTED_MODULE_0__.pan)(view, delta, this.duration_);\n keyEvent.preventDefault();\n stopEvent = true;\n }\n }\n return !stopEvent;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (KeyboardPan);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/KeyboardPan.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/KeyboardZoom.js":
|
||
/*!*****************************************************!*\
|
||
!*** ./node_modules/ol/interaction/KeyboardZoom.js ***!
|
||
\*****************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _Interaction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Interaction.js */ \"./node_modules/ol/interaction/Interaction.js\");\n/* harmony import */ var _events_condition_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events/condition.js */ \"./node_modules/ol/events/condition.js\");\n/**\n * @module ol/interaction/KeyboardZoom\n */\n\n\n\n\n/**\n * @typedef {Object} Options\n * @property {number} [duration=100] Animation duration in milliseconds.\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. The default condition is\n * that {@link module:ol/events/condition.targetNotEditable} is fulfilled and that\n * the platform modifier key isn't pressed\n * (!{@link module:ol/events/condition.platformModifierKey}).\n * @property {number} [delta=1] The zoom level delta on each key press.\n */\n\n/**\n * @classdesc\n * Allows the user to zoom the map using keyboard + and -.\n * Note that, although this interaction is by default included in maps,\n * the keys can only be used when browser focus is on the element to which\n * the keyboard events are attached. By default, this is the map div,\n * though you can change this with the `keyboardEventTarget` in\n * {@link module:ol/Map~Map}. `document` never loses focus but, for any other\n * element, focus will have to be on, and returned to, this element if the keys\n * are to function.\n * See also {@link module:ol/interaction/KeyboardPan~KeyboardPan}.\n * @api\n */\nclass KeyboardZoom extends _Interaction_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n super();\n options = options ? options : {};\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.condition_ = options.condition ? options.condition : function (mapBrowserEvent) {\n return !(0,_events_condition_js__WEBPACK_IMPORTED_MODULE_1__.platformModifierKey)(mapBrowserEvent) && (0,_events_condition_js__WEBPACK_IMPORTED_MODULE_1__.targetNotEditable)(mapBrowserEvent);\n };\n\n /**\n * @private\n * @type {number}\n */\n this.delta_ = options.delta ? options.delta : 1;\n\n /**\n * @private\n * @type {number}\n */\n this.duration_ = options.duration !== undefined ? options.duration : 100;\n }\n\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} if it was a\n * `KeyEvent`, and decides whether to zoom in or out (depending on whether the\n * key pressed was '+' or '-').\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n */\n handleEvent(mapBrowserEvent) {\n let stopEvent = false;\n if (mapBrowserEvent.type == _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].KEYDOWN || mapBrowserEvent.type == _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].KEYPRESS) {\n const keyEvent = /** @type {KeyboardEvent} */\n mapBrowserEvent.originalEvent;\n const key = keyEvent.key;\n if (this.condition_(mapBrowserEvent) && (key === '+' || key === '-')) {\n const map = mapBrowserEvent.map;\n const delta = key === '+' ? this.delta_ : -this.delta_;\n const view = map.getView();\n (0,_Interaction_js__WEBPACK_IMPORTED_MODULE_0__.zoomByDelta)(view, delta, undefined, this.duration_);\n keyEvent.preventDefault();\n stopEvent = true;\n }\n }\n return !stopEvent;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (KeyboardZoom);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/KeyboardZoom.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/Modify.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ol/interaction/Modify.js ***!
|
||
\***********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ModifyEvent: function() { return /* binding */ ModifyEvent; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Collection_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Collection.js */ \"./node_modules/ol/Collection.js\");\n/* harmony import */ var _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../CollectionEventType.js */ \"./node_modules/ol/CollectionEventType.js\");\n/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events/Event.js */ \"./node_modules/ol/events/Event.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _Feature_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../Feature.js */ \"./node_modules/ol/Feature.js\");\n/* harmony import */ var _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../MapBrowserEventType.js */ \"./node_modules/ol/MapBrowserEventType.js\");\n/* harmony import */ var _geom_Point_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geom/Point.js */ \"./node_modules/ol/geom/Point.js\");\n/* harmony import */ var _Pointer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Pointer.js */ \"./node_modules/ol/interaction/Pointer.js\");\n/* harmony import */ var _structs_RBush_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../structs/RBush.js */ \"./node_modules/ol/structs/RBush.js\");\n/* harmony import */ var _source_VectorEventType_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../source/VectorEventType.js */ \"./node_modules/ol/source/VectorEventType.js\");\n/* harmony import */ var _layer_Vector_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../layer/Vector.js */ \"./node_modules/ol/layer/Vector.js\");\n/* harmony import */ var _source_Vector_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../source/Vector.js */ \"./node_modules/ol/source/Vector.js\");\n/* harmony import */ var _events_condition_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../events/condition.js */ \"./node_modules/ol/events/condition.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _coordinate_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../coordinate.js */ \"./node_modules/ol/coordinate.js\");\n/* harmony import */ var _style_Style_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../style/Style.js */ \"./node_modules/ol/style/Style.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _geom_Polygon_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geom/Polygon.js */ \"./node_modules/ol/geom/Polygon.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../proj.js */ \"./node_modules/ol/proj.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n\n/**\n * @module ol/interaction/Modify\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * The segment index assigned to a circle's center when\n * breaking up a circle into ModifySegmentDataType segments.\n * @type {number}\n */\nconst CIRCLE_CENTER_INDEX = 0;\n\n/**\n * The segment index assigned to a circle's circumference when\n * breaking up a circle into ModifySegmentDataType segments.\n * @type {number}\n */\nconst CIRCLE_CIRCUMFERENCE_INDEX = 1;\nconst tempExtent = [0, 0, 0, 0];\nconst tempSegment = [];\n\n/**\n * @enum {string}\n */\nconst ModifyEventType = {\n /**\n * Triggered upon feature modification start\n * @event ModifyEvent#modifystart\n * @api\n */\n MODIFYSTART: 'modifystart',\n /**\n * Triggered upon feature modification end\n * @event ModifyEvent#modifyend\n * @api\n */\n MODIFYEND: 'modifyend'\n};\n\n/**\n * @typedef {Object} SegmentData\n * @property {Array<number>} [depth] Depth.\n * @property {Feature} feature Feature.\n * @property {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @property {number} [index] Index.\n * @property {Array<Array<number>>} segment Segment.\n * @property {Array<SegmentData>} [featureSegments] FeatureSegments.\n */\n\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event will be considered to add or move a\n * vertex to the sketch. Default is\n * {@link module:ol/events/condition.primaryAction}.\n * @property {import(\"../events/condition.js\").Condition} [deleteCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. By default,\n * {@link module:ol/events/condition.singleClick} with\n * {@link module:ol/events/condition.altKeyOnly} results in a vertex deletion.\n * @property {import(\"../events/condition.js\").Condition} [insertVertexCondition] A\n * function that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and\n * returns a boolean to indicate whether a new vertex should be added to the sketch\n * features. Default is {@link module:ol/events/condition.always}.\n * @property {number} [pixelTolerance=10] Pixel tolerance for considering the\n * pointer close enough to a segment or vertex for editing.\n * @property {import(\"../style/Style.js\").StyleLike|import(\"../style/flat.js\").FlatStyleLike} [style]\n * Style used for the modification point or vertex. For linestrings and polygons, this will\n * be the affected vertex, for circles a point along the circle, and for points the actual\n * point. If not configured, the default edit style is used (see {@link module:ol/style/Style~Style}).\n * When using a style function, the point feature passed to the function will have a `features`\n * property - an array whose entries are the features that are being modified, and a `geometries`\n * property - an array whose entries are the geometries that are being modified. Both arrays are\n * in the same order. The `geometries` are only useful when modifying geometry collections, where\n * the geometry will be the particular geometry from the collection that is being modified.\n * @property {VectorSource} [source] The vector source with\n * features to modify. If a vector source is not provided, a feature collection\n * must be provided with the `features` option.\n * @property {boolean|import(\"../layer/BaseVector\").default} [hitDetection] When configured, point\n * features will be considered for modification based on their visual appearance, instead of being within\n * the `pixelTolerance` from the pointer location. When a {@link module:ol/layer/BaseVector~BaseVectorLayer} is\n * provided, only the rendered representation of the features on that layer will be considered.\n * @property {Collection<Feature>} [features]\n * The features the interaction works on. If a feature collection is not\n * provided, a vector source must be provided with the `source` option.\n * @property {boolean} [wrapX=false] Wrap the world horizontally on the sketch\n * overlay.\n * @property {boolean} [snapToPointer=!hitDetection] The vertex, point or segment being modified snaps to the\n * pointer coordinate when clicked within the `pixelTolerance`.\n */\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Modify~Modify} instances are\n * instances of this type.\n */\nclass ModifyEvent extends _events_Event_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n /**\n * @param {ModifyEventType} type Type.\n * @param {Collection<Feature>} features\n * The features modified.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent\n * Associated {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n */\n constructor(type, features, mapBrowserEvent) {\n super(type);\n\n /**\n * The features being modified.\n * @type {Collection<Feature>}\n * @api\n */\n this.features = features;\n\n /**\n * Associated {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n * @type {import(\"../MapBrowserEvent.js\").default}\n * @api\n */\n this.mapBrowserEvent = mapBrowserEvent;\n }\n}\n\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature<import(\"../Observable\").EventTypes, import(\"../events/Event.js\").default, Return> &\n * import(\"../Observable\").OnSignature<import(\"../ObjectEventType\").Types|\n * 'change:active', import(\"../Object\").ObjectEvent, Return> &\n * import(\"../Observable\").OnSignature<'modifyend'|'modifystart', ModifyEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature<import(\"../Observable\").EventTypes|import(\"../ObjectEventType\").Types|\n * 'change:active'|'modifyend'|'modifystart', Return>} ModifyOnSignature\n */\n\n/**\n * @classdesc\n * Interaction for modifying feature geometries. To modify features that have\n * been added to an existing source, construct the modify interaction with the\n * `source` option. If you want to modify features in a collection (for example,\n * the collection used by a select interaction), construct the interaction with\n * the `features` option. The interaction must be constructed with either a\n * `source` or `features` option.\n *\n * Cartesian distance from the pointer is used to determine the features that\n * will be modified. This means that geometries will only be considered for\n * modification when they are within the configured `pixelTolerance`. For point\n * geometries, the `hitDetection` option can be used to match their visual\n * appearance.\n *\n * By default, the interaction will allow deletion of vertices when the `alt`\n * key is pressed. To configure the interaction with a different condition\n * for deletion, use the `deleteCondition` option.\n * @fires ModifyEvent\n * @api\n */\nclass Modify extends _Pointer_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"] {\n /**\n * @param {Options} options Options.\n */\n constructor(options) {\n super(/** @type {import(\"./Pointer.js\").Options} */options);\n\n /***\n * @type {ModifyOnSignature<import(\"../events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {ModifyOnSignature<import(\"../events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {ModifyOnSignature<void>}\n */\n this.un;\n\n /** @private */\n this.boundHandleFeatureChange_ = this.handleFeatureChange_.bind(this);\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.condition_ = options.condition ? options.condition : _events_condition_js__WEBPACK_IMPORTED_MODULE_4__.primaryAction;\n\n /**\n * @private\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Browser event.\n * @return {boolean} Combined condition result.\n */\n this.defaultDeleteCondition_ = function (mapBrowserEvent) {\n return (0,_events_condition_js__WEBPACK_IMPORTED_MODULE_4__.altKeyOnly)(mapBrowserEvent) && (0,_events_condition_js__WEBPACK_IMPORTED_MODULE_4__.singleClick)(mapBrowserEvent);\n };\n\n /**\n * @type {import(\"../events/condition.js\").Condition}\n * @private\n */\n this.deleteCondition_ = options.deleteCondition ? options.deleteCondition : this.defaultDeleteCondition_;\n\n /**\n * @type {import(\"../events/condition.js\").Condition}\n * @private\n */\n this.insertVertexCondition_ = options.insertVertexCondition ? options.insertVertexCondition : _events_condition_js__WEBPACK_IMPORTED_MODULE_4__.always;\n\n /**\n * Editing vertex.\n * @type {Feature<Point>}\n * @private\n */\n this.vertexFeature_ = null;\n\n /**\n * Segments intersecting {@link this.vertexFeature_} by segment uid.\n * @type {Object<string, boolean>}\n * @private\n */\n this.vertexSegments_ = null;\n\n /**\n * @type {import(\"../pixel.js\").Pixel}\n * @private\n */\n this.lastPixel_ = [0, 0];\n\n /**\n * Tracks if the next `singleclick` event should be ignored to prevent\n * accidental deletion right after vertex creation.\n * @type {boolean}\n * @private\n */\n this.ignoreNextSingleClick_ = false;\n\n /**\n * @type {Collection<Feature>}\n * @private\n */\n this.featuresBeingModified_ = null;\n\n /**\n * Segment RTree for each layer\n * @type {RBush<SegmentData>}\n * @private\n */\n this.rBush_ = new _structs_RBush_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]();\n\n /**\n * @type {number}\n * @private\n */\n this.pixelTolerance_ = options.pixelTolerance !== undefined ? options.pixelTolerance : 10;\n\n /**\n * @type {boolean}\n * @private\n */\n this.snappedToVertex_ = false;\n\n /**\n * Indicate whether the interaction is currently changing a feature's\n * coordinates.\n * @type {boolean}\n * @private\n */\n this.changingFeature_ = false;\n\n /**\n * @type {Array}\n * @private\n */\n this.dragSegments_ = [];\n\n /**\n * Draw overlay where sketch features are drawn.\n * @type {VectorLayer}\n * @private\n */\n this.overlay_ = new _layer_Vector_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]({\n source: new _source_Vector_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]({\n useSpatialIndex: false,\n wrapX: !!options.wrapX\n }),\n style: options.style ? options.style : getDefaultStyleFunction(),\n updateWhileAnimating: true,\n updateWhileInteracting: true\n });\n\n /**\n * @const\n * @private\n * @type {!Object<string, function(Feature, import(\"../geom/Geometry.js\").default): void>}\n */\n this.SEGMENT_WRITERS_ = {\n 'Point': this.writePointGeometry_.bind(this),\n 'LineString': this.writeLineStringGeometry_.bind(this),\n 'LinearRing': this.writeLineStringGeometry_.bind(this),\n 'Polygon': this.writePolygonGeometry_.bind(this),\n 'MultiPoint': this.writeMultiPointGeometry_.bind(this),\n 'MultiLineString': this.writeMultiLineStringGeometry_.bind(this),\n 'MultiPolygon': this.writeMultiPolygonGeometry_.bind(this),\n 'Circle': this.writeCircleGeometry_.bind(this),\n 'GeometryCollection': this.writeGeometryCollectionGeometry_.bind(this)\n };\n\n /**\n * @type {VectorSource}\n * @private\n */\n this.source_ = null;\n\n /**\n * @type {boolean|import(\"../layer/BaseVector\").default}\n */\n this.hitDetection_ = null;\n\n /** @type {Collection<Feature>} */\n let features;\n if (options.features) {\n features = options.features;\n } else if (options.source) {\n this.source_ = options.source;\n features = new _Collection_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"](this.source_.getFeatures());\n this.source_.addEventListener(_source_VectorEventType_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"].ADDFEATURE, this.handleSourceAdd_.bind(this));\n this.source_.addEventListener(_source_VectorEventType_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"].REMOVEFEATURE, this.handleSourceRemove_.bind(this));\n }\n if (!features) {\n throw new Error('The modify interaction requires features, a source or a layer');\n }\n if (options.hitDetection) {\n this.hitDetection_ = options.hitDetection;\n }\n\n /**\n * @type {Collection<Feature>}\n * @private\n */\n this.features_ = features;\n this.features_.forEach(this.addFeature_.bind(this));\n this.features_.addEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].ADD, this.handleFeatureAdd_.bind(this));\n this.features_.addEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].REMOVE, this.handleFeatureRemove_.bind(this));\n\n /**\n * @type {import(\"../MapBrowserEvent.js\").default}\n * @private\n */\n this.lastPointerEvent_ = null;\n\n /**\n * Delta (x, y in map units) between matched rtree vertex and pointer vertex.\n * @type {Array<number>}\n */\n this.delta_ = [0, 0];\n\n /**\n * @private\n */\n this.snapToPointer_ = options.snapToPointer === undefined ? !this.hitDetection_ : options.snapToPointer;\n }\n\n /**\n * @param {Feature} feature Feature.\n * @private\n */\n addFeature_(feature) {\n const geometry = feature.getGeometry();\n if (geometry) {\n const writer = this.SEGMENT_WRITERS_[geometry.getType()];\n if (writer) {\n writer(feature, geometry);\n }\n }\n const map = this.getMap();\n if (map && map.isRendered() && this.getActive()) {\n this.handlePointerAtPixel_(this.lastPixel_, map);\n }\n feature.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].CHANGE, this.boundHandleFeatureChange_);\n }\n\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} evt Map browser event.\n * @param {Array<Array<SegmentData>>} segments The segments subject to modification.\n * @private\n */\n willModifyFeatures_(evt, segments) {\n if (!this.featuresBeingModified_) {\n this.featuresBeingModified_ = new _Collection_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"]();\n const features = this.featuresBeingModified_.getArray();\n for (let i = 0, ii = segments.length; i < ii; ++i) {\n const segment = segments[i];\n for (let s = 0, ss = segment.length; s < ss; ++s) {\n const feature = segment[s].feature;\n if (feature && !features.includes(feature)) {\n this.featuresBeingModified_.push(feature);\n }\n }\n }\n if (this.featuresBeingModified_.getLength() === 0) {\n this.featuresBeingModified_ = null;\n } else {\n this.dispatchEvent(new ModifyEvent(ModifyEventType.MODIFYSTART, this.featuresBeingModified_, evt));\n }\n }\n }\n\n /**\n * @param {Feature} feature Feature.\n * @private\n */\n removeFeature_(feature) {\n this.removeFeatureSegmentData_(feature);\n // Remove the vertex feature if the collection of candidate features is empty.\n if (this.vertexFeature_ && this.features_.getLength() === 0) {\n this.overlay_.getSource().removeFeature(this.vertexFeature_);\n this.vertexFeature_ = null;\n }\n feature.removeEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].CHANGE, this.boundHandleFeatureChange_);\n }\n\n /**\n * @param {Feature} feature Feature.\n * @private\n */\n removeFeatureSegmentData_(feature) {\n const rBush = this.rBush_;\n /** @type {Array<SegmentData>} */\n const nodesToRemove = [];\n rBush.forEach(\n /**\n * @param {SegmentData} node RTree node.\n */\n function (node) {\n if (feature === node.feature) {\n nodesToRemove.push(node);\n }\n });\n for (let i = nodesToRemove.length - 1; i >= 0; --i) {\n const nodeToRemove = nodesToRemove[i];\n for (let j = this.dragSegments_.length - 1; j >= 0; --j) {\n if (this.dragSegments_[j][0] === nodeToRemove) {\n this.dragSegments_.splice(j, 1);\n }\n }\n rBush.remove(nodeToRemove);\n }\n }\n\n /**\n * Activate or deactivate the interaction.\n * @param {boolean} active Active.\n * @observable\n * @api\n */\n setActive(active) {\n if (this.vertexFeature_ && !active) {\n this.overlay_.getSource().removeFeature(this.vertexFeature_);\n this.vertexFeature_ = null;\n }\n super.setActive(active);\n }\n\n /**\n * Remove the interaction from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../Map.js\").default} map Map.\n */\n setMap(map) {\n this.overlay_.setMap(map);\n super.setMap(map);\n }\n\n /**\n * Get the overlay layer that this interaction renders the modification point or vertex to.\n * @return {VectorLayer} Overlay layer.\n * @api\n */\n getOverlay() {\n return this.overlay_;\n }\n\n /**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent} event Event.\n * @private\n */\n handleSourceAdd_(event) {\n if (event.feature) {\n this.features_.push(event.feature);\n }\n }\n\n /**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent} event Event.\n * @private\n */\n handleSourceRemove_(event) {\n if (event.feature) {\n this.features_.remove(event.feature);\n }\n }\n\n /**\n * @param {import(\"../Collection.js\").CollectionEvent<Feature>} evt Event.\n * @private\n */\n handleFeatureAdd_(evt) {\n this.addFeature_(evt.element);\n }\n\n /**\n * @param {import(\"../events/Event.js\").default} evt Event.\n * @private\n */\n handleFeatureChange_(evt) {\n if (!this.changingFeature_) {\n const feature = /** @type {Feature} */evt.target;\n this.removeFeature_(feature);\n this.addFeature_(feature);\n }\n }\n\n /**\n * @param {import(\"../Collection.js\").CollectionEvent<Feature>} evt Event.\n * @private\n */\n handleFeatureRemove_(evt) {\n this.removeFeature_(evt.element);\n }\n\n /**\n * @param {Feature} feature Feature\n * @param {Point} geometry Geometry.\n * @private\n */\n writePointGeometry_(feature, geometry) {\n const coordinates = geometry.getCoordinates();\n\n /** @type {SegmentData} */\n const segmentData = {\n feature: feature,\n geometry: geometry,\n segment: [coordinates, coordinates]\n };\n this.rBush_.insert(geometry.getExtent(), segmentData);\n }\n\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/MultiPoint.js\").default} geometry Geometry.\n * @private\n */\n writeMultiPointGeometry_(feature, geometry) {\n const points = geometry.getCoordinates();\n for (let i = 0, ii = points.length; i < ii; ++i) {\n const coordinates = points[i];\n\n /** @type {SegmentData} */\n const segmentData = {\n feature: feature,\n geometry: geometry,\n depth: [i],\n index: i,\n segment: [coordinates, coordinates]\n };\n this.rBush_.insert(geometry.getExtent(), segmentData);\n }\n }\n\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/LineString.js\").default} geometry Geometry.\n * @private\n */\n writeLineStringGeometry_(feature, geometry) {\n const coordinates = geometry.getCoordinates();\n for (let i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n const segment = coordinates.slice(i, i + 2);\n\n /** @type {SegmentData} */\n const segmentData = {\n feature: feature,\n geometry: geometry,\n index: i,\n segment: segment\n };\n this.rBush_.insert((0,_extent_js__WEBPACK_IMPORTED_MODULE_12__.boundingExtent)(segment), segmentData);\n }\n }\n\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/MultiLineString.js\").default} geometry Geometry.\n * @private\n */\n writeMultiLineStringGeometry_(feature, geometry) {\n const lines = geometry.getCoordinates();\n for (let j = 0, jj = lines.length; j < jj; ++j) {\n const coordinates = lines[j];\n for (let i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n const segment = coordinates.slice(i, i + 2);\n\n /** @type {SegmentData} */\n const segmentData = {\n feature: feature,\n geometry: geometry,\n depth: [j],\n index: i,\n segment: segment\n };\n this.rBush_.insert((0,_extent_js__WEBPACK_IMPORTED_MODULE_12__.boundingExtent)(segment), segmentData);\n }\n }\n }\n\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/Polygon.js\").default} geometry Geometry.\n * @private\n */\n writePolygonGeometry_(feature, geometry) {\n const rings = geometry.getCoordinates();\n for (let j = 0, jj = rings.length; j < jj; ++j) {\n const coordinates = rings[j];\n for (let i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n const segment = coordinates.slice(i, i + 2);\n\n /** @type {SegmentData} */\n const segmentData = {\n feature: feature,\n geometry: geometry,\n depth: [j],\n index: i,\n segment: segment\n };\n this.rBush_.insert((0,_extent_js__WEBPACK_IMPORTED_MODULE_12__.boundingExtent)(segment), segmentData);\n }\n }\n }\n\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/MultiPolygon.js\").default} geometry Geometry.\n * @private\n */\n writeMultiPolygonGeometry_(feature, geometry) {\n const polygons = geometry.getCoordinates();\n for (let k = 0, kk = polygons.length; k < kk; ++k) {\n const rings = polygons[k];\n for (let j = 0, jj = rings.length; j < jj; ++j) {\n const coordinates = rings[j];\n for (let i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n const segment = coordinates.slice(i, i + 2);\n\n /** @type {SegmentData} */\n const segmentData = {\n feature: feature,\n geometry: geometry,\n depth: [j, k],\n index: i,\n segment: segment\n };\n this.rBush_.insert((0,_extent_js__WEBPACK_IMPORTED_MODULE_12__.boundingExtent)(segment), segmentData);\n }\n }\n }\n }\n\n /**\n * We convert a circle into two segments. The segment at index\n * {@link CIRCLE_CENTER_INDEX} is the\n * circle's center (a point). The segment at index\n * {@link CIRCLE_CIRCUMFERENCE_INDEX} is\n * the circumference, and is not a line segment.\n *\n * @param {Feature} feature Feature.\n * @param {import(\"../geom/Circle.js\").default} geometry Geometry.\n * @private\n */\n writeCircleGeometry_(feature, geometry) {\n const coordinates = geometry.getCenter();\n\n /** @type {SegmentData} */\n const centerSegmentData = {\n feature: feature,\n geometry: geometry,\n index: CIRCLE_CENTER_INDEX,\n segment: [coordinates, coordinates]\n };\n\n /** @type {SegmentData} */\n const circumferenceSegmentData = {\n feature: feature,\n geometry: geometry,\n index: CIRCLE_CIRCUMFERENCE_INDEX,\n segment: [coordinates, coordinates]\n };\n const featureSegments = [centerSegmentData, circumferenceSegmentData];\n centerSegmentData.featureSegments = featureSegments;\n circumferenceSegmentData.featureSegments = featureSegments;\n this.rBush_.insert((0,_extent_js__WEBPACK_IMPORTED_MODULE_12__.createOrUpdateFromCoordinate)(coordinates), centerSegmentData);\n let circleGeometry = /** @type {import(\"../geom/Geometry.js\").default} */\n geometry;\n const userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getUserProjection)();\n if (userProjection && this.getMap()) {\n const projection = this.getMap().getView().getProjection();\n circleGeometry = circleGeometry.clone().transform(userProjection, projection);\n circleGeometry = (0,_geom_Polygon_js__WEBPACK_IMPORTED_MODULE_13__.fromCircle)(/** @type {import(\"../geom/Circle.js\").default} */circleGeometry).transform(projection, userProjection);\n }\n this.rBush_.insert(circleGeometry.getExtent(), circumferenceSegmentData);\n }\n\n /**\n * @param {Feature} feature Feature\n * @param {import(\"../geom/GeometryCollection.js\").default} geometry Geometry.\n * @private\n */\n writeGeometryCollectionGeometry_(feature, geometry) {\n const geometries = geometry.getGeometriesArray();\n for (let i = 0; i < geometries.length; ++i) {\n const geometry = geometries[i];\n const writer = this.SEGMENT_WRITERS_[geometry.getType()];\n writer(feature, geometry);\n }\n }\n\n /**\n * @param {import(\"../coordinate.js\").Coordinate} coordinates Coordinates.\n * @param {Array<Feature>} features The features being modified.\n * @param {Array<import(\"../geom/SimpleGeometry.js\").default>} geometries The geometries being modified.\n * @return {Feature} Vertex feature.\n * @private\n */\n createOrUpdateVertexFeature_(coordinates, features, geometries) {\n let vertexFeature = this.vertexFeature_;\n if (!vertexFeature) {\n vertexFeature = new _Feature_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"](new _geom_Point_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"](coordinates));\n this.vertexFeature_ = vertexFeature;\n this.overlay_.getSource().addFeature(vertexFeature);\n } else {\n const geometry = vertexFeature.getGeometry();\n geometry.setCoordinates(coordinates);\n }\n vertexFeature.set('features', features);\n vertexFeature.set('geometries', geometries);\n return vertexFeature;\n }\n\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} and may modify the geometry.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n */\n handleEvent(mapBrowserEvent) {\n if (!mapBrowserEvent.originalEvent) {\n return true;\n }\n this.lastPointerEvent_ = mapBrowserEvent;\n let handled;\n if (!mapBrowserEvent.map.getView().getInteracting() && mapBrowserEvent.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"].POINTERMOVE && !this.handlingDownUpSequence) {\n this.handlePointerMove_(mapBrowserEvent);\n }\n if (this.vertexFeature_ && this.deleteCondition_(mapBrowserEvent)) {\n if (mapBrowserEvent.type != _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"].SINGLECLICK || !this.ignoreNextSingleClick_) {\n handled = this.removePoint();\n } else {\n handled = true;\n }\n }\n if (mapBrowserEvent.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"].SINGLECLICK) {\n this.ignoreNextSingleClick_ = false;\n }\n return super.handleEvent(mapBrowserEvent) && !handled;\n }\n\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} evt Event.\n */\n handleDragEvent(evt) {\n this.ignoreNextSingleClick_ = false;\n this.willModifyFeatures_(evt, this.dragSegments_);\n const vertex = [evt.coordinate[0] + this.delta_[0], evt.coordinate[1] + this.delta_[1]];\n const features = [];\n const geometries = [];\n for (let i = 0, ii = this.dragSegments_.length; i < ii; ++i) {\n const dragSegment = this.dragSegments_[i];\n const segmentData = dragSegment[0];\n const feature = segmentData.feature;\n if (!features.includes(feature)) {\n features.push(feature);\n }\n const geometry = segmentData.geometry;\n if (!geometries.includes(geometry)) {\n geometries.push(geometry);\n }\n const depth = segmentData.depth;\n let coordinates;\n const segment = segmentData.segment;\n const index = dragSegment[1];\n while (vertex.length < geometry.getStride()) {\n vertex.push(segment[index][vertex.length]);\n }\n switch (geometry.getType()) {\n case 'Point':\n coordinates = vertex;\n segment[0] = vertex;\n segment[1] = vertex;\n break;\n case 'MultiPoint':\n coordinates = geometry.getCoordinates();\n coordinates[segmentData.index] = vertex;\n segment[0] = vertex;\n segment[1] = vertex;\n break;\n case 'LineString':\n coordinates = geometry.getCoordinates();\n coordinates[segmentData.index + index] = vertex;\n segment[index] = vertex;\n break;\n case 'MultiLineString':\n coordinates = geometry.getCoordinates();\n coordinates[depth[0]][segmentData.index + index] = vertex;\n segment[index] = vertex;\n break;\n case 'Polygon':\n coordinates = geometry.getCoordinates();\n coordinates[depth[0]][segmentData.index + index] = vertex;\n segment[index] = vertex;\n break;\n case 'MultiPolygon':\n coordinates = geometry.getCoordinates();\n coordinates[depth[1]][depth[0]][segmentData.index + index] = vertex;\n segment[index] = vertex;\n break;\n case 'Circle':\n segment[0] = vertex;\n segment[1] = vertex;\n if (segmentData.index === CIRCLE_CENTER_INDEX) {\n this.changingFeature_ = true;\n geometry.setCenter(vertex);\n this.changingFeature_ = false;\n } else {\n // We're dragging the circle's circumference:\n this.changingFeature_ = true;\n const projection = evt.map.getView().getProjection();\n let radius = (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.distance)((0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(geometry.getCenter(), projection), (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(vertex, projection));\n const userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getUserProjection)();\n if (userProjection) {\n const circleGeometry = geometry.clone().transform(userProjection, projection);\n circleGeometry.setRadius(radius);\n radius = circleGeometry.transform(projection, userProjection).getRadius();\n }\n geometry.setRadius(radius);\n this.changingFeature_ = false;\n }\n break;\n default:\n // pass\n }\n if (coordinates) {\n this.setGeometryCoordinates_(geometry, coordinates);\n }\n }\n this.createOrUpdateVertexFeature_(vertex, features, geometries);\n }\n\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} evt Event.\n * @return {boolean} If the event was consumed.\n */\n handleDownEvent(evt) {\n if (!this.condition_(evt)) {\n return false;\n }\n const pixelCoordinate = evt.coordinate;\n this.handlePointerAtPixel_(evt.pixel, evt.map, pixelCoordinate);\n this.dragSegments_.length = 0;\n this.featuresBeingModified_ = null;\n const vertexFeature = this.vertexFeature_;\n if (vertexFeature) {\n const projection = evt.map.getView().getProjection();\n const insertVertices = [];\n const vertex = vertexFeature.getGeometry().getCoordinates();\n const vertexExtent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_12__.boundingExtent)([vertex]);\n const segmentDataMatches = this.rBush_.getInExtent(vertexExtent);\n const componentSegments = {};\n segmentDataMatches.sort(compareIndexes);\n for (let i = 0, ii = segmentDataMatches.length; i < ii; ++i) {\n const segmentDataMatch = segmentDataMatches[i];\n const segment = segmentDataMatch.segment;\n let uid = (0,_util_js__WEBPACK_IMPORTED_MODULE_18__.getUid)(segmentDataMatch.geometry);\n const depth = segmentDataMatch.depth;\n if (depth) {\n uid += '-' + depth.join('-'); // separate feature components\n }\n if (!componentSegments[uid]) {\n componentSegments[uid] = new Array(2);\n }\n if (segmentDataMatch.geometry.getType() === 'Circle' && segmentDataMatch.index === CIRCLE_CIRCUMFERENCE_INDEX) {\n const closestVertex = closestOnSegmentData(pixelCoordinate, segmentDataMatch, projection);\n if ((0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.equals)(closestVertex, vertex) && !componentSegments[uid][0]) {\n this.dragSegments_.push([segmentDataMatch, 0]);\n componentSegments[uid][0] = segmentDataMatch;\n }\n continue;\n }\n if ((0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.equals)(segment[0], vertex) && !componentSegments[uid][0]) {\n this.dragSegments_.push([segmentDataMatch, 0]);\n componentSegments[uid][0] = segmentDataMatch;\n continue;\n }\n if ((0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.equals)(segment[1], vertex) && !componentSegments[uid][1]) {\n if (componentSegments[uid][0] && componentSegments[uid][0].index === 0) {\n let coordinates = segmentDataMatch.geometry.getCoordinates();\n switch (segmentDataMatch.geometry.getType()) {\n // prevent dragging closed linestrings by the connecting node\n case 'LineString':\n case 'MultiLineString':\n continue;\n // if dragging the first vertex of a polygon, ensure the other segment\n // belongs to the closing vertex of the linear ring\n case 'MultiPolygon':\n coordinates = coordinates[depth[1]];\n /* falls through */\n case 'Polygon':\n if (segmentDataMatch.index !== coordinates[depth[0]].length - 2) {\n continue;\n }\n break;\n default:\n // pass\n }\n }\n this.dragSegments_.push([segmentDataMatch, 1]);\n componentSegments[uid][1] = segmentDataMatch;\n continue;\n }\n if ((0,_util_js__WEBPACK_IMPORTED_MODULE_18__.getUid)(segment) in this.vertexSegments_ && !componentSegments[uid][0] && !componentSegments[uid][1] && this.insertVertexCondition_(evt)) {\n insertVertices.push(segmentDataMatch);\n }\n }\n if (insertVertices.length) {\n this.willModifyFeatures_(evt, [insertVertices]);\n }\n for (let j = insertVertices.length - 1; j >= 0; --j) {\n this.insertVertex_(insertVertices[j], vertex);\n }\n }\n return !!this.vertexFeature_;\n }\n\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} evt Event.\n * @return {boolean} If the event was consumed.\n */\n handleUpEvent(evt) {\n for (let i = this.dragSegments_.length - 1; i >= 0; --i) {\n const segmentData = this.dragSegments_[i][0];\n const geometry = segmentData.geometry;\n if (geometry.getType() === 'Circle') {\n // Update a circle object in the R* bush:\n const coordinates = geometry.getCenter();\n const centerSegmentData = segmentData.featureSegments[0];\n const circumferenceSegmentData = segmentData.featureSegments[1];\n centerSegmentData.segment[0] = coordinates;\n centerSegmentData.segment[1] = coordinates;\n circumferenceSegmentData.segment[0] = coordinates;\n circumferenceSegmentData.segment[1] = coordinates;\n this.rBush_.update((0,_extent_js__WEBPACK_IMPORTED_MODULE_12__.createOrUpdateFromCoordinate)(coordinates), centerSegmentData);\n let circleGeometry = geometry;\n const userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getUserProjection)();\n if (userProjection) {\n const projection = evt.map.getView().getProjection();\n circleGeometry = circleGeometry.clone().transform(userProjection, projection);\n circleGeometry = (0,_geom_Polygon_js__WEBPACK_IMPORTED_MODULE_13__.fromCircle)(circleGeometry).transform(projection, userProjection);\n }\n this.rBush_.update(circleGeometry.getExtent(), circumferenceSegmentData);\n } else {\n this.rBush_.update((0,_extent_js__WEBPACK_IMPORTED_MODULE_12__.boundingExtent)(segmentData.segment), segmentData);\n }\n }\n if (this.featuresBeingModified_) {\n this.dispatchEvent(new ModifyEvent(ModifyEventType.MODIFYEND, this.featuresBeingModified_, evt));\n this.featuresBeingModified_ = null;\n }\n return false;\n }\n\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} evt Event.\n * @private\n */\n handlePointerMove_(evt) {\n this.lastPixel_ = evt.pixel;\n this.handlePointerAtPixel_(evt.pixel, evt.map, evt.coordinate);\n }\n\n /**\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel\n * @param {import(\"../Map.js\").default} map Map.\n * @param {import(\"../coordinate.js\").Coordinate} [coordinate] The pixel Coordinate.\n * @private\n */\n handlePointerAtPixel_(pixel, map, coordinate) {\n const pixelCoordinate = coordinate || map.getCoordinateFromPixel(pixel);\n const projection = map.getView().getProjection();\n const sortByDistance = function (a, b) {\n return projectedDistanceToSegmentDataSquared(pixelCoordinate, a, projection) - projectedDistanceToSegmentDataSquared(pixelCoordinate, b, projection);\n };\n\n /** @type {Array<SegmentData>|undefined} */\n let nodes;\n /** @type {Point|undefined} */\n let hitPointGeometry;\n if (this.hitDetection_) {\n const layerFilter = typeof this.hitDetection_ === 'object' ? layer => layer === this.hitDetection_ : undefined;\n map.forEachFeatureAtPixel(pixel, (feature, layer, geometry) => {\n if (geometry && geometry.getType() === 'Point') {\n geometry = new _geom_Point_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"]((0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserCoordinate)(geometry.getCoordinates(), projection));\n }\n const geom = geometry || feature.getGeometry();\n if (feature instanceof _Feature_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"] && this.features_.getArray().includes(feature)) {\n hitPointGeometry = /** @type {Point} */geom;\n const coordinate = /** @type {Point} */feature.getGeometry().getFlatCoordinates().slice(0, 2);\n nodes = [{\n feature,\n geometry: hitPointGeometry,\n segment: [coordinate, coordinate]\n }];\n }\n return true;\n }, {\n layerFilter\n });\n }\n if (!nodes) {\n const viewExtent = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserExtent)((0,_extent_js__WEBPACK_IMPORTED_MODULE_12__.createOrUpdateFromCoordinate)(pixelCoordinate, tempExtent), projection);\n const buffer = map.getView().getResolution() * this.pixelTolerance_;\n const box = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserExtent)((0,_extent_js__WEBPACK_IMPORTED_MODULE_12__.buffer)(viewExtent, buffer, tempExtent), projection);\n nodes = this.rBush_.getInExtent(box);\n }\n if (nodes && nodes.length > 0) {\n const node = nodes.sort(sortByDistance)[0];\n const closestSegment = node.segment;\n let vertex = closestOnSegmentData(pixelCoordinate, node, projection);\n const vertexPixel = map.getPixelFromCoordinate(vertex);\n let dist = (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.distance)(pixel, vertexPixel);\n if (hitPointGeometry || dist <= this.pixelTolerance_) {\n /** @type {Object<string, boolean>} */\n const vertexSegments = {};\n vertexSegments[(0,_util_js__WEBPACK_IMPORTED_MODULE_18__.getUid)(closestSegment)] = true;\n if (!this.snapToPointer_) {\n this.delta_[0] = vertex[0] - pixelCoordinate[0];\n this.delta_[1] = vertex[1] - pixelCoordinate[1];\n }\n if (node.geometry.getType() === 'Circle' && node.index === CIRCLE_CIRCUMFERENCE_INDEX) {\n this.snappedToVertex_ = true;\n this.createOrUpdateVertexFeature_(vertex, [node.feature], [node.geometry]);\n } else {\n const pixel1 = map.getPixelFromCoordinate(closestSegment[0]);\n const pixel2 = map.getPixelFromCoordinate(closestSegment[1]);\n const squaredDist1 = (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.squaredDistance)(vertexPixel, pixel1);\n const squaredDist2 = (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.squaredDistance)(vertexPixel, pixel2);\n dist = Math.sqrt(Math.min(squaredDist1, squaredDist2));\n this.snappedToVertex_ = dist <= this.pixelTolerance_;\n if (this.snappedToVertex_) {\n vertex = squaredDist1 > squaredDist2 ? closestSegment[1] : closestSegment[0];\n }\n this.createOrUpdateVertexFeature_(vertex, [node.feature], [node.geometry]);\n const geometries = {};\n geometries[(0,_util_js__WEBPACK_IMPORTED_MODULE_18__.getUid)(node.geometry)] = true;\n for (let i = 1, ii = nodes.length; i < ii; ++i) {\n const segment = nodes[i].segment;\n if ((0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.equals)(closestSegment[0], segment[0]) && (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.equals)(closestSegment[1], segment[1]) || (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.equals)(closestSegment[0], segment[1]) && (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.equals)(closestSegment[1], segment[0])) {\n const geometryUid = (0,_util_js__WEBPACK_IMPORTED_MODULE_18__.getUid)(nodes[i].geometry);\n if (!(geometryUid in geometries)) {\n geometries[geometryUid] = true;\n vertexSegments[(0,_util_js__WEBPACK_IMPORTED_MODULE_18__.getUid)(segment)] = true;\n }\n } else {\n break;\n }\n }\n }\n this.vertexSegments_ = vertexSegments;\n return;\n }\n }\n if (this.vertexFeature_) {\n this.overlay_.getSource().removeFeature(this.vertexFeature_);\n this.vertexFeature_ = null;\n }\n }\n\n /**\n * @param {SegmentData} segmentData Segment data.\n * @param {import(\"../coordinate.js\").Coordinate} vertex Vertex.\n * @private\n */\n insertVertex_(segmentData, vertex) {\n const segment = segmentData.segment;\n const feature = segmentData.feature;\n const geometry = segmentData.geometry;\n const depth = segmentData.depth;\n const index = segmentData.index;\n let coordinates;\n while (vertex.length < geometry.getStride()) {\n vertex.push(0);\n }\n switch (geometry.getType()) {\n case 'MultiLineString':\n coordinates = geometry.getCoordinates();\n coordinates[depth[0]].splice(index + 1, 0, vertex);\n break;\n case 'Polygon':\n coordinates = geometry.getCoordinates();\n coordinates[depth[0]].splice(index + 1, 0, vertex);\n break;\n case 'MultiPolygon':\n coordinates = geometry.getCoordinates();\n coordinates[depth[1]][depth[0]].splice(index + 1, 0, vertex);\n break;\n case 'LineString':\n coordinates = geometry.getCoordinates();\n coordinates.splice(index + 1, 0, vertex);\n break;\n default:\n return;\n }\n this.setGeometryCoordinates_(geometry, coordinates);\n const rTree = this.rBush_;\n rTree.remove(segmentData);\n this.updateSegmentIndices_(geometry, index, depth, 1);\n\n /** @type {SegmentData} */\n const newSegmentData = {\n segment: [segment[0], vertex],\n feature: feature,\n geometry: geometry,\n depth: depth,\n index: index\n };\n rTree.insert((0,_extent_js__WEBPACK_IMPORTED_MODULE_12__.boundingExtent)(newSegmentData.segment), newSegmentData);\n this.dragSegments_.push([newSegmentData, 1]);\n\n /** @type {SegmentData} */\n const newSegmentData2 = {\n segment: [vertex, segment[1]],\n feature: feature,\n geometry: geometry,\n depth: depth,\n index: index + 1\n };\n rTree.insert((0,_extent_js__WEBPACK_IMPORTED_MODULE_12__.boundingExtent)(newSegmentData2.segment), newSegmentData2);\n this.dragSegments_.push([newSegmentData2, 0]);\n this.ignoreNextSingleClick_ = true;\n }\n\n /**\n * Removes the vertex currently being pointed.\n * @return {boolean} True when a vertex was removed.\n * @api\n */\n removePoint() {\n if (this.lastPointerEvent_ && this.lastPointerEvent_.type != _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"].POINTERDRAG) {\n const evt = this.lastPointerEvent_;\n this.willModifyFeatures_(evt, this.dragSegments_);\n const removed = this.removeVertex_();\n if (this.featuresBeingModified_) {\n this.dispatchEvent(new ModifyEvent(ModifyEventType.MODIFYEND, this.featuresBeingModified_, evt));\n }\n this.featuresBeingModified_ = null;\n return removed;\n }\n return false;\n }\n\n /**\n * Removes a vertex from all matching features.\n * @return {boolean} True when a vertex was removed.\n * @private\n */\n removeVertex_() {\n const dragSegments = this.dragSegments_;\n const segmentsByFeature = {};\n let deleted = false;\n let component, coordinates, dragSegment, geometry, i, index, left;\n let newIndex, right, segmentData, uid;\n for (i = dragSegments.length - 1; i >= 0; --i) {\n dragSegment = dragSegments[i];\n segmentData = dragSegment[0];\n uid = (0,_util_js__WEBPACK_IMPORTED_MODULE_18__.getUid)(segmentData.feature);\n if (segmentData.depth) {\n // separate feature components\n uid += '-' + segmentData.depth.join('-');\n }\n if (!(uid in segmentsByFeature)) {\n segmentsByFeature[uid] = {};\n }\n if (dragSegment[1] === 0) {\n segmentsByFeature[uid].right = segmentData;\n segmentsByFeature[uid].index = segmentData.index;\n } else if (dragSegment[1] == 1) {\n segmentsByFeature[uid].left = segmentData;\n segmentsByFeature[uid].index = segmentData.index + 1;\n }\n }\n for (uid in segmentsByFeature) {\n right = segmentsByFeature[uid].right;\n left = segmentsByFeature[uid].left;\n index = segmentsByFeature[uid].index;\n newIndex = index - 1;\n if (left !== undefined) {\n segmentData = left;\n } else {\n segmentData = right;\n }\n if (newIndex < 0) {\n newIndex = 0;\n }\n geometry = segmentData.geometry;\n coordinates = geometry.getCoordinates();\n component = coordinates;\n deleted = false;\n switch (geometry.getType()) {\n case 'MultiLineString':\n if (coordinates[segmentData.depth[0]].length > 2) {\n coordinates[segmentData.depth[0]].splice(index, 1);\n deleted = true;\n }\n break;\n case 'LineString':\n if (coordinates.length > 2) {\n coordinates.splice(index, 1);\n deleted = true;\n }\n break;\n case 'MultiPolygon':\n component = component[segmentData.depth[1]];\n /* falls through */\n case 'Polygon':\n component = component[segmentData.depth[0]];\n if (component.length > 4) {\n if (index == component.length - 1) {\n index = 0;\n }\n component.splice(index, 1);\n deleted = true;\n if (index === 0) {\n // close the ring again\n component.pop();\n component.push(component[0]);\n newIndex = component.length - 1;\n }\n }\n break;\n default:\n // pass\n }\n if (deleted) {\n this.setGeometryCoordinates_(geometry, coordinates);\n const segments = [];\n if (left !== undefined) {\n this.rBush_.remove(left);\n segments.push(left.segment[0]);\n }\n if (right !== undefined) {\n this.rBush_.remove(right);\n segments.push(right.segment[1]);\n }\n if (left !== undefined && right !== undefined) {\n /** @type {SegmentData} */\n const newSegmentData = {\n depth: segmentData.depth,\n feature: segmentData.feature,\n geometry: segmentData.geometry,\n index: newIndex,\n segment: segments\n };\n this.rBush_.insert((0,_extent_js__WEBPACK_IMPORTED_MODULE_12__.boundingExtent)(newSegmentData.segment), newSegmentData);\n }\n this.updateSegmentIndices_(geometry, index, segmentData.depth, -1);\n if (this.vertexFeature_) {\n this.overlay_.getSource().removeFeature(this.vertexFeature_);\n this.vertexFeature_ = null;\n }\n dragSegments.length = 0;\n }\n }\n return deleted;\n }\n\n /**\n * @param {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {Array} coordinates Coordinates.\n * @private\n */\n setGeometryCoordinates_(geometry, coordinates) {\n this.changingFeature_ = true;\n geometry.setCoordinates(coordinates);\n this.changingFeature_ = false;\n }\n\n /**\n * @param {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {number} index Index.\n * @param {Array<number>|undefined} depth Depth.\n * @param {number} delta Delta (1 or -1).\n * @private\n */\n updateSegmentIndices_(geometry, index, depth, delta) {\n this.rBush_.forEachInExtent(geometry.getExtent(), function (segmentDataMatch) {\n if (segmentDataMatch.geometry === geometry && (depth === undefined || segmentDataMatch.depth === undefined || (0,_array_js__WEBPACK_IMPORTED_MODULE_19__.equals)(segmentDataMatch.depth, depth)) && segmentDataMatch.index > index) {\n segmentDataMatch.index += delta;\n }\n });\n }\n}\n\n/**\n * @param {SegmentData} a The first segment data.\n * @param {SegmentData} b The second segment data.\n * @return {number} The difference in indexes.\n */\nfunction compareIndexes(a, b) {\n return a.index - b.index;\n}\n\n/**\n * Returns the distance from a point to a line segment.\n *\n * @param {import(\"../coordinate.js\").Coordinate} pointCoordinates The coordinates of the point from\n * which to calculate the distance.\n * @param {SegmentData} segmentData The object describing the line\n * segment we are calculating the distance to.\n * @param {import(\"../proj/Projection.js\").default} projection The view projection.\n * @return {number} The square of the distance between a point and a line segment.\n */\nfunction projectedDistanceToSegmentDataSquared(pointCoordinates, segmentData, projection) {\n const geometry = segmentData.geometry;\n if (geometry.getType() === 'Circle') {\n let circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */\n geometry;\n if (segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {\n const userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getUserProjection)();\n if (userProjection) {\n circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */\n circleGeometry.clone().transform(userProjection, projection);\n }\n const distanceToCenterSquared = (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.squaredDistance)(circleGeometry.getCenter(), (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(pointCoordinates, projection));\n const distanceToCircumference = Math.sqrt(distanceToCenterSquared) - circleGeometry.getRadius();\n return distanceToCircumference * distanceToCircumference;\n }\n }\n const coordinate = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(pointCoordinates, projection);\n tempSegment[0] = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(segmentData.segment[0], projection);\n tempSegment[1] = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(segmentData.segment[1], projection);\n return (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.squaredDistanceToSegment)(coordinate, tempSegment);\n}\n\n/**\n * Returns the point closest to a given line segment.\n *\n * @param {import(\"../coordinate.js\").Coordinate} pointCoordinates The point to which a closest point\n * should be found.\n * @param {SegmentData} segmentData The object describing the line\n * segment which should contain the closest point.\n * @param {import(\"../proj/Projection.js\").default} projection The view projection.\n * @return {import(\"../coordinate.js\").Coordinate} The point closest to the specified line segment.\n */\nfunction closestOnSegmentData(pointCoordinates, segmentData, projection) {\n const geometry = segmentData.geometry;\n if (geometry.getType() === 'Circle' && segmentData.index === CIRCLE_CIRCUMFERENCE_INDEX) {\n let circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */\n geometry;\n const userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getUserProjection)();\n if (userProjection) {\n circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */\n circleGeometry.clone().transform(userProjection, projection);\n }\n return (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserCoordinate)(circleGeometry.getClosestPoint((0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(pointCoordinates, projection)), projection);\n }\n const coordinate = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(pointCoordinates, projection);\n tempSegment[0] = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(segmentData.segment[0], projection);\n tempSegment[1] = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(segmentData.segment[1], projection);\n return (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserCoordinate)((0,_coordinate_js__WEBPACK_IMPORTED_MODULE_17__.closestOnSegment)(coordinate, tempSegment), projection);\n}\n\n/**\n * @return {import(\"../style/Style.js\").StyleFunction} Styles.\n */\nfunction getDefaultStyleFunction() {\n const style = (0,_style_Style_js__WEBPACK_IMPORTED_MODULE_20__.createEditingStyle)();\n return function (feature, resolution) {\n return style['Point'];\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Modify);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/Modify.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/MouseWheelZoom.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ol/interaction/MouseWheelZoom.js ***!
|
||
\*******************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _Interaction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Interaction.js */ \"./node_modules/ol/interaction/Interaction.js\");\n/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../has.js */ \"./node_modules/ol/has.js\");\n/* harmony import */ var _events_condition_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events/condition.js */ \"./node_modules/ol/events/condition.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../math.js */ \"./node_modules/ol/math.js\");\n/**\n * @module ol/interaction/MouseWheelZoom\n */\n\n\n\n\n\n\n/**\n * @typedef {'trackpad' | 'wheel'} Mode\n */\n\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. Default is\n * {@link module:ol/events/condition.always}.\n * @property {boolean} [onFocusOnly=false] When the map's target has a `tabindex` attribute set,\n * the interaction will only handle events when the map has the focus.\n * @property {number} [maxDelta=1] Maximum mouse wheel delta.\n * @property {number} [duration=250] Animation duration in milliseconds.\n * @property {number} [timeout=80] Mouse wheel timeout duration in milliseconds.\n * @property {boolean} [useAnchor=true] Enable zooming using the mouse's\n * location as the anchor. When set to `false`, zooming in and out will zoom to\n * the center of the screen instead of zooming on the mouse's location.\n * @property {boolean} [constrainResolution=false] If true, the mouse wheel zoom\n * event will always animate to the closest zoom level after an interaction;\n * false means intermediary zoom levels are allowed.\n */\n\n/**\n * @classdesc\n * Allows the user to zoom the map by scrolling the mouse wheel.\n * @api\n */\nclass MouseWheelZoom extends _Interaction_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options ? options : {};\n super(/** @type {import(\"./Interaction.js\").InteractionOptions} */options);\n\n /**\n * @private\n * @type {number}\n */\n this.totalDelta_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.lastDelta_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.maxDelta_ = options.maxDelta !== undefined ? options.maxDelta : 1;\n\n /**\n * @private\n * @type {number}\n */\n this.duration_ = options.duration !== undefined ? options.duration : 250;\n\n /**\n * @private\n * @type {number}\n */\n this.timeout_ = options.timeout !== undefined ? options.timeout : 80;\n\n /**\n * @private\n * @type {boolean}\n */\n this.useAnchor_ = options.useAnchor !== undefined ? options.useAnchor : true;\n\n /**\n * @private\n * @type {boolean}\n */\n this.constrainResolution_ = options.constrainResolution !== undefined ? options.constrainResolution : false;\n const condition = options.condition ? options.condition : _events_condition_js__WEBPACK_IMPORTED_MODULE_1__.always;\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.condition_ = options.onFocusOnly ? (0,_events_condition_js__WEBPACK_IMPORTED_MODULE_1__.all)(_events_condition_js__WEBPACK_IMPORTED_MODULE_1__.focusWithTabindex, condition) : condition;\n\n /**\n * @private\n * @type {?import(\"../coordinate.js\").Coordinate}\n */\n this.lastAnchor_ = null;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.startTime_ = undefined;\n\n /**\n * @private\n * @type {ReturnType<typeof setTimeout>}\n */\n this.timeoutId_;\n\n /**\n * @private\n * @type {Mode|undefined}\n */\n this.mode_ = undefined;\n\n /**\n * Trackpad events separated by this delay will be considered separate\n * interactions.\n * @private\n * @type {number}\n */\n this.trackpadEventGap_ = 400;\n\n /**\n * @private\n * @type {ReturnType<typeof setTimeout>}\n */\n this.trackpadTimeoutId_;\n\n /**\n * The number of delta values per zoom level\n * @private\n * @type {number}\n */\n this.deltaPerZoom_ = 300;\n }\n\n /**\n * @private\n */\n endInteraction_() {\n this.trackpadTimeoutId_ = undefined;\n const map = this.getMap();\n if (!map) {\n return;\n }\n const view = map.getView();\n view.endInteraction(undefined, this.lastDelta_ ? this.lastDelta_ > 0 ? 1 : -1 : 0, this.lastAnchor_);\n }\n\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} (if it was a mousewheel-event) and eventually\n * zooms the map.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n */\n handleEvent(mapBrowserEvent) {\n if (!this.condition_(mapBrowserEvent)) {\n return true;\n }\n const type = mapBrowserEvent.type;\n if (type !== _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].WHEEL) {\n return true;\n }\n const map = mapBrowserEvent.map;\n const wheelEvent = /** @type {WheelEvent} */\n mapBrowserEvent.originalEvent;\n wheelEvent.preventDefault();\n if (this.useAnchor_) {\n this.lastAnchor_ = mapBrowserEvent.coordinate;\n }\n\n // Delta normalisation inspired by\n // https://github.com/mapbox/mapbox-gl-js/blob/001c7b9/js/ui/handler/scroll_zoom.js\n let delta;\n if (mapBrowserEvent.type == _events_EventType_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].WHEEL) {\n delta = wheelEvent.deltaY;\n if (_has_js__WEBPACK_IMPORTED_MODULE_3__.FIREFOX && wheelEvent.deltaMode === WheelEvent.DOM_DELTA_PIXEL) {\n delta /= _has_js__WEBPACK_IMPORTED_MODULE_3__.DEVICE_PIXEL_RATIO;\n }\n if (wheelEvent.deltaMode === WheelEvent.DOM_DELTA_LINE) {\n delta *= 40;\n }\n }\n if (delta === 0) {\n return false;\n }\n this.lastDelta_ = delta;\n const now = Date.now();\n if (this.startTime_ === undefined) {\n this.startTime_ = now;\n }\n if (!this.mode_ || now - this.startTime_ > this.trackpadEventGap_) {\n this.mode_ = Math.abs(delta) < 4 ? 'trackpad' : 'wheel';\n }\n const view = map.getView();\n if (this.mode_ === 'trackpad' && !(view.getConstrainResolution() || this.constrainResolution_)) {\n if (this.trackpadTimeoutId_) {\n clearTimeout(this.trackpadTimeoutId_);\n } else {\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n view.beginInteraction();\n }\n this.trackpadTimeoutId_ = setTimeout(this.endInteraction_.bind(this), this.timeout_);\n view.adjustZoom(-delta / this.deltaPerZoom_, this.lastAnchor_);\n this.startTime_ = now;\n return false;\n }\n this.totalDelta_ += delta;\n const timeLeft = Math.max(this.timeout_ - (now - this.startTime_), 0);\n clearTimeout(this.timeoutId_);\n this.timeoutId_ = setTimeout(this.handleWheelZoom_.bind(this, map), timeLeft);\n return false;\n }\n\n /**\n * @private\n * @param {import(\"../Map.js\").default} map Map.\n */\n handleWheelZoom_(map) {\n const view = map.getView();\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n let delta = -(0,_math_js__WEBPACK_IMPORTED_MODULE_4__.clamp)(this.totalDelta_, -this.maxDelta_ * this.deltaPerZoom_, this.maxDelta_ * this.deltaPerZoom_) / this.deltaPerZoom_;\n if (view.getConstrainResolution() || this.constrainResolution_) {\n // view has a zoom constraint, zoom by 1\n delta = delta ? delta > 0 ? 1 : -1 : 0;\n }\n (0,_Interaction_js__WEBPACK_IMPORTED_MODULE_0__.zoomByDelta)(view, delta, this.lastAnchor_, this.duration_);\n this.mode_ = undefined;\n this.totalDelta_ = 0;\n this.lastAnchor_ = null;\n this.startTime_ = undefined;\n this.timeoutId_ = undefined;\n }\n\n /**\n * Enable or disable using the mouse's location as an anchor when zooming\n * @param {boolean} useAnchor true to zoom to the mouse's location, false\n * to zoom to the center of the map\n * @api\n */\n setMouseAnchor(useAnchor) {\n this.useAnchor_ = useAnchor;\n if (!useAnchor) {\n this.lastAnchor_ = null;\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (MouseWheelZoom);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/MouseWheelZoom.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/PinchRotate.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ol/interaction/PinchRotate.js ***!
|
||
\****************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Pointer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Pointer.js */ \"./node_modules/ol/interaction/Pointer.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _rotationconstraint_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../rotationconstraint.js */ \"./node_modules/ol/rotationconstraint.js\");\n/**\n * @module ol/interaction/PinchRotate\n */\n\n\n\n\n/**\n * @typedef {Object} Options\n * @property {number} [duration=250] The duration of the animation in\n * milliseconds.\n * @property {number} [threshold=0.3] Minimal angle in radians to start a rotation.\n */\n\n/**\n * @classdesc\n * Allows the user to rotate the map by twisting with two fingers\n * on a touch screen.\n * @api\n */\nclass PinchRotate extends _Pointer_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options ? options : {};\n const pointerOptions = /** @type {import(\"./Pointer.js\").Options} */\n options;\n if (!pointerOptions.stopDown) {\n pointerOptions.stopDown = _functions_js__WEBPACK_IMPORTED_MODULE_1__.FALSE;\n }\n super(pointerOptions);\n\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate}\n */\n this.anchor_ = null;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.lastAngle_ = undefined;\n\n /**\n * @private\n * @type {boolean}\n */\n this.rotating_ = false;\n\n /**\n * @private\n * @type {number}\n */\n this.rotationDelta_ = 0.0;\n\n /**\n * @private\n * @type {number}\n */\n this.threshold_ = options.threshold !== undefined ? options.threshold : 0.3;\n\n /**\n * @private\n * @type {number}\n */\n this.duration_ = options.duration !== undefined ? options.duration : 250;\n }\n\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n */\n handleDragEvent(mapBrowserEvent) {\n let rotationDelta = 0.0;\n const touch0 = this.targetPointers[0];\n const touch1 = this.targetPointers[1];\n\n // angle between touches\n const angle = Math.atan2(touch1.clientY - touch0.clientY, touch1.clientX - touch0.clientX);\n if (this.lastAngle_ !== undefined) {\n const delta = angle - this.lastAngle_;\n this.rotationDelta_ += delta;\n if (!this.rotating_ && Math.abs(this.rotationDelta_) > this.threshold_) {\n this.rotating_ = true;\n }\n rotationDelta = delta;\n }\n this.lastAngle_ = angle;\n const map = mapBrowserEvent.map;\n const view = map.getView();\n if (view.getConstraints().rotation === _rotationconstraint_js__WEBPACK_IMPORTED_MODULE_2__.disable) {\n return;\n }\n\n // rotate anchor point.\n // FIXME: should be the intersection point between the lines:\n // touch0,touch1 and previousTouch0,previousTouch1\n this.anchor_ = map.getCoordinateFromPixelInternal(map.getEventPixel((0,_Pointer_js__WEBPACK_IMPORTED_MODULE_0__.centroid)(this.targetPointers)));\n\n // rotate\n if (this.rotating_) {\n map.render();\n view.adjustRotationInternal(rotationDelta, this.anchor_);\n }\n }\n\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n handleUpEvent(mapBrowserEvent) {\n if (this.targetPointers.length < 2) {\n const map = mapBrowserEvent.map;\n const view = map.getView();\n view.endInteraction(this.duration_);\n return false;\n }\n return true;\n }\n\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n handleDownEvent(mapBrowserEvent) {\n if (this.targetPointers.length >= 2) {\n const map = mapBrowserEvent.map;\n this.anchor_ = null;\n this.lastAngle_ = undefined;\n this.rotating_ = false;\n this.rotationDelta_ = 0.0;\n if (!this.handlingDownUpSequence) {\n map.getView().beginInteraction();\n }\n return true;\n }\n return false;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (PinchRotate);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/PinchRotate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/PinchZoom.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/ol/interaction/PinchZoom.js ***!
|
||
\**************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Pointer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Pointer.js */ \"./node_modules/ol/interaction/Pointer.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/**\n * @module ol/interaction/PinchZoom\n */\n\n\n\n/**\n * @typedef {Object} Options\n * @property {number} [duration=400] Animation duration in milliseconds.\n */\n\n/**\n * @classdesc\n * Allows the user to zoom the map by pinching with two fingers\n * on a touch screen.\n * @api\n */\nclass PinchZoom extends _Pointer_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options ? options : {};\n const pointerOptions = /** @type {import(\"./Pointer.js\").Options} */\n options;\n if (!pointerOptions.stopDown) {\n pointerOptions.stopDown = _functions_js__WEBPACK_IMPORTED_MODULE_1__.FALSE;\n }\n super(pointerOptions);\n\n /**\n * @private\n * @type {import(\"../coordinate.js\").Coordinate}\n */\n this.anchor_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.duration_ = options.duration !== undefined ? options.duration : 400;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.lastDistance_ = undefined;\n\n /**\n * @private\n * @type {number}\n */\n this.lastScaleDelta_ = 1;\n }\n\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n */\n handleDragEvent(mapBrowserEvent) {\n let scaleDelta = 1.0;\n const touch0 = this.targetPointers[0];\n const touch1 = this.targetPointers[1];\n const dx = touch0.clientX - touch1.clientX;\n const dy = touch0.clientY - touch1.clientY;\n\n // distance between touches\n const distance = Math.sqrt(dx * dx + dy * dy);\n if (this.lastDistance_ !== undefined) {\n scaleDelta = this.lastDistance_ / distance;\n }\n this.lastDistance_ = distance;\n const map = mapBrowserEvent.map;\n const view = map.getView();\n if (scaleDelta != 1.0) {\n this.lastScaleDelta_ = scaleDelta;\n }\n\n // scale anchor point.\n this.anchor_ = map.getCoordinateFromPixelInternal(map.getEventPixel((0,_Pointer_js__WEBPACK_IMPORTED_MODULE_0__.centroid)(this.targetPointers)));\n\n // scale, bypass the resolution constraint\n map.render();\n view.adjustResolutionInternal(scaleDelta, this.anchor_);\n }\n\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n handleUpEvent(mapBrowserEvent) {\n if (this.targetPointers.length < 2) {\n const map = mapBrowserEvent.map;\n const view = map.getView();\n const direction = this.lastScaleDelta_ > 1 ? 1 : -1;\n view.endInteraction(this.duration_, direction);\n return false;\n }\n return true;\n }\n\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n */\n handleDownEvent(mapBrowserEvent) {\n if (this.targetPointers.length >= 2) {\n const map = mapBrowserEvent.map;\n this.anchor_ = null;\n this.lastDistance_ = undefined;\n this.lastScaleDelta_ = 1;\n if (!this.handlingDownUpSequence) {\n map.getView().beginInteraction();\n }\n return true;\n }\n return false;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (PinchZoom);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/PinchZoom.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/Pointer.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ol/interaction/Pointer.js ***!
|
||
\************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ centroid: function() { return /* binding */ centroid; }\n/* harmony export */ });\n/* harmony import */ var _Interaction_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Interaction.js */ \"./node_modules/ol/interaction/Interaction.js\");\n/* harmony import */ var _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../MapBrowserEventType.js */ \"./node_modules/ol/MapBrowserEventType.js\");\n/**\n * @module ol/interaction/Pointer\n */\n\n\n\n/**\n * @typedef {Object} Options\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} [handleDownEvent]\n * Function handling \"down\" events. If the function returns `true` then a drag\n * sequence is started.\n * @property {function(import(\"../MapBrowserEvent.js\").default):void} [handleDragEvent]\n * Function handling \"drag\" events. This function is called on \"move\" events\n * during a drag sequence.\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} [handleEvent]\n * Method called by the map to notify the interaction that a browser event was\n * dispatched to the map. The function may return `false` to prevent the\n * propagation of the event to other interactions in the map's interactions\n * chain.\n * @property {function(import(\"../MapBrowserEvent.js\").default):void} [handleMoveEvent]\n * Function handling \"move\" events. This function is called on \"move\" events.\n * This functions is also called during a drag sequence, so during a drag\n * sequence both the `handleDragEvent` function and this function are called.\n * If `handleDownEvent` is defined and it returns true this function will not\n * be called during a drag sequence.\n * @property {function(import(\"../MapBrowserEvent.js\").default):boolean} [handleUpEvent]\n * Function handling \"up\" events. If the function returns `false` then the\n * current drag sequence is stopped.\n * @property {function(boolean):boolean} [stopDown]\n * Should the down event be propagated to other interactions, or should be\n * stopped?\n */\n\n/**\n * @classdesc\n * Base class that calls user-defined functions on `down`, `move` and `up`\n * events. This class also manages \"drag sequences\".\n *\n * When the `handleDownEvent` user function returns `true` a drag sequence is\n * started. During a drag sequence the `handleDragEvent` user function is\n * called on `move` events. The drag sequence ends when the `handleUpEvent`\n * user function is called and returns `false`.\n * @api\n */\nclass PointerInteraction extends _Interaction_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options ? options : {};\n super(/** @type {import(\"./Interaction.js\").InteractionOptions} */options);\n if (options.handleDownEvent) {\n this.handleDownEvent = options.handleDownEvent;\n }\n if (options.handleDragEvent) {\n this.handleDragEvent = options.handleDragEvent;\n }\n if (options.handleMoveEvent) {\n this.handleMoveEvent = options.handleMoveEvent;\n }\n if (options.handleUpEvent) {\n this.handleUpEvent = options.handleUpEvent;\n }\n if (options.stopDown) {\n this.stopDown = options.stopDown;\n }\n\n /**\n * @type {boolean}\n * @protected\n */\n this.handlingDownUpSequence = false;\n\n /**\n * @type {Array<PointerEvent>}\n * @protected\n */\n this.targetPointers = [];\n }\n\n /**\n * Returns the current number of pointers involved in the interaction,\n * e.g. `2` when two fingers are used.\n * @return {number} The number of pointers.\n * @api\n */\n getPointerCount() {\n return this.targetPointers.length;\n }\n\n /**\n * Handle pointer down events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n * @protected\n */\n handleDownEvent(mapBrowserEvent) {\n return false;\n }\n\n /**\n * Handle pointer drag events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @protected\n */\n handleDragEvent(mapBrowserEvent) {}\n\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} and may call into\n * other functions, if event sequences like e.g. 'drag' or 'down-up' etc. are\n * detected.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @api\n */\n handleEvent(mapBrowserEvent) {\n if (!mapBrowserEvent.originalEvent) {\n return true;\n }\n let stopEvent = false;\n this.updateTrackedPointers_(mapBrowserEvent);\n if (this.handlingDownUpSequence) {\n if (mapBrowserEvent.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].POINTERDRAG) {\n this.handleDragEvent(mapBrowserEvent);\n // prevent page scrolling during dragging\n mapBrowserEvent.originalEvent.preventDefault();\n } else if (mapBrowserEvent.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].POINTERUP) {\n const handledUp = this.handleUpEvent(mapBrowserEvent);\n this.handlingDownUpSequence = handledUp && this.targetPointers.length > 0;\n }\n } else {\n if (mapBrowserEvent.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].POINTERDOWN) {\n const handled = this.handleDownEvent(mapBrowserEvent);\n this.handlingDownUpSequence = handled;\n stopEvent = this.stopDown(handled);\n } else if (mapBrowserEvent.type == _MapBrowserEventType_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].POINTERMOVE) {\n this.handleMoveEvent(mapBrowserEvent);\n }\n }\n return !stopEvent;\n }\n\n /**\n * Handle pointer move events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @protected\n */\n handleMoveEvent(mapBrowserEvent) {}\n\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @return {boolean} If the event was consumed.\n * @protected\n */\n handleUpEvent(mapBrowserEvent) {\n return false;\n }\n\n /**\n * This function is used to determine if \"down\" events should be propagated\n * to other interactions or should be stopped.\n * @param {boolean} handled Was the event handled by the interaction?\n * @return {boolean} Should the `down` event be stopped?\n */\n stopDown(handled) {\n return handled;\n }\n\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Event.\n * @private\n */\n updateTrackedPointers_(mapBrowserEvent) {\n if (mapBrowserEvent.activePointers) {\n this.targetPointers = mapBrowserEvent.activePointers;\n }\n }\n}\n\n/**\n * @param {Array<PointerEvent>} pointerEvents List of events.\n * @return {{clientX: number, clientY: number}} Centroid pixel.\n */\nfunction centroid(pointerEvents) {\n const length = pointerEvents.length;\n let clientX = 0;\n let clientY = 0;\n for (let i = 0; i < length; i++) {\n clientX += pointerEvents[i].clientX;\n clientY += pointerEvents[i].clientY;\n }\n return {\n clientX: clientX / length,\n clientY: clientY / length\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (PointerInteraction);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/Pointer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/Property.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/ol/interaction/Property.js ***!
|
||
\*************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/interaction/Property\n */\n\n/**\n * @enum {string}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ACTIVE: 'active'\n});\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/Property.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/Select.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ol/interaction/Select.js ***!
|
||
\***********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SelectEvent: function() { return /* binding */ SelectEvent; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Collection_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Collection.js */ \"./node_modules/ol/Collection.js\");\n/* harmony import */ var _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../CollectionEventType.js */ \"./node_modules/ol/CollectionEventType.js\");\n/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events/Event.js */ \"./node_modules/ol/events/Event.js\");\n/* harmony import */ var _Feature_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../Feature.js */ \"./node_modules/ol/Feature.js\");\n/* harmony import */ var _Interaction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Interaction.js */ \"./node_modules/ol/interaction/Interaction.js\");\n/* harmony import */ var _layer_Vector_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../layer/Vector.js */ \"./node_modules/ol/layer/Vector.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../obj.js */ \"./node_modules/ol/obj.js\");\n/* harmony import */ var _style_Style_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../style/Style.js */ \"./node_modules/ol/style/Style.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _events_condition_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../events/condition.js */ \"./node_modules/ol/events/condition.js\");\n\n/**\n * @module ol/interaction/Select\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @enum {string}\n */\nconst SelectEventType = {\n /**\n * Triggered when feature(s) has been (de)selected.\n * @event SelectEvent#select\n * @api\n */\n SELECT: 'select'\n};\n\n/**\n * A function that takes an {@link module:ol/Feature~Feature} and returns `true` if the feature may be\n * selected or `false` otherwise.\n * @typedef {function(import(\"../Feature.js\").default, import(\"../layer/Layer.js\").default<import(\"../source/Source\").default>):boolean} FilterFunction\n */\n\n/**\n * @typedef {Object} Options\n * @property {import(\"../events/condition.js\").Condition} [addCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * By default, this is {@link module:ol/events/condition.never}. Use this if you\n * want to use different events for add and remove instead of `toggle`.\n * @property {import(\"../events/condition.js\").Condition} [condition] A function that\n * takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. This is the event\n * for the selected features as a whole. By default, this is\n * {@link module:ol/events/condition.singleClick}. Clicking on a feature selects that\n * feature and removes any that were in the selection. Clicking outside any\n * feature removes all from the selection.\n * See `toggle`, `add`, `remove` options for adding/removing extra features to/\n * from the selection.\n * @property {Array<import(\"../layer/Layer.js\").default>|function(import(\"../layer/Layer.js\").default<import(\"../source/Source\").default>): boolean} [layers]\n * A list of layers from which features should be selected. Alternatively, a\n * filter function can be provided. The function will be called for each layer\n * in the map and should return `true` for layers that you want to be\n * selectable. If the option is absent, all visible layers will be considered\n * selectable.\n * @property {import(\"../style/Style.js\").StyleLike|null} [style]\n * Style for the selected features. By default the default edit style is used\n * (see {@link module:ol/style/Style~Style}). Set to `null` if this interaction should not apply\n * any style changes for selected features.\n * If set to a falsey value, the selected feature's style will not change.\n * @property {import(\"../events/condition.js\").Condition} [removeCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled.\n * By default, this is {@link module:ol/events/condition.never}. Use this if you\n * want to use different events for add and remove instead of `toggle`.\n * @property {import(\"../events/condition.js\").Condition} [toggleCondition] A function\n * that takes an {@link module:ol/MapBrowserEvent~MapBrowserEvent} and returns a\n * boolean to indicate whether that event should be handled. This is in addition\n * to the `condition` event. By default,\n * {@link module:ol/events/condition.shiftKeyOnly}, i.e. pressing `shift` as\n * well as the `condition` event, adds that feature to the current selection if\n * it is not currently selected, and removes it if it is. See `add` and `remove`\n * if you want to use different events instead of a toggle.\n * @property {boolean} [multi=false] A boolean that determines if the default\n * behaviour should select only single features or all (overlapping) features at\n * the clicked map position. The default of `false` means single select.\n * @property {Collection<Feature>} [features]\n * Collection where the interaction will place selected features. Optional. If\n * not set the interaction will create a collection. In any case the collection\n * used by the interaction is returned by\n * {@link module:ol/interaction/Select~Select#getFeatures}.\n * @property {FilterFunction} [filter] A function\n * that takes an {@link module:ol/Feature~Feature} and an\n * {@link module:ol/layer/Layer~Layer} and returns `true` if the feature may be\n * selected or `false` otherwise.\n * @property {number} [hitTolerance=0] Hit-detection tolerance. Pixels inside\n * the radius around the given position will be checked for features.\n */\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/interaction/Select~Select} instances are instances of\n * this type.\n */\nclass SelectEvent extends _events_Event_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {SelectEventType} type The event type.\n * @param {Array<import(\"../Feature.js\").default>} selected Selected features.\n * @param {Array<import(\"../Feature.js\").default>} deselected Deselected features.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Associated\n * {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n */\n constructor(type, selected, deselected, mapBrowserEvent) {\n super(type);\n\n /**\n * Selected features array.\n * @type {Array<import(\"../Feature.js\").default>}\n * @api\n */\n this.selected = selected;\n\n /**\n * Deselected features array.\n * @type {Array<import(\"../Feature.js\").default>}\n * @api\n */\n this.deselected = deselected;\n\n /**\n * Associated {@link module:ol/MapBrowserEvent~MapBrowserEvent}.\n * @type {import(\"../MapBrowserEvent.js\").default}\n * @api\n */\n this.mapBrowserEvent = mapBrowserEvent;\n }\n}\n\n/**\n * Original feature styles to reset to when features are no longer selected.\n * @type {Object<number, import(\"../style/Style.js\").default|Array<import(\"../style/Style.js\").default>|import(\"../style/Style.js\").StyleFunction>}\n */\nconst originalFeatureStyles = {};\n\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature<import(\"../Observable\").EventTypes, import(\"../events/Event.js\").default, Return> &\n * import(\"../Observable\").OnSignature<import(\"../ObjectEventType\").Types|\n * 'change:active', import(\"../Object\").ObjectEvent, Return> &\n * import(\"../Observable\").OnSignature<'select', SelectEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature<import(\"../Observable\").EventTypes|import(\"../ObjectEventType\").Types|\n * 'change:active'|'select', Return>} SelectOnSignature\n */\n\n/**\n * @classdesc\n * Interaction for selecting vector features. By default, selected features are\n * styled differently, so this interaction can be used for visual highlighting,\n * as well as selecting features for other actions, such as modification or\n * output. There are three ways of controlling which features are selected:\n * using the browser event as defined by the `condition` and optionally the\n * `toggle`, `add`/`remove`, and `multi` options; a `layers` filter; and a\n * further feature filter using the `filter` option.\n *\n * @fires SelectEvent\n * @api\n */\nclass Select extends _Interaction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n super();\n\n /***\n * @type {SelectOnSignature<import(\"../events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {SelectOnSignature<import(\"../events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {SelectOnSignature<void>}\n */\n this.un;\n options = options ? options : {};\n\n /**\n * @private\n */\n this.boundAddFeature_ = this.addFeature_.bind(this);\n\n /**\n * @private\n */\n this.boundRemoveFeature_ = this.removeFeature_.bind(this);\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.condition_ = options.condition ? options.condition : _events_condition_js__WEBPACK_IMPORTED_MODULE_3__.singleClick;\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.addCondition_ = options.addCondition ? options.addCondition : _events_condition_js__WEBPACK_IMPORTED_MODULE_3__.never;\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.removeCondition_ = options.removeCondition ? options.removeCondition : _events_condition_js__WEBPACK_IMPORTED_MODULE_3__.never;\n\n /**\n * @private\n * @type {import(\"../events/condition.js\").Condition}\n */\n this.toggleCondition_ = options.toggleCondition ? options.toggleCondition : _events_condition_js__WEBPACK_IMPORTED_MODULE_3__.shiftKeyOnly;\n\n /**\n * @private\n * @type {boolean}\n */\n this.multi_ = options.multi ? options.multi : false;\n\n /**\n * @private\n * @type {FilterFunction}\n */\n this.filter_ = options.filter ? options.filter : _functions_js__WEBPACK_IMPORTED_MODULE_4__.TRUE;\n\n /**\n * @private\n * @type {number}\n */\n this.hitTolerance_ = options.hitTolerance ? options.hitTolerance : 0;\n\n /**\n * @private\n * @type {import(\"../style/Style.js\").default|Array<import(\"../style/Style.js\").default>|import(\"../style/Style.js\").StyleFunction|null}\n */\n this.style_ = options.style !== undefined ? options.style : getDefaultStyleFunction();\n\n /**\n * @private\n * @type {Collection<Feature>}\n */\n this.features_ = options.features || new _Collection_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]();\n\n /** @type {function(import(\"../layer/Layer.js\").default<import(\"../source/Source\").default>): boolean} */\n let layerFilter;\n if (options.layers) {\n if (typeof options.layers === 'function') {\n layerFilter = options.layers;\n } else {\n const layers = options.layers;\n layerFilter = function (layer) {\n return layers.includes(layer);\n };\n }\n } else {\n layerFilter = _functions_js__WEBPACK_IMPORTED_MODULE_4__.TRUE;\n }\n\n /**\n * @private\n * @type {function(import(\"../layer/Layer.js\").default<import(\"../source/Source\").default>): boolean}\n */\n this.layerFilter_ = layerFilter;\n\n /**\n * An association between selected feature (key)\n * and layer (value)\n * @private\n * @type {Object<string, import(\"../layer/Layer.js\").default>}\n */\n this.featureLayerAssociation_ = {};\n }\n\n /**\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @private\n */\n addFeatureLayerAssociation_(feature, layer) {\n this.featureLayerAssociation_[(0,_util_js__WEBPACK_IMPORTED_MODULE_6__.getUid)(feature)] = layer;\n }\n\n /**\n * Get the selected features.\n * @return {Collection<Feature>} Features collection.\n * @api\n */\n getFeatures() {\n return this.features_;\n }\n\n /**\n * Returns the Hit-detection tolerance.\n * @return {number} Hit tolerance in pixels.\n * @api\n */\n getHitTolerance() {\n return this.hitTolerance_;\n }\n\n /**\n * Returns the associated {@link module:ol/layer/Vector~VectorLayer vector layer} of\n * a selected feature.\n * @param {import(\"../Feature.js\").default} feature Feature\n * @return {import('../layer/Vector.js').default} Layer.\n * @api\n */\n getLayer(feature) {\n return /** @type {import('../layer/Vector.js').default} */this.featureLayerAssociation_[(0,_util_js__WEBPACK_IMPORTED_MODULE_6__.getUid)(feature)];\n }\n\n /**\n * Hit-detection tolerance. Pixels inside the radius around the given position\n * will be checked for features.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @api\n */\n setHitTolerance(hitTolerance) {\n this.hitTolerance_ = hitTolerance;\n }\n\n /**\n * Remove the interaction from its current map, if any, and attach it to a new\n * map, if any. Pass `null` to just remove the interaction from the current map.\n * @param {import(\"../Map.js\").default|null} map Map.\n * @api\n */\n setMap(map) {\n const currentMap = this.getMap();\n if (currentMap && this.style_) {\n this.features_.forEach(this.restorePreviousStyle_.bind(this));\n }\n super.setMap(map);\n if (map) {\n this.features_.addEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].ADD, this.boundAddFeature_);\n this.features_.addEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].REMOVE, this.boundRemoveFeature_);\n if (this.style_) {\n this.features_.forEach(this.applySelectedStyle_.bind(this));\n }\n } else {\n this.features_.removeEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].ADD, this.boundAddFeature_);\n this.features_.removeEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].REMOVE, this.boundRemoveFeature_);\n }\n }\n\n /**\n * @param {import(\"../Collection.js\").CollectionEvent<Feature>} evt Event.\n * @private\n */\n addFeature_(evt) {\n const feature = evt.element;\n if (this.style_) {\n this.applySelectedStyle_(feature);\n }\n if (!this.getLayer(feature)) {\n const layer = /** @type {VectorLayer} */\n this.getMap().getAllLayers().find(function (layer) {\n if (layer instanceof _layer_Vector_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"] && layer.getSource() && layer.getSource().hasFeature(feature)) {\n return layer;\n }\n });\n if (layer) {\n this.addFeatureLayerAssociation_(feature, layer);\n }\n }\n }\n\n /**\n * @param {import(\"../Collection.js\").CollectionEvent<Feature>} evt Event.\n * @private\n */\n removeFeature_(evt) {\n if (this.style_) {\n this.restorePreviousStyle_(evt.element);\n }\n }\n\n /**\n * @return {import(\"../style/Style.js\").StyleLike|null} Select style.\n */\n getStyle() {\n return this.style_;\n }\n\n /**\n * @param {Feature} feature Feature\n * @private\n */\n applySelectedStyle_(feature) {\n const key = (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.getUid)(feature);\n if (!(key in originalFeatureStyles)) {\n originalFeatureStyles[key] = feature.getStyle();\n }\n feature.setStyle(this.style_);\n }\n\n /**\n * @param {Feature} feature Feature\n * @private\n */\n restorePreviousStyle_(feature) {\n const interactions = this.getMap().getInteractions().getArray();\n for (let i = interactions.length - 1; i >= 0; --i) {\n const interaction = interactions[i];\n if (interaction !== this && interaction instanceof Select && interaction.getStyle() && interaction.getFeatures().getArray().lastIndexOf(feature) !== -1) {\n feature.setStyle(interaction.getStyle());\n return;\n }\n }\n const key = (0,_util_js__WEBPACK_IMPORTED_MODULE_6__.getUid)(feature);\n feature.setStyle(originalFeatureStyles[key]);\n delete originalFeatureStyles[key];\n }\n\n /**\n * @param {Feature} feature Feature.\n * @private\n */\n removeFeatureLayerAssociation_(feature) {\n delete this.featureLayerAssociation_[(0,_util_js__WEBPACK_IMPORTED_MODULE_6__.getUid)(feature)];\n }\n\n /**\n * Handles the {@link module:ol/MapBrowserEvent~MapBrowserEvent map browser event} and may change the\n * selected state of features.\n * @param {import(\"../MapBrowserEvent.js\").default} mapBrowserEvent Map browser event.\n * @return {boolean} `false` to stop event propagation.\n */\n handleEvent(mapBrowserEvent) {\n if (!this.condition_(mapBrowserEvent)) {\n return true;\n }\n const add = this.addCondition_(mapBrowserEvent);\n const remove = this.removeCondition_(mapBrowserEvent);\n const toggle = this.toggleCondition_(mapBrowserEvent);\n const set = !add && !remove && !toggle;\n const map = mapBrowserEvent.map;\n const features = this.getFeatures();\n\n /**\n * @type {Array<Feature>}\n */\n const deselected = [];\n\n /**\n * @type {Array<Feature>}\n */\n const selected = [];\n if (set) {\n // Replace the currently selected feature(s) with the feature(s) at the\n // pixel, or clear the selected feature(s) if there is no feature at\n // the pixel.\n (0,_obj_js__WEBPACK_IMPORTED_MODULE_9__.clear)(this.featureLayerAssociation_);\n map.forEachFeatureAtPixel(mapBrowserEvent.pixel,\n /**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @return {boolean|undefined} Continue to iterate over the features.\n */\n (feature, layer) => {\n if (!(feature instanceof _Feature_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"]) || !this.filter_(feature, layer)) {\n return;\n }\n this.addFeatureLayerAssociation_(feature, layer);\n selected.push(feature);\n return !this.multi_;\n }, {\n layerFilter: this.layerFilter_,\n hitTolerance: this.hitTolerance_\n });\n for (let i = features.getLength() - 1; i >= 0; --i) {\n const feature = features.item(i);\n const index = selected.indexOf(feature);\n if (index > -1) {\n // feature is already selected\n selected.splice(index, 1);\n } else {\n features.remove(feature);\n deselected.push(feature);\n }\n }\n if (selected.length !== 0) {\n features.extend(selected);\n }\n } else {\n // Modify the currently selected feature(s).\n map.forEachFeatureAtPixel(mapBrowserEvent.pixel,\n /**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @return {boolean|undefined} Continue to iterate over the features.\n */\n (feature, layer) => {\n if (!(feature instanceof _Feature_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"]) || !this.filter_(feature, layer)) {\n return;\n }\n if ((add || toggle) && !features.getArray().includes(feature)) {\n this.addFeatureLayerAssociation_(feature, layer);\n selected.push(feature);\n } else if ((remove || toggle) && features.getArray().includes(feature)) {\n deselected.push(feature);\n this.removeFeatureLayerAssociation_(feature);\n }\n return !this.multi_;\n }, {\n layerFilter: this.layerFilter_,\n hitTolerance: this.hitTolerance_\n });\n for (let j = deselected.length - 1; j >= 0; --j) {\n features.remove(deselected[j]);\n }\n features.extend(selected);\n }\n if (selected.length > 0 || deselected.length > 0) {\n this.dispatchEvent(new SelectEvent(SelectEventType.SELECT, selected, deselected, mapBrowserEvent));\n }\n return true;\n }\n}\n\n/**\n * @return {import(\"../style/Style.js\").StyleFunction} Styles.\n */\nfunction getDefaultStyleFunction() {\n const styles = (0,_style_Style_js__WEBPACK_IMPORTED_MODULE_11__.createEditingStyle)();\n (0,_array_js__WEBPACK_IMPORTED_MODULE_12__.extend)(styles['Polygon'], styles['LineString']);\n (0,_array_js__WEBPACK_IMPORTED_MODULE_12__.extend)(styles['GeometryCollection'], styles['LineString']);\n return function (feature) {\n if (!feature.getGeometry()) {\n return null;\n }\n return styles[feature.getGeometry().getType()];\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Select);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/Select.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/Snap.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ol/interaction/Snap.js ***!
|
||
\*********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../CollectionEventType.js */ \"./node_modules/ol/CollectionEventType.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _Pointer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Pointer.js */ \"./node_modules/ol/interaction/Pointer.js\");\n/* harmony import */ var _structs_RBush_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../structs/RBush.js */ \"./node_modules/ol/structs/RBush.js\");\n/* harmony import */ var _source_VectorEventType_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../source/VectorEventType.js */ \"./node_modules/ol/source/VectorEventType.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _events_SnapEvent_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../events/SnapEvent.js */ \"./node_modules/ol/events/SnapEvent.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _coordinate_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../coordinate.js */ \"./node_modules/ol/coordinate.js\");\n/* harmony import */ var _geom_Polygon_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geom/Polygon.js */ \"./node_modules/ol/geom/Polygon.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../proj.js */ \"./node_modules/ol/proj.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../events.js */ \"./node_modules/ol/events.js\");\n\n/**\n * @module ol/interaction/Snap\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @typedef {Object} Result\n * @property {import(\"../coordinate.js\").Coordinate|null} vertex Vertex.\n * @property {import(\"../pixel.js\").Pixel|null} vertexPixel VertexPixel.\n * @property {import(\"../Feature.js\").default|null} feature Feature.\n * @property {Array<import(\"../coordinate.js\").Coordinate>|null} segment Segment, or `null` if snapped to a vertex.\n */\n\n/**\n * @typedef {Object} SegmentData\n * @property {import(\"../Feature.js\").default} feature Feature.\n * @property {Array<import(\"../coordinate.js\").Coordinate>} segment Segment.\n */\n\n/**\n * @typedef {Object} Options\n * @property {import(\"../Collection.js\").default<import(\"../Feature.js\").default>} [features] Snap to these features. Either this option or source should be provided.\n * @property {boolean} [edge=true] Snap to edges.\n * @property {boolean} [vertex=true] Snap to vertices.\n * @property {number} [pixelTolerance=10] Pixel tolerance for considering the pointer close enough to a segment or\n * vertex for snapping.\n * @property {import(\"../source/Vector.js\").default} [source] Snap to features from this source. Either this option or features should be provided\n */\n\n/**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent|import(\"../Collection.js\").CollectionEvent<import(\"../Feature.js\").default>} evt Event.\n * @return {import(\"../Feature.js\").default|null} Feature.\n */\nfunction getFeatureFromEvent(evt) {\n if (/** @type {import(\"../source/Vector.js\").VectorSourceEvent} */evt.feature) {\n return /** @type {import(\"../source/Vector.js\").VectorSourceEvent} */evt.feature;\n }\n if (/** @type {import(\"../Collection.js\").CollectionEvent<import(\"../Feature.js\").default>} */evt.element) {\n return /** @type {import(\"../Collection.js\").CollectionEvent<import(\"../Feature.js\").default>} */evt.element;\n }\n return null;\n}\nconst tempSegment = [];\n\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature<import(\"../Observable\").EventTypes, import(\"../events/Event.js\").default, Return> &\n * import(\"../Observable\").OnSignature<import(\"../ObjectEventType\").Types|\n * 'change:active', import(\"../Object\").ObjectEvent, Return> &\n * import(\"../Observable\").OnSignature<'snap', SnapEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature<import(\"../Observable\").EventTypes|import(\"../ObjectEventType\").Types|\n * 'change:active'|'snap', Return>} SnapOnSignature\n */\n\n/**\n * @classdesc\n * Handles snapping of vector features while modifying or drawing them. The\n * features can come from a {@link module:ol/source/Vector~VectorSource} or {@link module:ol/Collection~Collection}\n * Any interaction object that allows the user to interact\n * with the features using the mouse can benefit from the snapping, as long\n * as it is added before.\n *\n * The snap interaction modifies map browser event `coordinate` and `pixel`\n * properties to force the snap to occur to any interaction that them.\n *\n * Example:\n *\n * import Snap from 'ol/interaction/Snap.js';\n *\n * const snap = new Snap({\n * source: source\n * });\n *\n * map.addInteraction(snap);\n *\n * @fires SnapEvent\n * @api\n */\nclass Snap extends _Pointer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options ? options : {};\n const pointerOptions = /** @type {import(\"./Pointer.js\").Options} */\n options;\n if (!pointerOptions.handleDownEvent) {\n pointerOptions.handleDownEvent = _functions_js__WEBPACK_IMPORTED_MODULE_3__.TRUE;\n }\n if (!pointerOptions.stopDown) {\n pointerOptions.stopDown = _functions_js__WEBPACK_IMPORTED_MODULE_3__.FALSE;\n }\n super(pointerOptions);\n\n /***\n * @type {SnapOnSignature<import(\"../events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {SnapOnSignature<import(\"../events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {SnapOnSignature<void>}\n */\n this.un;\n\n /**\n * @type {import(\"../source/Vector.js\").default|null}\n * @private\n */\n this.source_ = options.source ? options.source : null;\n\n /**\n * @private\n * @type {boolean}\n */\n this.vertex_ = options.vertex !== undefined ? options.vertex : true;\n\n /**\n * @private\n * @type {boolean}\n */\n this.edge_ = options.edge !== undefined ? options.edge : true;\n\n /**\n * @type {import(\"../Collection.js\").default<import(\"../Feature.js\").default>|null}\n * @private\n */\n this.features_ = options.features ? options.features : null;\n\n /**\n * @type {Array<import(\"../events.js\").EventsKey>}\n * @private\n */\n this.featuresListenerKeys_ = [];\n\n /**\n * @type {Object<string, import(\"../events.js\").EventsKey>}\n * @private\n */\n this.featureChangeListenerKeys_ = {};\n\n /**\n * Extents are preserved so indexed segment can be quickly removed\n * when its feature geometry changes\n * @type {Object<string, import(\"../extent.js\").Extent>}\n * @private\n */\n this.indexedFeaturesExtents_ = {};\n\n /**\n * If a feature geometry changes while a pointer drag|move event occurs, the\n * feature doesn't get updated right away. It will be at the next 'pointerup'\n * event fired.\n * @type {!Object<string, import(\"../Feature.js\").default>}\n * @private\n */\n this.pendingFeatures_ = {};\n\n /**\n * @type {number}\n * @private\n */\n this.pixelTolerance_ = options.pixelTolerance !== undefined ? options.pixelTolerance : 10;\n\n /**\n * Segment RTree for each layer\n * @type {import(\"../structs/RBush.js\").default<SegmentData>}\n * @private\n */\n this.rBush_ = new _structs_RBush_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n\n /**\n * @const\n * @private\n * @type {Object<string, function(Array<Array<import('../coordinate.js').Coordinate>>, import(\"../geom/Geometry.js\").default): void>}\n */\n this.GEOMETRY_SEGMENTERS_ = {\n 'Point': this.segmentPointGeometry_.bind(this),\n 'LineString': this.segmentLineStringGeometry_.bind(this),\n 'LinearRing': this.segmentLineStringGeometry_.bind(this),\n 'Polygon': this.segmentPolygonGeometry_.bind(this),\n 'MultiPoint': this.segmentMultiPointGeometry_.bind(this),\n 'MultiLineString': this.segmentMultiLineStringGeometry_.bind(this),\n 'MultiPolygon': this.segmentMultiPolygonGeometry_.bind(this),\n 'GeometryCollection': this.segmentGeometryCollectionGeometry_.bind(this),\n 'Circle': this.segmentCircleGeometry_.bind(this)\n };\n }\n\n /**\n * Add a feature to the collection of features that we may snap to.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {boolean} [register] Whether to listen to the feature change or not\n * Defaults to `true`.\n * @api\n */\n addFeature(feature, register) {\n register = register !== undefined ? register : true;\n const feature_uid = (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.getUid)(feature);\n const geometry = feature.getGeometry();\n if (geometry) {\n const segmenter = this.GEOMETRY_SEGMENTERS_[geometry.getType()];\n if (segmenter) {\n this.indexedFeaturesExtents_[feature_uid] = geometry.getExtent((0,_extent_js__WEBPACK_IMPORTED_MODULE_6__.createEmpty)());\n const segments = /** @type {Array<Array<import('../coordinate.js').Coordinate>>} */[];\n segmenter(segments, geometry);\n if (segments.length === 1) {\n this.rBush_.insert((0,_extent_js__WEBPACK_IMPORTED_MODULE_6__.boundingExtent)(segments[0]), {\n feature: feature,\n segment: segments[0]\n });\n } else if (segments.length > 1) {\n const extents = segments.map(s => (0,_extent_js__WEBPACK_IMPORTED_MODULE_6__.boundingExtent)(s));\n const segmentsData = segments.map(segment => ({\n feature: feature,\n segment: segment\n }));\n this.rBush_.load(extents, segmentsData);\n }\n }\n }\n if (register) {\n this.featureChangeListenerKeys_[feature_uid] = (0,_events_js__WEBPACK_IMPORTED_MODULE_7__.listen)(feature, _events_EventType_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"].CHANGE, this.handleFeatureChange_, this);\n }\n }\n\n /**\n * @return {import(\"../Collection.js\").default<import(\"../Feature.js\").default>|Array<import(\"../Feature.js\").default>} Features.\n * @private\n */\n getFeatures_() {\n /** @type {import(\"../Collection.js\").default<import(\"../Feature.js\").default>|Array<import(\"../Feature.js\").default>} */\n let features;\n if (this.features_) {\n features = this.features_;\n } else if (this.source_) {\n features = this.source_.getFeatures();\n }\n return features;\n }\n\n /**\n * @param {import(\"../MapBrowserEvent.js\").default} evt Map browser event.\n * @return {boolean} `false` to stop event propagation.\n * @api\n */\n handleEvent(evt) {\n const result = this.snapTo(evt.pixel, evt.coordinate, evt.map);\n if (result) {\n evt.coordinate = result.vertex.slice(0, 2);\n evt.pixel = result.vertexPixel;\n this.dispatchEvent(new _events_SnapEvent_js__WEBPACK_IMPORTED_MODULE_9__.SnapEvent(_events_SnapEvent_js__WEBPACK_IMPORTED_MODULE_9__.SnapEventType.SNAP, {\n vertex: evt.coordinate,\n vertexPixel: evt.pixel,\n feature: result.feature,\n segment: result.segment\n }));\n }\n return super.handleEvent(evt);\n }\n\n /**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent|import(\"../Collection.js\").CollectionEvent<import(\"../Feature.js\").default>} evt Event.\n * @private\n */\n handleFeatureAdd_(evt) {\n const feature = getFeatureFromEvent(evt);\n if (feature) {\n this.addFeature(feature);\n }\n }\n\n /**\n * @param {import(\"../source/Vector.js\").VectorSourceEvent|import(\"../Collection.js\").CollectionEvent<import(\"../Feature.js\").default>} evt Event.\n * @private\n */\n handleFeatureRemove_(evt) {\n const feature = getFeatureFromEvent(evt);\n if (feature) {\n this.removeFeature(feature);\n }\n }\n\n /**\n * @param {import(\"../events/Event.js\").default} evt Event.\n * @private\n */\n handleFeatureChange_(evt) {\n const feature = /** @type {import(\"../Feature.js\").default} */evt.target;\n if (this.handlingDownUpSequence) {\n const uid = (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.getUid)(feature);\n if (!(uid in this.pendingFeatures_)) {\n this.pendingFeatures_[uid] = feature;\n }\n } else {\n this.updateFeature_(feature);\n }\n }\n\n /**\n * Handle pointer up events.\n * @param {import(\"../MapBrowserEvent.js\").default} evt Event.\n * @return {boolean} If the event was consumed.\n */\n handleUpEvent(evt) {\n const featuresToUpdate = Object.values(this.pendingFeatures_);\n if (featuresToUpdate.length) {\n featuresToUpdate.forEach(this.updateFeature_.bind(this));\n this.pendingFeatures_ = {};\n }\n return false;\n }\n\n /**\n * Remove a feature from the collection of features that we may snap to.\n * @param {import(\"../Feature.js\").default} feature Feature\n * @param {boolean} [unlisten] Whether to unlisten to the feature change\n * or not. Defaults to `true`.\n * @api\n */\n removeFeature(feature, unlisten) {\n const unregister = unlisten !== undefined ? unlisten : true;\n const feature_uid = (0,_util_js__WEBPACK_IMPORTED_MODULE_5__.getUid)(feature);\n const extent = this.indexedFeaturesExtents_[feature_uid];\n if (extent) {\n const rBush = this.rBush_;\n const nodesToRemove = [];\n rBush.forEachInExtent(extent, function (node) {\n if (feature === node.feature) {\n nodesToRemove.push(node);\n }\n });\n for (let i = nodesToRemove.length - 1; i >= 0; --i) {\n rBush.remove(nodesToRemove[i]);\n }\n }\n if (unregister) {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_7__.unlistenByKey)(this.featureChangeListenerKeys_[feature_uid]);\n delete this.featureChangeListenerKeys_[feature_uid];\n }\n }\n\n /**\n * Remove the interaction from its current map and attach it to the new map.\n * Subclasses may set up event handlers to get notified about changes to\n * the map here.\n * @param {import(\"../Map.js\").default} map Map.\n */\n setMap(map) {\n const currentMap = this.getMap();\n const keys = this.featuresListenerKeys_;\n const features = /** @type {Array<import(\"../Feature.js\").default>} */\n this.getFeatures_();\n if (currentMap) {\n keys.forEach(_events_js__WEBPACK_IMPORTED_MODULE_7__.unlistenByKey);\n keys.length = 0;\n this.rBush_.clear();\n Object.values(this.featureChangeListenerKeys_).forEach(_events_js__WEBPACK_IMPORTED_MODULE_7__.unlistenByKey);\n this.featureChangeListenerKeys_ = {};\n }\n super.setMap(map);\n if (map) {\n if (this.features_) {\n keys.push((0,_events_js__WEBPACK_IMPORTED_MODULE_7__.listen)(this.features_, _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].ADD, this.handleFeatureAdd_, this), (0,_events_js__WEBPACK_IMPORTED_MODULE_7__.listen)(this.features_, _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].REMOVE, this.handleFeatureRemove_, this));\n } else if (this.source_) {\n keys.push((0,_events_js__WEBPACK_IMPORTED_MODULE_7__.listen)(this.source_, _source_VectorEventType_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].ADDFEATURE, this.handleFeatureAdd_, this), (0,_events_js__WEBPACK_IMPORTED_MODULE_7__.listen)(this.source_, _source_VectorEventType_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"].REMOVEFEATURE, this.handleFeatureRemove_, this));\n }\n features.forEach(feature => this.addFeature(feature));\n }\n }\n\n /**\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel\n * @param {import(\"../coordinate.js\").Coordinate} pixelCoordinate Coordinate\n * @param {import(\"../Map.js\").default} map Map.\n * @return {Result|null} Snap result\n */\n snapTo(pixel, pixelCoordinate, map) {\n const projection = map.getView().getProjection();\n const projectedCoordinate = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(pixelCoordinate, projection);\n const box = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserExtent)((0,_extent_js__WEBPACK_IMPORTED_MODULE_6__.buffer)((0,_extent_js__WEBPACK_IMPORTED_MODULE_6__.boundingExtent)([projectedCoordinate]), map.getView().getResolution() * this.pixelTolerance_), projection);\n const segments = this.rBush_.getInExtent(box);\n const segmentsLength = segments.length;\n if (segmentsLength === 0) {\n return null;\n }\n let closestVertex;\n let minSquaredDistance = Infinity;\n let closestFeature;\n let closestSegment = null;\n const squaredPixelTolerance = this.pixelTolerance_ * this.pixelTolerance_;\n const getResult = () => {\n if (closestVertex) {\n const vertexPixel = map.getPixelFromCoordinate(closestVertex);\n const squaredPixelDistance = (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_12__.squaredDistance)(pixel, vertexPixel);\n if (squaredPixelDistance <= squaredPixelTolerance) {\n return {\n vertex: closestVertex,\n vertexPixel: [Math.round(vertexPixel[0]), Math.round(vertexPixel[1])],\n feature: closestFeature,\n segment: closestSegment\n };\n }\n }\n return null;\n };\n if (this.vertex_) {\n for (let i = 0; i < segmentsLength; ++i) {\n const segmentData = segments[i];\n if (segmentData.feature.getGeometry().getType() !== 'Circle') {\n segmentData.segment.forEach(vertex => {\n const tempVertexCoord = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(vertex, projection);\n const delta = (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_12__.squaredDistance)(projectedCoordinate, tempVertexCoord);\n if (delta < minSquaredDistance) {\n closestVertex = vertex;\n minSquaredDistance = delta;\n closestFeature = segmentData.feature;\n }\n });\n }\n }\n const result = getResult();\n if (result) {\n return result;\n }\n }\n if (this.edge_) {\n for (let i = 0; i < segmentsLength; ++i) {\n let vertex = null;\n const segmentData = segments[i];\n if (segmentData.feature.getGeometry().getType() === 'Circle') {\n let circleGeometry = segmentData.feature.getGeometry();\n const userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getUserProjection)();\n if (userProjection) {\n circleGeometry = circleGeometry.clone().transform(userProjection, projection);\n }\n vertex = (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_12__.closestOnCircle)(projectedCoordinate, /** @type {import(\"../geom/Circle.js\").default} */circleGeometry);\n } else {\n const [segmentStart, segmentEnd] = segmentData.segment;\n // points have only one coordinate\n if (segmentEnd) {\n tempSegment[0] = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(segmentStart, projection);\n tempSegment[1] = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserCoordinate)(segmentEnd, projection);\n vertex = (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_12__.closestOnSegment)(projectedCoordinate, tempSegment);\n }\n }\n if (vertex) {\n const delta = (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_12__.squaredDistance)(projectedCoordinate, vertex);\n if (delta < minSquaredDistance) {\n closestVertex = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserCoordinate)(vertex, projection);\n closestSegment = segmentData.feature.getGeometry().getType() === 'Circle' ? null : segmentData.segment;\n minSquaredDistance = delta;\n }\n }\n }\n const result = getResult();\n if (result) {\n return result;\n }\n }\n return null;\n }\n\n /**\n * @param {import(\"../Feature.js\").default} feature Feature\n * @private\n */\n updateFeature_(feature) {\n this.removeFeature(feature, false);\n this.addFeature(feature, false);\n }\n\n /**\n * @param {Array<Array<import('../coordinate.js').Coordinate>>} segments Segments\n * @param {import(\"../geom/Circle.js\").default} geometry Geometry.\n * @private\n */\n segmentCircleGeometry_(segments, geometry) {\n const projection = this.getMap().getView().getProjection();\n let circleGeometry = geometry;\n const userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getUserProjection)();\n if (userProjection) {\n circleGeometry = /** @type {import(\"../geom/Circle.js\").default} */\n circleGeometry.clone().transform(userProjection, projection);\n }\n const polygon = (0,_geom_Polygon_js__WEBPACK_IMPORTED_MODULE_13__.fromCircle)(circleGeometry);\n if (userProjection) {\n polygon.transform(projection, userProjection);\n }\n const coordinates = polygon.getCoordinates()[0];\n for (let i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n segments.push(coordinates.slice(i, i + 2));\n }\n }\n\n /**\n * @param {Array<Array<import('../coordinate.js').Coordinate>>} segments Segments\n * @param {import(\"../geom/GeometryCollection.js\").default} geometry Geometry.\n * @private\n */\n segmentGeometryCollectionGeometry_(segments, geometry) {\n const geometries = geometry.getGeometriesArray();\n for (let i = 0; i < geometries.length; ++i) {\n const segmenter = this.GEOMETRY_SEGMENTERS_[geometries[i].getType()];\n if (segmenter) {\n segmenter(segments, geometries[i]);\n }\n }\n }\n\n /**\n * @param {Array<Array<import('../coordinate.js').Coordinate>>} segments Segments\n * @param {import(\"../geom/LineString.js\").default} geometry Geometry.\n * @private\n */\n segmentLineStringGeometry_(segments, geometry) {\n const coordinates = geometry.getCoordinates();\n for (let i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n segments.push(coordinates.slice(i, i + 2));\n }\n }\n\n /**\n * @param {Array<Array<import('../coordinate.js').Coordinate>>} segments Segments\n * @param {import(\"../geom/MultiLineString.js\").default} geometry Geometry.\n * @private\n */\n segmentMultiLineStringGeometry_(segments, geometry) {\n const lines = geometry.getCoordinates();\n for (let j = 0, jj = lines.length; j < jj; ++j) {\n const coordinates = lines[j];\n for (let i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n segments.push(coordinates.slice(i, i + 2));\n }\n }\n }\n\n /**\n * @param {Array<Array<import('../coordinate.js').Coordinate>>} segments Segments\n * @param {import(\"../geom/MultiPoint.js\").default} geometry Geometry.\n * @private\n */\n segmentMultiPointGeometry_(segments, geometry) {\n geometry.getCoordinates().forEach(point => {\n segments.push([point]);\n });\n }\n\n /**\n * @param {Array<Array<import('../coordinate.js').Coordinate>>} segments Segments\n * @param {import(\"../geom/MultiPolygon.js\").default} geometry Geometry.\n * @private\n */\n segmentMultiPolygonGeometry_(segments, geometry) {\n const polygons = geometry.getCoordinates();\n for (let k = 0, kk = polygons.length; k < kk; ++k) {\n const rings = polygons[k];\n for (let j = 0, jj = rings.length; j < jj; ++j) {\n const coordinates = rings[j];\n for (let i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n segments.push(coordinates.slice(i, i + 2));\n }\n }\n }\n }\n\n /**\n * @param {Array<Array<import('../coordinate.js').Coordinate>>} segments Segments\n * @param {import(\"../geom/Point.js\").default} geometry Geometry.\n * @private\n */\n segmentPointGeometry_(segments, geometry) {\n segments.push([geometry.getCoordinates()]);\n }\n\n /**\n * @param {Array<Array<import('../coordinate.js').Coordinate>>} segments Segments\n * @param {import(\"../geom/Polygon.js\").default} geometry Geometry.\n * @private\n */\n segmentPolygonGeometry_(segments, geometry) {\n const rings = geometry.getCoordinates();\n for (let j = 0, jj = rings.length; j < jj; ++j) {\n const coordinates = rings[j];\n for (let i = 0, ii = coordinates.length - 1; i < ii; ++i) {\n segments.push(coordinates.slice(i, i + 2));\n }\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Snap);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/Snap.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/interaction/defaults.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/ol/interaction/defaults.js ***!
|
||
\*************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ defaults: function() { return /* binding */ defaults; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Collection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Collection.js */ \"./node_modules/ol/Collection.js\");\n/* harmony import */ var _DoubleClickZoom_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./DoubleClickZoom.js */ \"./node_modules/ol/interaction/DoubleClickZoom.js\");\n/* harmony import */ var _DragPan_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DragPan.js */ \"./node_modules/ol/interaction/DragPan.js\");\n/* harmony import */ var _DragRotate_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DragRotate.js */ \"./node_modules/ol/interaction/DragRotate.js\");\n/* harmony import */ var _DragZoom_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./DragZoom.js */ \"./node_modules/ol/interaction/DragZoom.js\");\n/* harmony import */ var _KeyboardPan_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./KeyboardPan.js */ \"./node_modules/ol/interaction/KeyboardPan.js\");\n/* harmony import */ var _KeyboardZoom_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./KeyboardZoom.js */ \"./node_modules/ol/interaction/KeyboardZoom.js\");\n/* harmony import */ var _Kinetic_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Kinetic.js */ \"./node_modules/ol/Kinetic.js\");\n/* harmony import */ var _MouseWheelZoom_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./MouseWheelZoom.js */ \"./node_modules/ol/interaction/MouseWheelZoom.js\");\n/* harmony import */ var _PinchRotate_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PinchRotate.js */ \"./node_modules/ol/interaction/PinchRotate.js\");\n/* harmony import */ var _PinchZoom_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PinchZoom.js */ \"./node_modules/ol/interaction/PinchZoom.js\");\n\n/**\n * @module ol/interaction/defaults\n */\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @typedef {Object} DefaultsOptions\n * @property {boolean} [altShiftDragRotate=true] Whether Alt-Shift-drag rotate is\n * desired.\n * @property {boolean} [onFocusOnly=false] Interact only when the map has the\n * focus. This affects the `MouseWheelZoom` and `DragPan` interactions and is\n * useful when page scroll is desired for maps that do not have the browser's\n * focus.\n * @property {boolean} [doubleClickZoom=true] Whether double click zoom is\n * desired.\n * @property {boolean} [keyboard=true] Whether keyboard interaction is desired.\n * @property {boolean} [mouseWheelZoom=true] Whether mousewheel zoom is desired.\n * @property {boolean} [shiftDragZoom=true] Whether Shift-drag zoom is desired.\n * @property {boolean} [dragPan=true] Whether drag pan is desired.\n * @property {boolean} [pinchRotate=true] Whether pinch rotate is desired.\n * @property {boolean} [pinchZoom=true] Whether pinch zoom is desired.\n * @property {number} [zoomDelta] Zoom level delta when using keyboard or double click zoom.\n * @property {number} [zoomDuration] Duration of the zoom animation in\n * milliseconds.\n */\n\n/**\n * Set of interactions included in maps by default. Specific interactions can be\n * excluded by setting the appropriate option to false in the constructor\n * options, but the order of the interactions is fixed. If you want to specify\n * a different order for interactions, you will need to create your own\n * {@link module:ol/interaction/Interaction~Interaction} instances and insert\n * them into a {@link module:ol/Collection~Collection} in the order you want\n * before creating your {@link module:ol/Map~Map} instance. Changing the order can\n * be of interest if the event propagation needs to be stopped at a point.\n * The default set of interactions, in sequence, is:\n * * {@link module:ol/interaction/DragRotate~DragRotate}\n * * {@link module:ol/interaction/DoubleClickZoom~DoubleClickZoom}\n * * {@link module:ol/interaction/DragPan~DragPan}\n * * {@link module:ol/interaction/PinchRotate~PinchRotate}\n * * {@link module:ol/interaction/PinchZoom~PinchZoom}\n * * {@link module:ol/interaction/KeyboardPan~KeyboardPan}\n * * {@link module:ol/interaction/KeyboardZoom~KeyboardZoom}\n * * {@link module:ol/interaction/MouseWheelZoom~MouseWheelZoom}\n * * {@link module:ol/interaction/DragZoom~DragZoom}\n *\n * @param {DefaultsOptions} [options] Defaults options.\n * @return {Collection<import(\"./Interaction.js\").default>}\n * A collection of interactions to be used with the {@link module:ol/Map~Map}\n * constructor's `interactions` option.\n * @api\n */\nfunction defaults(options) {\n options = options ? options : {};\n\n /** @type {Collection<import(\"./Interaction.js\").default>} */\n const interactions = new _Collection_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n const kinetic = new _Kinetic_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](-0.005, 0.05, 100);\n const altShiftDragRotate = options.altShiftDragRotate !== undefined ? options.altShiftDragRotate : true;\n if (altShiftDragRotate) {\n interactions.push(new _DragRotate_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]());\n }\n const doubleClickZoom = options.doubleClickZoom !== undefined ? options.doubleClickZoom : true;\n if (doubleClickZoom) {\n interactions.push(new _DoubleClickZoom_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]({\n delta: options.zoomDelta,\n duration: options.zoomDuration\n }));\n }\n const dragPan = options.dragPan !== undefined ? options.dragPan : true;\n if (dragPan) {\n interactions.push(new _DragPan_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]({\n onFocusOnly: options.onFocusOnly,\n kinetic: kinetic\n }));\n }\n const pinchRotate = options.pinchRotate !== undefined ? options.pinchRotate : true;\n if (pinchRotate) {\n interactions.push(new _PinchRotate_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]());\n }\n const pinchZoom = options.pinchZoom !== undefined ? options.pinchZoom : true;\n if (pinchZoom) {\n interactions.push(new _PinchZoom_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]({\n duration: options.zoomDuration\n }));\n }\n const keyboard = options.keyboard !== undefined ? options.keyboard : true;\n if (keyboard) {\n interactions.push(new _KeyboardPan_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"]());\n interactions.push(new _KeyboardZoom_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"]({\n delta: options.zoomDelta,\n duration: options.zoomDuration\n }));\n }\n const mouseWheelZoom = options.mouseWheelZoom !== undefined ? options.mouseWheelZoom : true;\n if (mouseWheelZoom) {\n interactions.push(new _MouseWheelZoom_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"]({\n onFocusOnly: options.onFocusOnly,\n duration: options.zoomDuration\n }));\n }\n const shiftDragZoom = options.shiftDragZoom !== undefined ? options.shiftDragZoom : true;\n if (shiftDragZoom) {\n interactions.push(new _DragZoom_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"]({\n duration: options.zoomDuration\n }));\n }\n return interactions;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/interaction/defaults.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/layer/Base.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/layer/Base.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Object.js */ \"./node_modules/ol/Object.js\");\n/* harmony import */ var _Property_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Property.js */ \"./node_modules/ol/layer/Property.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../asserts.js */ \"./node_modules/ol/asserts.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../math.js */ \"./node_modules/ol/math.js\");\n/**\n * @module ol/layer/Base\n */\n\n\n\n\n\n\n/**\n * A css color, or a function called with a view resolution returning a css color.\n *\n * @typedef {string|function(number):string} BackgroundColor\n * @api\n */\n\n/**\n * @typedef {import(\"../ObjectEventType\").Types|'change:extent'|'change:maxResolution'|'change:maxZoom'|\n * 'change:minResolution'|'change:minZoom'|'change:opacity'|'change:visible'|'change:zIndex'} BaseLayerObjectEventTypes\n */\n\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature<import(\"../Observable\").EventTypes, import(\"../events/Event.js\").default, Return> &\n * import(\"../Observable\").OnSignature<BaseLayerObjectEventTypes, import(\"../Object\").ObjectEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature<import(\"../Observable\").EventTypes|BaseLayerObjectEventTypes, Return>} BaseLayerOnSignature\n */\n\n/**\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number | undefined} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will be\n * visible.\n * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will\n * be visible.\n * @property {BackgroundColor} [background] Background color for the layer. If not specified, no background\n * will be rendered.\n * @property {Object<string, *>} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.\n */\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Note that with {@link module:ol/layer/Base~BaseLayer} and all its subclasses, any property set in\n * the options is set as a {@link module:ol/Object~BaseObject} property on the layer object, so\n * is observable, and has get/set accessors.\n *\n * @api\n */\nclass BaseLayer extends _Object_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} options Layer options.\n */\n constructor(options) {\n super();\n\n /***\n * @type {BaseLayerOnSignature<import(\"../events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {BaseLayerOnSignature<import(\"../events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {BaseLayerOnSignature<void>}\n */\n this.un;\n\n /**\n * @type {BackgroundColor|false}\n * @private\n */\n this.background_ = options.background;\n\n /**\n * @type {Object<string, *>}\n */\n const properties = Object.assign({}, options);\n if (typeof options.properties === 'object') {\n delete properties.properties;\n Object.assign(properties, options.properties);\n }\n properties[_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].OPACITY] = options.opacity !== undefined ? options.opacity : 1;\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_2__.assert)(typeof properties[_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].OPACITY] === 'number', 'Layer opacity must be a number');\n properties[_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].VISIBLE] = options.visible !== undefined ? options.visible : true;\n properties[_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Z_INDEX] = options.zIndex;\n properties[_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MAX_RESOLUTION] = options.maxResolution !== undefined ? options.maxResolution : Infinity;\n properties[_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MIN_RESOLUTION] = options.minResolution !== undefined ? options.minResolution : 0;\n properties[_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MIN_ZOOM] = options.minZoom !== undefined ? options.minZoom : -Infinity;\n properties[_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MAX_ZOOM] = options.maxZoom !== undefined ? options.maxZoom : Infinity;\n\n /**\n * @type {string}\n * @private\n */\n this.className_ = properties.className !== undefined ? properties.className : 'ol-layer';\n delete properties.className;\n this.setProperties(properties);\n\n /**\n * @type {import(\"./Layer.js\").State}\n * @private\n */\n this.state_ = null;\n }\n\n /**\n * Get the background for this layer.\n * @return {BackgroundColor|false} Layer background.\n */\n getBackground() {\n return this.background_;\n }\n\n /**\n * @return {string} CSS class name.\n */\n getClassName() {\n return this.className_;\n }\n\n /**\n * This method is not meant to be called by layers or layer renderers because the state\n * is incorrect if the layer is included in a layer group.\n *\n * @param {boolean} [managed] Layer is managed.\n * @return {import(\"./Layer.js\").State} Layer state.\n */\n getLayerState(managed) {\n /** @type {import(\"./Layer.js\").State} */\n const state = this.state_ || (/** @type {?} */{\n layer: this,\n managed: managed === undefined ? true : managed\n });\n const zIndex = this.getZIndex();\n state.opacity = (0,_math_js__WEBPACK_IMPORTED_MODULE_3__.clamp)(Math.round(this.getOpacity() * 100) / 100, 0, 1);\n state.visible = this.getVisible();\n state.extent = this.getExtent();\n state.zIndex = zIndex === undefined && !state.managed ? Infinity : zIndex;\n state.maxResolution = this.getMaxResolution();\n state.minResolution = Math.max(this.getMinResolution(), 0);\n state.minZoom = this.getMinZoom();\n state.maxZoom = this.getMaxZoom();\n this.state_ = state;\n return state;\n }\n\n /**\n * @abstract\n * @param {Array<import(\"./Layer.js\").default>} [array] Array of layers (to be\n * modified in place).\n * @return {Array<import(\"./Layer.js\").default>} Array of layers.\n */\n getLayersArray(array) {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_4__.abstract)();\n }\n\n /**\n * @abstract\n * @param {Array<import(\"./Layer.js\").State>} [states] Optional list of layer\n * states (to be modified in place).\n * @return {Array<import(\"./Layer.js\").State>} List of layer states.\n */\n getLayerStatesArray(states) {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_4__.abstract)();\n }\n\n /**\n * Return the {@link module:ol/extent~Extent extent} of the layer or `undefined` if it\n * will be visible regardless of extent.\n * @return {import(\"../extent.js\").Extent|undefined} The layer extent.\n * @observable\n * @api\n */\n getExtent() {\n return /** @type {import(\"../extent.js\").Extent|undefined} */this.get(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].EXTENT);\n }\n\n /**\n * Return the maximum resolution of the layer. Returns Infinity if\n * the layer has no maximum resolution set.\n * @return {number} The maximum resolution of the layer.\n * @observable\n * @api\n */\n getMaxResolution() {\n return /** @type {number} */this.get(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MAX_RESOLUTION);\n }\n\n /**\n * Return the minimum resolution of the layer. Returns 0 if\n * the layer has no minimum resolution set.\n * @return {number} The minimum resolution of the layer.\n * @observable\n * @api\n */\n getMinResolution() {\n return /** @type {number} */this.get(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MIN_RESOLUTION);\n }\n\n /**\n * Return the minimum zoom level of the layer. Returns -Infinity if\n * the layer has no minimum zoom set.\n * @return {number} The minimum zoom level of the layer.\n * @observable\n * @api\n */\n getMinZoom() {\n return /** @type {number} */this.get(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MIN_ZOOM);\n }\n\n /**\n * Return the maximum zoom level of the layer. Returns Infinity if\n * the layer has no maximum zoom set.\n * @return {number} The maximum zoom level of the layer.\n * @observable\n * @api\n */\n getMaxZoom() {\n return /** @type {number} */this.get(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MAX_ZOOM);\n }\n\n /**\n * Return the opacity of the layer (between 0 and 1).\n * @return {number} The opacity of the layer.\n * @observable\n * @api\n */\n getOpacity() {\n return /** @type {number} */this.get(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].OPACITY);\n }\n\n /**\n * @abstract\n * @return {import(\"../source/Source.js\").State} Source state.\n */\n getSourceState() {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_4__.abstract)();\n }\n\n /**\n * Return the value of this layer's `visible` property. To find out whether the layer\n * is visible on a map, use `isVisible()` instead.\n * @return {boolean} The value of the `visible` property of the layer.\n * @observable\n * @api\n */\n getVisible() {\n return /** @type {boolean} */this.get(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].VISIBLE);\n }\n\n /**\n * Return the Z-index of the layer, which is used to order layers before\n * rendering. Returns undefined if the layer is unmanaged.\n * @return {number|undefined} The Z-index of the layer.\n * @observable\n * @api\n */\n getZIndex() {\n return /** @type {number|undefined} */this.get(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Z_INDEX);\n }\n\n /**\n * Sets the background color.\n * @param {BackgroundColor} [background] Background color.\n */\n setBackground(background) {\n this.background_ = background;\n this.changed();\n }\n\n /**\n * Set the extent at which the layer is visible. If `undefined`, the layer\n * will be visible at all extents.\n * @param {import(\"../extent.js\").Extent|undefined} extent The extent of the layer.\n * @observable\n * @api\n */\n setExtent(extent) {\n this.set(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].EXTENT, extent);\n }\n\n /**\n * Set the maximum resolution at which the layer is visible.\n * @param {number} maxResolution The maximum resolution of the layer.\n * @observable\n * @api\n */\n setMaxResolution(maxResolution) {\n this.set(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MAX_RESOLUTION, maxResolution);\n }\n\n /**\n * Set the minimum resolution at which the layer is visible.\n * @param {number} minResolution The minimum resolution of the layer.\n * @observable\n * @api\n */\n setMinResolution(minResolution) {\n this.set(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MIN_RESOLUTION, minResolution);\n }\n\n /**\n * Set the maximum zoom (exclusive) at which the layer is visible.\n * Note that the zoom levels for layer visibility are based on the\n * view zoom level, which may be different from a tile source zoom level.\n * @param {number} maxZoom The maximum zoom of the layer.\n * @observable\n * @api\n */\n setMaxZoom(maxZoom) {\n this.set(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MAX_ZOOM, maxZoom);\n }\n\n /**\n * Set the minimum zoom (inclusive) at which the layer is visible.\n * Note that the zoom levels for layer visibility are based on the\n * view zoom level, which may be different from a tile source zoom level.\n * @param {number} minZoom The minimum zoom of the layer.\n * @observable\n * @api\n */\n setMinZoom(minZoom) {\n this.set(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MIN_ZOOM, minZoom);\n }\n\n /**\n * Set the opacity of the layer, allowed values range from 0 to 1.\n * @param {number} opacity The opacity of the layer.\n * @observable\n * @api\n */\n setOpacity(opacity) {\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_2__.assert)(typeof opacity === 'number', 'Layer opacity must be a number');\n this.set(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].OPACITY, opacity);\n }\n\n /**\n * Set the visibility of the layer (`true` or `false`).\n * @param {boolean} visible The visibility of the layer.\n * @observable\n * @api\n */\n setVisible(visible) {\n this.set(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].VISIBLE, visible);\n }\n\n /**\n * Set Z-index of the layer, which is used to order layers before rendering.\n * The default Z-index is 0.\n * @param {number} zindex The z-index of the layer.\n * @observable\n * @api\n */\n setZIndex(zindex) {\n this.set(_Property_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Z_INDEX, zindex);\n }\n\n /**\n * Clean up.\n */\n disposeInternal() {\n if (this.state_) {\n this.state_.layer = null;\n this.state_ = null;\n }\n super.disposeInternal();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (BaseLayer);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/layer/Base.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/layer/BaseImage.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/layer/BaseImage.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Layer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Layer.js */ \"./node_modules/ol/layer/Layer.js\");\n/**\n * @module ol/layer/BaseImage\n */\n\n\n/**\n * @template {import(\"../source/Image.js\").default} ImageSourceType\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will be\n * visible.\n * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will\n * be visible.\n * @property {import(\"../Map.js\").default} [map] Sets the layer as overlay on a map. The map will not manage\n * this layer in its layers collection, and the layer will be rendered on top. This is useful for\n * temporary layers. The standard way to add a layer to a map and have it managed by the map is to\n * use {@link import(\"../Map.js\").default#addLayer map.addLayer()}.\n * @property {ImageSourceType} [source] Source for this layer.\n * @property {Object<string, *>} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.\n */\n\n/**\n * @classdesc\n * Server-rendered images that are available for arbitrary extents and\n * resolutions.\n * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}\n * property on the layer object; for example, setting `title: 'My Title'` in the\n * options means that `title` is observable, and has get/set accessors.\n *\n * @template {import(\"../source/Image.js\").default} ImageSourceType\n * @template {import(\"../renderer/Layer.js\").default} RendererType\n * @extends {Layer<ImageSourceType, RendererType>}\n * @api\n */\nclass BaseImageLayer extends _Layer_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options<ImageSourceType>} [options] Layer options.\n */\n constructor(options) {\n options = options ? options : {};\n super(options);\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (BaseImageLayer);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/layer/BaseImage.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/layer/BaseVector.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ol/layer/BaseVector.js ***!
|
||
\*********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Layer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Layer.js */ \"./node_modules/ol/layer/Layer.js\");\n/* harmony import */ var rbush__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rbush */ \"./node_modules/rbush/rbush.min.js\");\n/* harmony import */ var _style_Style_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../style/Style.js */ \"./node_modules/ol/style/Style.js\");\n/* harmony import */ var _render_canvas_style_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../render/canvas/style.js */ \"./node_modules/ol/render/canvas/style.js\");\n/**\n * @module ol/layer/BaseVector\n */\n\n\n\n\n\n/**\n * @template {import(\"../source/Vector.js\").default|import(\"../source/VectorTile.js\").default} VectorSourceType\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will be\n * visible.\n * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will\n * be visible.\n * @property {import(\"../render.js\").OrderFunction} [renderOrder] Render order. Function to be used when sorting\n * features before rendering. By default features are drawn in the order that they are created. Use\n * `null` to avoid the sort, but get an undefined draw order.\n * @property {number} [renderBuffer=100] The buffer in pixels around the viewport extent used by the\n * renderer when getting features from the vector source for the rendering or hit-detection.\n * Recommended value: the size of the largest symbol, line width or label.\n * @property {VectorSourceType} [source] Source.\n * @property {import(\"../Map.js\").default} [map] Sets the layer as overlay on a map. The map will not manage\n * this layer in its layers collection, and the layer will be rendered on top. This is useful for\n * temporary layers. The standard way to add a layer to a map and have it managed by the map is to\n * use [map.addLayer()]{@link import(\"../Map.js\").default#addLayer}.\n * @property {boolean} [declutter=false] Declutter images and text. Decluttering is applied to all\n * image and text styles of all Vector and VectorTile layers that have set this to `true`. The priority\n * is defined by the z-index of the layer, the `zIndex` of the style and the render order of features.\n * Higher z-index means higher priority. Within the same z-index, a feature rendered before another has\n * higher priority.\n *\n * As an optimization decluttered features from layers with the same `className` are rendered above\n * the fill and stroke styles of all of those layers regardless of z-index. To opt out of this\n * behavior and place declutterd features with their own layer configure the layer with a `className`\n * other than `ol-layer`.\n * @property {import(\"../style/Style.js\").StyleLike|import(\"../style/flat.js\").FlatStyleLike|null} [style] Layer style. When set to `null`, only\n * features that have their own style will be rendered. See {@link module:ol/style/Style~Style} for the default style\n * which will be used if this is not set.\n * @property {import(\"./Base.js\").BackgroundColor} [background] Background color for the layer. If not specified, no background\n * will be rendered.\n * @property {boolean} [updateWhileAnimating=false] When set to `true`, feature batches will\n * be recreated during animations. This means that no vectors will be shown clipped, but the\n * setting will have a performance impact for large amounts of vector data. When set to `false`,\n * batches will be recreated when no animation is active.\n * @property {boolean} [updateWhileInteracting=false] When set to `true`, feature batches will\n * be recreated during interactions. See also `updateWhileAnimating`.\n * @property {Object<string, *>} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.\n */\n\n/**\n * @enum {string}\n * @private\n */\nconst Property = {\n RENDER_ORDER: 'renderOrder'\n};\n\n/**\n * @classdesc\n * Vector data that is rendered client-side.\n * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}\n * property on the layer object; for example, setting `title: 'My Title'` in the\n * options means that `title` is observable, and has get/set accessors.\n *\n * @template {import(\"../source/Vector.js\").default|import(\"../source/VectorTile.js\").default} VectorSourceType\n * @template {import(\"../renderer/canvas/VectorLayer.js\").default|import(\"../renderer/canvas/VectorTileLayer.js\").default|import(\"../renderer/canvas/VectorImageLayer.js\").default|import(\"../renderer/webgl/PointsLayer.js\").default} RendererType\n * @extends {Layer<VectorSourceType, RendererType>}\n * @api\n */\nclass BaseVectorLayer extends _Layer_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {Options<VectorSourceType>} [options] Options.\n */\n constructor(options) {\n options = options ? options : {};\n const baseOptions = Object.assign({}, options);\n delete baseOptions.style;\n delete baseOptions.renderBuffer;\n delete baseOptions.updateWhileAnimating;\n delete baseOptions.updateWhileInteracting;\n super(baseOptions);\n\n /**\n * @private\n * @type {boolean}\n */\n this.declutter_ = options.declutter !== undefined ? options.declutter : false;\n\n /**\n * @type {number}\n * @private\n */\n this.renderBuffer_ = options.renderBuffer !== undefined ? options.renderBuffer : 100;\n\n /**\n * User provided style.\n * @type {import(\"../style/Style.js\").StyleLike}\n * @private\n */\n this.style_ = null;\n\n /**\n * Style function for use within the library.\n * @type {import(\"../style/Style.js\").StyleFunction|undefined}\n * @private\n */\n this.styleFunction_ = undefined;\n this.setStyle(options.style);\n\n /**\n * @type {boolean}\n * @private\n */\n this.updateWhileAnimating_ = options.updateWhileAnimating !== undefined ? options.updateWhileAnimating : false;\n\n /**\n * @type {boolean}\n * @private\n */\n this.updateWhileInteracting_ = options.updateWhileInteracting !== undefined ? options.updateWhileInteracting : false;\n }\n\n /**\n * @return {boolean} Declutter.\n */\n getDeclutter() {\n return this.declutter_;\n }\n\n /**\n * Get the topmost feature that intersects the given pixel on the viewport. Returns a promise\n * that resolves with an array of features. The array will either contain the topmost feature\n * when a hit was detected, or it will be empty.\n *\n * The hit detection algorithm used for this method is optimized for performance, but is less\n * accurate than the one used in [map.getFeaturesAtPixel()]{@link import(\"../Map.js\").default#getFeaturesAtPixel}.\n * Text is not considered, and icons are only represented by their bounding box instead of the exact\n * image.\n *\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel.\n * @return {Promise<Array<import(\"../Feature\").FeatureLike>>} Promise that resolves with an array of features.\n * @api\n */\n getFeatures(pixel) {\n return super.getFeatures(pixel);\n }\n\n /**\n * @return {number|undefined} Render buffer.\n */\n getRenderBuffer() {\n return this.renderBuffer_;\n }\n\n /**\n * @return {function(import(\"../Feature.js\").default, import(\"../Feature.js\").default): number|null|undefined} Render\n * order.\n */\n getRenderOrder() {\n return /** @type {import(\"../render.js\").OrderFunction|null|undefined} */this.get(Property.RENDER_ORDER);\n }\n\n /**\n * Get the style for features. This returns whatever was passed to the `style`\n * option at construction or to the `setStyle` method.\n * @return {import(\"../style/Style.js\").StyleLike|null|undefined} Layer style.\n * @api\n */\n getStyle() {\n return this.style_;\n }\n\n /**\n * Get the style function.\n * @return {import(\"../style/Style.js\").StyleFunction|undefined} Layer style function.\n * @api\n */\n getStyleFunction() {\n return this.styleFunction_;\n }\n\n /**\n * @return {boolean} Whether the rendered layer should be updated while\n * animating.\n */\n getUpdateWhileAnimating() {\n return this.updateWhileAnimating_;\n }\n\n /**\n * @return {boolean} Whether the rendered layer should be updated while\n * interacting.\n */\n getUpdateWhileInteracting() {\n return this.updateWhileInteracting_;\n }\n\n /**\n * Render declutter items for this layer\n * @param {import(\"../Map.js\").FrameState} frameState Frame state.\n */\n renderDeclutter(frameState) {\n if (!frameState.declutterTree) {\n frameState.declutterTree = new rbush__WEBPACK_IMPORTED_MODULE_0__(9);\n }\n /** @type {*} */\n this.getRenderer().renderDeclutter(frameState);\n }\n\n /**\n * @param {import(\"../render.js\").OrderFunction|null|undefined} renderOrder\n * Render order.\n */\n setRenderOrder(renderOrder) {\n this.set(Property.RENDER_ORDER, renderOrder);\n }\n\n /**\n * Set the style for features. This can be a single style object, an array\n * of styles, or a function that takes a feature and resolution and returns\n * an array of styles. If set to `null`, the layer has no style (a `null` style),\n * so only features that have their own styles will be rendered in the layer. Call\n * `setStyle()` without arguments to reset to the default style. See\n * [the ol/style/Style module]{@link module:ol/style/Style~Style} for information on the default style.\n *\n * If your layer has a static style, you can use [flat style]{@link module:ol/style/flat~FlatStyle} object\n * literals instead of using the `Style` and symbolizer constructors (`Fill`, `Stroke`, etc.):\n * ```js\n * vectorLayer.setStyle({\n * \"fill-color\": \"yellow\",\n * \"stroke-color\": \"black\",\n * \"stroke-width\": 4\n * })\n * ```\n *\n * @param {import(\"../style/Style.js\").StyleLike|import(\"../style/flat.js\").FlatStyleLike|null} [style] Layer style.\n * @api\n */\n setStyle(style) {\n this.style_ = toStyleLike(style);\n this.styleFunction_ = style === null ? undefined : (0,_style_Style_js__WEBPACK_IMPORTED_MODULE_2__.toFunction)(this.style_);\n this.changed();\n }\n}\n\n/**\n * Coerce the allowed style types into a shorter list of types. Flat styles, arrays of flat\n * styles, and arrays of rules are converted into style functions.\n *\n * @param {import(\"../style/Style.js\").StyleLike|import(\"../style/flat.js\").FlatStyleLike|null} [style] Layer style.\n * @return {import(\"../style/Style.js\").StyleLike|null} The style.\n */\nfunction toStyleLike(style) {\n if (style === undefined) {\n return _style_Style_js__WEBPACK_IMPORTED_MODULE_2__.createDefaultStyle;\n }\n if (!style) {\n return null;\n }\n if (typeof style === 'function') {\n return style;\n }\n if (style instanceof _style_Style_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]) {\n return style;\n }\n if (!Array.isArray(style)) {\n return (0,_render_canvas_style_js__WEBPACK_IMPORTED_MODULE_3__.flatStylesToStyleFunction)([style]);\n }\n if (style.length === 0) {\n return [];\n }\n const length = style.length;\n const first = style[0];\n if (first instanceof _style_Style_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]) {\n /**\n * @type {Array<Style>}\n */\n const styles = new Array(length);\n for (let i = 0; i < length; ++i) {\n const candidate = style[i];\n if (!(candidate instanceof _style_Style_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])) {\n throw new Error('Expected a list of style instances');\n }\n styles[i] = candidate;\n }\n return styles;\n }\n if ('style' in first) {\n /**\n * @type Array<import(\"../style/flat.js\").Rule>\n */\n const rules = new Array(length);\n for (let i = 0; i < length; ++i) {\n const candidate = style[i];\n if (!('style' in candidate)) {\n throw new Error('Expected a list of rules with a style property');\n }\n rules[i] = candidate;\n }\n return (0,_render_canvas_style_js__WEBPACK_IMPORTED_MODULE_3__.rulesToStyleFunction)(rules);\n }\n const flatStyles = /** @type {Array<import(\"../style/flat.js\").FlatStyle>} */style;\n return (0,_render_canvas_style_js__WEBPACK_IMPORTED_MODULE_3__.flatStylesToStyleFunction)(flatStyles);\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (BaseVectorLayer);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/layer/BaseVector.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/layer/Group.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/ol/layer/Group.js ***!
|
||
\****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GroupEvent: function() { return /* binding */ GroupEvent; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Base_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Base.js */ \"./node_modules/ol/layer/Base.js\");\n/* harmony import */ var _Collection_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Collection.js */ \"./node_modules/ol/Collection.js\");\n/* harmony import */ var _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../CollectionEventType.js */ \"./node_modules/ol/CollectionEventType.js\");\n/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events/Event.js */ \"./node_modules/ol/events/Event.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../ObjectEventType.js */ \"./node_modules/ol/ObjectEventType.js\");\n/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../asserts.js */ \"./node_modules/ol/asserts.js\");\n/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../obj.js */ \"./node_modules/ol/obj.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../events.js */ \"./node_modules/ol/events.js\");\n\n/**\n * @module ol/layer/Group\n */\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @typedef {'addlayer'|'removelayer'} EventType\n */\n\n/**\n * @classdesc\n * A layer group triggers 'addlayer' and 'removelayer' events when layers are added to or removed from\n * the group or one of its child groups. When a layer group is added to or removed from another layer group,\n * a single event will be triggered (instead of one per layer in the group added or removed).\n */\nclass GroupEvent extends _events_Event_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {EventType} type The event type.\n * @param {BaseLayer} layer The layer.\n */\n constructor(type, layer) {\n super(type);\n\n /**\n * The added or removed layer.\n * @type {BaseLayer}\n * @api\n */\n this.layer = layer;\n }\n}\n\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature<import(\"../Observable\").EventTypes, import(\"../events/Event.js\").default, Return> &\n * import(\"../Observable\").OnSignature<import(\"./Base\").BaseLayerObjectEventTypes|\n * 'change:layers', import(\"../Object\").ObjectEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature<import(\"../Observable\").EventTypes|import(\"./Base\").BaseLayerObjectEventTypes|'change:layers', Return>} GroupOnSignature\n */\n\n/**\n * @typedef {Object} Options\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will be\n * visible.\n * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will\n * be visible.\n * @property {Array<import(\"./Base.js\").default>|Collection<import(\"./Base.js\").default>} [layers] Child layers.\n * @property {Object<string, *>} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.\n */\n\n/**\n * @enum {string}\n * @private\n */\nconst Property = {\n LAYERS: 'layers'\n};\n\n/**\n * @classdesc\n * A {@link module:ol/Collection~Collection} of layers that are handled together.\n *\n * A generic `change` event is triggered when the group/Collection changes.\n *\n * @api\n */\nclass LayerGroup extends _Base_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n /**\n * @param {Options} [options] Layer options.\n */\n constructor(options) {\n options = options || {};\n const baseOptions = /** @type {Options} */Object.assign({}, options);\n delete baseOptions.layers;\n let layers = options.layers;\n super(baseOptions);\n\n /***\n * @type {GroupOnSignature<import(\"../events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {GroupOnSignature<import(\"../events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {GroupOnSignature<void>}\n */\n this.un;\n\n /**\n * @private\n * @type {Array<import(\"../events.js\").EventsKey>}\n */\n this.layersListenerKeys_ = [];\n\n /**\n * @private\n * @type {Object<string, Array<import(\"../events.js\").EventsKey>>}\n */\n this.listenerKeys_ = {};\n this.addChangeListener(Property.LAYERS, this.handleLayersChanged_);\n if (layers) {\n if (Array.isArray(layers)) {\n layers = new _Collection_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"](layers.slice(), {\n unique: true\n });\n } else {\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_4__.assert)(typeof (/** @type {?} */layers.getArray) === 'function', 'Expected `layers` to be an array or a `Collection`');\n }\n } else {\n layers = new _Collection_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"](undefined, {\n unique: true\n });\n }\n this.setLayers(layers);\n }\n\n /**\n * @private\n */\n handleLayerChange_() {\n this.changed();\n }\n\n /**\n * @private\n */\n handleLayersChanged_() {\n this.layersListenerKeys_.forEach(_events_js__WEBPACK_IMPORTED_MODULE_5__.unlistenByKey);\n this.layersListenerKeys_.length = 0;\n const layers = this.getLayers();\n this.layersListenerKeys_.push((0,_events_js__WEBPACK_IMPORTED_MODULE_5__.listen)(layers, _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].ADD, this.handleLayersAdd_, this), (0,_events_js__WEBPACK_IMPORTED_MODULE_5__.listen)(layers, _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].REMOVE, this.handleLayersRemove_, this));\n for (const id in this.listenerKeys_) {\n this.listenerKeys_[id].forEach(_events_js__WEBPACK_IMPORTED_MODULE_5__.unlistenByKey);\n }\n (0,_obj_js__WEBPACK_IMPORTED_MODULE_7__.clear)(this.listenerKeys_);\n const layersArray = layers.getArray();\n for (let i = 0, ii = layersArray.length; i < ii; i++) {\n const layer = layersArray[i];\n this.registerLayerListeners_(layer);\n this.dispatchEvent(new GroupEvent('addlayer', layer));\n }\n this.changed();\n }\n\n /**\n * @param {BaseLayer} layer The layer.\n */\n registerLayerListeners_(layer) {\n const listenerKeys = [(0,_events_js__WEBPACK_IMPORTED_MODULE_5__.listen)(layer, _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"].PROPERTYCHANGE, this.handleLayerChange_, this), (0,_events_js__WEBPACK_IMPORTED_MODULE_5__.listen)(layer, _events_EventType_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"].CHANGE, this.handleLayerChange_, this)];\n if (layer instanceof LayerGroup) {\n listenerKeys.push((0,_events_js__WEBPACK_IMPORTED_MODULE_5__.listen)(layer, 'addlayer', this.handleLayerGroupAdd_, this), (0,_events_js__WEBPACK_IMPORTED_MODULE_5__.listen)(layer, 'removelayer', this.handleLayerGroupRemove_, this));\n }\n this.listenerKeys_[(0,_util_js__WEBPACK_IMPORTED_MODULE_10__.getUid)(layer)] = listenerKeys;\n }\n\n /**\n * @param {GroupEvent} event The layer group event.\n */\n handleLayerGroupAdd_(event) {\n this.dispatchEvent(new GroupEvent('addlayer', event.layer));\n }\n\n /**\n * @param {GroupEvent} event The layer group event.\n */\n handleLayerGroupRemove_(event) {\n this.dispatchEvent(new GroupEvent('removelayer', event.layer));\n }\n\n /**\n * @param {import(\"../Collection.js\").CollectionEvent<import(\"./Base.js\").default>} collectionEvent CollectionEvent.\n * @private\n */\n handleLayersAdd_(collectionEvent) {\n const layer = collectionEvent.element;\n this.registerLayerListeners_(layer);\n this.dispatchEvent(new GroupEvent('addlayer', layer));\n this.changed();\n }\n\n /**\n * @param {import(\"../Collection.js\").CollectionEvent<import(\"./Base.js\").default>} collectionEvent CollectionEvent.\n * @private\n */\n handleLayersRemove_(collectionEvent) {\n const layer = collectionEvent.element;\n const key = (0,_util_js__WEBPACK_IMPORTED_MODULE_10__.getUid)(layer);\n this.listenerKeys_[key].forEach(_events_js__WEBPACK_IMPORTED_MODULE_5__.unlistenByKey);\n delete this.listenerKeys_[key];\n this.dispatchEvent(new GroupEvent('removelayer', layer));\n this.changed();\n }\n\n /**\n * Returns the {@link module:ol/Collection~Collection collection} of {@link module:ol/layer/Layer~Layer layers}\n * in this group.\n * @return {!Collection<import(\"./Base.js\").default>} Collection of\n * {@link module:ol/layer/Base~BaseLayer layers} that are part of this group.\n * @observable\n * @api\n */\n getLayers() {\n return /** @type {!Collection<import(\"./Base.js\").default>} */this.get(Property.LAYERS);\n }\n\n /**\n * Set the {@link module:ol/Collection~Collection collection} of {@link module:ol/layer/Layer~Layer layers}\n * in this group.\n * @param {!Collection<import(\"./Base.js\").default>} layers Collection of\n * {@link module:ol/layer/Base~BaseLayer layers} that are part of this group.\n * @observable\n * @api\n */\n setLayers(layers) {\n const collection = this.getLayers();\n if (collection) {\n const currentLayers = collection.getArray();\n for (let i = 0, ii = currentLayers.length; i < ii; ++i) {\n this.dispatchEvent(new GroupEvent('removelayer', currentLayers[i]));\n }\n }\n this.set(Property.LAYERS, layers);\n }\n\n /**\n * @param {Array<import(\"./Layer.js\").default>} [array] Array of layers (to be modified in place).\n * @return {Array<import(\"./Layer.js\").default>} Array of layers.\n */\n getLayersArray(array) {\n array = array !== undefined ? array : [];\n this.getLayers().forEach(function (layer) {\n layer.getLayersArray(array);\n });\n return array;\n }\n\n /**\n * Get the layer states list and use this groups z-index as the default\n * for all layers in this and nested groups, if it is unset at this point.\n * If dest is not provided and this group's z-index is undefined\n * 0 is used a the default z-index.\n * @param {Array<import(\"./Layer.js\").State>} [dest] Optional list\n * of layer states (to be modified in place).\n * @return {Array<import(\"./Layer.js\").State>} List of layer states.\n */\n getLayerStatesArray(dest) {\n const states = dest !== undefined ? dest : [];\n const pos = states.length;\n this.getLayers().forEach(function (layer) {\n layer.getLayerStatesArray(states);\n });\n const ownLayerState = this.getLayerState();\n let defaultZIndex = ownLayerState.zIndex;\n if (!dest && ownLayerState.zIndex === undefined) {\n defaultZIndex = 0;\n }\n for (let i = pos, ii = states.length; i < ii; i++) {\n const layerState = states[i];\n layerState.opacity *= ownLayerState.opacity;\n layerState.visible = layerState.visible && ownLayerState.visible;\n layerState.maxResolution = Math.min(layerState.maxResolution, ownLayerState.maxResolution);\n layerState.minResolution = Math.max(layerState.minResolution, ownLayerState.minResolution);\n layerState.minZoom = Math.max(layerState.minZoom, ownLayerState.minZoom);\n layerState.maxZoom = Math.min(layerState.maxZoom, ownLayerState.maxZoom);\n if (ownLayerState.extent !== undefined) {\n if (layerState.extent !== undefined) {\n layerState.extent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_11__.getIntersection)(layerState.extent, ownLayerState.extent);\n } else {\n layerState.extent = ownLayerState.extent;\n }\n }\n if (layerState.zIndex === undefined) {\n layerState.zIndex = defaultZIndex;\n }\n }\n return states;\n }\n\n /**\n * @return {import(\"../source/Source.js\").State} Source state.\n */\n getSourceState() {\n return 'ready';\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayerGroup);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/layer/Group.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/layer/Image.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/ol/layer/Image.js ***!
|
||
\****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _BaseImage_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BaseImage.js */ \"./node_modules/ol/layer/BaseImage.js\");\n/* harmony import */ var _renderer_canvas_ImageLayer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../renderer/canvas/ImageLayer.js */ \"./node_modules/ol/renderer/canvas/ImageLayer.js\");\n/**\n * @module ol/layer/Image\n */\n\n\n\n/**\n * @classdesc\n * Server-rendered images that are available for arbitrary extents and\n * resolutions.\n * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}\n * property on the layer object; for example, setting `title: 'My Title'` in the\n * options means that `title` is observable, and has get/set accessors.\n *\n * @template {import(\"../source/Image.js\").default} ImageSourceType\n * @extends {BaseImageLayer<ImageSourceType, CanvasImageLayerRenderer>}\n * @api\n */\nclass ImageLayer extends _BaseImage_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {import(\"./BaseImage.js\").Options<ImageSourceType>} [options] Layer options.\n */\n constructor(options) {\n super(options);\n }\n createRenderer() {\n return new _renderer_canvas_ImageLayer_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this);\n }\n\n /**\n * Get data for a pixel location. A four element RGBA array will be returned. For requests outside the\n * layer extent, `null` will be returned. Data for an image can only be retrieved if the\n * source's `crossOrigin` property is set.\n *\n * ```js\n * // display layer data on every pointer move\n * map.on('pointermove', (event) => {\n * console.log(layer.getData(event.pixel));\n * });\n * ```\n * @param {import(\"../pixel\").Pixel} pixel Pixel.\n * @return {Uint8ClampedArray|Uint8Array|Float32Array|DataView|null} Pixel data.\n * @api\n */\n getData(pixel) {\n return super.getData(pixel);\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (ImageLayer);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/layer/Image.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/layer/Layer.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/ol/layer/Layer.js ***!
|
||
\****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ inView: function() { return /* binding */ inView; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Base_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Base.js */ \"./node_modules/ol/layer/Base.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _Property_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Property.js */ \"./node_modules/ol/layer/Property.js\");\n/* harmony import */ var _render_EventType_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../render/EventType.js */ \"./node_modules/ol/render/EventType.js\");\n/* harmony import */ var _View_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../View.js */ \"./node_modules/ol/View.js\");\n/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../asserts.js */ \"./node_modules/ol/asserts.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../events.js */ \"./node_modules/ol/events.js\");\n\n/**\n * @module ol/layer/Layer\n */\n\n\n\n\n\n\n\n\n\n/**\n * @typedef {function(import(\"../Map.js\").FrameState):HTMLElement} RenderFunction\n */\n\n/**\n * @typedef {'sourceready'|'change:source'} LayerEventType\n */\n\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature<import(\"../Observable\").EventTypes, import(\"../events/Event.js\").default, Return> &\n * import(\"../Observable\").OnSignature<import(\"./Base\").BaseLayerObjectEventTypes|\n * LayerEventType, import(\"../Object\").ObjectEvent, Return> &\n * import(\"../Observable\").OnSignature<import(\"../render/EventType\").LayerRenderEventTypes, import(\"../render/Event\").default, Return> &\n * import(\"../Observable\").CombinedOnSignature<import(\"../Observable\").EventTypes|import(\"./Base\").BaseLayerObjectEventTypes|LayerEventType|\n * import(\"../render/EventType\").LayerRenderEventTypes, Return>} LayerOnSignature\n */\n\n/**\n * @template {import(\"../source/Source.js\").default} [SourceType=import(\"../source/Source.js\").default]\n * @typedef {Object} Options\n * @property {string} [className='ol-layer'] A CSS class name to set to the layer element.\n * @property {number} [opacity=1] Opacity (0, 1).\n * @property {boolean} [visible=true] Visibility.\n * @property {import(\"../extent.js\").Extent} [extent] The bounding extent for layer rendering. The layer will not be\n * rendered outside of this extent.\n * @property {number} [zIndex] The z-index for layer rendering. At rendering time, the layers\n * will be ordered, first by Z-index and then by position. When `undefined`, a `zIndex` of 0 is assumed\n * for layers that are added to the map's `layers` collection, or `Infinity` when the layer's `setMap()`\n * method was used.\n * @property {number} [minResolution] The minimum resolution (inclusive) at which this layer will be\n * visible.\n * @property {number} [maxResolution] The maximum resolution (exclusive) below which this layer will\n * be visible.\n * @property {number} [minZoom] The minimum view zoom level (exclusive) above which this layer will be\n * visible.\n * @property {number} [maxZoom] The maximum view zoom level (inclusive) at which this layer will\n * be visible.\n * @property {SourceType} [source] Source for this layer. If not provided to the constructor,\n * the source can be set by calling {@link module:ol/layer/Layer~Layer#setSource layer.setSource(source)} after\n * construction.\n * @property {import(\"../Map.js\").default|null} [map] Map.\n * @property {RenderFunction} [render] Render function. Takes the frame state as input and is expected to return an\n * HTML element. Will overwrite the default rendering for the layer.\n * @property {Object<string, *>} [properties] Arbitrary observable properties. Can be accessed with `#get()` and `#set()`.\n */\n\n/**\n * @typedef {Object} State\n * @property {import(\"./Layer.js\").default} layer Layer.\n * @property {number} opacity Opacity, the value is rounded to two digits to appear after the decimal point.\n * @property {boolean} visible Visible.\n * @property {boolean} managed Managed.\n * @property {import(\"../extent.js\").Extent} [extent] Extent.\n * @property {number | undefined} zIndex ZIndex.\n * @property {number} maxResolution Maximum resolution.\n * @property {number} minResolution Minimum resolution.\n * @property {number} minZoom Minimum zoom.\n * @property {number} maxZoom Maximum zoom.\n */\n\n/**\n * @classdesc\n * Base class from which all layer types are derived. This should only be instantiated\n * in the case where a custom layer is added to the map with a custom `render` function.\n * Such a function can be specified in the `options` object, and is expected to return an HTML element.\n *\n * A visual representation of raster or vector map data.\n * Layers group together those properties that pertain to how the data is to be\n * displayed, irrespective of the source of that data.\n *\n * Layers are usually added to a map with [map.addLayer()]{@link import(\"../Map.js\").default#addLayer}.\n * Components like {@link module:ol/interaction/Draw~Draw} use unmanaged layers\n * internally. These unmanaged layers are associated with the map using\n * [layer.setMap()]{@link module:ol/layer/Layer~Layer#setMap} instead.\n *\n * A generic `change` event is fired when the state of the source changes.\n * A `sourceready` event is fired when the layer's source is ready.\n *\n * @fires import(\"../render/Event.js\").RenderEvent#prerender\n * @fires import(\"../render/Event.js\").RenderEvent#postrender\n * @fires import(\"../events/Event.js\").BaseEvent#sourceready\n *\n * @template {import(\"../source/Source.js\").default} [SourceType=import(\"../source/Source.js\").default]\n * @template {import(\"../renderer/Layer.js\").default} [RendererType=import(\"../renderer/Layer.js\").default]\n * @api\n */\nclass Layer extends _Base_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {Options<SourceType>} options Layer options.\n */\n constructor(options) {\n const baseOptions = Object.assign({}, options);\n delete baseOptions.source;\n super(baseOptions);\n\n /***\n * @type {LayerOnSignature<import(\"../events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {LayerOnSignature<import(\"../events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {LayerOnSignature<void>}\n */\n this.un;\n\n /**\n * @private\n * @type {?import(\"../events.js\").EventsKey}\n */\n this.mapPrecomposeKey_ = null;\n\n /**\n * @private\n * @type {?import(\"../events.js\").EventsKey}\n */\n this.mapRenderKey_ = null;\n\n /**\n * @private\n * @type {?import(\"../events.js\").EventsKey}\n */\n this.sourceChangeKey_ = null;\n\n /**\n * @private\n * @type {RendererType}\n */\n this.renderer_ = null;\n\n /**\n * @private\n * @type {boolean}\n */\n this.sourceReady_ = false;\n\n /**\n * @protected\n * @type {boolean}\n */\n this.rendered = false;\n\n // Overwrite default render method with a custom one\n if (options.render) {\n this.render = options.render;\n }\n if (options.map) {\n this.setMap(options.map);\n }\n this.addChangeListener(_Property_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].SOURCE, this.handleSourcePropertyChange_);\n const source = options.source ? (/** @type {SourceType} */options.source) : null;\n this.setSource(source);\n }\n\n /**\n * @param {Array<import(\"./Layer.js\").default>} [array] Array of layers (to be modified in place).\n * @return {Array<import(\"./Layer.js\").default>} Array of layers.\n */\n getLayersArray(array) {\n array = array ? array : [];\n array.push(this);\n return array;\n }\n\n /**\n * @param {Array<import(\"./Layer.js\").State>} [states] Optional list of layer states (to be modified in place).\n * @return {Array<import(\"./Layer.js\").State>} List of layer states.\n */\n getLayerStatesArray(states) {\n states = states ? states : [];\n states.push(this.getLayerState());\n return states;\n }\n\n /**\n * Get the layer source.\n * @return {SourceType|null} The layer source (or `null` if not yet set).\n * @observable\n * @api\n */\n getSource() {\n return /** @type {SourceType} */this.get(_Property_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].SOURCE) || null;\n }\n\n /**\n * @return {SourceType|null} The source being rendered.\n */\n getRenderSource() {\n return this.getSource();\n }\n\n /**\n * @return {import(\"../source/Source.js\").State} Source state.\n */\n getSourceState() {\n const source = this.getSource();\n return !source ? 'undefined' : source.getState();\n }\n\n /**\n * @private\n */\n handleSourceChange_() {\n this.changed();\n if (this.sourceReady_ || this.getSource().getState() !== 'ready') {\n return;\n }\n this.sourceReady_ = true;\n this.dispatchEvent('sourceready');\n }\n\n /**\n * @private\n */\n handleSourcePropertyChange_() {\n if (this.sourceChangeKey_) {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_3__.unlistenByKey)(this.sourceChangeKey_);\n this.sourceChangeKey_ = null;\n }\n this.sourceReady_ = false;\n const source = this.getSource();\n if (source) {\n this.sourceChangeKey_ = (0,_events_js__WEBPACK_IMPORTED_MODULE_3__.listen)(source, _events_EventType_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CHANGE, this.handleSourceChange_, this);\n if (source.getState() === 'ready') {\n this.sourceReady_ = true;\n setTimeout(() => {\n this.dispatchEvent('sourceready');\n }, 0);\n }\n }\n this.changed();\n }\n\n /**\n * @param {import(\"../pixel\").Pixel} pixel Pixel.\n * @return {Promise<Array<import(\"../Feature\").FeatureLike>>} Promise that resolves with\n * an array of features.\n */\n getFeatures(pixel) {\n if (!this.renderer_) {\n return Promise.resolve([]);\n }\n return this.renderer_.getFeatures(pixel);\n }\n\n /**\n * @param {import(\"../pixel\").Pixel} pixel Pixel.\n * @return {Uint8ClampedArray|Uint8Array|Float32Array|DataView|null} Pixel data.\n */\n getData(pixel) {\n if (!this.renderer_ || !this.rendered) {\n return null;\n }\n return this.renderer_.getData(pixel);\n }\n\n /**\n * The layer is visible on the map view, i.e. within its min/max resolution or zoom and\n * extent, not set to `visible: false`, and not inside a layer group that is set\n * to `visible: false`.\n * @param {View|import(\"../View.js\").ViewStateLayerStateExtent} [view] View or {@link import(\"../Map.js\").FrameState}.\n * Only required when the layer is not added to a map.\n * @return {boolean} The layer is visible in the map view.\n * @api\n */\n isVisible(view) {\n let frameState;\n const map = this.getMapInternal();\n if (!view && map) {\n view = map.getView();\n }\n if (view instanceof _View_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]) {\n frameState = {\n viewState: view.getState(),\n extent: view.calculateExtent()\n };\n } else {\n frameState = view;\n }\n if (!frameState.layerStatesArray && map) {\n frameState.layerStatesArray = map.getLayerGroup().getLayerStatesArray();\n }\n let layerState;\n if (frameState.layerStatesArray) {\n layerState = frameState.layerStatesArray.find(layerState => layerState.layer === this);\n } else {\n layerState = this.getLayerState();\n }\n const layerExtent = this.getExtent();\n return inView(layerState, frameState.viewState) && (!layerExtent || (0,_extent_js__WEBPACK_IMPORTED_MODULE_6__.intersects)(layerExtent, frameState.extent));\n }\n\n /**\n * Get the attributions of the source of this layer for the given view.\n * @param {View|import(\"../View.js\").ViewStateLayerStateExtent} [view] View or {@link import(\"../Map.js\").FrameState}.\n * Only required when the layer is not added to a map.\n * @return {Array<string>} Attributions for this layer at the given view.\n * @api\n */\n getAttributions(view) {\n if (!this.isVisible(view)) {\n return [];\n }\n let getAttributions;\n const source = this.getSource();\n if (source) {\n getAttributions = source.getAttributions();\n }\n if (!getAttributions) {\n return [];\n }\n const frameState = view instanceof _View_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"] ? view.getViewStateAndExtent() : view;\n let attributions = getAttributions(frameState);\n if (!Array.isArray(attributions)) {\n attributions = [attributions];\n }\n return attributions;\n }\n\n /**\n * In charge to manage the rendering of the layer. One layer type is\n * bounded with one layer renderer.\n * @param {?import(\"../Map.js\").FrameState} frameState Frame state.\n * @param {HTMLElement} target Target which the renderer may (but need not) use\n * for rendering its content.\n * @return {HTMLElement|null} The rendered element.\n */\n render(frameState, target) {\n const layerRenderer = this.getRenderer();\n if (layerRenderer.prepareFrame(frameState)) {\n this.rendered = true;\n return layerRenderer.renderFrame(frameState, target);\n }\n return null;\n }\n\n /**\n * Called when a layer is not visible during a map render.\n */\n unrender() {\n this.rendered = false;\n }\n\n /**\n * For use inside the library only.\n * @param {import(\"../Map.js\").default|null} map Map.\n */\n setMapInternal(map) {\n if (!map) {\n this.unrender();\n }\n this.set(_Property_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].MAP, map);\n }\n\n /**\n * For use inside the library only.\n * @return {import(\"../Map.js\").default|null} Map.\n */\n getMapInternal() {\n return this.get(_Property_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].MAP);\n }\n\n /**\n * Sets the layer to be rendered on top of other layers on a map. The map will\n * not manage this layer in its layers collection. This\n * is useful for temporary layers. To remove an unmanaged layer from the map,\n * use `#setMap(null)`.\n *\n * To add the layer to a map and have it managed by the map, use\n * {@link module:ol/Map~Map#addLayer} instead.\n * @param {import(\"../Map.js\").default|null} map Map.\n * @api\n */\n setMap(map) {\n if (this.mapPrecomposeKey_) {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_3__.unlistenByKey)(this.mapPrecomposeKey_);\n this.mapPrecomposeKey_ = null;\n }\n if (!map) {\n this.changed();\n }\n if (this.mapRenderKey_) {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_3__.unlistenByKey)(this.mapRenderKey_);\n this.mapRenderKey_ = null;\n }\n if (map) {\n this.mapPrecomposeKey_ = (0,_events_js__WEBPACK_IMPORTED_MODULE_3__.listen)(map, _render_EventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].PRECOMPOSE, function (evt) {\n const renderEvent = /** @type {import(\"../render/Event.js\").default} */evt;\n const layerStatesArray = renderEvent.frameState.layerStatesArray;\n const layerState = this.getLayerState(false);\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_8__.assert)(!layerStatesArray.some(function (arrayLayerState) {\n return arrayLayerState.layer === layerState.layer;\n }), 'A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both.');\n layerStatesArray.push(layerState);\n }, this);\n this.mapRenderKey_ = (0,_events_js__WEBPACK_IMPORTED_MODULE_3__.listen)(this, _events_EventType_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CHANGE, map.render, map);\n this.changed();\n }\n }\n\n /**\n * Set the layer source.\n * @param {SourceType|null} source The layer source.\n * @observable\n * @api\n */\n setSource(source) {\n this.set(_Property_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].SOURCE, source);\n }\n\n /**\n * Get the renderer for this layer.\n * @return {RendererType|null} The layer renderer.\n */\n getRenderer() {\n if (!this.renderer_) {\n this.renderer_ = this.createRenderer();\n }\n return this.renderer_;\n }\n\n /**\n * @return {boolean} The layer has a renderer.\n */\n hasRenderer() {\n return !!this.renderer_;\n }\n\n /**\n * Create a renderer for this layer.\n * @return {RendererType} A layer renderer.\n * @protected\n */\n createRenderer() {\n return null;\n }\n\n /**\n * Clean up.\n */\n disposeInternal() {\n if (this.renderer_) {\n this.renderer_.dispose();\n delete this.renderer_;\n }\n this.setSource(null);\n super.disposeInternal();\n }\n}\n\n/**\n * Return `true` if the layer is visible and if the provided view state\n * has resolution and zoom levels that are in range of the layer's min/max.\n * @param {State} layerState Layer state.\n * @param {import(\"../View.js\").State} viewState View state.\n * @return {boolean} The layer is visible at the given view state.\n */\nfunction inView(layerState, viewState) {\n if (!layerState.visible) {\n return false;\n }\n const resolution = viewState.resolution;\n if (resolution < layerState.minResolution || resolution >= layerState.maxResolution) {\n return false;\n }\n const zoom = viewState.zoom;\n return zoom > layerState.minZoom && zoom <= layerState.maxZoom;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Layer);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/layer/Layer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/layer/Property.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/ol/layer/Property.js ***!
|
||
\*******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/layer/Property\n */\n\n/**\n * @enum {string}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n OPACITY: 'opacity',\n VISIBLE: 'visible',\n EXTENT: 'extent',\n Z_INDEX: 'zIndex',\n MAX_RESOLUTION: 'maxResolution',\n MIN_RESOLUTION: 'minResolution',\n MAX_ZOOM: 'maxZoom',\n MIN_ZOOM: 'minZoom',\n SOURCE: 'source',\n MAP: 'map'\n});\n\n//# sourceURL=webpack://complexes/./node_modules/ol/layer/Property.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/layer/Vector.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ol/layer/Vector.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _BaseVector_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BaseVector.js */ \"./node_modules/ol/layer/BaseVector.js\");\n/* harmony import */ var _renderer_canvas_VectorLayer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../renderer/canvas/VectorLayer.js */ \"./node_modules/ol/renderer/canvas/VectorLayer.js\");\n/**\n * @module ol/layer/Vector\n */\n\n\n\n/**\n * @classdesc\n * Vector data is rendered client-side, as vectors. This layer type provides most accurate rendering\n * even during animations. Points and labels stay upright on rotated views. For very large\n * amounts of vector data, performance may suffer during pan and zoom animations. In this case,\n * try {@link module:ol/layer/VectorImage~VectorImageLayer}.\n *\n * Note that any property set in the options is set as a {@link module:ol/Object~BaseObject}\n * property on the layer object; for example, setting `title: 'My Title'` in the\n * options means that `title` is observable, and has get/set accessors.\n *\n * @template {import(\"../source/Vector.js\").default} VectorSourceType\n * @extends {BaseVectorLayer<VectorSourceType, CanvasVectorLayerRenderer>}\n * @api\n */\nclass VectorLayer extends _BaseVector_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {import(\"./BaseVector.js\").Options<VectorSourceType>} [options] Options.\n */\n constructor(options) {\n super(options);\n }\n createRenderer() {\n return new _renderer_canvas_VectorLayer_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this);\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (VectorLayer);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/layer/Vector.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/loadingstrategy.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/loadingstrategy.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ all: function() { return /* binding */ all; },\n/* harmony export */ bbox: function() { return /* binding */ bbox; },\n/* harmony export */ tile: function() { return /* binding */ tile; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./proj.js */ \"./node_modules/ol/proj.js\");\n\n/**\n * @module ol/loadingstrategy\n */\n\n\n\n/**\n * Strategy function for loading all features with a single request.\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @return {Array<import(\"./extent.js\").Extent>} Extents.\n * @api\n */\nfunction all(extent, resolution) {\n return [[-Infinity, -Infinity, Infinity, Infinity]];\n}\n\n/**\n * Strategy function for loading features based on the view's extent and\n * resolution.\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @return {Array<import(\"./extent.js\").Extent>} Extents.\n * @api\n */\nfunction bbox(extent, resolution) {\n return [extent];\n}\n\n/**\n * Creates a strategy function for loading features based on a tile grid.\n * @param {import(\"./tilegrid/TileGrid.js\").default} tileGrid Tile grid.\n * @return {function(import(\"./extent.js\").Extent, number, import(\"./proj.js\").Projection): Array<import(\"./extent.js\").Extent>} Loading strategy.\n * @api\n */\nfunction tile(tileGrid) {\n return (\n /**\n * @param {import(\"./extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"./proj.js\").Projection} projection Projection.\n * @return {Array<import(\"./extent.js\").Extent>} Extents.\n */\n function (extent, resolution, projection) {\n const z = tileGrid.getZForResolution((0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserResolution)(resolution, projection));\n const tileRange = tileGrid.getTileRangeForExtentAndZ((0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserExtent)(extent, projection), z);\n /** @type {Array<import(\"./extent.js\").Extent>} */\n const extents = [];\n /** @type {import(\"./tilecoord.js\").TileCoord} */\n const tileCoord = [z, 0, 0];\n for (tileCoord[1] = tileRange.minX; tileCoord[1] <= tileRange.maxX; ++tileCoord[1]) {\n for (tileCoord[2] = tileRange.minY; tileCoord[2] <= tileRange.maxY; ++tileCoord[2]) {\n extents.push((0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserExtent)(tileGrid.getTileCoordExtent(tileCoord), projection));\n }\n }\n return extents;\n }\n );\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/loadingstrategy.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/math.js":
|
||
/*!*********************************!*\
|
||
!*** ./node_modules/ol/math.js ***!
|
||
\*********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ceil: function() { return /* binding */ ceil; },\n/* harmony export */ clamp: function() { return /* binding */ clamp; },\n/* harmony export */ floor: function() { return /* binding */ floor; },\n/* harmony export */ lerp: function() { return /* binding */ lerp; },\n/* harmony export */ modulo: function() { return /* binding */ modulo; },\n/* harmony export */ round: function() { return /* binding */ round; },\n/* harmony export */ solveLinearSystem: function() { return /* binding */ solveLinearSystem; },\n/* harmony export */ squaredDistance: function() { return /* binding */ squaredDistance; },\n/* harmony export */ squaredSegmentDistance: function() { return /* binding */ squaredSegmentDistance; },\n/* harmony export */ toDegrees: function() { return /* binding */ toDegrees; },\n/* harmony export */ toFixed: function() { return /* binding */ toFixed; },\n/* harmony export */ toRadians: function() { return /* binding */ toRadians; }\n/* harmony export */ });\n/**\n * @module ol/math\n */\n\n/**\n * Takes a number and clamps it to within the provided bounds.\n * @param {number} value The input number.\n * @param {number} min The minimum value to return.\n * @param {number} max The maximum value to return.\n * @return {number} The input number if it is within bounds, or the nearest\n * number within the bounds.\n */\nfunction clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}\n\n/**\n * Returns the square of the closest distance between the point (x, y) and the\n * line segment (x1, y1) to (x2, y2).\n * @param {number} x X.\n * @param {number} y Y.\n * @param {number} x1 X1.\n * @param {number} y1 Y1.\n * @param {number} x2 X2.\n * @param {number} y2 Y2.\n * @return {number} Squared distance.\n */\nfunction squaredSegmentDistance(x, y, x1, y1, x2, y2) {\n const dx = x2 - x1;\n const dy = y2 - y1;\n if (dx !== 0 || dy !== 0) {\n const t = ((x - x1) * dx + (y - y1) * dy) / (dx * dx + dy * dy);\n if (t > 1) {\n x1 = x2;\n y1 = y2;\n } else if (t > 0) {\n x1 += dx * t;\n y1 += dy * t;\n }\n }\n return squaredDistance(x, y, x1, y1);\n}\n\n/**\n * Returns the square of the distance between the points (x1, y1) and (x2, y2).\n * @param {number} x1 X1.\n * @param {number} y1 Y1.\n * @param {number} x2 X2.\n * @param {number} y2 Y2.\n * @return {number} Squared distance.\n */\nfunction squaredDistance(x1, y1, x2, y2) {\n const dx = x2 - x1;\n const dy = y2 - y1;\n return dx * dx + dy * dy;\n}\n\n/**\n * Solves system of linear equations using Gaussian elimination method.\n *\n * @param {Array<Array<number>>} mat Augmented matrix (n x n + 1 column)\n * in row-major order.\n * @return {Array<number>|null} The resulting vector.\n */\nfunction solveLinearSystem(mat) {\n const n = mat.length;\n for (let i = 0; i < n; i++) {\n // Find max in the i-th column (ignoring i - 1 first rows)\n let maxRow = i;\n let maxEl = Math.abs(mat[i][i]);\n for (let r = i + 1; r < n; r++) {\n const absValue = Math.abs(mat[r][i]);\n if (absValue > maxEl) {\n maxEl = absValue;\n maxRow = r;\n }\n }\n if (maxEl === 0) {\n return null; // matrix is singular\n }\n\n // Swap max row with i-th (current) row\n const tmp = mat[maxRow];\n mat[maxRow] = mat[i];\n mat[i] = tmp;\n\n // Subtract the i-th row to make all the remaining rows 0 in the i-th column\n for (let j = i + 1; j < n; j++) {\n const coef = -mat[j][i] / mat[i][i];\n for (let k = i; k < n + 1; k++) {\n if (i == k) {\n mat[j][k] = 0;\n } else {\n mat[j][k] += coef * mat[i][k];\n }\n }\n }\n }\n\n // Solve Ax=b for upper triangular matrix A (mat)\n const x = new Array(n);\n for (let l = n - 1; l >= 0; l--) {\n x[l] = mat[l][n] / mat[l][l];\n for (let m = l - 1; m >= 0; m--) {\n mat[m][n] -= mat[m][l] * x[l];\n }\n }\n return x;\n}\n\n/**\n * Converts radians to to degrees.\n *\n * @param {number} angleInRadians Angle in radians.\n * @return {number} Angle in degrees.\n */\nfunction toDegrees(angleInRadians) {\n return angleInRadians * 180 / Math.PI;\n}\n\n/**\n * Converts degrees to radians.\n *\n * @param {number} angleInDegrees Angle in degrees.\n * @return {number} Angle in radians.\n */\nfunction toRadians(angleInDegrees) {\n return angleInDegrees * Math.PI / 180;\n}\n\n/**\n * Returns the modulo of a / b, depending on the sign of b.\n *\n * @param {number} a Dividend.\n * @param {number} b Divisor.\n * @return {number} Modulo.\n */\nfunction modulo(a, b) {\n const r = a % b;\n return r * b < 0 ? r + b : r;\n}\n\n/**\n * Calculates the linearly interpolated value of x between a and b.\n *\n * @param {number} a Number\n * @param {number} b Number\n * @param {number} x Value to be interpolated.\n * @return {number} Interpolated value.\n */\nfunction lerp(a, b, x) {\n return a + x * (b - a);\n}\n\n/**\n * Returns a number with a limited number of decimal digits.\n * @param {number} n The input number.\n * @param {number} decimals The maximum number of decimal digits.\n * @return {number} The input number with a limited number of decimal digits.\n */\nfunction toFixed(n, decimals) {\n const factor = Math.pow(10, decimals);\n return Math.round(n * factor) / factor;\n}\n\n/**\n * Rounds a number to the nearest integer value considering only the given number\n * of decimal digits (with rounding on the final digit).\n * @param {number} n The input number.\n * @param {number} decimals The maximum number of decimal digits.\n * @return {number} The nearest integer.\n */\nfunction round(n, decimals) {\n return Math.round(toFixed(n, decimals));\n}\n\n/**\n * Rounds a number to the next smaller integer considering only the given number\n * of decimal digits (with rounding on the final digit).\n * @param {number} n The input number.\n * @param {number} decimals The maximum number of decimal digits.\n * @return {number} The next smaller integer.\n */\nfunction floor(n, decimals) {\n return Math.floor(toFixed(n, decimals));\n}\n\n/**\n * Rounds a number to the next bigger integer considering only the given number\n * of decimal digits (with rounding on the final digit).\n * @param {number} n The input number.\n * @param {number} decimals The maximum number of decimal digits.\n * @return {number} The next bigger integer.\n */\nfunction ceil(n, decimals) {\n return Math.ceil(toFixed(n, decimals));\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/math.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/obj.js":
|
||
/*!********************************!*\
|
||
!*** ./node_modules/ol/obj.js ***!
|
||
\********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ clear: function() { return /* binding */ clear; },\n/* harmony export */ isEmpty: function() { return /* binding */ isEmpty; }\n/* harmony export */ });\n/**\n * @module ol/obj\n */\n\n/**\n * Removes all properties from an object.\n * @param {Object<string, unknown>} object The object to clear.\n */\nfunction clear(object) {\n for (const property in object) {\n delete object[property];\n }\n}\n\n/**\n * Determine if an object has any properties.\n * @param {Object} object The object to check.\n * @return {boolean} The object is empty.\n */\nfunction isEmpty(object) {\n let property;\n for (property in object) {\n return false;\n }\n return !property;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/obj.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/pointer/EventType.js":
|
||
/*!**********************************************!*\
|
||
!*** ./node_modules/ol/pointer/EventType.js ***!
|
||
\**********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/pointer/EventType\n */\n\n/**\n * Constants for event names.\n * @enum {string}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n POINTERMOVE: 'pointermove',\n POINTERDOWN: 'pointerdown',\n POINTERUP: 'pointerup',\n POINTEROVER: 'pointerover',\n POINTEROUT: 'pointerout',\n POINTERENTER: 'pointerenter',\n POINTERLEAVE: 'pointerleave',\n POINTERCANCEL: 'pointercancel'\n});\n\n//# sourceURL=webpack://complexes/./node_modules/ol/pointer/EventType.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/proj.js":
|
||
/*!*********************************!*\
|
||
!*** ./node_modules/ol/proj.js ***!
|
||
\*********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ METERS_PER_UNIT: function() { return /* reexport safe */ _proj_Units_js__WEBPACK_IMPORTED_MODULE_0__.METERS_PER_UNIT; },\n/* harmony export */ Projection: function() { return /* reexport safe */ _proj_Projection_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ addCommon: function() { return /* binding */ addCommon; },\n/* harmony export */ addCoordinateTransforms: function() { return /* binding */ addCoordinateTransforms; },\n/* harmony export */ addEquivalentProjections: function() { return /* binding */ addEquivalentProjections; },\n/* harmony export */ addEquivalentTransforms: function() { return /* binding */ addEquivalentTransforms; },\n/* harmony export */ addProjection: function() { return /* binding */ addProjection; },\n/* harmony export */ addProjections: function() { return /* binding */ addProjections; },\n/* harmony export */ clearAllProjections: function() { return /* binding */ clearAllProjections; },\n/* harmony export */ clearUserProjection: function() { return /* binding */ clearUserProjection; },\n/* harmony export */ cloneTransform: function() { return /* binding */ cloneTransform; },\n/* harmony export */ createProjection: function() { return /* binding */ createProjection; },\n/* harmony export */ createSafeCoordinateTransform: function() { return /* binding */ createSafeCoordinateTransform; },\n/* harmony export */ createTransformFromCoordinateTransform: function() { return /* binding */ createTransformFromCoordinateTransform; },\n/* harmony export */ disableCoordinateWarning: function() { return /* binding */ disableCoordinateWarning; },\n/* harmony export */ equivalent: function() { return /* binding */ equivalent; },\n/* harmony export */ fromLonLat: function() { return /* binding */ fromLonLat; },\n/* harmony export */ fromUserCoordinate: function() { return /* binding */ fromUserCoordinate; },\n/* harmony export */ fromUserExtent: function() { return /* binding */ fromUserExtent; },\n/* harmony export */ fromUserResolution: function() { return /* binding */ fromUserResolution; },\n/* harmony export */ get: function() { return /* binding */ get; },\n/* harmony export */ getPointResolution: function() { return /* binding */ getPointResolution; },\n/* harmony export */ getTransform: function() { return /* binding */ getTransform; },\n/* harmony export */ getTransformFromProjections: function() { return /* binding */ getTransformFromProjections; },\n/* harmony export */ getUserProjection: function() { return /* binding */ getUserProjection; },\n/* harmony export */ identityTransform: function() { return /* binding */ identityTransform; },\n/* harmony export */ setUserProjection: function() { return /* binding */ setUserProjection; },\n/* harmony export */ toLonLat: function() { return /* binding */ toLonLat; },\n/* harmony export */ toUserCoordinate: function() { return /* binding */ toUserCoordinate; },\n/* harmony export */ toUserExtent: function() { return /* binding */ toUserExtent; },\n/* harmony export */ toUserResolution: function() { return /* binding */ toUserResolution; },\n/* harmony export */ transform: function() { return /* binding */ transform; },\n/* harmony export */ transformExtent: function() { return /* binding */ transformExtent; },\n/* harmony export */ transformWithProjections: function() { return /* binding */ transformWithProjections; },\n/* harmony export */ useGeographic: function() { return /* binding */ useGeographic; }\n/* harmony export */ });\n/* harmony import */ var _proj_Projection_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./proj/Projection.js */ \"./node_modules/ol/proj/Projection.js\");\n/* harmony import */ var _proj_epsg3857_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./proj/epsg3857.js */ \"./node_modules/ol/proj/epsg3857.js\");\n/* harmony import */ var _proj_epsg4326_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./proj/epsg4326.js */ \"./node_modules/ol/proj/epsg4326.js\");\n/* harmony import */ var _proj_Units_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./proj/Units.js */ \"./node_modules/ol/proj/Units.js\");\n/* harmony import */ var _proj_projections_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./proj/projections.js */ \"./node_modules/ol/proj/projections.js\");\n/* harmony import */ var _proj_transforms_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./proj/transforms.js */ \"./node_modules/ol/proj/transforms.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./math.js */ \"./node_modules/ol/math.js\");\n/* harmony import */ var _coordinate_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./coordinate.js */ \"./node_modules/ol/coordinate.js\");\n/* harmony import */ var _sphere_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sphere.js */ \"./node_modules/ol/sphere.js\");\n/* harmony import */ var _console_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./console.js */ \"./node_modules/ol/console.js\");\n/**\n * @module ol/proj\n */\n\n/**\n * The ol/proj module stores:\n * * a list of {@link module:ol/proj/Projection~Projection}\n * objects, one for each projection supported by the application\n * * a list of transform functions needed to convert coordinates in one projection\n * into another.\n *\n * The static functions are the methods used to maintain these.\n * Each transform function can handle not only simple coordinate pairs, but also\n * large arrays of coordinates such as vector geometries.\n *\n * When loaded, the library adds projection objects for EPSG:4326 (WGS84\n * geographic coordinates) and EPSG:3857 (Web or Spherical Mercator, as used\n * for example by Bing Maps or OpenStreetMap), together with the relevant\n * transform functions.\n *\n * Additional transforms may be added by using the http://proj4js.org/\n * library (version 2.2 or later). You can use the full build supplied by\n * Proj4js, or create a custom build to support those projections you need; see\n * the Proj4js website for how to do this. You also need the Proj4js definitions\n * for the required projections. These definitions can be obtained from\n * https://epsg.io/, and are a JS function, so can be loaded in a script\n * tag (as in the examples) or pasted into your application.\n *\n * After all required projection definitions are added to proj4's registry (by\n * using `proj4.defs()`), simply call `register(proj4)` from the `ol/proj/proj4`\n * package. Existing transforms are not changed by this function. See\n * examples/wms-image-custom-proj for an example of this.\n *\n * Additional projection definitions can be registered with `proj4.defs()` any\n * time. Just make sure to call `register(proj4)` again; for example, with user-supplied data where you don't\n * know in advance what projections are needed, you can initially load minimal\n * support and then load whichever are requested.\n *\n * Note that Proj4js does not support projection extents. If you want to add\n * one for creating default tile grids, you can add it after the Projection\n * object has been created with `setExtent`, for example,\n * `get('EPSG:1234').setExtent(extent)`.\n *\n * In addition to Proj4js support, any transform functions can be added with\n * {@link module:ol/proj.addCoordinateTransforms}. To use this, you must first create\n * a {@link module:ol/proj/Projection~Projection} object for the new projection and add it with\n * {@link module:ol/proj.addProjection}. You can then add the forward and inverse\n * functions with {@link module:ol/proj.addCoordinateTransforms}. See\n * examples/wms-custom-proj for an example of this.\n *\n * Note that if no transforms are needed and you only need to define the\n * projection, just add a {@link module:ol/proj/Projection~Projection} with\n * {@link module:ol/proj.addProjection}. See examples/wms-no-proj for an example of\n * this.\n */\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * A projection as {@link module:ol/proj/Projection~Projection}, SRS identifier\n * string or undefined.\n * @typedef {Projection|string|undefined} ProjectionLike\n * @api\n */\n\n/**\n * A transform function accepts an array of input coordinate values, an optional\n * output array, and an optional dimension (default should be 2). The function\n * transforms the input coordinate values, populates the output array, and\n * returns the output array.\n *\n * @typedef {function(Array<number>, Array<number>=, number=): Array<number>} TransformFunction\n * @api\n */\n\n\n\nlet showCoordinateWarning = true;\n\n/**\n * @param {boolean} [disable = true] Disable console info about `useGeographic()`\n */\nfunction disableCoordinateWarning(disable) {\n const hide = disable === undefined ? true : disable;\n showCoordinateWarning = !hide;\n}\n\n/**\n * @param {Array<number>} input Input coordinate array.\n * @param {Array<number>} [output] Output array of coordinate values.\n * @return {Array<number>} Output coordinate array (new array, same coordinate\n * values).\n */\nfunction cloneTransform(input, output) {\n if (output !== undefined) {\n for (let i = 0, ii = input.length; i < ii; ++i) {\n output[i] = input[i];\n }\n output = output;\n } else {\n output = input.slice();\n }\n return output;\n}\n\n/**\n * @param {Array<number>} input Input coordinate array.\n * @param {Array<number>} [output] Output array of coordinate values.\n * @return {Array<number>} Input coordinate array (same array as input).\n */\nfunction identityTransform(input, output) {\n if (output !== undefined && input !== output) {\n for (let i = 0, ii = input.length; i < ii; ++i) {\n output[i] = input[i];\n }\n input = output;\n }\n return input;\n}\n\n/**\n * Add a Projection object to the list of supported projections that can be\n * looked up by their code.\n *\n * @param {Projection} projection Projection instance.\n * @api\n */\nfunction addProjection(projection) {\n (0,_proj_projections_js__WEBPACK_IMPORTED_MODULE_2__.add)(projection.getCode(), projection);\n (0,_proj_transforms_js__WEBPACK_IMPORTED_MODULE_3__.add)(projection, projection, cloneTransform);\n}\n\n/**\n * @param {Array<Projection>} projections Projections.\n */\nfunction addProjections(projections) {\n projections.forEach(addProjection);\n}\n\n/**\n * Fetches a Projection object for the code specified.\n *\n * @param {ProjectionLike} projectionLike Either a code string which is\n * a combination of authority and identifier such as \"EPSG:4326\", or an\n * existing projection object, or undefined.\n * @return {Projection|null} Projection object, or null if not in list.\n * @api\n */\nfunction get(projectionLike) {\n return typeof projectionLike === 'string' ? (0,_proj_projections_js__WEBPACK_IMPORTED_MODULE_2__.get)(/** @type {string} */projectionLike) : /** @type {Projection} */projectionLike || null;\n}\n\n/**\n * Get the resolution of the point in degrees or distance units.\n * For projections with degrees as the unit this will simply return the\n * provided resolution. For other projections the point resolution is\n * by default estimated by transforming the `point` pixel to EPSG:4326,\n * measuring its width and height on the normal sphere,\n * and taking the average of the width and height.\n * A custom function can be provided for a specific projection, either\n * by setting the `getPointResolution` option in the\n * {@link module:ol/proj/Projection~Projection} constructor or by using\n * {@link module:ol/proj/Projection~Projection#setGetPointResolution} to change an existing\n * projection object.\n * @param {ProjectionLike} projection The projection.\n * @param {number} resolution Nominal resolution in projection units.\n * @param {import(\"./coordinate.js\").Coordinate} point Point to find adjusted resolution at.\n * @param {import(\"./proj/Units.js\").Units} [units] Units to get the point resolution in.\n * Default is the projection's units.\n * @return {number} Point resolution.\n * @api\n */\nfunction getPointResolution(projection, resolution, point, units) {\n projection = get(projection);\n let pointResolution;\n const getter = projection.getPointResolutionFunc();\n if (getter) {\n pointResolution = getter(resolution, point);\n if (units && units !== projection.getUnits()) {\n const metersPerUnit = projection.getMetersPerUnit();\n if (metersPerUnit) {\n pointResolution = pointResolution * metersPerUnit / _proj_Units_js__WEBPACK_IMPORTED_MODULE_0__.METERS_PER_UNIT[units];\n }\n }\n } else {\n const projUnits = projection.getUnits();\n if (projUnits == 'degrees' && !units || units == 'degrees') {\n pointResolution = resolution;\n } else {\n // Estimate point resolution by transforming the center pixel to EPSG:4326,\n // measuring its width and height on the normal sphere, and taking the\n // average of the width and height.\n const toEPSG4326 = getTransformFromProjections(projection, get('EPSG:4326'));\n if (toEPSG4326 === identityTransform && projUnits !== 'degrees') {\n // no transform is available\n pointResolution = resolution * projection.getMetersPerUnit();\n } else {\n let 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];\n vertices = toEPSG4326(vertices, vertices, 2);\n const width = (0,_sphere_js__WEBPACK_IMPORTED_MODULE_4__.getDistance)(vertices.slice(0, 2), vertices.slice(2, 4));\n const height = (0,_sphere_js__WEBPACK_IMPORTED_MODULE_4__.getDistance)(vertices.slice(4, 6), vertices.slice(6, 8));\n pointResolution = (width + height) / 2;\n }\n const metersPerUnit = units ? _proj_Units_js__WEBPACK_IMPORTED_MODULE_0__.METERS_PER_UNIT[units] : projection.getMetersPerUnit();\n if (metersPerUnit !== undefined) {\n pointResolution /= metersPerUnit;\n }\n }\n }\n return pointResolution;\n}\n\n/**\n * Registers transformation functions that don't alter coordinates. Those allow\n * to transform between projections with equal meaning.\n *\n * @param {Array<Projection>} projections Projections.\n * @api\n */\nfunction addEquivalentProjections(projections) {\n addProjections(projections);\n projections.forEach(function (source) {\n projections.forEach(function (destination) {\n if (source !== destination) {\n (0,_proj_transforms_js__WEBPACK_IMPORTED_MODULE_3__.add)(source, destination, cloneTransform);\n }\n });\n });\n}\n\n/**\n * Registers transformation functions to convert coordinates in any projection\n * in projection1 to any projection in projection2.\n *\n * @param {Array<Projection>} projections1 Projections with equal\n * meaning.\n * @param {Array<Projection>} projections2 Projections with equal\n * meaning.\n * @param {TransformFunction} forwardTransform Transformation from any\n * projection in projection1 to any projection in projection2.\n * @param {TransformFunction} inverseTransform Transform from any projection\n * in projection2 to any projection in projection1..\n */\nfunction addEquivalentTransforms(projections1, projections2, forwardTransform, inverseTransform) {\n projections1.forEach(function (projection1) {\n projections2.forEach(function (projection2) {\n (0,_proj_transforms_js__WEBPACK_IMPORTED_MODULE_3__.add)(projection1, projection2, forwardTransform);\n (0,_proj_transforms_js__WEBPACK_IMPORTED_MODULE_3__.add)(projection2, projection1, inverseTransform);\n });\n });\n}\n\n/**\n * Clear all cached projections and transforms.\n */\nfunction clearAllProjections() {\n (0,_proj_projections_js__WEBPACK_IMPORTED_MODULE_2__.clear)();\n (0,_proj_transforms_js__WEBPACK_IMPORTED_MODULE_3__.clear)();\n}\n\n/**\n * @param {Projection|string|undefined} projection Projection.\n * @param {string} defaultCode Default code.\n * @return {Projection} Projection.\n */\nfunction createProjection(projection, defaultCode) {\n if (!projection) {\n return get(defaultCode);\n }\n if (typeof projection === 'string') {\n return get(projection);\n }\n return /** @type {Projection} */projection;\n}\n\n/**\n * Creates a {@link module:ol/proj~TransformFunction} from a simple 2D coordinate transform\n * function.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} coordTransform Coordinate\n * transform.\n * @return {TransformFunction} Transform function.\n */\nfunction createTransformFromCoordinateTransform(coordTransform) {\n return (\n /**\n * @param {Array<number>} input Input.\n * @param {Array<number>} [output] Output.\n * @param {number} [dimension] Dimension.\n * @return {Array<number>} Output.\n */\n function (input, output, dimension) {\n const length = input.length;\n dimension = dimension !== undefined ? dimension : 2;\n output = output !== undefined ? output : new Array(length);\n for (let i = 0; i < length; i += dimension) {\n const point = coordTransform(input.slice(i, i + dimension));\n const pointLength = point.length;\n for (let j = 0, jj = dimension; j < jj; ++j) {\n output[i + j] = j >= pointLength ? input[i + j] : point[j];\n }\n }\n return output;\n }\n );\n}\n\n/**\n * Registers coordinate transform functions to convert coordinates between the\n * source projection and the destination projection.\n * The forward and inverse functions convert coordinate pairs; this function\n * converts these into the functions used internally which also handle\n * extents and coordinate arrays.\n *\n * @param {ProjectionLike} source Source projection.\n * @param {ProjectionLike} destination Destination projection.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} forward The forward transform\n * function (that is, from the source projection to the destination\n * projection) that takes a {@link module:ol/coordinate~Coordinate} as argument and returns\n * the transformed {@link module:ol/coordinate~Coordinate}.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} inverse The inverse transform\n * function (that is, from the destination projection to the source\n * projection) that takes a {@link module:ol/coordinate~Coordinate} as argument and returns\n * the transformed {@link module:ol/coordinate~Coordinate}. If the transform function can only\n * transform less dimensions than the input coordinate, it is supposeed to return a coordinate\n * with only the length it can transform. The other dimensions will be taken unchanged from the\n * source.\n * @api\n */\nfunction addCoordinateTransforms(source, destination, forward, inverse) {\n const sourceProj = get(source);\n const destProj = get(destination);\n (0,_proj_transforms_js__WEBPACK_IMPORTED_MODULE_3__.add)(sourceProj, destProj, createTransformFromCoordinateTransform(forward));\n (0,_proj_transforms_js__WEBPACK_IMPORTED_MODULE_3__.add)(destProj, sourceProj, createTransformFromCoordinateTransform(inverse));\n}\n\n/**\n * Transforms a coordinate from longitude/latitude to a different projection.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate as longitude and latitude, i.e.\n * an array with longitude as 1st and latitude as 2nd element.\n * @param {ProjectionLike} [projection] Target projection. The\n * default is Web Mercator, i.e. 'EPSG:3857'.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate projected to the target projection.\n * @api\n */\nfunction fromLonLat(coordinate, projection) {\n disableCoordinateWarning();\n return transform(coordinate, 'EPSG:4326', projection !== undefined ? projection : 'EPSG:3857');\n}\n\n/**\n * Transforms a coordinate to longitude/latitude.\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Projected coordinate.\n * @param {ProjectionLike} [projection] Projection of the coordinate.\n * The default is Web Mercator, i.e. 'EPSG:3857'.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate as longitude and latitude, i.e. an array\n * with longitude as 1st and latitude as 2nd element.\n * @api\n */\nfunction toLonLat(coordinate, projection) {\n const lonLat = transform(coordinate, projection !== undefined ? projection : 'EPSG:3857', 'EPSG:4326');\n const lon = lonLat[0];\n if (lon < -180 || lon > 180) {\n lonLat[0] = (0,_math_js__WEBPACK_IMPORTED_MODULE_5__.modulo)(lon + 180, 360) - 180;\n }\n return lonLat;\n}\n\n/**\n * Checks if two projections are the same, that is every coordinate in one\n * projection does represent the same geographic point as the same coordinate in\n * the other projection.\n *\n * @param {Projection} projection1 Projection 1.\n * @param {Projection} projection2 Projection 2.\n * @return {boolean} Equivalent.\n * @api\n */\nfunction equivalent(projection1, projection2) {\n if (projection1 === projection2) {\n return true;\n }\n const equalUnits = projection1.getUnits() === projection2.getUnits();\n if (projection1.getCode() === projection2.getCode()) {\n return equalUnits;\n }\n const transformFunc = getTransformFromProjections(projection1, projection2);\n return transformFunc === cloneTransform && equalUnits;\n}\n\n/**\n * Searches in the list of transform functions for the function for converting\n * coordinates from the source projection to the destination projection.\n *\n * @param {Projection} sourceProjection Source Projection object.\n * @param {Projection} destinationProjection Destination Projection\n * object.\n * @return {TransformFunction} Transform function.\n */\nfunction getTransformFromProjections(sourceProjection, destinationProjection) {\n const sourceCode = sourceProjection.getCode();\n const destinationCode = destinationProjection.getCode();\n let transformFunc = (0,_proj_transforms_js__WEBPACK_IMPORTED_MODULE_3__.get)(sourceCode, destinationCode);\n if (!transformFunc) {\n transformFunc = identityTransform;\n }\n return transformFunc;\n}\n\n/**\n * Given the projection-like objects, searches for a transformation\n * function to convert a coordinates array from the source projection to the\n * destination projection.\n *\n * @param {ProjectionLike} source Source.\n * @param {ProjectionLike} destination Destination.\n * @return {TransformFunction} Transform function.\n * @api\n */\nfunction getTransform(source, destination) {\n const sourceProjection = get(source);\n const destinationProjection = get(destination);\n return getTransformFromProjections(sourceProjection, destinationProjection);\n}\n\n/**\n * Transforms a coordinate from source projection to destination projection.\n * This returns a new coordinate (and does not modify the original).\n *\n * See {@link module:ol/proj.transformExtent} for extent transformation.\n * See the transform method of {@link module:ol/geom/Geometry~Geometry} and its\n * subclasses for geometry transforms.\n *\n * @param {import(\"./coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {ProjectionLike} source Source projection-like.\n * @param {ProjectionLike} destination Destination projection-like.\n * @return {import(\"./coordinate.js\").Coordinate} Coordinate.\n * @api\n */\nfunction transform(coordinate, source, destination) {\n const transformFunc = getTransform(source, destination);\n return transformFunc(coordinate, undefined, coordinate.length);\n}\n\n/**\n * Transforms an extent from source projection to destination projection. This\n * returns a new extent (and does not modify the original).\n *\n * @param {import(\"./extent.js\").Extent} extent The extent to transform.\n * @param {ProjectionLike} source Source projection-like.\n * @param {ProjectionLike} destination Destination projection-like.\n * @param {number} [stops] Number of stops per side used for the transform.\n * By default only the corners are used.\n * @return {import(\"./extent.js\").Extent} The transformed extent.\n * @api\n */\nfunction transformExtent(extent, source, destination, stops) {\n const transformFunc = getTransform(source, destination);\n return (0,_extent_js__WEBPACK_IMPORTED_MODULE_6__.applyTransform)(extent, transformFunc, undefined, stops);\n}\n\n/**\n * Transforms the given point to the destination projection.\n *\n * @param {import(\"./coordinate.js\").Coordinate} point Point.\n * @param {Projection} sourceProjection Source projection.\n * @param {Projection} destinationProjection Destination projection.\n * @return {import(\"./coordinate.js\").Coordinate} Point.\n */\nfunction transformWithProjections(point, sourceProjection, destinationProjection) {\n const transformFunc = getTransformFromProjections(sourceProjection, destinationProjection);\n return transformFunc(point);\n}\n\n/**\n * @type {Projection|null}\n */\nlet userProjection = null;\n\n/**\n * Set the projection for coordinates supplied from and returned by API methods.\n * This includes all API methods except for those interacting with tile grids,\n * plus {@link import(\"./Map.js\").FrameState} and {@link import(\"./View.js\").State}.\n * @param {ProjectionLike} projection The user projection.\n * @api\n */\nfunction setUserProjection(projection) {\n userProjection = get(projection);\n}\n\n/**\n * Clear the user projection if set.\n * @api\n */\nfunction clearUserProjection() {\n userProjection = null;\n}\n\n/**\n * Get the projection for coordinates supplied from and returned by API methods.\n * @return {Projection|null} The user projection (or null if not set).\n * @api\n */\nfunction getUserProjection() {\n return userProjection;\n}\n\n/**\n * Use geographic coordinates (WGS-84 datum) in API methods.\n * This includes all API methods except for those interacting with tile grids,\n * plus {@link import(\"./Map.js\").FrameState} and {@link import(\"./View.js\").State}.\n * @api\n */\nfunction useGeographic() {\n setUserProjection('EPSG:4326');\n}\n\n/**\n * Return a coordinate transformed into the user projection. If no user projection\n * is set, the original coordinate is returned.\n * @param {Array<number>} coordinate Input coordinate.\n * @param {ProjectionLike} sourceProjection The input coordinate projection.\n * @return {Array<number>} The input coordinate in the user projection.\n */\nfunction toUserCoordinate(coordinate, sourceProjection) {\n if (!userProjection) {\n return coordinate;\n }\n return transform(coordinate, sourceProjection, userProjection);\n}\n\n/**\n * Return a coordinate transformed from the user projection. If no user projection\n * is set, the original coordinate is returned.\n * @param {Array<number>} coordinate Input coordinate.\n * @param {ProjectionLike} destProjection The destination projection.\n * @return {Array<number>} The input coordinate transformed.\n */\nfunction fromUserCoordinate(coordinate, destProjection) {\n if (!userProjection) {\n if (showCoordinateWarning && !(0,_coordinate_js__WEBPACK_IMPORTED_MODULE_7__.equals)(coordinate, [0, 0]) && coordinate[0] >= -180 && coordinate[0] <= 180 && coordinate[1] >= -90 && coordinate[1] <= 90) {\n showCoordinateWarning = false;\n (0,_console_js__WEBPACK_IMPORTED_MODULE_8__.warn)('Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.');\n }\n return coordinate;\n }\n return transform(coordinate, userProjection, destProjection);\n}\n\n/**\n * Return an extent transformed into the user projection. If no user projection\n * is set, the original extent is returned.\n * @param {import(\"./extent.js\").Extent} extent Input extent.\n * @param {ProjectionLike} sourceProjection The input extent projection.\n * @return {import(\"./extent.js\").Extent} The input extent in the user projection.\n */\nfunction toUserExtent(extent, sourceProjection) {\n if (!userProjection) {\n return extent;\n }\n return transformExtent(extent, sourceProjection, userProjection);\n}\n\n/**\n * Return an extent transformed from the user projection. If no user projection\n * is set, the original extent is returned.\n * @param {import(\"./extent.js\").Extent} extent Input extent.\n * @param {ProjectionLike} destProjection The destination projection.\n * @return {import(\"./extent.js\").Extent} The input extent transformed.\n */\nfunction fromUserExtent(extent, destProjection) {\n if (!userProjection) {\n return extent;\n }\n return transformExtent(extent, userProjection, destProjection);\n}\n\n/**\n * Return the resolution in user projection units per pixel. If no user projection\n * is set, or source or user projection are missing units, the original resolution\n * is returned.\n * @param {number} resolution Resolution in input projection units per pixel.\n * @param {ProjectionLike} sourceProjection The input projection.\n * @return {number} Resolution in user projection units per pixel.\n */\nfunction toUserResolution(resolution, sourceProjection) {\n if (!userProjection) {\n return resolution;\n }\n const sourceMetersPerUnit = get(sourceProjection).getMetersPerUnit();\n const userMetersPerUnit = userProjection.getMetersPerUnit();\n return sourceMetersPerUnit && userMetersPerUnit ? resolution * sourceMetersPerUnit / userMetersPerUnit : resolution;\n}\n\n/**\n * Return the resolution in user projection units per pixel. If no user projection\n * is set, or source or user projection are missing units, the original resolution\n * is returned.\n * @param {number} resolution Resolution in user projection units per pixel.\n * @param {ProjectionLike} destProjection The destination projection.\n * @return {number} Resolution in destination projection units per pixel.\n */\nfunction fromUserResolution(resolution, destProjection) {\n if (!userProjection) {\n return resolution;\n }\n const destMetersPerUnit = get(destProjection).getMetersPerUnit();\n const userMetersPerUnit = userProjection.getMetersPerUnit();\n return destMetersPerUnit && userMetersPerUnit ? resolution * userMetersPerUnit / destMetersPerUnit : resolution;\n}\n\n/**\n * Creates a safe coordinate transform function from a coordinate transform function.\n * \"Safe\" means that it can handle wrapping of x-coordinates for global projections,\n * and that coordinates exceeding the source projection validity extent's range will be\n * clamped to the validity range.\n * @param {Projection} sourceProj Source projection.\n * @param {Projection} destProj Destination projection.\n * @param {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} transform Transform function (source to destination).\n * @return {function(import(\"./coordinate.js\").Coordinate): import(\"./coordinate.js\").Coordinate} Safe transform function (source to destination).\n */\nfunction createSafeCoordinateTransform(sourceProj, destProj, transform) {\n return function (coord) {\n let transformed, worldsAway;\n if (sourceProj.canWrapX()) {\n const sourceExtent = sourceProj.getExtent();\n const sourceExtentWidth = (0,_extent_js__WEBPACK_IMPORTED_MODULE_6__.getWidth)(sourceExtent);\n coord = coord.slice(0);\n worldsAway = (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_7__.getWorldsAway)(coord, sourceProj, sourceExtentWidth);\n if (worldsAway) {\n // Move x to the real world\n coord[0] = coord[0] - worldsAway * sourceExtentWidth;\n }\n coord[0] = (0,_math_js__WEBPACK_IMPORTED_MODULE_5__.clamp)(coord[0], sourceExtent[0], sourceExtent[2]);\n coord[1] = (0,_math_js__WEBPACK_IMPORTED_MODULE_5__.clamp)(coord[1], sourceExtent[1], sourceExtent[3]);\n transformed = transform(coord);\n } else {\n transformed = transform(coord);\n }\n if (worldsAway && destProj.canWrapX()) {\n // Move transformed coordinate back to the offset world\n transformed[0] += worldsAway * (0,_extent_js__WEBPACK_IMPORTED_MODULE_6__.getWidth)(destProj.getExtent());\n }\n return transformed;\n };\n}\n\n/**\n * Add transforms to and from EPSG:4326 and EPSG:3857. This function is called\n * by when this module is executed and should only need to be called again after\n * `clearAllProjections()` is called (e.g. in tests).\n */\nfunction addCommon() {\n // Add transformations that don't alter coordinates to convert within set of\n // projections with equal meaning.\n addEquivalentProjections(_proj_epsg3857_js__WEBPACK_IMPORTED_MODULE_9__.PROJECTIONS);\n addEquivalentProjections(_proj_epsg4326_js__WEBPACK_IMPORTED_MODULE_10__.PROJECTIONS);\n // Add transformations to convert EPSG:4326 like coordinates to EPSG:3857 like\n // coordinates and back.\n addEquivalentTransforms(_proj_epsg4326_js__WEBPACK_IMPORTED_MODULE_10__.PROJECTIONS, _proj_epsg3857_js__WEBPACK_IMPORTED_MODULE_9__.PROJECTIONS, _proj_epsg3857_js__WEBPACK_IMPORTED_MODULE_9__.fromEPSG4326, _proj_epsg3857_js__WEBPACK_IMPORTED_MODULE_9__.toEPSG4326);\n}\naddCommon();\n\n//# sourceURL=webpack://complexes/./node_modules/ol/proj.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/proj/Projection.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/proj/Projection.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Units_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Units.js */ \"./node_modules/ol/proj/Units.js\");\n/**\n * @module ol/proj/Projection\n */\n\n\n/**\n * @typedef {Object} Options\n * @property {string} code The SRS identifier code, e.g. `EPSG:4326`.\n * @property {import(\"./Units.js\").Units} [units] Units. Required unless a\n * proj4 projection is defined for `code`.\n * @property {import(\"../extent.js\").Extent} [extent] The validity extent for the SRS.\n * @property {string} [axisOrientation='enu'] The axis orientation as specified in Proj4.\n * @property {boolean} [global=false] Whether the projection is valid for the whole globe.\n * @property {number} [metersPerUnit] The meters per unit for the SRS.\n * If not provided, the `units` are used to get the meters per unit from the {@link METERS_PER_UNIT}\n * lookup table.\n * @property {import(\"../extent.js\").Extent} [worldExtent] The world extent for the SRS.\n * @property {function(number, import(\"../coordinate.js\").Coordinate):number} [getPointResolution]\n * Function to determine resolution at a point. The function is called with a\n * `number` view resolution and a {@link module:ol/coordinate~Coordinate} as arguments, and returns\n * the `number` resolution in projection units at the passed coordinate. If this is `undefined`,\n * the default {@link module:ol/proj.getPointResolution} function will be used.\n */\n\n/**\n * @classdesc\n * Projection definition class. One of these is created for each projection\n * supported in the application and stored in the {@link module:ol/proj} namespace.\n * You can use these in applications, but this is not required, as API params\n * and options use {@link module:ol/proj~ProjectionLike} which means the simple string\n * code will suffice.\n *\n * You can use {@link module:ol/proj.get} to retrieve the object for a particular\n * projection.\n *\n * The library includes definitions for `EPSG:4326` and `EPSG:3857`, together\n * with the following aliases:\n * * `EPSG:4326`: CRS:84, urn:ogc:def:crs:EPSG:6.6:4326,\n * urn:ogc:def:crs:OGC:1.3:CRS84, urn:ogc:def:crs:OGC:2:84,\n * http://www.opengis.net/gml/srs/epsg.xml#4326,\n * urn:x-ogc:def:crs:EPSG:4326\n * * `EPSG:3857`: EPSG:102100, EPSG:102113, EPSG:900913,\n * urn:ogc:def:crs:EPSG:6.18:3:3857,\n * http://www.opengis.net/gml/srs/epsg.xml#3857\n *\n * If you use [proj4js](https://github.com/proj4js/proj4js), aliases can\n * be added using `proj4.defs()`. After all required projection definitions are\n * added, call the {@link module:ol/proj/proj4.register} function.\n *\n * @api\n */\nclass Projection {\n /**\n * @param {Options} options Projection options.\n */\n constructor(options) {\n /**\n * @private\n * @type {string}\n */\n this.code_ = options.code;\n\n /**\n * Units of projected coordinates. When set to `TILE_PIXELS`, a\n * `this.extent_` and `this.worldExtent_` must be configured properly for each\n * tile.\n * @private\n * @type {import(\"./Units.js\").Units}\n */\n this.units_ = /** @type {import(\"./Units.js\").Units} */options.units;\n\n /**\n * Validity extent of the projection in projected coordinates. For projections\n * with `TILE_PIXELS` units, this is the extent of the tile in\n * tile pixel space.\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.extent_ = options.extent !== undefined ? options.extent : null;\n\n /**\n * Extent of the world in EPSG:4326. For projections with\n * `TILE_PIXELS` units, this is the extent of the tile in\n * projected coordinate space.\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.worldExtent_ = options.worldExtent !== undefined ? options.worldExtent : null;\n\n /**\n * @private\n * @type {string}\n */\n this.axisOrientation_ = options.axisOrientation !== undefined ? options.axisOrientation : 'enu';\n\n /**\n * @private\n * @type {boolean}\n */\n this.global_ = options.global !== undefined ? options.global : false;\n\n /**\n * @private\n * @type {boolean}\n */\n this.canWrapX_ = !!(this.global_ && this.extent_);\n\n /**\n * @private\n * @type {function(number, import(\"../coordinate.js\").Coordinate):number|undefined}\n */\n this.getPointResolutionFunc_ = options.getPointResolution;\n\n /**\n * @private\n * @type {import(\"../tilegrid/TileGrid.js\").default}\n */\n this.defaultTileGrid_ = null;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.metersPerUnit_ = options.metersPerUnit;\n }\n\n /**\n * @return {boolean} The projection is suitable for wrapping the x-axis\n */\n canWrapX() {\n return this.canWrapX_;\n }\n\n /**\n * Get the code for this projection, e.g. 'EPSG:4326'.\n * @return {string} Code.\n * @api\n */\n getCode() {\n return this.code_;\n }\n\n /**\n * Get the validity extent for this projection.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n getExtent() {\n return this.extent_;\n }\n\n /**\n * Get the units of this projection.\n * @return {import(\"./Units.js\").Units} Units.\n * @api\n */\n getUnits() {\n return this.units_;\n }\n\n /**\n * Get the amount of meters per unit of this projection. If the projection is\n * not configured with `metersPerUnit` or a units identifier, the return is\n * `undefined`.\n * @return {number|undefined} Meters.\n * @api\n */\n getMetersPerUnit() {\n return this.metersPerUnit_ || _Units_js__WEBPACK_IMPORTED_MODULE_0__.METERS_PER_UNIT[this.units_];\n }\n\n /**\n * Get the world extent for this projection.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n getWorldExtent() {\n return this.worldExtent_;\n }\n\n /**\n * Get the axis orientation of this projection.\n * Example values are:\n * enu - the default easting, northing, elevation.\n * neu - northing, easting, up - useful for \"lat/long\" geographic coordinates,\n * or south orientated transverse mercator.\n * wnu - westing, northing, up - some planetary coordinate systems have\n * \"west positive\" coordinate systems\n * @return {string} Axis orientation.\n * @api\n */\n getAxisOrientation() {\n return this.axisOrientation_;\n }\n\n /**\n * Is this projection a global projection which spans the whole world?\n * @return {boolean} Whether the projection is global.\n * @api\n */\n isGlobal() {\n return this.global_;\n }\n\n /**\n * Set if the projection is a global projection which spans the whole world\n * @param {boolean} global Whether the projection is global.\n * @api\n */\n setGlobal(global) {\n this.global_ = global;\n this.canWrapX_ = !!(global && this.extent_);\n }\n\n /**\n * @return {import(\"../tilegrid/TileGrid.js\").default} The default tile grid.\n */\n getDefaultTileGrid() {\n return this.defaultTileGrid_;\n }\n\n /**\n * @param {import(\"../tilegrid/TileGrid.js\").default} tileGrid The default tile grid.\n */\n setDefaultTileGrid(tileGrid) {\n this.defaultTileGrid_ = tileGrid;\n }\n\n /**\n * Set the validity extent for this projection.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @api\n */\n setExtent(extent) {\n this.extent_ = extent;\n this.canWrapX_ = !!(this.global_ && extent);\n }\n\n /**\n * Set the world extent for this projection.\n * @param {import(\"../extent.js\").Extent} worldExtent World extent\n * [minlon, minlat, maxlon, maxlat].\n * @api\n */\n setWorldExtent(worldExtent) {\n this.worldExtent_ = worldExtent;\n }\n\n /**\n * Set the getPointResolution function (see {@link module:ol/proj.getPointResolution}\n * for this projection.\n * @param {function(number, import(\"../coordinate.js\").Coordinate):number} func Function\n * @api\n */\n setGetPointResolution(func) {\n this.getPointResolutionFunc_ = func;\n }\n\n /**\n * Get the custom point resolution function for this projection (if set).\n * @return {function(number, import(\"../coordinate.js\").Coordinate):number|undefined} The custom point\n * resolution function (if set).\n */\n getPointResolutionFunc() {\n return this.getPointResolutionFunc_;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Projection);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/proj/Projection.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/proj/Units.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/proj/Units.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ METERS_PER_UNIT: function() { return /* binding */ METERS_PER_UNIT; },\n/* harmony export */ fromCode: function() { return /* binding */ fromCode; }\n/* harmony export */ });\n/**\n * @module ol/proj/Units\n */\n\n/**\n * @typedef {'radians' | 'degrees' | 'ft' | 'm' | 'pixels' | 'tile-pixels' | 'us-ft'} Units\n * Projection units.\n */\n\n/**\n * See http://duff.ess.washington.edu/data/raster/drg/docs/geotiff.txt\n * @type {Object<number, Units>}\n */\nconst unitByCode = {\n '9001': 'm',\n '9002': 'ft',\n '9003': 'us-ft',\n '9101': 'radians',\n '9102': 'degrees'\n};\n\n/**\n * @param {number} code Unit code.\n * @return {Units} Units.\n */\nfunction fromCode(code) {\n return unitByCode[code];\n}\n\n/**\n * @typedef {Object} MetersPerUnitLookup\n * @property {number} radians Radians\n * @property {number} degrees Degrees\n * @property {number} ft Feet\n * @property {number} m Meters\n * @property {number} us-ft US feet\n */\n\n/**\n * Meters per unit lookup table.\n * @const\n * @type {MetersPerUnitLookup}\n * @api\n */\nconst METERS_PER_UNIT = {\n // use the radius of the Normal sphere\n 'radians': 6370997 / (2 * Math.PI),\n 'degrees': 2 * Math.PI * 6370997 / 360,\n 'ft': 0.3048,\n 'm': 1,\n 'us-ft': 1200 / 3937\n};\n\n//# sourceURL=webpack://complexes/./node_modules/ol/proj/Units.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/proj/epsg3857.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ol/proj/epsg3857.js ***!
|
||
\******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EXTENT: function() { return /* binding */ EXTENT; },\n/* harmony export */ HALF_SIZE: function() { return /* binding */ HALF_SIZE; },\n/* harmony export */ MAX_SAFE_Y: function() { return /* binding */ MAX_SAFE_Y; },\n/* harmony export */ PROJECTIONS: function() { return /* binding */ PROJECTIONS; },\n/* harmony export */ RADIUS: function() { return /* binding */ RADIUS; },\n/* harmony export */ WORLD_EXTENT: function() { return /* binding */ WORLD_EXTENT; },\n/* harmony export */ fromEPSG4326: function() { return /* binding */ fromEPSG4326; },\n/* harmony export */ toEPSG4326: function() { return /* binding */ toEPSG4326; }\n/* harmony export */ });\n/* harmony import */ var _Projection_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Projection.js */ \"./node_modules/ol/proj/Projection.js\");\n/**\n * @module ol/proj/epsg3857\n */\n\n\n/**\n * Radius of WGS84 sphere\n *\n * @const\n * @type {number}\n */\nconst RADIUS = 6378137;\n\n/**\n * @const\n * @type {number}\n */\nconst HALF_SIZE = Math.PI * RADIUS;\n\n/**\n * @const\n * @type {import(\"../extent.js\").Extent}\n */\nconst EXTENT = [-HALF_SIZE, -HALF_SIZE, HALF_SIZE, HALF_SIZE];\n\n/**\n * @const\n * @type {import(\"../extent.js\").Extent}\n */\nconst WORLD_EXTENT = [-180, -85, 180, 85];\n\n/**\n * Maximum safe value in y direction\n * @const\n * @type {number}\n */\nconst MAX_SAFE_Y = RADIUS * Math.log(Math.tan(Math.PI / 2));\n\n/**\n * @classdesc\n * Projection object for web/spherical Mercator (EPSG:3857).\n */\nclass EPSG3857Projection extends _Projection_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {string} code Code.\n */\n constructor(code) {\n super({\n code: code,\n units: 'm',\n extent: EXTENT,\n global: true,\n worldExtent: WORLD_EXTENT,\n getPointResolution: function (resolution, point) {\n return resolution / Math.cosh(point[1] / RADIUS);\n }\n });\n }\n}\n\n/**\n * Projections equal to EPSG:3857.\n *\n * @const\n * @type {Array<import(\"./Projection.js\").default>}\n */\nconst PROJECTIONS = [new EPSG3857Projection('EPSG:3857'), new EPSG3857Projection('EPSG:102100'), new EPSG3857Projection('EPSG:102113'), new EPSG3857Projection('EPSG:900913'), new EPSG3857Projection('http://www.opengis.net/def/crs/EPSG/0/3857'), new EPSG3857Projection('http://www.opengis.net/gml/srs/epsg.xml#3857')];\n\n/**\n * Transformation from EPSG:4326 to EPSG:3857.\n *\n * @param {Array<number>} input Input array of coordinate values.\n * @param {Array<number>} [output] Output array of coordinate values.\n * @param {number} [dimension] Dimension (default is `2`).\n * @return {Array<number>} Output array of coordinate values.\n */\nfunction fromEPSG4326(input, output, dimension) {\n const length = input.length;\n dimension = dimension > 1 ? dimension : 2;\n if (output === undefined) {\n if (dimension > 2) {\n // preserve values beyond second dimension\n output = input.slice();\n } else {\n output = new Array(length);\n }\n }\n for (let i = 0; i < length; i += dimension) {\n output[i] = HALF_SIZE * input[i] / 180;\n let y = RADIUS * Math.log(Math.tan(Math.PI * (+input[i + 1] + 90) / 360));\n if (y > MAX_SAFE_Y) {\n y = MAX_SAFE_Y;\n } else if (y < -MAX_SAFE_Y) {\n y = -MAX_SAFE_Y;\n }\n output[i + 1] = y;\n }\n return output;\n}\n\n/**\n * Transformation from EPSG:3857 to EPSG:4326.\n *\n * @param {Array<number>} input Input array of coordinate values.\n * @param {Array<number>} [output] Output array of coordinate values.\n * @param {number} [dimension] Dimension (default is `2`).\n * @return {Array<number>} Output array of coordinate values.\n */\nfunction toEPSG4326(input, output, dimension) {\n const length = input.length;\n dimension = dimension > 1 ? dimension : 2;\n if (output === undefined) {\n if (dimension > 2) {\n // preserve values beyond second dimension\n output = input.slice();\n } else {\n output = new Array(length);\n }\n }\n for (let i = 0; i < length; i += dimension) {\n output[i] = 180 * input[i] / HALF_SIZE;\n output[i + 1] = 360 * Math.atan(Math.exp(input[i + 1] / RADIUS)) / Math.PI - 90;\n }\n return output;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/proj/epsg3857.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/proj/epsg4326.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ol/proj/epsg4326.js ***!
|
||
\******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EXTENT: function() { return /* binding */ EXTENT; },\n/* harmony export */ METERS_PER_UNIT: function() { return /* binding */ METERS_PER_UNIT; },\n/* harmony export */ PROJECTIONS: function() { return /* binding */ PROJECTIONS; },\n/* harmony export */ RADIUS: function() { return /* binding */ RADIUS; }\n/* harmony export */ });\n/* harmony import */ var _Projection_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Projection.js */ \"./node_modules/ol/proj/Projection.js\");\n/**\n * @module ol/proj/epsg4326\n */\n\n\n/**\n * Semi-major radius of the WGS84 ellipsoid.\n *\n * @const\n * @type {number}\n */\nconst RADIUS = 6378137;\n\n/**\n * Extent of the EPSG:4326 projection which is the whole world.\n *\n * @const\n * @type {import(\"../extent.js\").Extent}\n */\nconst EXTENT = [-180, -90, 180, 90];\n\n/**\n * @const\n * @type {number}\n */\nconst METERS_PER_UNIT = Math.PI * RADIUS / 180;\n\n/**\n * @classdesc\n * Projection object for WGS84 geographic coordinates (EPSG:4326).\n *\n * Note that OpenLayers does not strictly comply with the EPSG definition.\n * The EPSG registry defines 4326 as a CRS for Latitude,Longitude (y,x).\n * OpenLayers treats EPSG:4326 as a pseudo-projection, with x,y coordinates.\n */\nclass EPSG4326Projection extends _Projection_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {string} code Code.\n * @param {string} [axisOrientation] Axis orientation.\n */\n constructor(code, axisOrientation) {\n super({\n code: code,\n units: 'degrees',\n extent: EXTENT,\n axisOrientation: axisOrientation,\n global: true,\n metersPerUnit: METERS_PER_UNIT,\n worldExtent: EXTENT\n });\n }\n}\n\n/**\n * Projections equal to EPSG:4326.\n *\n * @const\n * @type {Array<import(\"./Projection.js\").default>}\n */\nconst PROJECTIONS = [new EPSG4326Projection('CRS:84'), new EPSG4326Projection('EPSG:4326', 'neu'), new EPSG4326Projection('urn:ogc:def:crs:OGC:1.3:CRS84'), new EPSG4326Projection('urn:ogc:def:crs:OGC:2:84'), new EPSG4326Projection('http://www.opengis.net/def/crs/OGC/1.3/CRS84'), new EPSG4326Projection('http://www.opengis.net/gml/srs/epsg.xml#4326', 'neu'), new EPSG4326Projection('http://www.opengis.net/def/crs/EPSG/0/4326', 'neu')];\n\n//# sourceURL=webpack://complexes/./node_modules/ol/proj/epsg4326.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/proj/projections.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ol/proj/projections.js ***!
|
||
\*********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ add: function() { return /* binding */ add; },\n/* harmony export */ clear: function() { return /* binding */ clear; },\n/* harmony export */ get: function() { return /* binding */ get; }\n/* harmony export */ });\n/**\n * @module ol/proj/projections\n */\n\n/**\n * @type {Object<string, import(\"./Projection.js\").default>}\n */\nlet cache = {};\n\n/**\n * Clear the projections cache.\n */\nfunction clear() {\n cache = {};\n}\n\n/**\n * Get a cached projection by code.\n * @param {string} code The code for the projection.\n * @return {import(\"./Projection.js\").default} The projection (if cached).\n */\nfunction get(code) {\n return cache[code] || cache[code.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\\w+)$/, 'EPSG:$3')] || null;\n}\n\n/**\n * Add a projection to the cache.\n * @param {string} code The projection code.\n * @param {import(\"./Projection.js\").default} projection The projection to cache.\n */\nfunction add(code, projection) {\n cache[code] = projection;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/proj/projections.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/proj/transforms.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/proj/transforms.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ add: function() { return /* binding */ add; },\n/* harmony export */ clear: function() { return /* binding */ clear; },\n/* harmony export */ get: function() { return /* binding */ get; },\n/* harmony export */ remove: function() { return /* binding */ remove; }\n/* harmony export */ });\n/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../obj.js */ \"./node_modules/ol/obj.js\");\n/**\n * @module ol/proj/transforms\n */\n\n\n/**\n * @private\n * @type {!Object<string, Object<string, import(\"../proj.js\").TransformFunction>>}\n */\nlet transforms = {};\n\n/**\n * Clear the transform cache.\n */\nfunction clear() {\n transforms = {};\n}\n\n/**\n * Registers a conversion function to convert coordinates from the source\n * projection to the destination projection.\n *\n * @param {import(\"./Projection.js\").default} source Source.\n * @param {import(\"./Projection.js\").default} destination Destination.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform.\n */\nfunction add(source, destination, transformFn) {\n const sourceCode = source.getCode();\n const destinationCode = destination.getCode();\n if (!(sourceCode in transforms)) {\n transforms[sourceCode] = {};\n }\n transforms[sourceCode][destinationCode] = transformFn;\n}\n\n/**\n * Unregisters the conversion function to convert coordinates from the source\n * projection to the destination projection. This method is used to clean up\n * cached transforms during testing.\n *\n * @param {import(\"./Projection.js\").default} source Source projection.\n * @param {import(\"./Projection.js\").default} destination Destination projection.\n * @return {import(\"../proj.js\").TransformFunction} transformFn The unregistered transform.\n */\nfunction remove(source, destination) {\n const sourceCode = source.getCode();\n const destinationCode = destination.getCode();\n const transform = transforms[sourceCode][destinationCode];\n delete transforms[sourceCode][destinationCode];\n if ((0,_obj_js__WEBPACK_IMPORTED_MODULE_0__.isEmpty)(transforms[sourceCode])) {\n delete transforms[sourceCode];\n }\n return transform;\n}\n\n/**\n * Get a transform given a source code and a destination code.\n * @param {string} sourceCode The code for the source projection.\n * @param {string} destinationCode The code for the destination projection.\n * @return {import(\"../proj.js\").TransformFunction|undefined} The transform function (if found).\n */\nfunction get(sourceCode, destinationCode) {\n let transform;\n if (sourceCode in transforms && destinationCode in transforms[sourceCode]) {\n transform = transforms[sourceCode][destinationCode];\n }\n return transform;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/proj/transforms.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/Box.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/render/Box.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Disposable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Disposable.js */ \"./node_modules/ol/Disposable.js\");\n/* harmony import */ var _geom_Polygon_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geom/Polygon.js */ \"./node_modules/ol/geom/Polygon.js\");\n/**\n * @module ol/render/Box\n */\n\n\n\nclass RenderBox extends _Disposable_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {string} className CSS class name.\n */\n constructor(className) {\n super();\n\n /**\n * @type {import(\"../geom/Polygon.js\").default}\n * @private\n */\n this.geometry_ = null;\n\n /**\n * @type {HTMLDivElement}\n * @private\n */\n this.element_ = document.createElement('div');\n this.element_.style.position = 'absolute';\n this.element_.style.pointerEvents = 'auto';\n this.element_.className = 'ol-box ' + className;\n\n /**\n * @private\n * @type {import(\"../Map.js\").default|null}\n */\n this.map_ = null;\n\n /**\n * @private\n * @type {import(\"../pixel.js\").Pixel}\n */\n this.startPixel_ = null;\n\n /**\n * @private\n * @type {import(\"../pixel.js\").Pixel}\n */\n this.endPixel_ = null;\n }\n\n /**\n * Clean up.\n */\n disposeInternal() {\n this.setMap(null);\n }\n\n /**\n * @private\n */\n render_() {\n const startPixel = this.startPixel_;\n const endPixel = this.endPixel_;\n const px = 'px';\n const style = this.element_.style;\n style.left = Math.min(startPixel[0], endPixel[0]) + px;\n style.top = Math.min(startPixel[1], endPixel[1]) + px;\n style.width = Math.abs(endPixel[0] - startPixel[0]) + px;\n style.height = Math.abs(endPixel[1] - startPixel[1]) + px;\n }\n\n /**\n * @param {import(\"../Map.js\").default|null} map Map.\n */\n setMap(map) {\n if (this.map_) {\n this.map_.getOverlayContainer().removeChild(this.element_);\n const style = this.element_.style;\n style.left = 'inherit';\n style.top = 'inherit';\n style.width = 'inherit';\n style.height = 'inherit';\n }\n this.map_ = map;\n if (this.map_) {\n this.map_.getOverlayContainer().appendChild(this.element_);\n }\n }\n\n /**\n * @param {import(\"../pixel.js\").Pixel} startPixel Start pixel.\n * @param {import(\"../pixel.js\").Pixel} endPixel End pixel.\n */\n setPixels(startPixel, endPixel) {\n this.startPixel_ = startPixel;\n this.endPixel_ = endPixel;\n this.createOrUpdateGeometry();\n this.render_();\n }\n\n /**\n * Creates or updates the cached geometry.\n */\n createOrUpdateGeometry() {\n const startPixel = this.startPixel_;\n const endPixel = this.endPixel_;\n const pixels = [startPixel, [startPixel[0], endPixel[1]], endPixel, [endPixel[0], startPixel[1]]];\n const coordinates = pixels.map(this.map_.getCoordinateFromPixelInternal, this.map_);\n // close the polygon\n coordinates[4] = coordinates[0].slice();\n if (!this.geometry_) {\n this.geometry_ = new _geom_Polygon_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]([coordinates]);\n } else {\n this.geometry_.setCoordinates([coordinates]);\n }\n }\n\n /**\n * @return {import(\"../geom/Polygon.js\").default} Geometry.\n */\n getGeometry() {\n return this.geometry_;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (RenderBox);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/Box.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/Event.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ol/render/Event.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../events/Event.js */ \"./node_modules/ol/events/Event.js\");\n/**\n * @module ol/render/Event\n */\n\n\nclass RenderEvent extends _events_Event_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {import(\"./EventType.js\").default} type Type.\n * @param {import(\"../transform.js\").Transform} [inversePixelTransform] Transform for\n * CSS pixels to rendered pixels.\n * @param {import(\"../Map.js\").FrameState} [frameState] Frame state.\n * @param {?(CanvasRenderingContext2D|WebGLRenderingContext)} [context] Context.\n */\n constructor(type, inversePixelTransform, frameState, context) {\n super(type);\n\n /**\n * Transform from CSS pixels (relative to the top-left corner of the map viewport)\n * to rendered pixels on this event's `context`. Only available when a Canvas renderer is used, null otherwise.\n * @type {import(\"../transform.js\").Transform|undefined}\n * @api\n */\n this.inversePixelTransform = inversePixelTransform;\n\n /**\n * An object representing the current render frame state.\n * @type {import(\"../Map.js\").FrameState|undefined}\n * @api\n */\n this.frameState = frameState;\n\n /**\n * Canvas context. Not available when the event is dispatched by the map. For Canvas 2D layers,\n * the context will be the 2D rendering context. For WebGL layers, the context will be the WebGL\n * context.\n * @type {CanvasRenderingContext2D|WebGLRenderingContext|undefined}\n * @api\n */\n this.context = context;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (RenderEvent);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/Event.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/EventType.js":
|
||
/*!*********************************************!*\
|
||
!*** ./node_modules/ol/render/EventType.js ***!
|
||
\*********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/render/EventType\n */\n\n/**\n * @enum {string}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n /**\n * Triggered before a layer is rendered.\n * @event module:ol/render/Event~RenderEvent#prerender\n * @api\n */\n PRERENDER: 'prerender',\n /**\n * Triggered after a layer is rendered.\n * @event module:ol/render/Event~RenderEvent#postrender\n * @api\n */\n POSTRENDER: 'postrender',\n /**\n * Triggered before layers are composed. When dispatched by the map, the event object will not have\n * a `context` set. When dispatched by a layer, the event object will have a `context` set. Only\n * WebGL layers currently dispatch this event.\n * @event module:ol/render/Event~RenderEvent#precompose\n * @api\n */\n PRECOMPOSE: 'precompose',\n /**\n * Triggered after layers are composed. When dispatched by the map, the event object will not have\n * a `context` set. When dispatched by a layer, the event object will have a `context` set. Only\n * WebGL layers currently dispatch this event.\n * @event module:ol/render/Event~RenderEvent#postcompose\n * @api\n */\n POSTCOMPOSE: 'postcompose',\n /**\n * Triggered when rendering is complete, i.e. all sources and tiles have\n * finished loading for the current viewport, and all tiles are faded in.\n * The event object will not have a `context` set.\n * @event module:ol/render/Event~RenderEvent#rendercomplete\n * @api\n */\n RENDERCOMPLETE: 'rendercomplete'\n});\n\n/**\n * @typedef {'postrender'|'precompose'|'postcompose'|'rendercomplete'} MapRenderEventTypes\n */\n\n/**\n * @typedef {'postrender'|'prerender'} LayerRenderEventTypes\n */\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/EventType.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/Feature.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/ol/render/Feature.js ***!
|
||
\*******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ toFeature: function() { return /* binding */ toFeature; },\n/* harmony export */ toGeometry: function() { return /* binding */ toGeometry; }\n/* harmony export */ });\n/* harmony import */ var _Feature_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../Feature.js */ \"./node_modules/ol/Feature.js\");\n/* harmony import */ var _geom_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../geom.js */ \"./node_modules/ol/geom/Point.js\");\n/* harmony import */ var _geom_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../geom.js */ \"./node_modules/ol/geom/MultiPoint.js\");\n/* harmony import */ var _geom_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geom.js */ \"./node_modules/ol/geom/LineString.js\");\n/* harmony import */ var _geom_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geom.js */ \"./node_modules/ol/geom/MultiLineString.js\");\n/* harmony import */ var _geom_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geom.js */ \"./node_modules/ol/geom/MultiPolygon.js\");\n/* harmony import */ var _geom_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../geom.js */ \"./node_modules/ol/geom/Polygon.js\");\n/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../transform.js */ \"./node_modules/ol/transform.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _geom_flat_simplify_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geom/flat/simplify.js */ \"./node_modules/ol/geom/flat/simplify.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _geom_flat_interiorpoint_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geom/flat/interiorpoint.js */ \"./node_modules/ol/geom/flat/interiorpoint.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../proj.js */ \"./node_modules/ol/proj.js\");\n/* harmony import */ var _geom_flat_orient_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geom/flat/orient.js */ \"./node_modules/ol/geom/flat/orient.js\");\n/* harmony import */ var _geom_flat_interpolate_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geom/flat/interpolate.js */ \"./node_modules/ol/geom/flat/interpolate.js\");\n/* harmony import */ var _geom_flat_center_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geom/flat/center.js */ \"./node_modules/ol/geom/flat/center.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _geom_flat_transform_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geom/flat/transform.js */ \"./node_modules/ol/geom/flat/transform.js\");\n/**\n * @module ol/render/Feature\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @typedef {'Point' | 'LineString' | 'LinearRing' | 'Polygon' | 'MultiPoint' | 'MultiLineString'} Type\n * The geometry type. One of `'Point'`, `'LineString'`, `'LinearRing'`,\n * `'Polygon'`, `'MultiPoint'` or 'MultiLineString'`.\n */\n\n/**\n * @type {import(\"../transform.js\").Transform}\n */\nconst tmpTransform = (0,_transform_js__WEBPACK_IMPORTED_MODULE_1__.create)();\n\n/**\n * Lightweight, read-only, {@link module:ol/Feature~Feature} and {@link module:ol/geom/Geometry~Geometry} like\n * structure, optimized for vector tile rendering and styling. Geometry access\n * through the API is limited to getting the type and extent of the geometry.\n */\nclass RenderFeature {\n /**\n * @param {Type} type Geometry type.\n * @param {Array<number>} flatCoordinates Flat coordinates. These always need\n * to be right-handed for polygons.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {Object<string, *>} properties Properties.\n * @param {number|string|undefined} id Feature id.\n */\n constructor(type, flatCoordinates, ends, stride, properties, id) {\n /**\n * @type {import(\"../style/Style.js\").StyleFunction|undefined}\n */\n this.styleFunction;\n\n /**\n * @private\n * @type {import(\"../extent.js\").Extent|undefined}\n */\n this.extent_;\n\n /**\n * @private\n * @type {number|string|undefined}\n */\n this.id_ = id;\n\n /**\n * @private\n * @type {Type}\n */\n this.type_ = type;\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.flatCoordinates_ = flatCoordinates;\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.flatInteriorPoints_ = null;\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.flatMidpoints_ = null;\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.ends_ = ends;\n\n /**\n * @private\n * @type {Object<string, *>}\n */\n this.properties_ = properties;\n\n /**\n * @type {number}\n */\n this.squaredTolerance_;\n\n /**\n * @type {number}\n */\n this.stride_ = stride;\n\n /**\n * @private\n * @type {RenderFeature}\n */\n this.simplifiedGeometry_;\n }\n\n /**\n * Get a feature property by its key.\n * @param {string} key Key\n * @return {*} Value for the requested key.\n * @api\n */\n get(key) {\n return this.properties_[key];\n }\n\n /**\n * Get the extent of this feature's geometry.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n getExtent() {\n if (!this.extent_) {\n this.extent_ = this.type_ === 'Point' ? (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.createOrUpdateFromCoordinate)(this.flatCoordinates_) : (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.createOrUpdateFromFlatCoordinates)(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2);\n }\n return this.extent_;\n }\n\n /**\n * @return {Array<number>} Flat interior points.\n */\n getFlatInteriorPoint() {\n if (!this.flatInteriorPoints_) {\n const flatCenter = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getCenter)(this.getExtent());\n this.flatInteriorPoints_ = (0,_geom_flat_interiorpoint_js__WEBPACK_IMPORTED_MODULE_3__.getInteriorPointOfArray)(this.flatCoordinates_, 0, /** @type {Array<number>} */this.ends_, 2, flatCenter, 0);\n }\n return this.flatInteriorPoints_;\n }\n\n /**\n * @return {Array<number>} Flat interior points.\n */\n getFlatInteriorPoints() {\n if (!this.flatInteriorPoints_) {\n const ends = (0,_geom_flat_orient_js__WEBPACK_IMPORTED_MODULE_4__.inflateEnds)(this.flatCoordinates_, this.ends_);\n const flatCenters = (0,_geom_flat_center_js__WEBPACK_IMPORTED_MODULE_5__.linearRingss)(this.flatCoordinates_, 0, ends, 2);\n this.flatInteriorPoints_ = (0,_geom_flat_interiorpoint_js__WEBPACK_IMPORTED_MODULE_3__.getInteriorPointsOfMultiArray)(this.flatCoordinates_, 0, ends, 2, flatCenters);\n }\n return this.flatInteriorPoints_;\n }\n\n /**\n * @return {Array<number>} Flat midpoint.\n */\n getFlatMidpoint() {\n if (!this.flatMidpoints_) {\n this.flatMidpoints_ = (0,_geom_flat_interpolate_js__WEBPACK_IMPORTED_MODULE_6__.interpolatePoint)(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2, 0.5);\n }\n return this.flatMidpoints_;\n }\n\n /**\n * @return {Array<number>} Flat midpoints.\n */\n getFlatMidpoints() {\n if (!this.flatMidpoints_) {\n this.flatMidpoints_ = [];\n const flatCoordinates = this.flatCoordinates_;\n let offset = 0;\n const ends = /** @type {Array<number>} */this.ends_;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const midpoint = (0,_geom_flat_interpolate_js__WEBPACK_IMPORTED_MODULE_6__.interpolatePoint)(flatCoordinates, offset, end, 2, 0.5);\n (0,_array_js__WEBPACK_IMPORTED_MODULE_7__.extend)(this.flatMidpoints_, midpoint);\n offset = end;\n }\n }\n return this.flatMidpoints_;\n }\n\n /**\n * Get the feature identifier. This is a stable identifier for the feature and\n * is set when reading data from a remote source.\n * @return {number|string|undefined} Id.\n * @api\n */\n getId() {\n return this.id_;\n }\n\n /**\n * @return {Array<number>} Flat coordinates.\n */\n getOrientedFlatCoordinates() {\n return this.flatCoordinates_;\n }\n\n /**\n * For API compatibility with {@link module:ol/Feature~Feature}, this method is useful when\n * determining the geometry type in style function (see {@link #getType}).\n * @return {RenderFeature} Feature.\n * @api\n */\n getGeometry() {\n return this;\n }\n\n /**\n * @param {number} squaredTolerance Squared tolerance.\n * @return {RenderFeature} Simplified geometry.\n */\n getSimplifiedGeometry(squaredTolerance) {\n return this;\n }\n\n /**\n * Get a transformed and simplified version of the geometry.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [transform] Optional transform function.\n * @return {RenderFeature} Simplified geometry.\n */\n simplifyTransformed(squaredTolerance, transform) {\n return this;\n }\n\n /**\n * Get the feature properties.\n * @return {Object<string, *>} Feature properties.\n * @api\n */\n getProperties() {\n return this.properties_;\n }\n\n /**\n * Get an object of all property names and values. This has the same behavior as getProperties,\n * but is here to conform with the {@link module:ol/Feature~Feature} interface.\n * @return {Object<string, *>?} Object.\n */\n getPropertiesInternal() {\n return this.properties_;\n }\n\n /**\n * @return {number} Stride.\n */\n getStride() {\n return this.stride_;\n }\n\n /**\n * @return {import('../style/Style.js').StyleFunction|undefined} Style\n */\n getStyleFunction() {\n return this.styleFunction;\n }\n\n /**\n * Get the type of this feature's geometry.\n * @return {Type} Geometry type.\n * @api\n */\n getType() {\n return this.type_;\n }\n\n /**\n * Transform geometry coordinates from tile pixel space to projected.\n *\n * @param {import(\"../proj.js\").ProjectionLike} projection The data projection\n */\n transform(projection) {\n projection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.get)(projection);\n const pixelExtent = projection.getExtent();\n const projectedExtent = projection.getWorldExtent();\n if (pixelExtent && projectedExtent) {\n const scale = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getHeight)(projectedExtent) / (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getHeight)(pixelExtent);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_1__.compose)(tmpTransform, projectedExtent[0], projectedExtent[3], scale, -scale, 0, 0, 0);\n (0,_geom_flat_transform_js__WEBPACK_IMPORTED_MODULE_8__.transform2D)(this.flatCoordinates_, 0, this.flatCoordinates_.length, 2, tmpTransform, this.flatCoordinates_);\n }\n }\n\n /**\n * Apply a transform function to the coordinates of the geometry.\n * The geometry is modified in place.\n * If you do not want the geometry modified in place, first `clone()` it and\n * then use this function on the clone.\n * @param {import(\"../proj.js\").TransformFunction} transformFn Transform function.\n */\n applyTransform(transformFn) {\n transformFn(this.flatCoordinates_, this.flatCoordinates_, this.stride_);\n }\n\n /**\n * @return {RenderFeature} A cloned render feature.\n */\n clone() {\n return new RenderFeature(this.type_, this.flatCoordinates_.slice(), this.ends_.slice(), this.stride_, Object.assign({}, this.properties_), this.id_);\n }\n\n /**\n * @return {Array<number>} Ends.\n */\n getEnds() {\n return this.ends_;\n }\n\n /**\n * Add transform and resolution based geometry simplification to this instance.\n * @return {RenderFeature} This render feature.\n */\n enableSimplifyTransformed() {\n this.simplifyTransformed = (0,_functions_js__WEBPACK_IMPORTED_MODULE_9__.memoizeOne)((squaredTolerance, transform) => {\n if (squaredTolerance === this.squaredTolerance_) {\n return this.simplifiedGeometry_;\n }\n this.simplifiedGeometry_ = this.clone();\n if (transform) {\n this.simplifiedGeometry_.applyTransform(transform);\n }\n const simplifiedFlatCoordinates = this.simplifiedGeometry_.getFlatCoordinates();\n let simplifiedEnds;\n switch (this.type_) {\n case 'LineString':\n simplifiedFlatCoordinates.length = (0,_geom_flat_simplify_js__WEBPACK_IMPORTED_MODULE_10__.douglasPeucker)(simplifiedFlatCoordinates, 0, this.simplifiedGeometry_.flatCoordinates_.length, this.simplifiedGeometry_.stride_, squaredTolerance, simplifiedFlatCoordinates, 0);\n simplifiedEnds = [simplifiedFlatCoordinates.length];\n break;\n case 'MultiLineString':\n simplifiedEnds = [];\n simplifiedFlatCoordinates.length = (0,_geom_flat_simplify_js__WEBPACK_IMPORTED_MODULE_10__.douglasPeuckerArray)(simplifiedFlatCoordinates, 0, this.simplifiedGeometry_.ends_, this.simplifiedGeometry_.stride_, squaredTolerance, simplifiedFlatCoordinates, 0, simplifiedEnds);\n break;\n case 'Polygon':\n simplifiedEnds = [];\n simplifiedFlatCoordinates.length = (0,_geom_flat_simplify_js__WEBPACK_IMPORTED_MODULE_10__.quantizeArray)(simplifiedFlatCoordinates, 0, this.simplifiedGeometry_.ends_, this.simplifiedGeometry_.stride_, Math.sqrt(squaredTolerance), simplifiedFlatCoordinates, 0, simplifiedEnds);\n break;\n default:\n }\n if (simplifiedEnds) {\n this.simplifiedGeometry_ = new RenderFeature(this.type_, simplifiedFlatCoordinates, simplifiedEnds, 2, this.properties_, this.id_);\n }\n this.squaredTolerance_ = squaredTolerance;\n return this.simplifiedGeometry_;\n });\n return this;\n }\n}\n\n/**\n * @return {Array<number>} Flat coordinates.\n */\nRenderFeature.prototype.getFlatCoordinates = RenderFeature.prototype.getOrientedFlatCoordinates;\n\n/**\n * Create a geometry from an `ol/render/Feature`\n * @param {RenderFeature} renderFeature\n * Render Feature\n * @return {Point|MultiPoint|LineString|MultiLineString|Polygon|MultiPolygon}\n * New geometry instance.\n * @api\n */\nfunction toGeometry(renderFeature) {\n const geometryType = renderFeature.getType();\n switch (geometryType) {\n case 'Point':\n return new _geom_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"](renderFeature.getFlatCoordinates());\n case 'MultiPoint':\n return new _geom_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"](renderFeature.getFlatCoordinates(), 'XY');\n case 'LineString':\n return new _geom_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"](renderFeature.getFlatCoordinates(), 'XY');\n case 'MultiLineString':\n return new _geom_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"](renderFeature.getFlatCoordinates(), 'XY', /** @type {Array<number>} */renderFeature.getEnds());\n case 'Polygon':\n const flatCoordinates = renderFeature.getFlatCoordinates();\n const ends = /** @type {Array<number>} */renderFeature.getEnds();\n const endss = (0,_geom_flat_orient_js__WEBPACK_IMPORTED_MODULE_4__.inflateEnds)(flatCoordinates, ends);\n return endss.length > 1 ? new _geom_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"](flatCoordinates, 'XY', endss) : new _geom_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"](flatCoordinates, 'XY', ends);\n default:\n throw new Error('Invalid geometry type:' + geometryType);\n }\n}\n\n/**\n * Create an `ol/Feature` from an `ol/render/Feature`\n * @param {RenderFeature} renderFeature RenderFeature\n * @param {string} [geometryName='geometry'] Geometry name to use\n * when creating the Feature.\n * @return {Feature} Newly constructed `ol/Feature` with properties,\n * geometry, and id copied over.\n * @api\n */\nfunction toFeature(renderFeature, geometryName) {\n const id = renderFeature.getId();\n const geometry = toGeometry(renderFeature);\n const properties = renderFeature.getProperties();\n const feature = new _Feature_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"]();\n if (geometryName !== undefined) {\n feature.setGeometryName(geometryName);\n }\n feature.setGeometry(geometry);\n if (id !== undefined) {\n feature.setId(id);\n }\n feature.setProperties(properties, true);\n return feature;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (RenderFeature);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/Feature.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/VectorContext.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/ol/render/VectorContext.js ***!
|
||
\*************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/render/VectorContext\n */\n\n/**\n * @classdesc\n * Context for drawing geometries. A vector context is available on render\n * events and does not need to be constructed directly.\n * @api\n */\nclass VectorContext {\n /**\n * Render a geometry with a custom renderer.\n *\n * @param {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {Function} renderer Renderer.\n * @param {Function} hitDetectionRenderer Renderer.\n */\n drawCustom(geometry, feature, renderer, hitDetectionRenderer) {}\n\n /**\n * Render a geometry.\n *\n * @param {import(\"../geom/Geometry.js\").default} geometry The geometry to render.\n */\n drawGeometry(geometry) {}\n\n /**\n * Set the rendering style.\n *\n * @param {import(\"../style/Style.js\").default} style The rendering style.\n */\n setStyle(style) {}\n\n /**\n * @param {import(\"../geom/Circle.js\").default} circleGeometry Circle geometry.\n * @param {import(\"../Feature.js\").default} feature Feature.\n */\n drawCircle(circleGeometry, feature) {}\n\n /**\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"../style/Style.js\").default} style Style.\n */\n drawFeature(feature, style) {}\n\n /**\n * @param {import(\"../geom/GeometryCollection.js\").default} geometryCollectionGeometry Geometry collection.\n * @param {import(\"../Feature.js\").default} feature Feature.\n */\n drawGeometryCollection(geometryCollectionGeometry, feature) {}\n\n /**\n * @param {import(\"../geom/LineString.js\").default|import(\"./Feature.js\").default} lineStringGeometry Line string geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n drawLineString(lineStringGeometry, feature) {}\n\n /**\n * @param {import(\"../geom/MultiLineString.js\").default|import(\"./Feature.js\").default} multiLineStringGeometry MultiLineString geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n drawMultiLineString(multiLineStringGeometry, feature) {}\n\n /**\n * @param {import(\"../geom/MultiPoint.js\").default|import(\"./Feature.js\").default} multiPointGeometry MultiPoint geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n drawMultiPoint(multiPointGeometry, feature) {}\n\n /**\n * @param {import(\"../geom/MultiPolygon.js\").default} multiPolygonGeometry MultiPolygon geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n drawMultiPolygon(multiPolygonGeometry, feature) {}\n\n /**\n * @param {import(\"../geom/Point.js\").default|import(\"./Feature.js\").default} pointGeometry Point geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n drawPoint(pointGeometry, feature) {}\n\n /**\n * @param {import(\"../geom/Polygon.js\").default|import(\"./Feature.js\").default} polygonGeometry Polygon geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n drawPolygon(polygonGeometry, feature) {}\n\n /**\n * @param {import(\"../geom/SimpleGeometry.js\").default|import(\"./Feature.js\").default} geometry Geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\n drawText(geometry, feature) {}\n\n /**\n * @param {import(\"../style/Fill.js\").default} fillStyle Fill style.\n * @param {import(\"../style/Stroke.js\").default} strokeStyle Stroke style.\n */\n setFillStrokeStyle(fillStyle, strokeStyle) {}\n\n /**\n * @param {import(\"../style/Image.js\").default} imageStyle Image style.\n * @param {import(\"../render/canvas.js\").DeclutterImageWithText} [declutterImageWithText] Shared data for combined decluttering with a text style.\n */\n setImageStyle(imageStyle, declutterImageWithText) {}\n\n /**\n * @param {import(\"../style/Text.js\").default} textStyle Text style.\n * @param {import(\"../render/canvas.js\").DeclutterImageWithText} [declutterImageWithText] Shared data for combined decluttering with an image style.\n */\n setTextStyle(textStyle, declutterImageWithText) {}\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (VectorContext);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/VectorContext.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/canvas.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ol/render/canvas.js ***!
|
||
\******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ checkedFonts: function() { return /* binding */ checkedFonts; },\n/* harmony export */ defaultFillStyle: function() { return /* binding */ defaultFillStyle; },\n/* harmony export */ defaultFont: function() { return /* binding */ defaultFont; },\n/* harmony export */ defaultLineCap: function() { return /* binding */ defaultLineCap; },\n/* harmony export */ defaultLineDash: function() { return /* binding */ defaultLineDash; },\n/* harmony export */ defaultLineDashOffset: function() { return /* binding */ defaultLineDashOffset; },\n/* harmony export */ defaultLineJoin: function() { return /* binding */ defaultLineJoin; },\n/* harmony export */ defaultLineWidth: function() { return /* binding */ defaultLineWidth; },\n/* harmony export */ defaultMiterLimit: function() { return /* binding */ defaultMiterLimit; },\n/* harmony export */ defaultPadding: function() { return /* binding */ defaultPadding; },\n/* harmony export */ defaultStrokeStyle: function() { return /* binding */ defaultStrokeStyle; },\n/* harmony export */ defaultTextAlign: function() { return /* binding */ defaultTextAlign; },\n/* harmony export */ defaultTextBaseline: function() { return /* binding */ defaultTextBaseline; },\n/* harmony export */ drawImageOrLabel: function() { return /* binding */ drawImageOrLabel; },\n/* harmony export */ getTextDimensions: function() { return /* binding */ getTextDimensions; },\n/* harmony export */ measureAndCacheTextWidth: function() { return /* binding */ measureAndCacheTextWidth; },\n/* harmony export */ measureTextHeight: function() { return /* binding */ measureTextHeight; },\n/* harmony export */ measureTextWidth: function() { return /* binding */ measureTextWidth; },\n/* harmony export */ registerFont: function() { return /* binding */ registerFont; },\n/* harmony export */ rotateAtOffset: function() { return /* binding */ rotateAtOffset; },\n/* harmony export */ textHeights: function() { return /* binding */ textHeights; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Object.js */ \"./node_modules/ol/Object.js\");\n/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../has.js */ \"./node_modules/ol/has.js\");\n/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../obj.js */ \"./node_modules/ol/obj.js\");\n/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../dom.js */ \"./node_modules/ol/dom.js\");\n/* harmony import */ var _css_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../css.js */ \"./node_modules/ol/css.js\");\n\n/**\n * @module ol/render/canvas\n */\n\n\n\n\n\n\n/**\n * @typedef {'Circle' | 'Image' | 'LineString' | 'Polygon' | 'Text' | 'Default'} BuilderType\n */\n\n/**\n * @typedef {Object} FillState\n * @property {import(\"../colorlike.js\").ColorLike} fillStyle FillStyle.\n */\n\n/**\n * @typedef Label\n * @property {number} width Width.\n * @property {number} height Height.\n * @property {Array<string|number>} contextInstructions ContextInstructions.\n */\n\n/**\n * @typedef {Object} FillStrokeState\n * @property {import(\"../colorlike.js\").ColorLike} [currentFillStyle] Current FillStyle.\n * @property {import(\"../colorlike.js\").ColorLike} [currentStrokeStyle] Current StrokeStyle.\n * @property {CanvasLineCap} [currentLineCap] Current LineCap.\n * @property {Array<number>} currentLineDash Current LineDash.\n * @property {number} [currentLineDashOffset] Current LineDashOffset.\n * @property {CanvasLineJoin} [currentLineJoin] Current LineJoin.\n * @property {number} [currentLineWidth] Current LineWidth.\n * @property {number} [currentMiterLimit] Current MiterLimit.\n * @property {number} [lastStroke] Last stroke.\n * @property {import(\"../colorlike.js\").ColorLike} [fillStyle] FillStyle.\n * @property {import(\"../colorlike.js\").ColorLike} [strokeStyle] StrokeStyle.\n * @property {CanvasLineCap} [lineCap] LineCap.\n * @property {Array<number>} lineDash LineDash.\n * @property {number} [lineDashOffset] LineDashOffset.\n * @property {CanvasLineJoin} [lineJoin] LineJoin.\n * @property {number} [lineWidth] LineWidth.\n * @property {number} [miterLimit] MiterLimit.\n */\n\n/**\n * @typedef {Object} StrokeState\n * @property {CanvasLineCap} lineCap LineCap.\n * @property {Array<number>} lineDash LineDash.\n * @property {number} lineDashOffset LineDashOffset.\n * @property {CanvasLineJoin} lineJoin LineJoin.\n * @property {number} lineWidth LineWidth.\n * @property {number} miterLimit MiterLimit.\n * @property {import(\"../colorlike.js\").ColorLike} strokeStyle StrokeStyle.\n */\n\n/**\n * @typedef {Object} TextState\n * @property {string} font Font.\n * @property {CanvasTextAlign} [textAlign] TextAlign.\n * @property {number} [repeat] Repeat.\n * @property {import(\"../style/Text.js\").TextJustify} [justify] Justify.\n * @property {CanvasTextBaseline} textBaseline TextBaseline.\n * @property {import(\"../style/Text.js\").TextPlacement} [placement] Placement.\n * @property {number} [maxAngle] MaxAngle.\n * @property {boolean} [overflow] Overflow.\n * @property {import(\"../style/Fill.js\").default} [backgroundFill] BackgroundFill.\n * @property {import(\"../style/Stroke.js\").default} [backgroundStroke] BackgroundStroke.\n * @property {import(\"../size.js\").Size} [scale] Scale.\n * @property {Array<number>} [padding] Padding.\n */\n\n/**\n * @typedef {Object} SerializableInstructions\n * @property {Array<*>} instructions The rendering instructions.\n * @property {Array<*>} hitDetectionInstructions The rendering hit detection instructions.\n * @property {Array<number>} coordinates The array of all coordinates.\n * @property {!Object<string, TextState>} [textStates] The text states (decluttering).\n * @property {!Object<string, FillState>} [fillStates] The fill states (decluttering).\n * @property {!Object<string, StrokeState>} [strokeStates] The stroke states (decluttering).\n */\n\n/**\n * @typedef {Object<number, import(\"./canvas/Executor.js\").ReplayImageOrLabelArgs>} DeclutterImageWithText\n */\n\n/**\n * @const\n * @type {string}\n */\nconst defaultFont = '10px sans-serif';\n\n/**\n * @const\n * @type {string}\n */\nconst defaultFillStyle = '#000';\n\n/**\n * @const\n * @type {CanvasLineCap}\n */\nconst defaultLineCap = 'round';\n\n/**\n * @const\n * @type {Array<number>}\n */\nconst defaultLineDash = [];\n\n/**\n * @const\n * @type {number}\n */\nconst defaultLineDashOffset = 0;\n\n/**\n * @const\n * @type {CanvasLineJoin}\n */\nconst defaultLineJoin = 'round';\n\n/**\n * @const\n * @type {number}\n */\nconst defaultMiterLimit = 10;\n\n/**\n * @const\n * @type {import(\"../colorlike.js\").ColorLike}\n */\nconst defaultStrokeStyle = '#000';\n\n/**\n * @const\n * @type {CanvasTextAlign}\n */\nconst defaultTextAlign = 'center';\n\n/**\n * @const\n * @type {CanvasTextBaseline}\n */\nconst defaultTextBaseline = 'middle';\n\n/**\n * @const\n * @type {Array<number>}\n */\nconst defaultPadding = [0, 0, 0, 0];\n\n/**\n * @const\n * @type {number}\n */\nconst defaultLineWidth = 1;\n\n/**\n * @type {BaseObject}\n */\nconst checkedFonts = new _Object_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n\n/**\n * @type {CanvasRenderingContext2D}\n */\nlet measureContext = null;\n\n/**\n * @type {string}\n */\nlet measureFont;\n\n/**\n * @type {!Object<string, number>}\n */\nconst textHeights = {};\n\n/**\n * Clears the label cache when a font becomes available.\n * @param {string} fontSpec CSS font spec.\n */\nconst registerFont = function () {\n const retries = 100;\n const size = '32px ';\n const referenceFonts = ['monospace', 'serif'];\n const len = referenceFonts.length;\n const text = 'wmytzilWMYTZIL@#/&?$%10\\uF013';\n let interval, referenceWidth;\n\n /**\n * @param {string} fontStyle Css font-style\n * @param {string} fontWeight Css font-weight\n * @param {*} fontFamily Css font-family\n * @return {boolean} Font with style and weight is available\n */\n function isAvailable(fontStyle, fontWeight, fontFamily) {\n let available = true;\n for (let i = 0; i < len; ++i) {\n const referenceFont = referenceFonts[i];\n referenceWidth = measureTextWidth(fontStyle + ' ' + fontWeight + ' ' + size + referenceFont, text);\n if (fontFamily != referenceFont) {\n const width = measureTextWidth(fontStyle + ' ' + fontWeight + ' ' + size + fontFamily + ',' + referenceFont, text);\n // If width and referenceWidth are the same, then the fallback was used\n // instead of the font we wanted, so the font is not available.\n available = available && width != referenceWidth;\n }\n }\n if (available) {\n return true;\n }\n return false;\n }\n function check() {\n let done = true;\n const fonts = checkedFonts.getKeys();\n for (let i = 0, ii = fonts.length; i < ii; ++i) {\n const font = fonts[i];\n if (checkedFonts.get(font) < retries) {\n if (isAvailable.apply(this, font.split('\\n'))) {\n (0,_obj_js__WEBPACK_IMPORTED_MODULE_2__.clear)(textHeights);\n // Make sure that loaded fonts are picked up by Safari\n measureContext = null;\n measureFont = undefined;\n checkedFonts.set(font, retries);\n } else {\n checkedFonts.set(font, checkedFonts.get(font) + 1, true);\n done = false;\n }\n }\n }\n if (done) {\n clearInterval(interval);\n interval = undefined;\n }\n }\n return function (fontSpec) {\n const font = (0,_css_js__WEBPACK_IMPORTED_MODULE_3__.getFontParameters)(fontSpec);\n if (!font) {\n return;\n }\n const families = font.families;\n for (let i = 0, ii = families.length; i < ii; ++i) {\n const family = families[i];\n const key = font.style + '\\n' + font.weight + '\\n' + family;\n if (checkedFonts.get(key) === undefined) {\n checkedFonts.set(key, retries, true);\n if (!isAvailable(font.style, font.weight, family)) {\n checkedFonts.set(key, 0, true);\n if (interval === undefined) {\n interval = setInterval(check, 32);\n }\n }\n }\n }\n };\n}();\n\n/**\n * @param {string} font Font to use for measuring.\n * @return {import(\"../size.js\").Size} Measurement.\n */\nconst measureTextHeight = function () {\n /**\n * @type {HTMLDivElement}\n */\n let measureElement;\n return function (fontSpec) {\n let height = textHeights[fontSpec];\n if (height == undefined) {\n if (_has_js__WEBPACK_IMPORTED_MODULE_4__.WORKER_OFFSCREEN_CANVAS) {\n const font = (0,_css_js__WEBPACK_IMPORTED_MODULE_3__.getFontParameters)(fontSpec);\n const metrics = measureText(fontSpec, 'Žg');\n const lineHeight = isNaN(Number(font.lineHeight)) ? 1.2 : Number(font.lineHeight);\n height = lineHeight * (metrics.actualBoundingBoxAscent + metrics.actualBoundingBoxDescent);\n } else {\n if (!measureElement) {\n measureElement = document.createElement('div');\n measureElement.innerHTML = 'M';\n measureElement.style.minHeight = '0';\n measureElement.style.maxHeight = 'none';\n measureElement.style.height = 'auto';\n measureElement.style.padding = '0';\n measureElement.style.border = 'none';\n measureElement.style.position = 'absolute';\n measureElement.style.display = 'block';\n measureElement.style.left = '-99999px';\n }\n measureElement.style.font = fontSpec;\n document.body.appendChild(measureElement);\n height = measureElement.offsetHeight;\n document.body.removeChild(measureElement);\n }\n textHeights[fontSpec] = height;\n }\n return height;\n };\n}();\n\n/**\n * @param {string} font Font.\n * @param {string} text Text.\n * @return {TextMetrics} Text metrics.\n */\nfunction measureText(font, text) {\n if (!measureContext) {\n measureContext = (0,_dom_js__WEBPACK_IMPORTED_MODULE_5__.createCanvasContext2D)(1, 1);\n }\n if (font != measureFont) {\n measureContext.font = font;\n measureFont = measureContext.font;\n }\n return measureContext.measureText(text);\n}\n\n/**\n * @param {string} font Font.\n * @param {string} text Text.\n * @return {number} Width.\n */\nfunction measureTextWidth(font, text) {\n return measureText(font, text).width;\n}\n\n/**\n * Measure text width using a cache.\n * @param {string} font The font.\n * @param {string} text The text to measure.\n * @param {Object<string, number>} cache A lookup of cached widths by text.\n * @return {number} The text width.\n */\nfunction measureAndCacheTextWidth(font, text, cache) {\n if (text in cache) {\n return cache[text];\n }\n const width = text.split('\\n').reduce((prev, curr) => Math.max(prev, measureTextWidth(font, curr)), 0);\n cache[text] = width;\n return width;\n}\n\n/**\n * @param {TextState} baseStyle Base style.\n * @param {Array<string>} chunks Text chunks to measure.\n * @return {{width: number, height: number, widths: Array<number>, heights: Array<number>, lineWidths: Array<number>}}} Text metrics.\n */\nfunction getTextDimensions(baseStyle, chunks) {\n const widths = [];\n const heights = [];\n const lineWidths = [];\n let width = 0;\n let lineWidth = 0;\n let height = 0;\n let lineHeight = 0;\n for (let i = 0, ii = chunks.length; i <= ii; i += 2) {\n const text = chunks[i];\n if (text === '\\n' || i === ii) {\n width = Math.max(width, lineWidth);\n lineWidths.push(lineWidth);\n lineWidth = 0;\n height += lineHeight;\n continue;\n }\n const font = chunks[i + 1] || baseStyle.font;\n const currentWidth = measureTextWidth(font, text);\n widths.push(currentWidth);\n lineWidth += currentWidth;\n const currentHeight = measureTextHeight(font);\n heights.push(currentHeight);\n lineHeight = Math.max(lineHeight, currentHeight);\n }\n return {\n width,\n height,\n widths,\n heights,\n lineWidths\n };\n}\n\n/**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {number} rotation Rotation.\n * @param {number} offsetX X offset.\n * @param {number} offsetY Y offset.\n */\nfunction rotateAtOffset(context, rotation, offsetX, offsetY) {\n if (rotation !== 0) {\n context.translate(offsetX, offsetY);\n context.rotate(rotation);\n context.translate(-offsetX, -offsetY);\n }\n}\n\n/**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../transform.js\").Transform|null} transform Transform.\n * @param {number} opacity Opacity.\n * @param {Label|HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} labelOrImage Label.\n * @param {number} originX Origin X.\n * @param {number} originY Origin Y.\n * @param {number} w Width.\n * @param {number} h Height.\n * @param {number} x X.\n * @param {number} y Y.\n * @param {import(\"../size.js\").Size} scale Scale.\n */\nfunction drawImageOrLabel(context, transform, opacity, labelOrImage, originX, originY, w, h, x, y, scale) {\n context.save();\n if (opacity !== 1) {\n context.globalAlpha *= opacity;\n }\n if (transform) {\n context.transform.apply(context, transform);\n }\n if (/** @type {*} */labelOrImage.contextInstructions) {\n // label\n context.translate(x, y);\n context.scale(scale[0], scale[1]);\n executeLabelInstructions(/** @type {Label} */labelOrImage, context);\n } else if (scale[0] < 0 || scale[1] < 0) {\n // flipped image\n context.translate(x, y);\n context.scale(scale[0], scale[1]);\n context.drawImage(/** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */\n labelOrImage, originX, originY, w, h, 0, 0, w, h);\n } else {\n // if image not flipped translate and scale can be avoided\n context.drawImage(/** @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement} */\n labelOrImage, originX, originY, w, h, x, y, w * scale[0], h * scale[1]);\n }\n context.restore();\n}\n\n/**\n * @param {Label} label Label.\n * @param {CanvasRenderingContext2D} context Context.\n */\nfunction executeLabelInstructions(label, context) {\n const contextInstructions = label.contextInstructions;\n for (let i = 0, ii = contextInstructions.length; i < ii; i += 2) {\n if (Array.isArray(contextInstructions[i + 1])) {\n context[contextInstructions[i]].apply(context, contextInstructions[i + 1]);\n } else {\n context[contextInstructions[i]] = contextInstructions[i + 1];\n }\n }\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/canvas.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/canvas/Builder.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/ol/render/canvas/Builder.js ***!
|
||
\**************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Instruction_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Instruction.js */ \"./node_modules/ol/render/canvas/Instruction.js\");\n/* harmony import */ var _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../extent/Relationship.js */ \"./node_modules/ol/extent/Relationship.js\");\n/* harmony import */ var _VectorContext_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VectorContext.js */ \"./node_modules/ol/render/VectorContext.js\");\n/* harmony import */ var _colorlike_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../colorlike.js */ \"./node_modules/ol/colorlike.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _canvas_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../canvas.js */ \"./node_modules/ol/render/canvas.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _geom_flat_inflate_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../geom/flat/inflate.js */ \"./node_modules/ol/geom/flat/inflate.js\");\n\n/**\n * @module ol/render/canvas/Builder\n */\n\n\n\n\n\n\n\n\nclass CanvasBuilder extends _VectorContext_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {number} tolerance Tolerance.\n * @param {import(\"../../extent.js\").Extent} maxExtent Maximum extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n */\n constructor(tolerance, maxExtent, resolution, pixelRatio) {\n super();\n\n /**\n * @protected\n * @type {number}\n */\n this.tolerance = tolerance;\n\n /**\n * @protected\n * @const\n * @type {import(\"../../extent.js\").Extent}\n */\n this.maxExtent = maxExtent;\n\n /**\n * @protected\n * @type {number}\n */\n this.pixelRatio = pixelRatio;\n\n /**\n * @protected\n * @type {number}\n */\n this.maxLineWidth = 0;\n\n /**\n * @protected\n * @const\n * @type {number}\n */\n this.resolution = resolution;\n\n /**\n * @private\n * @type {Array<*>}\n */\n this.beginGeometryInstruction1_ = null;\n\n /**\n * @private\n * @type {Array<*>}\n */\n this.beginGeometryInstruction2_ = null;\n\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n this.bufferedMaxExtent_ = null;\n\n /**\n * @protected\n * @type {Array<*>}\n */\n this.instructions = [];\n\n /**\n * @protected\n * @type {Array<number>}\n */\n this.coordinates = [];\n\n /**\n * @private\n * @type {import(\"../../coordinate.js\").Coordinate}\n */\n this.tmpCoordinate_ = [];\n\n /**\n * @protected\n * @type {Array<*>}\n */\n this.hitDetectionInstructions = [];\n\n /**\n * @protected\n * @type {import(\"../canvas.js\").FillStrokeState}\n */\n this.state = /** @type {import(\"../canvas.js\").FillStrokeState} */{};\n }\n\n /**\n * @protected\n * @param {Array<number>} dashArray Dash array.\n * @return {Array<number>} Dash array with pixel ratio applied\n */\n applyPixelRatio(dashArray) {\n const pixelRatio = this.pixelRatio;\n return pixelRatio == 1 ? dashArray : dashArray.map(function (dash) {\n return dash * pixelRatio;\n });\n }\n\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} stride Stride.\n * @protected\n * @return {number} My end\n */\n appendFlatPointCoordinates(flatCoordinates, stride) {\n const extent = this.getBufferedMaxExtent();\n const tmpCoord = this.tmpCoordinate_;\n const coordinates = this.coordinates;\n let myEnd = coordinates.length;\n for (let i = 0, ii = flatCoordinates.length; i < ii; i += stride) {\n tmpCoord[0] = flatCoordinates[i];\n tmpCoord[1] = flatCoordinates[i + 1];\n if ((0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.containsCoordinate)(extent, tmpCoord)) {\n coordinates[myEnd++] = tmpCoord[0];\n coordinates[myEnd++] = tmpCoord[1];\n }\n }\n return myEnd;\n }\n\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {boolean} closed Last input coordinate equals first.\n * @param {boolean} skipFirst Skip first coordinate.\n * @protected\n * @return {number} My end.\n */\n appendFlatLineCoordinates(flatCoordinates, offset, end, stride, closed, skipFirst) {\n const coordinates = this.coordinates;\n let myEnd = coordinates.length;\n const extent = this.getBufferedMaxExtent();\n if (skipFirst) {\n offset += stride;\n }\n let lastXCoord = flatCoordinates[offset];\n let lastYCoord = flatCoordinates[offset + 1];\n const nextCoord = this.tmpCoordinate_;\n let skipped = true;\n let i, lastRel, nextRel;\n for (i = offset + stride; i < end; i += stride) {\n nextCoord[0] = flatCoordinates[i];\n nextCoord[1] = flatCoordinates[i + 1];\n nextRel = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.coordinateRelationship)(extent, nextCoord);\n if (nextRel !== lastRel) {\n if (skipped) {\n coordinates[myEnd++] = lastXCoord;\n coordinates[myEnd++] = lastYCoord;\n skipped = false;\n }\n coordinates[myEnd++] = nextCoord[0];\n coordinates[myEnd++] = nextCoord[1];\n } else if (nextRel === _extent_Relationship_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].INTERSECTING) {\n coordinates[myEnd++] = nextCoord[0];\n coordinates[myEnd++] = nextCoord[1];\n skipped = false;\n } else {\n skipped = true;\n }\n lastXCoord = nextCoord[0];\n lastYCoord = nextCoord[1];\n lastRel = nextRel;\n }\n\n // Last coordinate equals first or only one point to append:\n if (closed && skipped || i === offset + stride) {\n coordinates[myEnd++] = lastXCoord;\n coordinates[myEnd++] = lastYCoord;\n }\n return myEnd;\n }\n\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @param {Array<number>} builderEnds Builder ends.\n * @return {number} Offset.\n */\n drawCustomCoordinates_(flatCoordinates, offset, ends, stride, builderEnds) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n const end = ends[i];\n const builderEnd = this.appendFlatLineCoordinates(flatCoordinates, offset, end, stride, false, false);\n builderEnds.push(builderEnd);\n offset = end;\n }\n return offset;\n }\n\n /**\n * @param {import(\"../../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n * @param {Function} renderer Renderer.\n * @param {Function} hitDetectionRenderer Renderer.\n */\n drawCustom(geometry, feature, renderer, hitDetectionRenderer) {\n this.beginGeometry(geometry, feature);\n const type = geometry.getType();\n const stride = geometry.getStride();\n const builderBegin = this.coordinates.length;\n let flatCoordinates, builderEnd, builderEnds, builderEndss;\n let offset;\n switch (type) {\n case 'MultiPolygon':\n flatCoordinates = /** @type {import(\"../../geom/MultiPolygon.js\").default} */geometry.getOrientedFlatCoordinates();\n builderEndss = [];\n const endss = /** @type {import(\"../../geom/MultiPolygon.js\").default} */geometry.getEndss();\n offset = 0;\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const myEnds = [];\n offset = this.drawCustomCoordinates_(flatCoordinates, offset, endss[i], stride, myEnds);\n builderEndss.push(myEnds);\n }\n this.instructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CUSTOM, builderBegin, builderEndss, geometry, renderer, _geom_flat_inflate_js__WEBPACK_IMPORTED_MODULE_5__.inflateMultiCoordinatesArray]);\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CUSTOM, builderBegin, builderEndss, geometry, hitDetectionRenderer || renderer, _geom_flat_inflate_js__WEBPACK_IMPORTED_MODULE_5__.inflateMultiCoordinatesArray]);\n break;\n case 'Polygon':\n case 'MultiLineString':\n builderEnds = [];\n flatCoordinates = type == 'Polygon' ? /** @type {import(\"../../geom/Polygon.js\").default} */geometry.getOrientedFlatCoordinates() : geometry.getFlatCoordinates();\n offset = this.drawCustomCoordinates_(flatCoordinates, 0, /** @type {import(\"../../geom/Polygon.js\").default|import(\"../../geom/MultiLineString.js\").default} */geometry.getEnds(), stride, builderEnds);\n this.instructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CUSTOM, builderBegin, builderEnds, geometry, renderer, _geom_flat_inflate_js__WEBPACK_IMPORTED_MODULE_5__.inflateCoordinatesArray]);\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CUSTOM, builderBegin, builderEnds, geometry, hitDetectionRenderer || renderer, _geom_flat_inflate_js__WEBPACK_IMPORTED_MODULE_5__.inflateCoordinatesArray]);\n break;\n case 'LineString':\n case 'Circle':\n flatCoordinates = geometry.getFlatCoordinates();\n builderEnd = this.appendFlatLineCoordinates(flatCoordinates, 0, flatCoordinates.length, stride, false, false);\n this.instructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CUSTOM, builderBegin, builderEnd, geometry, renderer, _geom_flat_inflate_js__WEBPACK_IMPORTED_MODULE_5__.inflateCoordinates]);\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CUSTOM, builderBegin, builderEnd, geometry, hitDetectionRenderer || renderer, _geom_flat_inflate_js__WEBPACK_IMPORTED_MODULE_5__.inflateCoordinates]);\n break;\n case 'MultiPoint':\n flatCoordinates = geometry.getFlatCoordinates();\n builderEnd = this.appendFlatPointCoordinates(flatCoordinates, stride);\n if (builderEnd > builderBegin) {\n this.instructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CUSTOM, builderBegin, builderEnd, geometry, renderer, _geom_flat_inflate_js__WEBPACK_IMPORTED_MODULE_5__.inflateCoordinates]);\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CUSTOM, builderBegin, builderEnd, geometry, hitDetectionRenderer || renderer, _geom_flat_inflate_js__WEBPACK_IMPORTED_MODULE_5__.inflateCoordinates]);\n }\n break;\n case 'Point':\n flatCoordinates = geometry.getFlatCoordinates();\n this.coordinates.push(flatCoordinates[0], flatCoordinates[1]);\n builderEnd = this.coordinates.length;\n this.instructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CUSTOM, builderBegin, builderEnd, geometry, renderer]);\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CUSTOM, builderBegin, builderEnd, geometry, hitDetectionRenderer || renderer]);\n break;\n default:\n }\n this.endGeometry(feature);\n }\n\n /**\n * @protected\n * @param {import(\"../../geom/Geometry\").default|import(\"../Feature.js\").default} geometry The geometry.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n */\n beginGeometry(geometry, feature) {\n this.beginGeometryInstruction1_ = [_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].BEGIN_GEOMETRY, feature, 0, geometry];\n this.instructions.push(this.beginGeometryInstruction1_);\n this.beginGeometryInstruction2_ = [_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].BEGIN_GEOMETRY, feature, 0, geometry];\n this.hitDetectionInstructions.push(this.beginGeometryInstruction2_);\n }\n\n /**\n * @return {import(\"../canvas.js\").SerializableInstructions} the serializable instructions.\n */\n finish() {\n return {\n instructions: this.instructions,\n hitDetectionInstructions: this.hitDetectionInstructions,\n coordinates: this.coordinates\n };\n }\n\n /**\n * Reverse the hit detection instructions.\n */\n reverseHitDetectionInstructions() {\n const hitDetectionInstructions = this.hitDetectionInstructions;\n // step 1 - reverse array\n hitDetectionInstructions.reverse();\n // step 2 - reverse instructions within geometry blocks\n let i;\n const n = hitDetectionInstructions.length;\n let instruction;\n let type;\n let begin = -1;\n for (i = 0; i < n; ++i) {\n instruction = hitDetectionInstructions[i];\n type = /** @type {import(\"./Instruction.js\").default} */instruction[0];\n if (type == _Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].END_GEOMETRY) {\n begin = i;\n } else if (type == _Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].BEGIN_GEOMETRY) {\n instruction[2] = i;\n (0,_array_js__WEBPACK_IMPORTED_MODULE_6__.reverseSubArray)(this.hitDetectionInstructions, begin, i);\n begin = -1;\n }\n }\n }\n\n /**\n * @param {import(\"../../style/Fill.js\").default} fillStyle Fill style.\n * @param {import(\"../../style/Stroke.js\").default} strokeStyle Stroke style.\n */\n setFillStrokeStyle(fillStyle, strokeStyle) {\n const state = this.state;\n if (fillStyle) {\n const fillStyleColor = fillStyle.getColor();\n state.fillStyle = (0,_colorlike_js__WEBPACK_IMPORTED_MODULE_7__.asColorLike)(fillStyleColor ? fillStyleColor : _canvas_js__WEBPACK_IMPORTED_MODULE_8__.defaultFillStyle);\n } else {\n state.fillStyle = undefined;\n }\n if (strokeStyle) {\n const strokeStyleColor = strokeStyle.getColor();\n state.strokeStyle = (0,_colorlike_js__WEBPACK_IMPORTED_MODULE_7__.asColorLike)(strokeStyleColor ? strokeStyleColor : _canvas_js__WEBPACK_IMPORTED_MODULE_8__.defaultStrokeStyle);\n const strokeStyleLineCap = strokeStyle.getLineCap();\n state.lineCap = strokeStyleLineCap !== undefined ? strokeStyleLineCap : _canvas_js__WEBPACK_IMPORTED_MODULE_8__.defaultLineCap;\n const strokeStyleLineDash = strokeStyle.getLineDash();\n state.lineDash = strokeStyleLineDash ? strokeStyleLineDash.slice() : _canvas_js__WEBPACK_IMPORTED_MODULE_8__.defaultLineDash;\n const strokeStyleLineDashOffset = strokeStyle.getLineDashOffset();\n state.lineDashOffset = strokeStyleLineDashOffset ? strokeStyleLineDashOffset : _canvas_js__WEBPACK_IMPORTED_MODULE_8__.defaultLineDashOffset;\n const strokeStyleLineJoin = strokeStyle.getLineJoin();\n state.lineJoin = strokeStyleLineJoin !== undefined ? strokeStyleLineJoin : _canvas_js__WEBPACK_IMPORTED_MODULE_8__.defaultLineJoin;\n const strokeStyleWidth = strokeStyle.getWidth();\n state.lineWidth = strokeStyleWidth !== undefined ? strokeStyleWidth : _canvas_js__WEBPACK_IMPORTED_MODULE_8__.defaultLineWidth;\n const strokeStyleMiterLimit = strokeStyle.getMiterLimit();\n state.miterLimit = strokeStyleMiterLimit !== undefined ? strokeStyleMiterLimit : _canvas_js__WEBPACK_IMPORTED_MODULE_8__.defaultMiterLimit;\n if (state.lineWidth > this.maxLineWidth) {\n this.maxLineWidth = state.lineWidth;\n // invalidate the buffered max extent cache\n this.bufferedMaxExtent_ = null;\n }\n } else {\n state.strokeStyle = undefined;\n state.lineCap = undefined;\n state.lineDash = null;\n state.lineDashOffset = undefined;\n state.lineJoin = undefined;\n state.lineWidth = undefined;\n state.miterLimit = undefined;\n }\n }\n\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n * @return {Array<*>} Fill instruction.\n */\n createFill(state) {\n const fillStyle = state.fillStyle;\n /** @type {Array<*>} */\n const fillInstruction = [_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SET_FILL_STYLE, fillStyle];\n if (typeof fillStyle !== 'string') {\n // Fill is a pattern or gradient - align it!\n fillInstruction.push(true);\n }\n return fillInstruction;\n }\n\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n */\n applyStroke(state) {\n this.instructions.push(this.createStroke(state));\n }\n\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n * @return {Array<*>} Stroke instruction.\n */\n createStroke(state) {\n return [_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].SET_STROKE_STYLE, state.strokeStyle, state.lineWidth * this.pixelRatio, state.lineCap, state.lineJoin, state.miterLimit, this.applyPixelRatio(state.lineDash), state.lineDashOffset * this.pixelRatio];\n }\n\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n * @param {function(this:CanvasBuilder, import(\"../canvas.js\").FillStrokeState):Array<*>} createFill Create fill.\n */\n updateFillStyle(state, createFill) {\n const fillStyle = state.fillStyle;\n if (typeof fillStyle !== 'string' || state.currentFillStyle != fillStyle) {\n if (fillStyle !== undefined) {\n this.instructions.push(createFill.call(this, state));\n }\n state.currentFillStyle = fillStyle;\n }\n }\n\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n * @param {function(this:CanvasBuilder, import(\"../canvas.js\").FillStrokeState): void} applyStroke Apply stroke.\n */\n updateStrokeStyle(state, applyStroke) {\n const strokeStyle = state.strokeStyle;\n const lineCap = state.lineCap;\n const lineDash = state.lineDash;\n const lineDashOffset = state.lineDashOffset;\n const lineJoin = state.lineJoin;\n const lineWidth = state.lineWidth;\n const miterLimit = state.miterLimit;\n if (state.currentStrokeStyle != strokeStyle || state.currentLineCap != lineCap || lineDash != state.currentLineDash && !(0,_array_js__WEBPACK_IMPORTED_MODULE_6__.equals)(state.currentLineDash, lineDash) || state.currentLineDashOffset != lineDashOffset || state.currentLineJoin != lineJoin || state.currentLineWidth != lineWidth || state.currentMiterLimit != miterLimit) {\n if (strokeStyle !== undefined) {\n applyStroke.call(this, state);\n }\n state.currentStrokeStyle = strokeStyle;\n state.currentLineCap = lineCap;\n state.currentLineDash = lineDash;\n state.currentLineDashOffset = lineDashOffset;\n state.currentLineJoin = lineJoin;\n state.currentLineWidth = lineWidth;\n state.currentMiterLimit = miterLimit;\n }\n }\n\n /**\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n */\n endGeometry(feature) {\n this.beginGeometryInstruction1_[2] = this.instructions.length;\n this.beginGeometryInstruction1_ = null;\n this.beginGeometryInstruction2_[2] = this.hitDetectionInstructions.length;\n this.beginGeometryInstruction2_ = null;\n const endGeometryInstruction = [_Instruction_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].END_GEOMETRY, feature];\n this.instructions.push(endGeometryInstruction);\n this.hitDetectionInstructions.push(endGeometryInstruction);\n }\n\n /**\n * Get the buffered rendering extent. Rendering will be clipped to the extent\n * provided to the constructor. To account for symbolizers that may intersect\n * this extent, we calculate a buffered extent (e.g. based on stroke width).\n * @return {import(\"../../extent.js\").Extent} The buffered rendering extent.\n * @protected\n */\n getBufferedMaxExtent() {\n if (!this.bufferedMaxExtent_) {\n this.bufferedMaxExtent_ = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.clone)(this.maxExtent);\n if (this.maxLineWidth > 0) {\n const width = this.resolution * (this.maxLineWidth + 1) / 2;\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.buffer)(this.bufferedMaxExtent_, width, this.bufferedMaxExtent_);\n }\n }\n return this.bufferedMaxExtent_;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (CanvasBuilder);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/canvas/Builder.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/canvas/BuilderGroup.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ol/render/canvas/BuilderGroup.js ***!
|
||
\*******************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Builder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Builder.js */ \"./node_modules/ol/render/canvas/Builder.js\");\n/* harmony import */ var _ImageBuilder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ImageBuilder.js */ \"./node_modules/ol/render/canvas/ImageBuilder.js\");\n/* harmony import */ var _LineStringBuilder_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./LineStringBuilder.js */ \"./node_modules/ol/render/canvas/LineStringBuilder.js\");\n/* harmony import */ var _PolygonBuilder_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PolygonBuilder.js */ \"./node_modules/ol/render/canvas/PolygonBuilder.js\");\n/* harmony import */ var _TextBuilder_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TextBuilder.js */ \"./node_modules/ol/render/canvas/TextBuilder.js\");\n/**\n * @module ol/render/canvas/BuilderGroup\n */\n\n\n\n\n\n\n\n/**\n * @type {Object<import(\"../canvas.js\").BuilderType, typeof Builder>}\n */\nconst BATCH_CONSTRUCTORS = {\n 'Circle': _PolygonBuilder_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n 'Default': _Builder_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n 'Image': _ImageBuilder_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n 'LineString': _LineStringBuilder_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n 'Polygon': _PolygonBuilder_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n 'Text': _TextBuilder_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n};\nclass BuilderGroup {\n /**\n * @param {number} tolerance Tolerance.\n * @param {import(\"../../extent.js\").Extent} maxExtent Max extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n */\n constructor(tolerance, maxExtent, resolution, pixelRatio) {\n /**\n * @private\n * @type {number}\n */\n this.tolerance_ = tolerance;\n\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n this.maxExtent_ = maxExtent;\n\n /**\n * @private\n * @type {number}\n */\n this.pixelRatio_ = pixelRatio;\n\n /**\n * @private\n * @type {number}\n */\n this.resolution_ = resolution;\n\n /**\n * @private\n * @type {!Object<string, !Object<import(\"../canvas.js\").BuilderType, Builder>>}\n */\n this.buildersByZIndex_ = {};\n }\n\n /**\n * @return {!Object<string, !Object<import(\"../canvas.js\").BuilderType, import(\"./Builder.js\").SerializableInstructions>>} The serializable instructions\n */\n finish() {\n const builderInstructions = {};\n for (const zKey in this.buildersByZIndex_) {\n builderInstructions[zKey] = builderInstructions[zKey] || {};\n const builders = this.buildersByZIndex_[zKey];\n for (const builderKey in builders) {\n const builderInstruction = builders[builderKey].finish();\n builderInstructions[zKey][builderKey] = builderInstruction;\n }\n }\n return builderInstructions;\n }\n\n /**\n * @param {number|undefined} zIndex Z index.\n * @param {import(\"../canvas.js\").BuilderType} builderType Replay type.\n * @return {import(\"../VectorContext.js\").default} Replay.\n */\n getBuilder(zIndex, builderType) {\n const zIndexKey = zIndex !== undefined ? zIndex.toString() : '0';\n let replays = this.buildersByZIndex_[zIndexKey];\n if (replays === undefined) {\n replays = {};\n this.buildersByZIndex_[zIndexKey] = replays;\n }\n let replay = replays[builderType];\n if (replay === undefined) {\n const Constructor = BATCH_CONSTRUCTORS[builderType];\n replay = new Constructor(this.tolerance_, this.maxExtent_, this.resolution_, this.pixelRatio_);\n replays[builderType] = replay;\n }\n return replay;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (BuilderGroup);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/canvas/BuilderGroup.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/canvas/Executor.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/ol/render/canvas/Executor.js ***!
|
||
\***************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Instruction_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Instruction.js */ \"./node_modules/ol/render/canvas/Instruction.js\");\n/* harmony import */ var _TextBuilder_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TextBuilder.js */ \"./node_modules/ol/render/canvas/TextBuilder.js\");\n/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../transform.js */ \"./node_modules/ol/transform.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _canvas_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../canvas.js */ \"./node_modules/ol/render/canvas.js\");\n/* harmony import */ var _geom_flat_textpath_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../geom/flat/textpath.js */ \"./node_modules/ol/geom/flat/textpath.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _geom_flat_length_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../geom/flat/length.js */ \"./node_modules/ol/geom/flat/length.js\");\n/* harmony import */ var _geom_flat_transform_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../geom/flat/transform.js */ \"./node_modules/ol/geom/flat/transform.js\");\n\n/**\n * @module ol/render/canvas/Executor\n */\n\n\n\n\n\n\n\n\n\n\n/**\n * @typedef {Object} BBox\n * @property {number} minX Minimal x.\n * @property {number} minY Minimal y.\n * @property {number} maxX Maximal x.\n * @property {number} maxY Maximal y\n * @property {*} value Value.\n */\n\n/**\n * @typedef {Object} ImageOrLabelDimensions\n * @property {number} drawImageX DrawImageX.\n * @property {number} drawImageY DrawImageY.\n * @property {number} drawImageW DrawImageW.\n * @property {number} drawImageH DrawImageH.\n * @property {number} originX OriginX.\n * @property {number} originY OriginY.\n * @property {Array<number>} scale Scale.\n * @property {BBox} declutterBox DeclutterBox.\n * @property {import(\"../../transform.js\").Transform} canvasTransform CanvasTransform.\n */\n\n/**\n * @typedef {{0: CanvasRenderingContext2D, 1: number, 2: import(\"../canvas.js\").Label|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement, 3: ImageOrLabelDimensions, 4: number, 5: Array<*>, 6: Array<*>}} ReplayImageOrLabelArgs\n */\n\n/**\n * @template T\n * @typedef {function(import(\"../../Feature.js\").FeatureLike, import(\"../../geom/SimpleGeometry.js\").default): T} FeatureCallback\n */\n\n/**\n * @type {import(\"../../extent.js\").Extent}\n */\nconst tmpExtent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.createEmpty)();\n\n/** @type {import(\"../../coordinate.js\").Coordinate} */\nconst p1 = [];\n/** @type {import(\"../../coordinate.js\").Coordinate} */\nconst p2 = [];\n/** @type {import(\"../../coordinate.js\").Coordinate} */\nconst p3 = [];\n/** @type {import(\"../../coordinate.js\").Coordinate} */\nconst p4 = [];\n\n/**\n * @param {ReplayImageOrLabelArgs} replayImageOrLabelArgs Arguments to replayImageOrLabel\n * @return {BBox} Declutter bbox.\n */\nfunction getDeclutterBox(replayImageOrLabelArgs) {\n return replayImageOrLabelArgs[3].declutterBox;\n}\nconst rtlRegEx = new RegExp(/* eslint-disable prettier/prettier */\n'[' + String.fromCharCode(0x00591) + '-' + String.fromCharCode(0x008ff) + String.fromCharCode(0x0fb1d) + '-' + String.fromCharCode(0x0fdff) + String.fromCharCode(0x0fe70) + '-' + String.fromCharCode(0x0fefc) + String.fromCharCode(0x10800) + '-' + String.fromCharCode(0x10fff) + String.fromCharCode(0x1e800) + '-' + String.fromCharCode(0x1efff) + ']'\n/* eslint-enable prettier/prettier */);\n\n/**\n * @param {string} text Text.\n * @param {CanvasTextAlign} align Alignment.\n * @return {number} Text alignment.\n */\nfunction horizontalTextAlign(text, align) {\n if (align === 'start') {\n align = rtlRegEx.test(text) ? 'right' : 'left';\n } else if (align === 'end') {\n align = rtlRegEx.test(text) ? 'left' : 'right';\n }\n return _TextBuilder_js__WEBPACK_IMPORTED_MODULE_2__.TEXT_ALIGN[align];\n}\n\n/**\n * @param {Array<string>} acc Accumulator.\n * @param {string} line Line of text.\n * @param {number} i Index\n * @return {Array<string>} Accumulator.\n */\nfunction createTextChunks(acc, line, i) {\n if (i > 0) {\n acc.push('\\n', '');\n }\n acc.push(line, '');\n return acc;\n}\nclass Executor {\n /**\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {boolean} overlaps The replay can have overlapping geometries.\n * @param {import(\"../canvas.js\").SerializableInstructions} instructions The serializable instructions\n */\n constructor(resolution, pixelRatio, overlaps, instructions) {\n /**\n * @protected\n * @type {boolean}\n */\n this.overlaps = overlaps;\n\n /**\n * @protected\n * @type {number}\n */\n this.pixelRatio = pixelRatio;\n\n /**\n * @protected\n * @const\n * @type {number}\n */\n this.resolution = resolution;\n\n /**\n * @private\n * @type {boolean}\n */\n this.alignFill_;\n\n /**\n * @protected\n * @type {Array<*>}\n */\n this.instructions = instructions.instructions;\n\n /**\n * @protected\n * @type {Array<number>}\n */\n this.coordinates = instructions.coordinates;\n\n /**\n * @private\n * @type {!Object<number,import(\"../../coordinate.js\").Coordinate|Array<import(\"../../coordinate.js\").Coordinate>|Array<Array<import(\"../../coordinate.js\").Coordinate>>>}\n */\n this.coordinateCache_ = {};\n\n /**\n * @private\n * @type {!import(\"../../transform.js\").Transform}\n */\n this.renderedTransform_ = (0,_transform_js__WEBPACK_IMPORTED_MODULE_3__.create)();\n\n /**\n * @protected\n * @type {Array<*>}\n */\n this.hitDetectionInstructions = instructions.hitDetectionInstructions;\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.pixelCoordinates_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.viewRotation_ = 0;\n\n /**\n * @type {!Object<string, import(\"../canvas.js\").FillState>}\n */\n this.fillStates = instructions.fillStates || {};\n\n /**\n * @type {!Object<string, import(\"../canvas.js\").StrokeState>}\n */\n this.strokeStates = instructions.strokeStates || {};\n\n /**\n * @type {!Object<string, import(\"../canvas.js\").TextState>}\n */\n this.textStates = instructions.textStates || {};\n\n /**\n * @private\n * @type {Object<string, Object<string, number>>}\n */\n this.widths_ = {};\n\n /**\n * @private\n * @type {Object<string, import(\"../canvas.js\").Label>}\n */\n this.labels_ = {};\n }\n\n /**\n * @param {string|Array<string>} text Text.\n * @param {string} textKey Text style key.\n * @param {string} fillKey Fill style key.\n * @param {string} strokeKey Stroke style key.\n * @return {import(\"../canvas.js\").Label} Label.\n */\n createLabel(text, textKey, fillKey, strokeKey) {\n const key = text + textKey + fillKey + strokeKey;\n if (this.labels_[key]) {\n return this.labels_[key];\n }\n const strokeState = strokeKey ? this.strokeStates[strokeKey] : null;\n const fillState = fillKey ? this.fillStates[fillKey] : null;\n const textState = this.textStates[textKey];\n const pixelRatio = this.pixelRatio;\n const scale = [textState.scale[0] * pixelRatio, textState.scale[1] * pixelRatio];\n const textIsArray = Array.isArray(text);\n const align = textState.justify ? _TextBuilder_js__WEBPACK_IMPORTED_MODULE_2__.TEXT_ALIGN[textState.justify] : horizontalTextAlign(Array.isArray(text) ? text[0] : text, textState.textAlign || _canvas_js__WEBPACK_IMPORTED_MODULE_4__.defaultTextAlign);\n const strokeWidth = strokeKey && strokeState.lineWidth ? strokeState.lineWidth : 0;\n const chunks = textIsArray ? text : text.split('\\n').reduce(createTextChunks, []);\n const {\n width,\n height,\n widths,\n heights,\n lineWidths\n } = (0,_canvas_js__WEBPACK_IMPORTED_MODULE_4__.getTextDimensions)(textState, chunks);\n const renderWidth = width + strokeWidth;\n const contextInstructions = [];\n // make canvas 2 pixels wider to account for italic text width measurement errors\n const w = (renderWidth + 2) * scale[0];\n const h = (height + strokeWidth) * scale[1];\n /** @type {import(\"../canvas.js\").Label} */\n const label = {\n width: w < 0 ? Math.floor(w) : Math.ceil(w),\n height: h < 0 ? Math.floor(h) : Math.ceil(h),\n contextInstructions: contextInstructions\n };\n if (scale[0] != 1 || scale[1] != 1) {\n contextInstructions.push('scale', scale);\n }\n if (strokeKey) {\n contextInstructions.push('strokeStyle', strokeState.strokeStyle);\n contextInstructions.push('lineWidth', strokeWidth);\n contextInstructions.push('lineCap', strokeState.lineCap);\n contextInstructions.push('lineJoin', strokeState.lineJoin);\n contextInstructions.push('miterLimit', strokeState.miterLimit);\n contextInstructions.push('setLineDash', [strokeState.lineDash]);\n contextInstructions.push('lineDashOffset', strokeState.lineDashOffset);\n }\n if (fillKey) {\n contextInstructions.push('fillStyle', fillState.fillStyle);\n }\n contextInstructions.push('textBaseline', 'middle');\n contextInstructions.push('textAlign', 'center');\n const leftRight = 0.5 - align;\n let x = align * renderWidth + leftRight * strokeWidth;\n const strokeInstructions = [];\n const fillInstructions = [];\n let lineHeight = 0;\n let lineOffset = 0;\n let widthHeightIndex = 0;\n let lineWidthIndex = 0;\n let previousFont;\n for (let i = 0, ii = chunks.length; i < ii; i += 2) {\n const text = chunks[i];\n if (text === '\\n') {\n lineOffset += lineHeight;\n lineHeight = 0;\n x = align * renderWidth + leftRight * strokeWidth;\n ++lineWidthIndex;\n continue;\n }\n const font = chunks[i + 1] || textState.font;\n if (font !== previousFont) {\n if (strokeKey) {\n strokeInstructions.push('font', font);\n }\n if (fillKey) {\n fillInstructions.push('font', font);\n }\n previousFont = font;\n }\n lineHeight = Math.max(lineHeight, heights[widthHeightIndex]);\n const fillStrokeArgs = [text, x + leftRight * widths[widthHeightIndex] + align * (widths[widthHeightIndex] - lineWidths[lineWidthIndex]), 0.5 * (strokeWidth + lineHeight) + lineOffset];\n x += widths[widthHeightIndex];\n if (strokeKey) {\n strokeInstructions.push('strokeText', fillStrokeArgs);\n }\n if (fillKey) {\n fillInstructions.push('fillText', fillStrokeArgs);\n }\n ++widthHeightIndex;\n }\n Array.prototype.push.apply(contextInstructions, strokeInstructions);\n Array.prototype.push.apply(contextInstructions, fillInstructions);\n this.labels_[key] = label;\n return label;\n }\n\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../coordinate.js\").Coordinate} p1 1st point of the background box.\n * @param {import(\"../../coordinate.js\").Coordinate} p2 2nd point of the background box.\n * @param {import(\"../../coordinate.js\").Coordinate} p3 3rd point of the background box.\n * @param {import(\"../../coordinate.js\").Coordinate} p4 4th point of the background box.\n * @param {Array<*>} fillInstruction Fill instruction.\n * @param {Array<*>} strokeInstruction Stroke instruction.\n */\n replayTextBackground_(context, p1, p2, p3, p4, fillInstruction, strokeInstruction) {\n context.beginPath();\n context.moveTo.apply(context, p1);\n context.lineTo.apply(context, p2);\n context.lineTo.apply(context, p3);\n context.lineTo.apply(context, p4);\n context.lineTo.apply(context, p1);\n if (fillInstruction) {\n this.alignFill_ = /** @type {boolean} */fillInstruction[2];\n this.fill_(context);\n }\n if (strokeInstruction) {\n this.setStrokeStyle_(context, /** @type {Array<*>} */strokeInstruction);\n context.stroke();\n }\n }\n\n /**\n * @private\n * @param {number} sheetWidth Width of the sprite sheet.\n * @param {number} sheetHeight Height of the sprite sheet.\n * @param {number} centerX X.\n * @param {number} centerY Y.\n * @param {number} width Width.\n * @param {number} height Height.\n * @param {number} anchorX Anchor X.\n * @param {number} anchorY Anchor Y.\n * @param {number} originX Origin X.\n * @param {number} originY Origin Y.\n * @param {number} rotation Rotation.\n * @param {import(\"../../size.js\").Size} scale Scale.\n * @param {boolean} snapToPixel Snap to pixel.\n * @param {Array<number>} padding Padding.\n * @param {boolean} fillStroke Background fill or stroke.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n * @return {ImageOrLabelDimensions} Dimensions for positioning and decluttering the image or label.\n */\n calculateImageOrLabelDimensions_(sheetWidth, sheetHeight, centerX, centerY, width, height, anchorX, anchorY, originX, originY, rotation, scale, snapToPixel, padding, fillStroke, feature) {\n anchorX *= scale[0];\n anchorY *= scale[1];\n let x = centerX - anchorX;\n let y = centerY - anchorY;\n const w = width + originX > sheetWidth ? sheetWidth - originX : width;\n const h = height + originY > sheetHeight ? sheetHeight - originY : height;\n const boxW = padding[3] + w * scale[0] + padding[1];\n const boxH = padding[0] + h * scale[1] + padding[2];\n const boxX = x - padding[3];\n const boxY = y - padding[0];\n if (fillStroke || rotation !== 0) {\n p1[0] = boxX;\n p4[0] = boxX;\n p1[1] = boxY;\n p2[1] = boxY;\n p2[0] = boxX + boxW;\n p3[0] = p2[0];\n p3[1] = boxY + boxH;\n p4[1] = p3[1];\n }\n let transform;\n if (rotation !== 0) {\n transform = (0,_transform_js__WEBPACK_IMPORTED_MODULE_3__.compose)((0,_transform_js__WEBPACK_IMPORTED_MODULE_3__.create)(), centerX, centerY, 1, 1, rotation, -centerX, -centerY);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_3__.apply)(transform, p1);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_3__.apply)(transform, p2);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_3__.apply)(transform, p3);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_3__.apply)(transform, p4);\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.createOrUpdate)(Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1]), tmpExtent);\n } else {\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.createOrUpdate)(Math.min(boxX, boxX + boxW), Math.min(boxY, boxY + boxH), Math.max(boxX, boxX + boxW), Math.max(boxY, boxY + boxH), tmpExtent);\n }\n if (snapToPixel) {\n x = Math.round(x);\n y = Math.round(y);\n }\n return {\n drawImageX: x,\n drawImageY: y,\n drawImageW: w,\n drawImageH: h,\n originX: originX,\n originY: originY,\n declutterBox: {\n minX: tmpExtent[0],\n minY: tmpExtent[1],\n maxX: tmpExtent[2],\n maxY: tmpExtent[3],\n value: feature\n },\n canvasTransform: transform,\n scale: scale\n };\n }\n\n /**\n * @private\n * @param {CanvasRenderingContext2D} context Context.\n * @param {number} contextScale Scale of the context.\n * @param {import(\"../canvas.js\").Label|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} imageOrLabel Image.\n * @param {ImageOrLabelDimensions} dimensions Dimensions.\n * @param {number} opacity Opacity.\n * @param {Array<*>} fillInstruction Fill instruction.\n * @param {Array<*>} strokeInstruction Stroke instruction.\n * @return {boolean} The image or label was rendered.\n */\n replayImageOrLabel_(context, contextScale, imageOrLabel, dimensions, opacity, fillInstruction, strokeInstruction) {\n const fillStroke = !!(fillInstruction || strokeInstruction);\n const box = dimensions.declutterBox;\n const canvas = context.canvas;\n const strokePadding = strokeInstruction ? strokeInstruction[2] * dimensions.scale[0] / 2 : 0;\n const intersects = box.minX - strokePadding <= canvas.width / contextScale && box.maxX + strokePadding >= 0 && box.minY - strokePadding <= canvas.height / contextScale && box.maxY + strokePadding >= 0;\n if (intersects) {\n if (fillStroke) {\n this.replayTextBackground_(context, p1, p2, p3, p4, /** @type {Array<*>} */fillInstruction, /** @type {Array<*>} */strokeInstruction);\n }\n (0,_canvas_js__WEBPACK_IMPORTED_MODULE_4__.drawImageOrLabel)(context, dimensions.canvasTransform, opacity, imageOrLabel, dimensions.originX, dimensions.originY, dimensions.drawImageW, dimensions.drawImageH, dimensions.drawImageX, dimensions.drawImageY, dimensions.scale);\n }\n return true;\n }\n\n /**\n * @private\n * @param {CanvasRenderingContext2D} context Context.\n */\n fill_(context) {\n if (this.alignFill_) {\n const origin = (0,_transform_js__WEBPACK_IMPORTED_MODULE_3__.apply)(this.renderedTransform_, [0, 0]);\n const repeatSize = 512 * this.pixelRatio;\n context.save();\n context.translate(origin[0] % repeatSize, origin[1] % repeatSize);\n context.rotate(this.viewRotation_);\n }\n context.fill();\n if (this.alignFill_) {\n context.restore();\n }\n }\n\n /**\n * @private\n * @param {CanvasRenderingContext2D} context Context.\n * @param {Array<*>} instruction Instruction.\n */\n setStrokeStyle_(context, instruction) {\n context['strokeStyle'] = /** @type {import(\"../../colorlike.js\").ColorLike} */instruction[1];\n context.lineWidth = /** @type {number} */instruction[2];\n context.lineCap = /** @type {CanvasLineCap} */instruction[3];\n context.lineJoin = /** @type {CanvasLineJoin} */instruction[4];\n context.miterLimit = /** @type {number} */instruction[5];\n context.lineDashOffset = /** @type {number} */instruction[7];\n context.setLineDash(/** @type {Array<number>} */instruction[6]);\n }\n\n /**\n * @private\n * @param {string|Array<string>} text The text to draw.\n * @param {string} textKey The key of the text state.\n * @param {string} strokeKey The key for the stroke state.\n * @param {string} fillKey The key for the fill state.\n * @return {{label: import(\"../canvas.js\").Label, anchorX: number, anchorY: number}} The text image and its anchor.\n */\n drawLabelWithPointPlacement_(text, textKey, strokeKey, fillKey) {\n const textState = this.textStates[textKey];\n const label = this.createLabel(text, textKey, fillKey, strokeKey);\n const strokeState = this.strokeStates[strokeKey];\n const pixelRatio = this.pixelRatio;\n const align = horizontalTextAlign(Array.isArray(text) ? text[0] : text, textState.textAlign || _canvas_js__WEBPACK_IMPORTED_MODULE_4__.defaultTextAlign);\n const baseline = _TextBuilder_js__WEBPACK_IMPORTED_MODULE_2__.TEXT_ALIGN[textState.textBaseline || _canvas_js__WEBPACK_IMPORTED_MODULE_4__.defaultTextBaseline];\n const strokeWidth = strokeState && strokeState.lineWidth ? strokeState.lineWidth : 0;\n\n // Remove the 2 pixels we added in createLabel() for the anchor\n const width = label.width / pixelRatio - 2 * textState.scale[0];\n const anchorX = align * width + 2 * (0.5 - align) * strokeWidth;\n const anchorY = baseline * label.height / pixelRatio + 2 * (0.5 - baseline) * strokeWidth;\n return {\n label: label,\n anchorX: anchorX,\n anchorY: anchorY\n };\n }\n\n /**\n * @private\n * @param {CanvasRenderingContext2D} context Context.\n * @param {number} contextScale Scale of the context.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {Array<*>} instructions Instructions array.\n * @param {boolean} snapToPixel Snap point symbols and text to integer pixels.\n * @param {FeatureCallback<T>} [featureCallback] Feature callback.\n * @param {import(\"../../extent.js\").Extent} [hitExtent] Only check\n * features that intersect this extent.\n * @param {import(\"rbush\").default} [declutterTree] Declutter tree.\n * @return {T|undefined} Callback result.\n * @template T\n */\n execute_(context, contextScale, transform, instructions, snapToPixel, featureCallback, hitExtent, declutterTree) {\n /** @type {Array<number>} */\n let pixelCoordinates;\n if (this.pixelCoordinates_ && (0,_array_js__WEBPACK_IMPORTED_MODULE_5__.equals)(transform, this.renderedTransform_)) {\n pixelCoordinates = this.pixelCoordinates_;\n } else {\n if (!this.pixelCoordinates_) {\n this.pixelCoordinates_ = [];\n }\n pixelCoordinates = (0,_geom_flat_transform_js__WEBPACK_IMPORTED_MODULE_6__.transform2D)(this.coordinates, 0, this.coordinates.length, 2, transform, this.pixelCoordinates_);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_3__.setFromArray)(this.renderedTransform_, transform);\n }\n let i = 0; // instruction index\n const ii = instructions.length; // end of instructions\n let d = 0; // data index\n let dd; // end of per-instruction data\n let anchorX, anchorY, prevX, prevY, roundX, roundY, image, text, textKey, strokeKey, fillKey;\n let pendingFill = 0;\n let pendingStroke = 0;\n let lastFillInstruction = null;\n let lastStrokeInstruction = null;\n const coordinateCache = this.coordinateCache_;\n const viewRotation = this.viewRotation_;\n const viewRotationFromTransform = Math.round(Math.atan2(-transform[1], transform[0]) * 1e12) / 1e12;\n const state = /** @type {import(\"../../render.js\").State} */{\n context: context,\n pixelRatio: this.pixelRatio,\n resolution: this.resolution,\n rotation: viewRotation\n };\n\n // When the batch size gets too big, performance decreases. 200 is a good\n // balance between batch size and number of fill/stroke instructions.\n const batchSize = this.instructions != instructions || this.overlaps ? 0 : 200;\n let /** @type {import(\"../../Feature.js\").FeatureLike} */feature;\n let x, y, currentGeometry;\n while (i < ii) {\n const instruction = instructions[i];\n const type = /** @type {import(\"./Instruction.js\").default} */\n instruction[0];\n switch (type) {\n case _Instruction_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].BEGIN_GEOMETRY:\n feature = /** @type {import(\"../../Feature.js\").FeatureLike} */\n instruction[1];\n currentGeometry = instruction[3];\n if (!feature.getGeometry()) {\n i = /** @type {number} */instruction[2];\n } else if (hitExtent !== undefined && !(0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.intersects)(hitExtent, currentGeometry.getExtent())) {\n i = /** @type {number} */instruction[2] + 1;\n } else {\n ++i;\n }\n break;\n case _Instruction_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].BEGIN_PATH:\n if (pendingFill > batchSize) {\n this.fill_(context);\n pendingFill = 0;\n }\n if (pendingStroke > batchSize) {\n context.stroke();\n pendingStroke = 0;\n }\n if (!pendingFill && !pendingStroke) {\n context.beginPath();\n prevX = NaN;\n prevY = NaN;\n }\n ++i;\n break;\n case _Instruction_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].CIRCLE:\n d = /** @type {number} */instruction[1];\n const x1 = pixelCoordinates[d];\n const y1 = pixelCoordinates[d + 1];\n const x2 = pixelCoordinates[d + 2];\n const y2 = pixelCoordinates[d + 3];\n const dx = x2 - x1;\n const dy = y2 - y1;\n const r = Math.sqrt(dx * dx + dy * dy);\n context.moveTo(x1 + r, y1);\n context.arc(x1, y1, r, 0, 2 * Math.PI, true);\n ++i;\n break;\n case _Instruction_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].CLOSE_PATH:\n context.closePath();\n ++i;\n break;\n case _Instruction_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].CUSTOM:\n d = /** @type {number} */instruction[1];\n dd = instruction[2];\n const geometry = /** @type {import(\"../../geom/SimpleGeometry.js\").default} */\n instruction[3];\n const renderer = instruction[4];\n const fn = instruction.length == 6 ? instruction[5] : undefined;\n state.geometry = geometry;\n state.feature = feature;\n if (!(i in coordinateCache)) {\n coordinateCache[i] = [];\n }\n const coords = coordinateCache[i];\n if (fn) {\n fn(pixelCoordinates, d, dd, 2, coords);\n } else {\n coords[0] = pixelCoordinates[d];\n coords[1] = pixelCoordinates[d + 1];\n coords.length = 2;\n }\n renderer(coords, state);\n ++i;\n break;\n case _Instruction_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].DRAW_IMAGE:\n d = /** @type {number} */instruction[1];\n dd = /** @type {number} */instruction[2];\n image = /** @type {HTMLCanvasElement|HTMLVideoElement|HTMLImageElement} */\n instruction[3];\n\n // Remaining arguments in DRAW_IMAGE are in alphabetical order\n anchorX = /** @type {number} */instruction[4];\n anchorY = /** @type {number} */instruction[5];\n let height = /** @type {number} */instruction[6];\n const opacity = /** @type {number} */instruction[7];\n const originX = /** @type {number} */instruction[8];\n const originY = /** @type {number} */instruction[9];\n const rotateWithView = /** @type {boolean} */instruction[10];\n let rotation = /** @type {number} */instruction[11];\n const scale = /** @type {import(\"../../size.js\").Size} */\n instruction[12];\n let width = /** @type {number} */instruction[13];\n const declutterMode = /** @type {\"declutter\"|\"obstacle\"|\"none\"|undefined} */\n instruction[14];\n const declutterImageWithText = /** @type {import(\"../canvas.js\").DeclutterImageWithText} */\n instruction[15];\n if (!image && instruction.length >= 20) {\n // create label images\n text = /** @type {string} */instruction[19];\n textKey = /** @type {string} */instruction[20];\n strokeKey = /** @type {string} */instruction[21];\n fillKey = /** @type {string} */instruction[22];\n const labelWithAnchor = this.drawLabelWithPointPlacement_(text, textKey, strokeKey, fillKey);\n image = labelWithAnchor.label;\n instruction[3] = image;\n const textOffsetX = /** @type {number} */instruction[23];\n anchorX = (labelWithAnchor.anchorX - textOffsetX) * this.pixelRatio;\n instruction[4] = anchorX;\n const textOffsetY = /** @type {number} */instruction[24];\n anchorY = (labelWithAnchor.anchorY - textOffsetY) * this.pixelRatio;\n instruction[5] = anchorY;\n height = image.height;\n instruction[6] = height;\n width = image.width;\n instruction[13] = width;\n }\n let geometryWidths;\n if (instruction.length > 25) {\n geometryWidths = /** @type {number} */instruction[25];\n }\n let padding, backgroundFill, backgroundStroke;\n if (instruction.length > 17) {\n padding = /** @type {Array<number>} */instruction[16];\n backgroundFill = /** @type {boolean} */instruction[17];\n backgroundStroke = /** @type {boolean} */instruction[18];\n } else {\n padding = _canvas_js__WEBPACK_IMPORTED_MODULE_4__.defaultPadding;\n backgroundFill = false;\n backgroundStroke = false;\n }\n if (rotateWithView && viewRotationFromTransform) {\n // Canvas is expected to be rotated to reverse view rotation.\n rotation += viewRotation;\n } else if (!rotateWithView && !viewRotationFromTransform) {\n // Canvas is not rotated, images need to be rotated back to be north-up.\n rotation -= viewRotation;\n }\n let widthIndex = 0;\n for (; d < dd; d += 2) {\n if (geometryWidths && geometryWidths[widthIndex++] < width / this.pixelRatio) {\n continue;\n }\n const dimensions = this.calculateImageOrLabelDimensions_(image.width, image.height, pixelCoordinates[d], pixelCoordinates[d + 1], width, height, anchorX, anchorY, originX, originY, rotation, scale, snapToPixel, padding, backgroundFill || backgroundStroke, feature);\n /** @type {ReplayImageOrLabelArgs} */\n const args = [context, contextScale, image, dimensions, opacity, backgroundFill ? (/** @type {Array<*>} */lastFillInstruction) : null, backgroundStroke ? (/** @type {Array<*>} */lastStrokeInstruction) : null];\n if (declutterTree) {\n if (declutterMode === 'none') {\n // not rendered in declutter group\n continue;\n } else if (declutterMode === 'obstacle') {\n // will always be drawn, thus no collision detection, but insert as obstacle\n declutterTree.insert(dimensions.declutterBox);\n continue;\n } else {\n let imageArgs;\n let imageDeclutterBox;\n if (declutterImageWithText) {\n const index = dd - d;\n if (!declutterImageWithText[index]) {\n // We now have the image for an image+text combination.\n declutterImageWithText[index] = args;\n // Don't render anything for now, wait for the text.\n continue;\n }\n imageArgs = declutterImageWithText[index];\n delete declutterImageWithText[index];\n imageDeclutterBox = getDeclutterBox(imageArgs);\n if (declutterTree.collides(imageDeclutterBox)) {\n continue;\n }\n }\n if (declutterTree.collides(dimensions.declutterBox)) {\n continue;\n }\n if (imageArgs) {\n // We now have image and text for an image+text combination.\n declutterTree.insert(imageDeclutterBox);\n // Render the image before we render the text.\n this.replayImageOrLabel_.apply(this, imageArgs);\n }\n declutterTree.insert(dimensions.declutterBox);\n }\n }\n this.replayImageOrLabel_.apply(this, args);\n }\n ++i;\n break;\n case _Instruction_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].DRAW_CHARS:\n const begin = /** @type {number} */instruction[1];\n const end = /** @type {number} */instruction[2];\n const baseline = /** @type {number} */instruction[3];\n const overflow = /** @type {number} */instruction[4];\n fillKey = /** @type {string} */instruction[5];\n const maxAngle = /** @type {number} */instruction[6];\n const measurePixelRatio = /** @type {number} */instruction[7];\n const offsetY = /** @type {number} */instruction[8];\n strokeKey = /** @type {string} */instruction[9];\n const strokeWidth = /** @type {number} */instruction[10];\n text = /** @type {string} */instruction[11];\n textKey = /** @type {string} */instruction[12];\n const pixelRatioScale = [(/** @type {number} */instruction[13]), (/** @type {number} */instruction[13])];\n const textState = this.textStates[textKey];\n const font = textState.font;\n const textScale = [textState.scale[0] * measurePixelRatio, textState.scale[1] * measurePixelRatio];\n let cachedWidths;\n if (font in this.widths_) {\n cachedWidths = this.widths_[font];\n } else {\n cachedWidths = {};\n this.widths_[font] = cachedWidths;\n }\n const pathLength = (0,_geom_flat_length_js__WEBPACK_IMPORTED_MODULE_8__.lineStringLength)(pixelCoordinates, begin, end, 2);\n const textLength = Math.abs(textScale[0]) * (0,_canvas_js__WEBPACK_IMPORTED_MODULE_4__.measureAndCacheTextWidth)(font, text, cachedWidths);\n if (overflow || textLength <= pathLength) {\n const textAlign = this.textStates[textKey].textAlign;\n const startM = (pathLength - textLength) * horizontalTextAlign(text, textAlign);\n const parts = (0,_geom_flat_textpath_js__WEBPACK_IMPORTED_MODULE_9__.drawTextOnPath)(pixelCoordinates, begin, end, 2, text, startM, maxAngle, Math.abs(textScale[0]), _canvas_js__WEBPACK_IMPORTED_MODULE_4__.measureAndCacheTextWidth, font, cachedWidths, viewRotationFromTransform ? 0 : this.viewRotation_);\n drawChars: if (parts) {\n /** @type {Array<ReplayImageOrLabelArgs>} */\n const replayImageOrLabelArgs = [];\n let c, cc, chars, label, part;\n if (strokeKey) {\n for (c = 0, cc = parts.length; c < cc; ++c) {\n part = parts[c]; // x, y, anchorX, rotation, chunk\n chars = /** @type {string} */part[4];\n label = this.createLabel(chars, textKey, '', strokeKey);\n anchorX = /** @type {number} */part[2] + (textScale[0] < 0 ? -strokeWidth : strokeWidth);\n anchorY = baseline * label.height + (0.5 - baseline) * 2 * strokeWidth * textScale[1] / textScale[0] - offsetY;\n const dimensions = this.calculateImageOrLabelDimensions_(label.width, label.height, part[0], part[1], label.width, label.height, anchorX, anchorY, 0, 0, part[3], pixelRatioScale, false, _canvas_js__WEBPACK_IMPORTED_MODULE_4__.defaultPadding, false, feature);\n if (declutterTree && declutterTree.collides(dimensions.declutterBox)) {\n break drawChars;\n }\n replayImageOrLabelArgs.push([context, contextScale, label, dimensions, 1, null, null]);\n }\n }\n if (fillKey) {\n for (c = 0, cc = parts.length; c < cc; ++c) {\n part = parts[c]; // x, y, anchorX, rotation, chunk\n chars = /** @type {string} */part[4];\n label = this.createLabel(chars, textKey, fillKey, '');\n anchorX = /** @type {number} */part[2];\n anchorY = baseline * label.height - offsetY;\n const dimensions = this.calculateImageOrLabelDimensions_(label.width, label.height, part[0], part[1], label.width, label.height, anchorX, anchorY, 0, 0, part[3], pixelRatioScale, false, _canvas_js__WEBPACK_IMPORTED_MODULE_4__.defaultPadding, false, feature);\n if (declutterTree && declutterTree.collides(dimensions.declutterBox)) {\n break drawChars;\n }\n replayImageOrLabelArgs.push([context, contextScale, label, dimensions, 1, null, null]);\n }\n }\n if (declutterTree) {\n declutterTree.load(replayImageOrLabelArgs.map(getDeclutterBox));\n }\n for (let i = 0, ii = replayImageOrLabelArgs.length; i < ii; ++i) {\n this.replayImageOrLabel_.apply(this, replayImageOrLabelArgs[i]);\n }\n }\n }\n ++i;\n break;\n case _Instruction_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].END_GEOMETRY:\n if (featureCallback !== undefined) {\n feature = /** @type {import(\"../../Feature.js\").FeatureLike} */\n instruction[1];\n const result = featureCallback(feature, currentGeometry);\n if (result) {\n return result;\n }\n }\n ++i;\n break;\n case _Instruction_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].FILL:\n if (batchSize) {\n pendingFill++;\n } else {\n this.fill_(context);\n }\n ++i;\n break;\n case _Instruction_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].MOVE_TO_LINE_TO:\n d = /** @type {number} */instruction[1];\n dd = /** @type {number} */instruction[2];\n x = pixelCoordinates[d];\n y = pixelCoordinates[d + 1];\n roundX = x + 0.5 | 0;\n roundY = y + 0.5 | 0;\n if (roundX !== prevX || roundY !== prevY) {\n context.moveTo(x, y);\n prevX = roundX;\n prevY = roundY;\n }\n for (d += 2; d < dd; d += 2) {\n x = pixelCoordinates[d];\n y = pixelCoordinates[d + 1];\n roundX = x + 0.5 | 0;\n roundY = y + 0.5 | 0;\n if (d == dd - 2 || roundX !== prevX || roundY !== prevY) {\n context.lineTo(x, y);\n prevX = roundX;\n prevY = roundY;\n }\n }\n ++i;\n break;\n case _Instruction_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].SET_FILL_STYLE:\n lastFillInstruction = instruction;\n this.alignFill_ = instruction[2];\n if (pendingFill) {\n this.fill_(context);\n pendingFill = 0;\n if (pendingStroke) {\n context.stroke();\n pendingStroke = 0;\n }\n }\n context.fillStyle = /** @type {import(\"../../colorlike.js\").ColorLike} */\n instruction[1];\n ++i;\n break;\n case _Instruction_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].SET_STROKE_STYLE:\n lastStrokeInstruction = instruction;\n if (pendingStroke) {\n context.stroke();\n pendingStroke = 0;\n }\n this.setStrokeStyle_(context, /** @type {Array<*>} */instruction);\n ++i;\n break;\n case _Instruction_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].STROKE:\n if (batchSize) {\n pendingStroke++;\n } else {\n context.stroke();\n }\n ++i;\n break;\n default:\n // consume the instruction anyway, to avoid an infinite loop\n ++i;\n break;\n }\n }\n if (pendingFill) {\n this.fill_(context);\n }\n if (pendingStroke) {\n context.stroke();\n }\n return undefined;\n }\n\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {number} contextScale Scale of the context.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {number} viewRotation View rotation.\n * @param {boolean} snapToPixel Snap point symbols and text to integer pixels.\n * @param {import(\"rbush\").default} [declutterTree] Declutter tree.\n */\n execute(context, contextScale, transform, viewRotation, snapToPixel, declutterTree) {\n this.viewRotation_ = viewRotation;\n this.execute_(context, contextScale, transform, this.instructions, snapToPixel, undefined, undefined, declutterTree);\n }\n\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {number} viewRotation View rotation.\n * @param {FeatureCallback<T>} [featureCallback] Feature callback.\n * @param {import(\"../../extent.js\").Extent} [hitExtent] Only check\n * features that intersect this extent.\n * @return {T|undefined} Callback result.\n * @template T\n */\n executeHitDetection(context, transform, viewRotation, featureCallback, hitExtent) {\n this.viewRotation_ = viewRotation;\n return this.execute_(context, 1, transform, this.hitDetectionInstructions, true, featureCallback, hitExtent);\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Executor);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/canvas/Executor.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/canvas/ExecutorGroup.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ol/render/canvas/ExecutorGroup.js ***!
|
||
\********************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getPixelIndexArray: function() { return /* binding */ getPixelIndexArray; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Executor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Executor.js */ \"./node_modules/ol/render/canvas/Executor.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../transform.js */ \"./node_modules/ol/transform.js\");\n/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../dom.js */ \"./node_modules/ol/dom.js\");\n/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../obj.js */ \"./node_modules/ol/obj.js\");\n/* harmony import */ var _geom_flat_transform_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../geom/flat/transform.js */ \"./node_modules/ol/geom/flat/transform.js\");\n\n/**\n * @module ol/render/canvas/ExecutorGroup\n */\n\n\n\n\n\n\n\n\n\n/**\n * @const\n * @type {Array<import(\"../canvas.js\").BuilderType>}\n */\nconst ORDER = ['Polygon', 'Circle', 'LineString', 'Image', 'Text', 'Default'];\nclass ExecutorGroup {\n /**\n * @param {import(\"../../extent.js\").Extent} maxExtent Max extent for clipping. When a\n * `maxExtent` was set on the Builder for this executor group, the same `maxExtent`\n * should be set here, unless the target context does not exceed that extent (which\n * can be the case when rendering to tiles).\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {boolean} overlaps The executor group can have overlapping geometries.\n * @param {!Object<string, !Object<import(\"../canvas.js\").BuilderType, import(\"../canvas.js\").SerializableInstructions>>} allInstructions\n * The serializable instructions.\n * @param {number} [renderBuffer] Optional rendering buffer.\n */\n constructor(maxExtent, resolution, pixelRatio, overlaps, allInstructions, renderBuffer) {\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n this.maxExtent_ = maxExtent;\n\n /**\n * @private\n * @type {boolean}\n */\n this.overlaps_ = overlaps;\n\n /**\n * @private\n * @type {number}\n */\n this.pixelRatio_ = pixelRatio;\n\n /**\n * @private\n * @type {number}\n */\n this.resolution_ = resolution;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.renderBuffer_ = renderBuffer;\n\n /**\n * @private\n * @type {!Object<string, !Object<import(\"../canvas.js\").BuilderType, import(\"./Executor\").default>>}\n */\n this.executorsByZIndex_ = {};\n\n /**\n * @private\n * @type {CanvasRenderingContext2D}\n */\n this.hitDetectionContext_ = null;\n\n /**\n * @private\n * @type {import(\"../../transform.js\").Transform}\n */\n this.hitDetectionTransform_ = (0,_transform_js__WEBPACK_IMPORTED_MODULE_1__.create)();\n this.createExecutors_(allInstructions);\n }\n\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n */\n clip(context, transform) {\n const flatClipCoords = this.getClipCoords(transform);\n context.beginPath();\n context.moveTo(flatClipCoords[0], flatClipCoords[1]);\n context.lineTo(flatClipCoords[2], flatClipCoords[3]);\n context.lineTo(flatClipCoords[4], flatClipCoords[5]);\n context.lineTo(flatClipCoords[6], flatClipCoords[7]);\n context.clip();\n }\n\n /**\n * Create executors and populate them using the provided instructions.\n * @private\n * @param {!Object<string, !Object<import(\"../canvas.js\").BuilderType, import(\"../canvas.js\").SerializableInstructions>>} allInstructions The serializable instructions\n */\n createExecutors_(allInstructions) {\n for (const zIndex in allInstructions) {\n let executors = this.executorsByZIndex_[zIndex];\n if (executors === undefined) {\n executors = {};\n this.executorsByZIndex_[zIndex] = executors;\n }\n const instructionByZindex = allInstructions[zIndex];\n for (const builderType in instructionByZindex) {\n const instructions = instructionByZindex[builderType];\n executors[builderType] = new _Executor_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.resolution_, this.pixelRatio_, this.overlaps_, instructions);\n }\n }\n }\n\n /**\n * @param {Array<import(\"../canvas.js\").BuilderType>} executors Executors.\n * @return {boolean} Has executors of the provided types.\n */\n hasExecutors(executors) {\n for (const zIndex in this.executorsByZIndex_) {\n const candidates = this.executorsByZIndex_[zIndex];\n for (let i = 0, ii = executors.length; i < ii; ++i) {\n if (executors[i] in candidates) {\n return true;\n }\n }\n }\n return false;\n }\n\n /**\n * @param {import(\"../../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {function(import(\"../../Feature.js\").FeatureLike, import(\"../../geom/SimpleGeometry.js\").default, number): T} callback Feature callback.\n * @param {Array<import(\"../../Feature.js\").FeatureLike>} declutteredFeatures Decluttered features.\n * @return {T|undefined} Callback result.\n * @template T\n */\n forEachFeatureAtCoordinate(coordinate, resolution, rotation, hitTolerance, callback, declutteredFeatures) {\n hitTolerance = Math.round(hitTolerance);\n const contextSize = hitTolerance * 2 + 1;\n const transform = (0,_transform_js__WEBPACK_IMPORTED_MODULE_1__.compose)(this.hitDetectionTransform_, hitTolerance + 0.5, hitTolerance + 0.5, 1 / resolution, -1 / resolution, -rotation, -coordinate[0], -coordinate[1]);\n const newContext = !this.hitDetectionContext_;\n if (newContext) {\n this.hitDetectionContext_ = (0,_dom_js__WEBPACK_IMPORTED_MODULE_3__.createCanvasContext2D)(contextSize, contextSize, undefined, {\n willReadFrequently: true\n });\n }\n const context = this.hitDetectionContext_;\n if (context.canvas.width !== contextSize || context.canvas.height !== contextSize) {\n context.canvas.width = contextSize;\n context.canvas.height = contextSize;\n } else if (!newContext) {\n context.clearRect(0, 0, contextSize, contextSize);\n }\n\n /**\n * @type {import(\"../../extent.js\").Extent}\n */\n let hitExtent;\n if (this.renderBuffer_ !== undefined) {\n hitExtent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.createEmpty)();\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.extendCoordinate)(hitExtent, coordinate);\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.buffer)(hitExtent, resolution * (this.renderBuffer_ + hitTolerance), hitExtent);\n }\n const indexes = getPixelIndexArray(hitTolerance);\n let builderType;\n\n /**\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @return {T|undefined} Callback result.\n */\n function featureCallback(feature, geometry) {\n const imageData = context.getImageData(0, 0, contextSize, contextSize).data;\n for (let i = 0, ii = indexes.length; i < ii; i++) {\n if (imageData[indexes[i]] > 0) {\n if (!declutteredFeatures || builderType !== 'Image' && builderType !== 'Text' || declutteredFeatures.includes(feature)) {\n const idx = (indexes[i] - 3) / 4;\n const x = hitTolerance - idx % contextSize;\n const y = hitTolerance - (idx / contextSize | 0);\n const result = callback(feature, geometry, x * x + y * y);\n if (result) {\n return result;\n }\n }\n context.clearRect(0, 0, contextSize, contextSize);\n break;\n }\n }\n return undefined;\n }\n\n /** @type {Array<number>} */\n const zs = Object.keys(this.executorsByZIndex_).map(Number);\n zs.sort(_array_js__WEBPACK_IMPORTED_MODULE_5__.ascending);\n let i, j, executors, executor, result;\n for (i = zs.length - 1; i >= 0; --i) {\n const zIndexKey = zs[i].toString();\n executors = this.executorsByZIndex_[zIndexKey];\n for (j = ORDER.length - 1; j >= 0; --j) {\n builderType = ORDER[j];\n executor = executors[builderType];\n if (executor !== undefined) {\n result = executor.executeHitDetection(context, transform, rotation, featureCallback, hitExtent);\n if (result) {\n return result;\n }\n }\n }\n }\n return undefined;\n }\n\n /**\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @return {Array<number>|null} Clip coordinates.\n */\n getClipCoords(transform) {\n const maxExtent = this.maxExtent_;\n if (!maxExtent) {\n return null;\n }\n const minX = maxExtent[0];\n const minY = maxExtent[1];\n const maxX = maxExtent[2];\n const maxY = maxExtent[3];\n const flatClipCoords = [minX, minY, minX, maxY, maxX, maxY, maxX, minY];\n (0,_geom_flat_transform_js__WEBPACK_IMPORTED_MODULE_6__.transform2D)(flatClipCoords, 0, 8, 2, transform, flatClipCoords);\n return flatClipCoords;\n }\n\n /**\n * @return {boolean} Is empty.\n */\n isEmpty() {\n return (0,_obj_js__WEBPACK_IMPORTED_MODULE_7__.isEmpty)(this.executorsByZIndex_);\n }\n\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {number} contextScale Scale of the context.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {number} viewRotation View rotation.\n * @param {boolean} snapToPixel Snap point symbols and test to integer pixel.\n * @param {Array<import(\"../canvas.js\").BuilderType>} [builderTypes] Ordered replay types to replay.\n * Default is {@link module:ol/render/replay~ORDER}\n * @param {import(\"rbush\").default} [declutterTree] Declutter tree.\n */\n execute(context, contextScale, transform, viewRotation, snapToPixel, builderTypes, declutterTree) {\n /** @type {Array<number>} */\n const zs = Object.keys(this.executorsByZIndex_).map(Number);\n zs.sort(_array_js__WEBPACK_IMPORTED_MODULE_5__.ascending);\n\n // setup clipping so that the parts of over-simplified geometries are not\n // visible outside the current extent when panning\n if (this.maxExtent_) {\n context.save();\n this.clip(context, transform);\n }\n builderTypes = builderTypes ? builderTypes : ORDER;\n let i, ii, j, jj, replays, replay;\n if (declutterTree) {\n zs.reverse();\n }\n for (i = 0, ii = zs.length; i < ii; ++i) {\n const zIndexKey = zs[i].toString();\n replays = this.executorsByZIndex_[zIndexKey];\n for (j = 0, jj = builderTypes.length; j < jj; ++j) {\n const builderType = builderTypes[j];\n replay = replays[builderType];\n if (replay !== undefined) {\n replay.execute(context, contextScale, transform, viewRotation, snapToPixel, declutterTree);\n }\n }\n }\n if (this.maxExtent_) {\n context.restore();\n }\n }\n}\n\n/**\n * This cache is used to store arrays of indexes for calculated pixel circles\n * to increase performance.\n * It is a static property to allow each Replaygroup to access it.\n * @type {Object<number, Array<number>>}\n */\nconst circlePixelIndexArrayCache = {};\n\n/**\n * This methods creates an array with indexes of all pixels within a circle,\n * ordered by how close they are to the center.\n * A cache is used to increase performance.\n * @param {number} radius Radius.\n * @return {Array<number>} An array with indexes within a circle.\n */\nfunction getPixelIndexArray(radius) {\n if (circlePixelIndexArrayCache[radius] !== undefined) {\n return circlePixelIndexArrayCache[radius];\n }\n const size = radius * 2 + 1;\n const maxDistanceSq = radius * radius;\n const distances = new Array(maxDistanceSq + 1);\n for (let i = 0; i <= radius; ++i) {\n for (let j = 0; j <= radius; ++j) {\n const distanceSq = i * i + j * j;\n if (distanceSq > maxDistanceSq) {\n break;\n }\n let distance = distances[distanceSq];\n if (!distance) {\n distance = [];\n distances[distanceSq] = distance;\n }\n distance.push(((radius + i) * size + (radius + j)) * 4 + 3);\n if (i > 0) {\n distance.push(((radius - i) * size + (radius + j)) * 4 + 3);\n }\n if (j > 0) {\n distance.push(((radius + i) * size + (radius - j)) * 4 + 3);\n if (i > 0) {\n distance.push(((radius - i) * size + (radius - j)) * 4 + 3);\n }\n }\n }\n }\n const pixelIndex = [];\n for (let i = 0, ii = distances.length; i < ii; ++i) {\n if (distances[i]) {\n pixelIndex.push(...distances[i]);\n }\n }\n circlePixelIndexArrayCache[radius] = pixelIndex;\n return pixelIndex;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (ExecutorGroup);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/canvas/ExecutorGroup.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/canvas/ImageBuilder.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ol/render/canvas/ImageBuilder.js ***!
|
||
\*******************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Builder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Builder.js */ \"./node_modules/ol/render/canvas/Builder.js\");\n/* harmony import */ var _Instruction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Instruction.js */ \"./node_modules/ol/render/canvas/Instruction.js\");\n\n/**\n * @module ol/render/canvas/ImageBuilder\n */\n\n\nclass CanvasImageBuilder extends _Builder_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {number} tolerance Tolerance.\n * @param {import(\"../../extent.js\").Extent} maxExtent Maximum extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n */\n constructor(tolerance, maxExtent, resolution, pixelRatio) {\n super(tolerance, maxExtent, resolution, pixelRatio);\n\n /**\n * @private\n * @type {import('../../DataTile.js').ImageLike}\n */\n this.hitDetectionImage_ = null;\n\n /**\n * @private\n * @type {import('../../DataTile.js').ImageLike}\n */\n this.image_ = null;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.imagePixelRatio_ = undefined;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.anchorX_ = undefined;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.anchorY_ = undefined;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.height_ = undefined;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.opacity_ = undefined;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.originX_ = undefined;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.originY_ = undefined;\n\n /**\n * @private\n * @type {boolean|undefined}\n */\n this.rotateWithView_ = undefined;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.rotation_ = undefined;\n\n /**\n * @private\n * @type {import(\"../../size.js\").Size|undefined}\n */\n this.scale_ = undefined;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.width_ = undefined;\n\n /**\n * @private\n * @type {\"declutter\"|\"obstacle\"|\"none\"|undefined}\n */\n this.declutterMode_ = undefined;\n\n /**\n * Data shared with a text builder for combined decluttering.\n * @private\n * @type {import(\"../canvas.js\").DeclutterImageWithText}\n */\n this.declutterImageWithText_ = undefined;\n }\n\n /**\n * @param {import(\"../../geom/Point.js\").default|import(\"../Feature.js\").default} pointGeometry Point geometry.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n */\n drawPoint(pointGeometry, feature) {\n if (!this.image_) {\n return;\n }\n this.beginGeometry(pointGeometry, feature);\n const flatCoordinates = pointGeometry.getFlatCoordinates();\n const stride = pointGeometry.getStride();\n const myBegin = this.coordinates.length;\n const myEnd = this.appendFlatPointCoordinates(flatCoordinates, stride);\n this.instructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].DRAW_IMAGE, myBegin, myEnd, this.image_,\n // Remaining arguments to DRAW_IMAGE are in alphabetical order\n this.anchorX_ * this.imagePixelRatio_, this.anchorY_ * this.imagePixelRatio_, Math.ceil(this.height_ * this.imagePixelRatio_), this.opacity_, this.originX_ * this.imagePixelRatio_, this.originY_ * this.imagePixelRatio_, this.rotateWithView_, this.rotation_, [this.scale_[0] * this.pixelRatio / this.imagePixelRatio_, this.scale_[1] * this.pixelRatio / this.imagePixelRatio_], Math.ceil(this.width_ * this.imagePixelRatio_), this.declutterMode_, this.declutterImageWithText_]);\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].DRAW_IMAGE, myBegin, myEnd, this.hitDetectionImage_,\n // Remaining arguments to DRAW_IMAGE are in alphabetical order\n this.anchorX_, this.anchorY_, this.height_, 1, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_, this.width_, this.declutterMode_, this.declutterImageWithText_]);\n this.endGeometry(feature);\n }\n\n /**\n * @param {import(\"../../geom/MultiPoint.js\").default|import(\"../Feature.js\").default} multiPointGeometry MultiPoint geometry.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n */\n drawMultiPoint(multiPointGeometry, feature) {\n if (!this.image_) {\n return;\n }\n this.beginGeometry(multiPointGeometry, feature);\n const flatCoordinates = multiPointGeometry.getFlatCoordinates();\n const stride = multiPointGeometry.getStride();\n const myBegin = this.coordinates.length;\n const myEnd = this.appendFlatPointCoordinates(flatCoordinates, stride);\n this.instructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].DRAW_IMAGE, myBegin, myEnd, this.image_,\n // Remaining arguments to DRAW_IMAGE are in alphabetical order\n this.anchorX_ * this.imagePixelRatio_, this.anchorY_ * this.imagePixelRatio_, Math.ceil(this.height_ * this.imagePixelRatio_), this.opacity_, this.originX_ * this.imagePixelRatio_, this.originY_ * this.imagePixelRatio_, this.rotateWithView_, this.rotation_, [this.scale_[0] * this.pixelRatio / this.imagePixelRatio_, this.scale_[1] * this.pixelRatio / this.imagePixelRatio_], Math.ceil(this.width_ * this.imagePixelRatio_), this.declutterMode_, this.declutterImageWithText_]);\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].DRAW_IMAGE, myBegin, myEnd, this.hitDetectionImage_,\n // Remaining arguments to DRAW_IMAGE are in alphabetical order\n this.anchorX_, this.anchorY_, this.height_, 1, this.originX_, this.originY_, this.rotateWithView_, this.rotation_, this.scale_, this.width_, this.declutterMode_, this.declutterImageWithText_]);\n this.endGeometry(feature);\n }\n\n /**\n * @return {import(\"../canvas.js\").SerializableInstructions} the serializable instructions.\n */\n finish() {\n this.reverseHitDetectionInstructions();\n // FIXME this doesn't really protect us against further calls to draw*Geometry\n this.anchorX_ = undefined;\n this.anchorY_ = undefined;\n this.hitDetectionImage_ = null;\n this.image_ = null;\n this.imagePixelRatio_ = undefined;\n this.height_ = undefined;\n this.scale_ = undefined;\n this.opacity_ = undefined;\n this.originX_ = undefined;\n this.originY_ = undefined;\n this.rotateWithView_ = undefined;\n this.rotation_ = undefined;\n this.width_ = undefined;\n return super.finish();\n }\n\n /**\n * @param {import(\"../../style/Image.js\").default} imageStyle Image style.\n * @param {Object} [sharedData] Shared data.\n */\n setImageStyle(imageStyle, sharedData) {\n const anchor = imageStyle.getAnchor();\n const size = imageStyle.getSize();\n const origin = imageStyle.getOrigin();\n this.imagePixelRatio_ = imageStyle.getPixelRatio(this.pixelRatio);\n this.anchorX_ = anchor[0];\n this.anchorY_ = anchor[1];\n this.hitDetectionImage_ = imageStyle.getHitDetectionImage();\n this.image_ = imageStyle.getImage(this.pixelRatio);\n this.height_ = size[1];\n this.opacity_ = imageStyle.getOpacity();\n this.originX_ = origin[0];\n this.originY_ = origin[1];\n this.rotateWithView_ = imageStyle.getRotateWithView();\n this.rotation_ = imageStyle.getRotation();\n this.scale_ = imageStyle.getScaleArray();\n this.width_ = size[0];\n this.declutterMode_ = imageStyle.getDeclutterMode();\n this.declutterImageWithText_ = sharedData;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (CanvasImageBuilder);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/canvas/ImageBuilder.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/canvas/Immediate.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ol/render/canvas/Immediate.js ***!
|
||
\****************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _VectorContext_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../VectorContext.js */ \"./node_modules/ol/render/VectorContext.js\");\n/* harmony import */ var _colorlike_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../colorlike.js */ \"./node_modules/ol/colorlike.js\");\n/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../transform.js */ \"./node_modules/ol/transform.js\");\n/* harmony import */ var _canvas_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../canvas.js */ \"./node_modules/ol/render/canvas.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../math.js */ \"./node_modules/ol/math.js\");\n/* harmony import */ var _geom_flat_transform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../geom/flat/transform.js */ \"./node_modules/ol/geom/flat/transform.js\");\n/* harmony import */ var _geom_SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../geom/SimpleGeometry.js */ \"./node_modules/ol/geom/SimpleGeometry.js\");\n/**\n * @module ol/render/canvas/Immediate\n */\n// FIXME test, especially polygons with holes and multipolygons\n// FIXME need to handle large thick features (where pixel size matters)\n// FIXME add offset and end to ol/geom/flat/transform~transform2D?\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * A concrete subclass of {@link module:ol/render/VectorContext~VectorContext} that implements\n * direct rendering of features and geometries to an HTML5 Canvas context.\n * Instances of this class are created internally by the library and\n * provided to application code as vectorContext member of the\n * {@link module:ol/render/Event~RenderEvent} object associated with postcompose, precompose and\n * render events emitted by layers and maps.\n */\nclass CanvasImmediateRenderer extends _VectorContext_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n * @param {number} viewRotation View rotation.\n * @param {number} [squaredTolerance] Optional squared tolerance for simplification.\n * @param {import(\"../../proj.js\").TransformFunction} [userTransform] Transform from user to view projection.\n */\n constructor(context, pixelRatio, extent, transform, viewRotation, squaredTolerance, userTransform) {\n super();\n\n /**\n * @private\n * @type {CanvasRenderingContext2D}\n */\n this.context_ = context;\n\n /**\n * @private\n * @type {number}\n */\n this.pixelRatio_ = pixelRatio;\n\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n this.extent_ = extent;\n\n /**\n * @private\n * @type {import(\"../../transform.js\").Transform}\n */\n this.transform_ = transform;\n\n /**\n * @private\n * @type {number}\n */\n this.transformRotation_ = transform ? (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.toFixed)(Math.atan2(transform[1], transform[0]), 10) : 0;\n\n /**\n * @private\n * @type {number}\n */\n this.viewRotation_ = viewRotation;\n\n /**\n * @private\n * @type {number}\n */\n this.squaredTolerance_ = squaredTolerance;\n\n /**\n * @private\n * @type {import(\"../../proj.js\").TransformFunction}\n */\n this.userTransform_ = userTransform;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").FillState}\n */\n this.contextFillState_ = null;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").StrokeState}\n */\n this.contextStrokeState_ = null;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").TextState}\n */\n this.contextTextState_ = null;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").FillState}\n */\n this.fillState_ = null;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").StrokeState}\n */\n this.strokeState_ = null;\n\n /**\n * @private\n * @type {import('../../DataTile.js').ImageLike}\n */\n this.image_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.imageAnchorX_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.imageAnchorY_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.imageHeight_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.imageOpacity_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.imageOriginX_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.imageOriginY_ = 0;\n\n /**\n * @private\n * @type {boolean}\n */\n this.imageRotateWithView_ = false;\n\n /**\n * @private\n * @type {number}\n */\n this.imageRotation_ = 0;\n\n /**\n * @private\n * @type {import(\"../../size.js\").Size}\n */\n this.imageScale_ = [0, 0];\n\n /**\n * @private\n * @type {number}\n */\n this.imageWidth_ = 0;\n\n /**\n * @private\n * @type {string}\n */\n this.text_ = '';\n\n /**\n * @private\n * @type {number}\n */\n this.textOffsetX_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.textOffsetY_ = 0;\n\n /**\n * @private\n * @type {boolean}\n */\n this.textRotateWithView_ = false;\n\n /**\n * @private\n * @type {number}\n */\n this.textRotation_ = 0;\n\n /**\n * @private\n * @type {import(\"../../size.js\").Size}\n */\n this.textScale_ = [0, 0];\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").FillState}\n */\n this.textFillState_ = null;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").StrokeState}\n */\n this.textStrokeState_ = null;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").TextState}\n */\n this.textState_ = null;\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.pixelCoordinates_ = [];\n\n /**\n * @private\n * @type {import(\"../../transform.js\").Transform}\n */\n this.tmpLocalTransform_ = (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.create)();\n }\n\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @private\n */\n drawImages_(flatCoordinates, offset, end, stride) {\n if (!this.image_) {\n return;\n }\n const pixelCoordinates = (0,_geom_flat_transform_js__WEBPACK_IMPORTED_MODULE_3__.transform2D)(flatCoordinates, offset, end, stride, this.transform_, this.pixelCoordinates_);\n const context = this.context_;\n const localTransform = this.tmpLocalTransform_;\n const alpha = context.globalAlpha;\n if (this.imageOpacity_ != 1) {\n context.globalAlpha = alpha * this.imageOpacity_;\n }\n let rotation = this.imageRotation_;\n if (this.transformRotation_ === 0) {\n rotation -= this.viewRotation_;\n }\n if (this.imageRotateWithView_) {\n rotation += this.viewRotation_;\n }\n for (let i = 0, ii = pixelCoordinates.length; i < ii; i += 2) {\n const x = pixelCoordinates[i] - this.imageAnchorX_;\n const y = pixelCoordinates[i + 1] - this.imageAnchorY_;\n if (rotation !== 0 || this.imageScale_[0] != 1 || this.imageScale_[1] != 1) {\n const centerX = x + this.imageAnchorX_;\n const centerY = y + this.imageAnchorY_;\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.compose)(localTransform, centerX, centerY, 1, 1, rotation, -centerX, -centerY);\n context.save();\n context.transform.apply(context, localTransform);\n context.translate(centerX, centerY);\n context.scale(this.imageScale_[0], this.imageScale_[1]);\n context.drawImage(this.image_, this.imageOriginX_, this.imageOriginY_, this.imageWidth_, this.imageHeight_, -this.imageAnchorX_, -this.imageAnchorY_, this.imageWidth_, this.imageHeight_);\n context.restore();\n } else {\n context.drawImage(this.image_, this.imageOriginX_, this.imageOriginY_, this.imageWidth_, this.imageHeight_, x, y, this.imageWidth_, this.imageHeight_);\n }\n }\n if (this.imageOpacity_ != 1) {\n context.globalAlpha = alpha;\n }\n }\n\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @private\n */\n drawText_(flatCoordinates, offset, end, stride) {\n if (!this.textState_ || this.text_ === '') {\n return;\n }\n if (this.textFillState_) {\n this.setContextFillState_(this.textFillState_);\n }\n if (this.textStrokeState_) {\n this.setContextStrokeState_(this.textStrokeState_);\n }\n this.setContextTextState_(this.textState_);\n const pixelCoordinates = (0,_geom_flat_transform_js__WEBPACK_IMPORTED_MODULE_3__.transform2D)(flatCoordinates, offset, end, stride, this.transform_, this.pixelCoordinates_);\n const context = this.context_;\n let rotation = this.textRotation_;\n if (this.transformRotation_ === 0) {\n rotation -= this.viewRotation_;\n }\n if (this.textRotateWithView_) {\n rotation += this.viewRotation_;\n }\n for (; offset < end; offset += stride) {\n const x = pixelCoordinates[offset] + this.textOffsetX_;\n const y = pixelCoordinates[offset + 1] + this.textOffsetY_;\n if (rotation !== 0 || this.textScale_[0] != 1 || this.textScale_[1] != 1) {\n context.save();\n context.translate(x - this.textOffsetX_, y - this.textOffsetY_);\n context.rotate(rotation);\n context.translate(this.textOffsetX_, this.textOffsetY_);\n context.scale(this.textScale_[0], this.textScale_[1]);\n if (this.textStrokeState_) {\n context.strokeText(this.text_, 0, 0);\n }\n if (this.textFillState_) {\n context.fillText(this.text_, 0, 0);\n }\n context.restore();\n } else {\n if (this.textStrokeState_) {\n context.strokeText(this.text_, x, y);\n }\n if (this.textFillState_) {\n context.fillText(this.text_, x, y);\n }\n }\n }\n }\n\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @param {boolean} close Close.\n * @private\n * @return {number} end End.\n */\n moveToLineTo_(flatCoordinates, offset, end, stride, close) {\n const context = this.context_;\n const pixelCoordinates = (0,_geom_flat_transform_js__WEBPACK_IMPORTED_MODULE_3__.transform2D)(flatCoordinates, offset, end, stride, this.transform_, this.pixelCoordinates_);\n context.moveTo(pixelCoordinates[0], pixelCoordinates[1]);\n let length = pixelCoordinates.length;\n if (close) {\n length -= 2;\n }\n for (let i = 2; i < length; i += 2) {\n context.lineTo(pixelCoordinates[i], pixelCoordinates[i + 1]);\n }\n if (close) {\n context.closePath();\n }\n return end;\n }\n\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @private\n * @return {number} End.\n */\n drawRings_(flatCoordinates, offset, ends, stride) {\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n offset = this.moveToLineTo_(flatCoordinates, offset, ends[i], stride, true);\n }\n return offset;\n }\n\n /**\n * Render a circle geometry into the canvas. Rendering is immediate and uses\n * the current fill and stroke styles.\n *\n * @param {import(\"../../geom/Circle.js\").default} geometry Circle geometry.\n * @api\n */\n drawCircle(geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/Circle.js\").default} */\n geometry.simplifyTransformed(this.squaredTolerance_, this.userTransform_);\n }\n if (!(0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.intersects)(this.extent_, geometry.getExtent())) {\n return;\n }\n if (this.fillState_ || this.strokeState_) {\n if (this.fillState_) {\n this.setContextFillState_(this.fillState_);\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n }\n const pixelCoordinates = (0,_geom_SimpleGeometry_js__WEBPACK_IMPORTED_MODULE_5__.transformGeom2D)(geometry, this.transform_, this.pixelCoordinates_);\n const dx = pixelCoordinates[2] - pixelCoordinates[0];\n const dy = pixelCoordinates[3] - pixelCoordinates[1];\n const radius = Math.sqrt(dx * dx + dy * dy);\n const context = this.context_;\n context.beginPath();\n context.arc(pixelCoordinates[0], pixelCoordinates[1], radius, 0, 2 * Math.PI);\n if (this.fillState_) {\n context.fill();\n }\n if (this.strokeState_) {\n context.stroke();\n }\n }\n if (this.text_ !== '') {\n this.drawText_(geometry.getCenter(), 0, 2, 2);\n }\n }\n\n /**\n * Set the rendering style. Note that since this is an immediate rendering API,\n * any `zIndex` on the provided style will be ignored.\n *\n * @param {import(\"../../style/Style.js\").default} style The rendering style.\n * @api\n */\n setStyle(style) {\n this.setFillStrokeStyle(style.getFill(), style.getStroke());\n this.setImageStyle(style.getImage());\n this.setTextStyle(style.getText());\n }\n\n /**\n * @param {import(\"../../transform.js\").Transform} transform Transform.\n */\n setTransform(transform) {\n this.transform_ = transform;\n }\n\n /**\n * Render a geometry into the canvas. Call\n * {@link module:ol/render/canvas/Immediate~CanvasImmediateRenderer#setStyle renderer.setStyle()} first to set the rendering style.\n *\n * @param {import(\"../../geom/Geometry.js\").default|import(\"../Feature.js\").default} geometry The geometry to render.\n * @api\n */\n drawGeometry(geometry) {\n const type = geometry.getType();\n switch (type) {\n case 'Point':\n this.drawPoint(/** @type {import(\"../../geom/Point.js\").default} */geometry);\n break;\n case 'LineString':\n this.drawLineString(/** @type {import(\"../../geom/LineString.js\").default} */geometry);\n break;\n case 'Polygon':\n this.drawPolygon(/** @type {import(\"../../geom/Polygon.js\").default} */geometry);\n break;\n case 'MultiPoint':\n this.drawMultiPoint(/** @type {import(\"../../geom/MultiPoint.js\").default} */geometry);\n break;\n case 'MultiLineString':\n this.drawMultiLineString(/** @type {import(\"../../geom/MultiLineString.js\").default} */\n geometry);\n break;\n case 'MultiPolygon':\n this.drawMultiPolygon(/** @type {import(\"../../geom/MultiPolygon.js\").default} */geometry);\n break;\n case 'GeometryCollection':\n this.drawGeometryCollection(/** @type {import(\"../../geom/GeometryCollection.js\").default} */\n geometry);\n break;\n case 'Circle':\n this.drawCircle(/** @type {import(\"../../geom/Circle.js\").default} */geometry);\n break;\n default:\n }\n }\n\n /**\n * Render a feature into the canvas. Note that any `zIndex` on the provided\n * style will be ignored - features are rendered immediately in the order that\n * this method is called. If you need `zIndex` support, you should be using an\n * {@link module:ol/layer/Vector~VectorLayer} instead.\n *\n * @param {import(\"../../Feature.js\").default} feature Feature.\n * @param {import(\"../../style/Style.js\").default} style Style.\n * @api\n */\n drawFeature(feature, style) {\n const geometry = style.getGeometryFunction()(feature);\n if (!geometry) {\n return;\n }\n this.setStyle(style);\n this.drawGeometry(geometry);\n }\n\n /**\n * Render a GeometryCollection to the canvas. Rendering is immediate and\n * uses the current styles appropriate for each geometry in the collection.\n *\n * @param {import(\"../../geom/GeometryCollection.js\").default} geometry Geometry collection.\n */\n drawGeometryCollection(geometry) {\n const geometries = geometry.getGeometriesArray();\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n this.drawGeometry(geometries[i]);\n }\n }\n\n /**\n * Render a Point geometry into the canvas. Rendering is immediate and uses\n * the current style.\n *\n * @param {import(\"../../geom/Point.js\").default|import(\"../Feature.js\").default} geometry Point geometry.\n */\n drawPoint(geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/Point.js\").default} */\n geometry.simplifyTransformed(this.squaredTolerance_, this.userTransform_);\n }\n const flatCoordinates = geometry.getFlatCoordinates();\n const stride = geometry.getStride();\n if (this.image_) {\n this.drawImages_(flatCoordinates, 0, flatCoordinates.length, stride);\n }\n if (this.text_ !== '') {\n this.drawText_(flatCoordinates, 0, flatCoordinates.length, stride);\n }\n }\n\n /**\n * Render a MultiPoint geometry into the canvas. Rendering is immediate and\n * uses the current style.\n *\n * @param {import(\"../../geom/MultiPoint.js\").default|import(\"../Feature.js\").default} geometry MultiPoint geometry.\n */\n drawMultiPoint(geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/MultiPoint.js\").default} */\n geometry.simplifyTransformed(this.squaredTolerance_, this.userTransform_);\n }\n const flatCoordinates = geometry.getFlatCoordinates();\n const stride = geometry.getStride();\n if (this.image_) {\n this.drawImages_(flatCoordinates, 0, flatCoordinates.length, stride);\n }\n if (this.text_ !== '') {\n this.drawText_(flatCoordinates, 0, flatCoordinates.length, stride);\n }\n }\n\n /**\n * Render a LineString into the canvas. Rendering is immediate and uses\n * the current style.\n *\n * @param {import(\"../../geom/LineString.js\").default|import(\"../Feature.js\").default} geometry LineString geometry.\n */\n drawLineString(geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/LineString.js\").default} */\n geometry.simplifyTransformed(this.squaredTolerance_, this.userTransform_);\n }\n if (!(0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.intersects)(this.extent_, geometry.getExtent())) {\n return;\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n const context = this.context_;\n const flatCoordinates = geometry.getFlatCoordinates();\n context.beginPath();\n this.moveToLineTo_(flatCoordinates, 0, flatCoordinates.length, geometry.getStride(), false);\n context.stroke();\n }\n if (this.text_ !== '') {\n const flatMidpoint = geometry.getFlatMidpoint();\n this.drawText_(flatMidpoint, 0, 2, 2);\n }\n }\n\n /**\n * Render a MultiLineString geometry into the canvas. Rendering is immediate\n * and uses the current style.\n *\n * @param {import(\"../../geom/MultiLineString.js\").default|import(\"../Feature.js\").default} geometry MultiLineString geometry.\n */\n drawMultiLineString(geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/MultiLineString.js\").default} */\n geometry.simplifyTransformed(this.squaredTolerance_, this.userTransform_);\n }\n const geometryExtent = geometry.getExtent();\n if (!(0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.intersects)(this.extent_, geometryExtent)) {\n return;\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n const context = this.context_;\n const flatCoordinates = geometry.getFlatCoordinates();\n let offset = 0;\n const ends = /** @type {Array<number>} */geometry.getEnds();\n const stride = geometry.getStride();\n context.beginPath();\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n offset = this.moveToLineTo_(flatCoordinates, offset, ends[i], stride, false);\n }\n context.stroke();\n }\n if (this.text_ !== '') {\n const flatMidpoints = geometry.getFlatMidpoints();\n this.drawText_(flatMidpoints, 0, flatMidpoints.length, 2);\n }\n }\n\n /**\n * Render a Polygon geometry into the canvas. Rendering is immediate and uses\n * the current style.\n *\n * @param {import(\"../../geom/Polygon.js\").default|import(\"../Feature.js\").default} geometry Polygon geometry.\n */\n drawPolygon(geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/Polygon.js\").default} */\n geometry.simplifyTransformed(this.squaredTolerance_, this.userTransform_);\n }\n if (!(0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.intersects)(this.extent_, geometry.getExtent())) {\n return;\n }\n if (this.strokeState_ || this.fillState_) {\n if (this.fillState_) {\n this.setContextFillState_(this.fillState_);\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n }\n const context = this.context_;\n context.beginPath();\n this.drawRings_(geometry.getOrientedFlatCoordinates(), 0, /** @type {Array<number>} */geometry.getEnds(), geometry.getStride());\n if (this.fillState_) {\n context.fill();\n }\n if (this.strokeState_) {\n context.stroke();\n }\n }\n if (this.text_ !== '') {\n const flatInteriorPoint = geometry.getFlatInteriorPoint();\n this.drawText_(flatInteriorPoint, 0, 2, 2);\n }\n }\n\n /**\n * Render MultiPolygon geometry into the canvas. Rendering is immediate and\n * uses the current style.\n * @param {import(\"../../geom/MultiPolygon.js\").default} geometry MultiPolygon geometry.\n */\n drawMultiPolygon(geometry) {\n if (this.squaredTolerance_) {\n geometry = /** @type {import(\"../../geom/MultiPolygon.js\").default} */\n geometry.simplifyTransformed(this.squaredTolerance_, this.userTransform_);\n }\n if (!(0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.intersects)(this.extent_, geometry.getExtent())) {\n return;\n }\n if (this.strokeState_ || this.fillState_) {\n if (this.fillState_) {\n this.setContextFillState_(this.fillState_);\n }\n if (this.strokeState_) {\n this.setContextStrokeState_(this.strokeState_);\n }\n const context = this.context_;\n const flatCoordinates = geometry.getOrientedFlatCoordinates();\n let offset = 0;\n const endss = geometry.getEndss();\n const stride = geometry.getStride();\n context.beginPath();\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n const ends = endss[i];\n offset = this.drawRings_(flatCoordinates, offset, ends, stride);\n }\n if (this.fillState_) {\n context.fill();\n }\n if (this.strokeState_) {\n context.stroke();\n }\n }\n if (this.text_ !== '') {\n const flatInteriorPoints = geometry.getFlatInteriorPoints();\n this.drawText_(flatInteriorPoints, 0, flatInteriorPoints.length, 2);\n }\n }\n\n /**\n * @param {import(\"../canvas.js\").FillState} fillState Fill state.\n * @private\n */\n setContextFillState_(fillState) {\n const context = this.context_;\n const contextFillState = this.contextFillState_;\n if (!contextFillState) {\n context.fillStyle = fillState.fillStyle;\n this.contextFillState_ = {\n fillStyle: fillState.fillStyle\n };\n } else {\n if (contextFillState.fillStyle != fillState.fillStyle) {\n contextFillState.fillStyle = fillState.fillStyle;\n context.fillStyle = fillState.fillStyle;\n }\n }\n }\n\n /**\n * @param {import(\"../canvas.js\").StrokeState} strokeState Stroke state.\n * @private\n */\n setContextStrokeState_(strokeState) {\n const context = this.context_;\n const contextStrokeState = this.contextStrokeState_;\n if (!contextStrokeState) {\n context.lineCap = strokeState.lineCap;\n context.setLineDash(strokeState.lineDash);\n context.lineDashOffset = strokeState.lineDashOffset;\n context.lineJoin = strokeState.lineJoin;\n context.lineWidth = strokeState.lineWidth;\n context.miterLimit = strokeState.miterLimit;\n context.strokeStyle = strokeState.strokeStyle;\n this.contextStrokeState_ = {\n lineCap: strokeState.lineCap,\n lineDash: strokeState.lineDash,\n lineDashOffset: strokeState.lineDashOffset,\n lineJoin: strokeState.lineJoin,\n lineWidth: strokeState.lineWidth,\n miterLimit: strokeState.miterLimit,\n strokeStyle: strokeState.strokeStyle\n };\n } else {\n if (contextStrokeState.lineCap != strokeState.lineCap) {\n contextStrokeState.lineCap = strokeState.lineCap;\n context.lineCap = strokeState.lineCap;\n }\n if (!(0,_array_js__WEBPACK_IMPORTED_MODULE_6__.equals)(contextStrokeState.lineDash, strokeState.lineDash)) {\n context.setLineDash(contextStrokeState.lineDash = strokeState.lineDash);\n }\n if (contextStrokeState.lineDashOffset != strokeState.lineDashOffset) {\n contextStrokeState.lineDashOffset = strokeState.lineDashOffset;\n context.lineDashOffset = strokeState.lineDashOffset;\n }\n if (contextStrokeState.lineJoin != strokeState.lineJoin) {\n contextStrokeState.lineJoin = strokeState.lineJoin;\n context.lineJoin = strokeState.lineJoin;\n }\n if (contextStrokeState.lineWidth != strokeState.lineWidth) {\n contextStrokeState.lineWidth = strokeState.lineWidth;\n context.lineWidth = strokeState.lineWidth;\n }\n if (contextStrokeState.miterLimit != strokeState.miterLimit) {\n contextStrokeState.miterLimit = strokeState.miterLimit;\n context.miterLimit = strokeState.miterLimit;\n }\n if (contextStrokeState.strokeStyle != strokeState.strokeStyle) {\n contextStrokeState.strokeStyle = strokeState.strokeStyle;\n context.strokeStyle = strokeState.strokeStyle;\n }\n }\n }\n\n /**\n * @param {import(\"../canvas.js\").TextState} textState Text state.\n * @private\n */\n setContextTextState_(textState) {\n const context = this.context_;\n const contextTextState = this.contextTextState_;\n const textAlign = textState.textAlign ? textState.textAlign : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultTextAlign;\n if (!contextTextState) {\n context.font = textState.font;\n context.textAlign = textAlign;\n context.textBaseline = textState.textBaseline;\n this.contextTextState_ = {\n font: textState.font,\n textAlign: textAlign,\n textBaseline: textState.textBaseline\n };\n } else {\n if (contextTextState.font != textState.font) {\n contextTextState.font = textState.font;\n context.font = textState.font;\n }\n if (contextTextState.textAlign != textAlign) {\n contextTextState.textAlign = textAlign;\n context.textAlign = textAlign;\n }\n if (contextTextState.textBaseline != textState.textBaseline) {\n contextTextState.textBaseline = textState.textBaseline;\n context.textBaseline = textState.textBaseline;\n }\n }\n }\n\n /**\n * Set the fill and stroke style for subsequent draw operations. To clear\n * either fill or stroke styles, pass null for the appropriate parameter.\n *\n * @param {import(\"../../style/Fill.js\").default} fillStyle Fill style.\n * @param {import(\"../../style/Stroke.js\").default} strokeStyle Stroke style.\n */\n setFillStrokeStyle(fillStyle, strokeStyle) {\n if (!fillStyle) {\n this.fillState_ = null;\n } else {\n const fillStyleColor = fillStyle.getColor();\n this.fillState_ = {\n fillStyle: (0,_colorlike_js__WEBPACK_IMPORTED_MODULE_8__.asColorLike)(fillStyleColor ? fillStyleColor : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultFillStyle)\n };\n }\n if (!strokeStyle) {\n this.strokeState_ = null;\n } else {\n const strokeStyleColor = strokeStyle.getColor();\n const strokeStyleLineCap = strokeStyle.getLineCap();\n const strokeStyleLineDash = strokeStyle.getLineDash();\n const strokeStyleLineDashOffset = strokeStyle.getLineDashOffset();\n const strokeStyleLineJoin = strokeStyle.getLineJoin();\n const strokeStyleWidth = strokeStyle.getWidth();\n const strokeStyleMiterLimit = strokeStyle.getMiterLimit();\n const lineDash = strokeStyleLineDash ? strokeStyleLineDash : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultLineDash;\n this.strokeState_ = {\n lineCap: strokeStyleLineCap !== undefined ? strokeStyleLineCap : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultLineCap,\n lineDash: this.pixelRatio_ === 1 ? lineDash : lineDash.map(n => n * this.pixelRatio_),\n lineDashOffset: (strokeStyleLineDashOffset ? strokeStyleLineDashOffset : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultLineDashOffset) * this.pixelRatio_,\n lineJoin: strokeStyleLineJoin !== undefined ? strokeStyleLineJoin : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultLineJoin,\n lineWidth: (strokeStyleWidth !== undefined ? strokeStyleWidth : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultLineWidth) * this.pixelRatio_,\n miterLimit: strokeStyleMiterLimit !== undefined ? strokeStyleMiterLimit : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultMiterLimit,\n strokeStyle: (0,_colorlike_js__WEBPACK_IMPORTED_MODULE_8__.asColorLike)(strokeStyleColor ? strokeStyleColor : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultStrokeStyle)\n };\n }\n }\n\n /**\n * Set the image style for subsequent draw operations. Pass null to remove\n * the image style.\n *\n * @param {import(\"../../style/Image.js\").default} imageStyle Image style.\n */\n setImageStyle(imageStyle) {\n let imageSize;\n if (!imageStyle || !(imageSize = imageStyle.getSize())) {\n this.image_ = null;\n return;\n }\n const imagePixelRatio = imageStyle.getPixelRatio(this.pixelRatio_);\n const imageAnchor = imageStyle.getAnchor();\n const imageOrigin = imageStyle.getOrigin();\n this.image_ = imageStyle.getImage(this.pixelRatio_);\n this.imageAnchorX_ = imageAnchor[0] * imagePixelRatio;\n this.imageAnchorY_ = imageAnchor[1] * imagePixelRatio;\n this.imageHeight_ = imageSize[1] * imagePixelRatio;\n this.imageOpacity_ = imageStyle.getOpacity();\n this.imageOriginX_ = imageOrigin[0];\n this.imageOriginY_ = imageOrigin[1];\n this.imageRotateWithView_ = imageStyle.getRotateWithView();\n this.imageRotation_ = imageStyle.getRotation();\n const imageScale = imageStyle.getScaleArray();\n this.imageScale_ = [imageScale[0] * this.pixelRatio_ / imagePixelRatio, imageScale[1] * this.pixelRatio_ / imagePixelRatio];\n this.imageWidth_ = imageSize[0] * imagePixelRatio;\n }\n\n /**\n * Set the text style for subsequent draw operations. Pass null to\n * remove the text style.\n *\n * @param {import(\"../../style/Text.js\").default} textStyle Text style.\n */\n setTextStyle(textStyle) {\n if (!textStyle) {\n this.text_ = '';\n } else {\n const textFillStyle = textStyle.getFill();\n if (!textFillStyle) {\n this.textFillState_ = null;\n } else {\n const textFillStyleColor = textFillStyle.getColor();\n this.textFillState_ = {\n fillStyle: (0,_colorlike_js__WEBPACK_IMPORTED_MODULE_8__.asColorLike)(textFillStyleColor ? textFillStyleColor : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultFillStyle)\n };\n }\n const textStrokeStyle = textStyle.getStroke();\n if (!textStrokeStyle) {\n this.textStrokeState_ = null;\n } else {\n const textStrokeStyleColor = textStrokeStyle.getColor();\n const textStrokeStyleLineCap = textStrokeStyle.getLineCap();\n const textStrokeStyleLineDash = textStrokeStyle.getLineDash();\n const textStrokeStyleLineDashOffset = textStrokeStyle.getLineDashOffset();\n const textStrokeStyleLineJoin = textStrokeStyle.getLineJoin();\n const textStrokeStyleWidth = textStrokeStyle.getWidth();\n const textStrokeStyleMiterLimit = textStrokeStyle.getMiterLimit();\n this.textStrokeState_ = {\n lineCap: textStrokeStyleLineCap !== undefined ? textStrokeStyleLineCap : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultLineCap,\n lineDash: textStrokeStyleLineDash ? textStrokeStyleLineDash : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultLineDash,\n lineDashOffset: textStrokeStyleLineDashOffset ? textStrokeStyleLineDashOffset : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultLineDashOffset,\n lineJoin: textStrokeStyleLineJoin !== undefined ? textStrokeStyleLineJoin : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultLineJoin,\n lineWidth: textStrokeStyleWidth !== undefined ? textStrokeStyleWidth : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultLineWidth,\n miterLimit: textStrokeStyleMiterLimit !== undefined ? textStrokeStyleMiterLimit : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultMiterLimit,\n strokeStyle: (0,_colorlike_js__WEBPACK_IMPORTED_MODULE_8__.asColorLike)(textStrokeStyleColor ? textStrokeStyleColor : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultStrokeStyle)\n };\n }\n const textFont = textStyle.getFont();\n const textOffsetX = textStyle.getOffsetX();\n const textOffsetY = textStyle.getOffsetY();\n const textRotateWithView = textStyle.getRotateWithView();\n const textRotation = textStyle.getRotation();\n const textScale = textStyle.getScaleArray();\n const textText = textStyle.getText();\n const textTextAlign = textStyle.getTextAlign();\n const textTextBaseline = textStyle.getTextBaseline();\n this.textState_ = {\n font: textFont !== undefined ? textFont : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultFont,\n textAlign: textTextAlign !== undefined ? textTextAlign : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultTextAlign,\n textBaseline: textTextBaseline !== undefined ? textTextBaseline : _canvas_js__WEBPACK_IMPORTED_MODULE_7__.defaultTextBaseline\n };\n this.text_ = textText !== undefined ? Array.isArray(textText) ? textText.reduce((acc, t, i) => acc += i % 2 ? ' ' : t, '') : textText : '';\n this.textOffsetX_ = textOffsetX !== undefined ? this.pixelRatio_ * textOffsetX : 0;\n this.textOffsetY_ = textOffsetY !== undefined ? this.pixelRatio_ * textOffsetY : 0;\n this.textRotateWithView_ = textRotateWithView !== undefined ? textRotateWithView : false;\n this.textRotation_ = textRotation !== undefined ? textRotation : 0;\n this.textScale_ = [this.pixelRatio_ * textScale[0], this.pixelRatio_ * textScale[1]];\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (CanvasImmediateRenderer);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/canvas/Immediate.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/canvas/Instruction.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/ol/render/canvas/Instruction.js ***!
|
||
\******************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ beginPathInstruction: function() { return /* binding */ beginPathInstruction; },\n/* harmony export */ closePathInstruction: function() { return /* binding */ closePathInstruction; },\n/* harmony export */ fillInstruction: function() { return /* binding */ fillInstruction; },\n/* harmony export */ strokeInstruction: function() { return /* binding */ strokeInstruction; }\n/* harmony export */ });\n/**\n * @module ol/render/canvas/Instruction\n */\n\n/**\n * @enum {number}\n */\nconst Instruction = {\n BEGIN_GEOMETRY: 0,\n BEGIN_PATH: 1,\n CIRCLE: 2,\n CLOSE_PATH: 3,\n CUSTOM: 4,\n DRAW_CHARS: 5,\n DRAW_IMAGE: 6,\n END_GEOMETRY: 7,\n FILL: 8,\n MOVE_TO_LINE_TO: 9,\n SET_FILL_STYLE: 10,\n SET_STROKE_STYLE: 11,\n STROKE: 12\n};\n\n/**\n * @type {Array<Instruction>}\n */\nconst fillInstruction = [Instruction.FILL];\n\n/**\n * @type {Array<Instruction>}\n */\nconst strokeInstruction = [Instruction.STROKE];\n\n/**\n * @type {Array<Instruction>}\n */\nconst beginPathInstruction = [Instruction.BEGIN_PATH];\n\n/**\n * @type {Array<Instruction>}\n */\nconst closePathInstruction = [Instruction.CLOSE_PATH];\n/* harmony default export */ __webpack_exports__[\"default\"] = (Instruction);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/canvas/Instruction.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/canvas/LineStringBuilder.js":
|
||
/*!************************************************************!*\
|
||
!*** ./node_modules/ol/render/canvas/LineStringBuilder.js ***!
|
||
\************************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Builder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Builder.js */ \"./node_modules/ol/render/canvas/Builder.js\");\n/* harmony import */ var _Instruction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Instruction.js */ \"./node_modules/ol/render/canvas/Instruction.js\");\n/* harmony import */ var _canvas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../canvas.js */ \"./node_modules/ol/render/canvas.js\");\n\n/**\n * @module ol/render/canvas/LineStringBuilder\n */\n\n\n\nclass CanvasLineStringBuilder extends _Builder_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {number} tolerance Tolerance.\n * @param {import(\"../../extent.js\").Extent} maxExtent Maximum extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n */\n constructor(tolerance, maxExtent, resolution, pixelRatio) {\n super(tolerance, maxExtent, resolution, pixelRatio);\n }\n\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {number} end End.\n * @param {number} stride Stride.\n * @private\n * @return {number} end.\n */\n drawFlatCoordinates_(flatCoordinates, offset, end, stride) {\n const myBegin = this.coordinates.length;\n const myEnd = this.appendFlatLineCoordinates(flatCoordinates, offset, end, stride, false, false);\n const moveToLineToInstruction = [_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].MOVE_TO_LINE_TO, myBegin, myEnd];\n this.instructions.push(moveToLineToInstruction);\n this.hitDetectionInstructions.push(moveToLineToInstruction);\n return end;\n }\n\n /**\n * @param {import(\"../../geom/LineString.js\").default|import(\"../Feature.js\").default} lineStringGeometry Line string geometry.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n */\n drawLineString(lineStringGeometry, feature) {\n const state = this.state;\n const strokeStyle = state.strokeStyle;\n const lineWidth = state.lineWidth;\n if (strokeStyle === undefined || lineWidth === undefined) {\n return;\n }\n this.updateStrokeStyle(state, this.applyStroke);\n this.beginGeometry(lineStringGeometry, feature);\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].SET_STROKE_STYLE, state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin, state.miterLimit, _canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineDash, _canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineDashOffset], _Instruction_js__WEBPACK_IMPORTED_MODULE_2__.beginPathInstruction);\n const flatCoordinates = lineStringGeometry.getFlatCoordinates();\n const stride = lineStringGeometry.getStride();\n this.drawFlatCoordinates_(flatCoordinates, 0, flatCoordinates.length, stride);\n this.hitDetectionInstructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.strokeInstruction);\n this.endGeometry(feature);\n }\n\n /**\n * @param {import(\"../../geom/MultiLineString.js\").default|import(\"../Feature.js\").default} multiLineStringGeometry MultiLineString geometry.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n */\n drawMultiLineString(multiLineStringGeometry, feature) {\n const state = this.state;\n const strokeStyle = state.strokeStyle;\n const lineWidth = state.lineWidth;\n if (strokeStyle === undefined || lineWidth === undefined) {\n return;\n }\n this.updateStrokeStyle(state, this.applyStroke);\n this.beginGeometry(multiLineStringGeometry, feature);\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].SET_STROKE_STYLE, state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin, state.miterLimit, _canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineDash, _canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineDashOffset], _Instruction_js__WEBPACK_IMPORTED_MODULE_2__.beginPathInstruction);\n const ends = multiLineStringGeometry.getEnds();\n const flatCoordinates = multiLineStringGeometry.getFlatCoordinates();\n const stride = multiLineStringGeometry.getStride();\n let offset = 0;\n for (let i = 0, ii = ends.length; i < ii; ++i) {\n offset = this.drawFlatCoordinates_(flatCoordinates, offset, /** @type {number} */ends[i], stride);\n }\n this.hitDetectionInstructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.strokeInstruction);\n this.endGeometry(feature);\n }\n\n /**\n * @return {import(\"../canvas.js\").SerializableInstructions} the serializable instructions.\n */\n finish() {\n const state = this.state;\n if (state.lastStroke != undefined && state.lastStroke != this.coordinates.length) {\n this.instructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.strokeInstruction);\n }\n this.reverseHitDetectionInstructions();\n this.state = null;\n return super.finish();\n }\n\n /**\n * @param {import(\"../canvas.js\").FillStrokeState} state State.\n */\n applyStroke(state) {\n if (state.lastStroke != undefined && state.lastStroke != this.coordinates.length) {\n this.instructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.strokeInstruction);\n state.lastStroke = this.coordinates.length;\n }\n state.lastStroke = 0;\n super.applyStroke(state);\n this.instructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.beginPathInstruction);\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (CanvasLineStringBuilder);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/canvas/LineStringBuilder.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/canvas/PolygonBuilder.js":
|
||
/*!*********************************************************!*\
|
||
!*** ./node_modules/ol/render/canvas/PolygonBuilder.js ***!
|
||
\*********************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Builder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Builder.js */ \"./node_modules/ol/render/canvas/Builder.js\");\n/* harmony import */ var _Instruction_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Instruction.js */ \"./node_modules/ol/render/canvas/Instruction.js\");\n/* harmony import */ var _canvas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../canvas.js */ \"./node_modules/ol/render/canvas.js\");\n/* harmony import */ var _geom_flat_simplify_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../geom/flat/simplify.js */ \"./node_modules/ol/geom/flat/simplify.js\");\n\n/**\n * @module ol/render/canvas/PolygonBuilder\n */\n\n\n\n\nclass CanvasPolygonBuilder extends _Builder_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {number} tolerance Tolerance.\n * @param {import(\"../../extent.js\").Extent} maxExtent Maximum extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n */\n constructor(tolerance, maxExtent, resolution, pixelRatio) {\n super(tolerance, maxExtent, resolution, pixelRatio);\n }\n\n /**\n * @param {Array<number>} flatCoordinates Flat coordinates.\n * @param {number} offset Offset.\n * @param {Array<number>} ends Ends.\n * @param {number} stride Stride.\n * @private\n * @return {number} End.\n */\n drawFlatCoordinatess_(flatCoordinates, offset, ends, stride) {\n const state = this.state;\n const fill = state.fillStyle !== undefined;\n const stroke = state.strokeStyle !== undefined;\n const numEnds = ends.length;\n this.instructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.beginPathInstruction);\n this.hitDetectionInstructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.beginPathInstruction);\n for (let i = 0; i < numEnds; ++i) {\n const end = ends[i];\n const myBegin = this.coordinates.length;\n const myEnd = this.appendFlatLineCoordinates(flatCoordinates, offset, end, stride, true, !stroke);\n const moveToLineToInstruction = [_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].MOVE_TO_LINE_TO, myBegin, myEnd];\n this.instructions.push(moveToLineToInstruction);\n this.hitDetectionInstructions.push(moveToLineToInstruction);\n if (stroke) {\n // Performance optimization: only call closePath() when we have a stroke.\n // Otherwise the ring is closed already (see appendFlatLineCoordinates above).\n this.instructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.closePathInstruction);\n this.hitDetectionInstructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.closePathInstruction);\n }\n offset = end;\n }\n if (fill) {\n this.instructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.fillInstruction);\n this.hitDetectionInstructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.fillInstruction);\n }\n if (stroke) {\n this.instructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.strokeInstruction);\n this.hitDetectionInstructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.strokeInstruction);\n }\n return offset;\n }\n\n /**\n * @param {import(\"../../geom/Circle.js\").default} circleGeometry Circle geometry.\n * @param {import(\"../../Feature.js\").default} feature Feature.\n */\n drawCircle(circleGeometry, feature) {\n const state = this.state;\n const fillStyle = state.fillStyle;\n const strokeStyle = state.strokeStyle;\n if (fillStyle === undefined && strokeStyle === undefined) {\n return;\n }\n this.setFillStrokeStyles_();\n this.beginGeometry(circleGeometry, feature);\n if (state.fillStyle !== undefined) {\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].SET_FILL_STYLE, _canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultFillStyle]);\n }\n if (state.strokeStyle !== undefined) {\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].SET_STROKE_STYLE, state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin, state.miterLimit, _canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineDash, _canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineDashOffset]);\n }\n const flatCoordinates = circleGeometry.getFlatCoordinates();\n const stride = circleGeometry.getStride();\n const myBegin = this.coordinates.length;\n this.appendFlatLineCoordinates(flatCoordinates, 0, flatCoordinates.length, stride, false, false);\n const circleInstruction = [_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].CIRCLE, myBegin];\n this.instructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.beginPathInstruction, circleInstruction);\n this.hitDetectionInstructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.beginPathInstruction, circleInstruction);\n if (state.fillStyle !== undefined) {\n this.instructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.fillInstruction);\n this.hitDetectionInstructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.fillInstruction);\n }\n if (state.strokeStyle !== undefined) {\n this.instructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.strokeInstruction);\n this.hitDetectionInstructions.push(_Instruction_js__WEBPACK_IMPORTED_MODULE_2__.strokeInstruction);\n }\n this.endGeometry(feature);\n }\n\n /**\n * @param {import(\"../../geom/Polygon.js\").default|import(\"../Feature.js\").default} polygonGeometry Polygon geometry.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n */\n drawPolygon(polygonGeometry, feature) {\n const state = this.state;\n const fillStyle = state.fillStyle;\n const strokeStyle = state.strokeStyle;\n if (fillStyle === undefined && strokeStyle === undefined) {\n return;\n }\n this.setFillStrokeStyles_();\n this.beginGeometry(polygonGeometry, feature);\n if (state.fillStyle !== undefined) {\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].SET_FILL_STYLE, _canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultFillStyle]);\n }\n if (state.strokeStyle !== undefined) {\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].SET_STROKE_STYLE, state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin, state.miterLimit, _canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineDash, _canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineDashOffset]);\n }\n const ends = polygonGeometry.getEnds();\n const flatCoordinates = polygonGeometry.getOrientedFlatCoordinates();\n const stride = polygonGeometry.getStride();\n this.drawFlatCoordinatess_(flatCoordinates, 0, /** @type {Array<number>} */ends, stride);\n this.endGeometry(feature);\n }\n\n /**\n * @param {import(\"../../geom/MultiPolygon.js\").default} multiPolygonGeometry MultiPolygon geometry.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n */\n drawMultiPolygon(multiPolygonGeometry, feature) {\n const state = this.state;\n const fillStyle = state.fillStyle;\n const strokeStyle = state.strokeStyle;\n if (fillStyle === undefined && strokeStyle === undefined) {\n return;\n }\n this.setFillStrokeStyles_();\n this.beginGeometry(multiPolygonGeometry, feature);\n if (state.fillStyle !== undefined) {\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].SET_FILL_STYLE, _canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultFillStyle]);\n }\n if (state.strokeStyle !== undefined) {\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].SET_STROKE_STYLE, state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin, state.miterLimit, _canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineDash, _canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineDashOffset]);\n }\n const endss = multiPolygonGeometry.getEndss();\n const flatCoordinates = multiPolygonGeometry.getOrientedFlatCoordinates();\n const stride = multiPolygonGeometry.getStride();\n let offset = 0;\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n offset = this.drawFlatCoordinatess_(flatCoordinates, offset, endss[i], stride);\n }\n this.endGeometry(feature);\n }\n\n /**\n * @return {import(\"../canvas.js\").SerializableInstructions} the serializable instructions.\n */\n finish() {\n this.reverseHitDetectionInstructions();\n this.state = null;\n // We want to preserve topology when drawing polygons. Polygons are\n // simplified using quantization and point elimination. However, we might\n // have received a mix of quantized and non-quantized geometries, so ensure\n // that all are quantized by quantizing all coordinates in the batch.\n const tolerance = this.tolerance;\n if (tolerance !== 0) {\n const coordinates = this.coordinates;\n for (let i = 0, ii = coordinates.length; i < ii; ++i) {\n coordinates[i] = (0,_geom_flat_simplify_js__WEBPACK_IMPORTED_MODULE_4__.snap)(coordinates[i], tolerance);\n }\n }\n return super.finish();\n }\n\n /**\n * @private\n */\n setFillStrokeStyles_() {\n const state = this.state;\n const fillStyle = state.fillStyle;\n if (fillStyle !== undefined) {\n this.updateFillStyle(state, this.createFill);\n }\n if (state.strokeStyle !== undefined) {\n this.updateStrokeStyle(state, this.applyStroke);\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (CanvasPolygonBuilder);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/canvas/PolygonBuilder.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/canvas/TextBuilder.js":
|
||
/*!******************************************************!*\
|
||
!*** ./node_modules/ol/render/canvas/TextBuilder.js ***!
|
||
\******************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TEXT_ALIGN: function() { return /* binding */ TEXT_ALIGN; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Builder_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Builder.js */ \"./node_modules/ol/render/canvas/Builder.js\");\n/* harmony import */ var _Instruction_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Instruction.js */ \"./node_modules/ol/render/canvas/Instruction.js\");\n/* harmony import */ var _colorlike_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../colorlike.js */ \"./node_modules/ol/colorlike.js\");\n/* harmony import */ var _canvas_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../canvas.js */ \"./node_modules/ol/render/canvas.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _geom_flat_linechunk_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../geom/flat/linechunk.js */ \"./node_modules/ol/geom/flat/linechunk.js\");\n/* harmony import */ var _geom_flat_straightchunk_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../geom/flat/straightchunk.js */ \"./node_modules/ol/geom/flat/straightchunk.js\");\n\n/**\n * @module ol/render/canvas/TextBuilder\n */\n\n\n\n\n\n\n\n\n/**\n * @const\n * @type {{left: 0, center: 0.5, right: 1, top: 0, middle: 0.5, hanging: 0.2, alphabetic: 0.8, ideographic: 0.8, bottom: 1}}\n */\nconst TEXT_ALIGN = {\n 'left': 0,\n 'center': 0.5,\n 'right': 1,\n 'top': 0,\n 'middle': 0.5,\n 'hanging': 0.2,\n 'alphabetic': 0.8,\n 'ideographic': 0.8,\n 'bottom': 1\n};\nclass CanvasTextBuilder extends _Builder_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {number} tolerance Tolerance.\n * @param {import(\"../../extent.js\").Extent} maxExtent Maximum extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n */\n constructor(tolerance, maxExtent, resolution, pixelRatio) {\n super(tolerance, maxExtent, resolution, pixelRatio);\n\n /**\n * @private\n * @type {Array<HTMLCanvasElement>}\n */\n this.labels_ = null;\n\n /**\n * @private\n * @type {string|Array<string>}\n */\n this.text_ = '';\n\n /**\n * @private\n * @type {number}\n */\n this.textOffsetX_ = 0;\n\n /**\n * @private\n * @type {number}\n */\n this.textOffsetY_ = 0;\n\n /**\n * @private\n * @type {boolean|undefined}\n */\n this.textRotateWithView_ = undefined;\n\n /**\n * @private\n * @type {number}\n */\n this.textRotation_ = 0;\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").FillState}\n */\n this.textFillState_ = null;\n\n /**\n * @type {!Object<string, import(\"../canvas.js\").FillState>}\n */\n this.fillStates = {};\n this.fillStates[_canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultFillStyle] = {\n fillStyle: _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultFillStyle\n };\n\n /**\n * @private\n * @type {?import(\"../canvas.js\").StrokeState}\n */\n this.textStrokeState_ = null;\n\n /**\n * @type {!Object<string, import(\"../canvas.js\").StrokeState>}\n */\n this.strokeStates = {};\n\n /**\n * @private\n * @type {import(\"../canvas.js\").TextState}\n */\n this.textState_ = /** @type {import(\"../canvas.js\").TextState} */{};\n\n /**\n * @type {!Object<string, import(\"../canvas.js\").TextState>}\n */\n this.textStates = {};\n\n /**\n * @private\n * @type {string}\n */\n this.textKey_ = '';\n\n /**\n * @private\n * @type {string}\n */\n this.fillKey_ = '';\n\n /**\n * @private\n * @type {string}\n */\n this.strokeKey_ = '';\n\n /**\n * Data shared with an image builder for combined decluttering.\n * @private\n * @type {import(\"../canvas.js\").DeclutterImageWithText}\n */\n this.declutterImageWithText_ = undefined;\n }\n\n /**\n * @return {import(\"../canvas.js\").SerializableInstructions} the serializable instructions.\n */\n finish() {\n const instructions = super.finish();\n instructions.textStates = this.textStates;\n instructions.fillStates = this.fillStates;\n instructions.strokeStates = this.strokeStates;\n return instructions;\n }\n\n /**\n * @param {import(\"../../geom/SimpleGeometry.js\").default|import(\"../Feature.js\").default} geometry Geometry.\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n */\n drawText(geometry, feature) {\n const fillState = this.textFillState_;\n const strokeState = this.textStrokeState_;\n const textState = this.textState_;\n if (this.text_ === '' || !textState || !fillState && !strokeState) {\n return;\n }\n const coordinates = this.coordinates;\n let begin = coordinates.length;\n const geometryType = geometry.getType();\n let flatCoordinates = null;\n let stride = geometry.getStride();\n if (textState.placement === 'line' && (geometryType == 'LineString' || geometryType == 'MultiLineString' || geometryType == 'Polygon' || geometryType == 'MultiPolygon')) {\n if (!(0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.intersects)(this.getBufferedMaxExtent(), geometry.getExtent())) {\n return;\n }\n let ends;\n flatCoordinates = geometry.getFlatCoordinates();\n if (geometryType == 'LineString') {\n ends = [flatCoordinates.length];\n } else if (geometryType == 'MultiLineString') {\n ends = /** @type {import(\"../../geom/MultiLineString.js\").default} */geometry.getEnds();\n } else if (geometryType == 'Polygon') {\n ends = /** @type {import(\"../../geom/Polygon.js\").default} */geometry.getEnds().slice(0, 1);\n } else if (geometryType == 'MultiPolygon') {\n const endss = /** @type {import(\"../../geom/MultiPolygon.js\").default} */geometry.getEndss();\n ends = [];\n for (let i = 0, ii = endss.length; i < ii; ++i) {\n ends.push(endss[i][0]);\n }\n }\n this.beginGeometry(geometry, feature);\n const repeat = textState.repeat;\n const textAlign = repeat ? undefined : textState.textAlign;\n // No `justify` support for line placement.\n let flatOffset = 0;\n for (let o = 0, oo = ends.length; o < oo; ++o) {\n let chunks;\n if (repeat) {\n chunks = (0,_geom_flat_linechunk_js__WEBPACK_IMPORTED_MODULE_4__.lineChunk)(repeat * this.resolution, flatCoordinates, flatOffset, ends[o], stride);\n } else {\n chunks = [flatCoordinates.slice(flatOffset, ends[o])];\n }\n for (let c = 0, cc = chunks.length; c < cc; ++c) {\n const chunk = chunks[c];\n let chunkBegin = 0;\n let chunkEnd = chunk.length;\n if (textAlign == undefined) {\n const range = (0,_geom_flat_straightchunk_js__WEBPACK_IMPORTED_MODULE_5__.matchingChunk)(textState.maxAngle, chunk, 0, chunk.length, 2);\n chunkBegin = range[0];\n chunkEnd = range[1];\n }\n for (let i = chunkBegin; i < chunkEnd; i += stride) {\n coordinates.push(chunk[i], chunk[i + 1]);\n }\n const end = coordinates.length;\n flatOffset = ends[o];\n this.drawChars_(begin, end);\n begin = end;\n }\n }\n this.endGeometry(feature);\n } else {\n let geometryWidths = textState.overflow ? null : [];\n switch (geometryType) {\n case 'Point':\n case 'MultiPoint':\n flatCoordinates = /** @type {import(\"../../geom/MultiPoint.js\").default} */geometry.getFlatCoordinates();\n break;\n case 'LineString':\n flatCoordinates = /** @type {import(\"../../geom/LineString.js\").default} */geometry.getFlatMidpoint();\n break;\n case 'Circle':\n flatCoordinates = /** @type {import(\"../../geom/Circle.js\").default} */geometry.getCenter();\n break;\n case 'MultiLineString':\n flatCoordinates = /** @type {import(\"../../geom/MultiLineString.js\").default} */geometry.getFlatMidpoints();\n stride = 2;\n break;\n case 'Polygon':\n flatCoordinates = /** @type {import(\"../../geom/Polygon.js\").default} */geometry.getFlatInteriorPoint();\n if (!textState.overflow) {\n geometryWidths.push(flatCoordinates[2] / this.resolution);\n }\n stride = 3;\n break;\n case 'MultiPolygon':\n const interiorPoints = /** @type {import(\"../../geom/MultiPolygon.js\").default} */geometry.getFlatInteriorPoints();\n flatCoordinates = [];\n for (let i = 0, ii = interiorPoints.length; i < ii; i += 3) {\n if (!textState.overflow) {\n geometryWidths.push(interiorPoints[i + 2] / this.resolution);\n }\n flatCoordinates.push(interiorPoints[i], interiorPoints[i + 1]);\n }\n if (flatCoordinates.length === 0) {\n return;\n }\n stride = 2;\n break;\n default:\n }\n const end = this.appendFlatPointCoordinates(flatCoordinates, stride);\n if (end === begin) {\n return;\n }\n if (geometryWidths && (end - begin) / 2 !== flatCoordinates.length / stride) {\n let beg = begin / 2;\n geometryWidths = geometryWidths.filter((w, i) => {\n const keep = coordinates[(beg + i) * 2] === flatCoordinates[i * stride] && coordinates[(beg + i) * 2 + 1] === flatCoordinates[i * stride + 1];\n if (!keep) {\n --beg;\n }\n return keep;\n });\n }\n this.saveTextStates_();\n if (textState.backgroundFill || textState.backgroundStroke) {\n this.setFillStrokeStyle(textState.backgroundFill, textState.backgroundStroke);\n if (textState.backgroundFill) {\n this.updateFillStyle(this.state, this.createFill);\n }\n if (textState.backgroundStroke) {\n this.updateStrokeStyle(this.state, this.applyStroke);\n this.hitDetectionInstructions.push(this.createStroke(this.state));\n }\n }\n this.beginGeometry(geometry, feature);\n\n // adjust padding for negative scale\n let padding = textState.padding;\n if (padding != _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultPadding && (textState.scale[0] < 0 || textState.scale[1] < 0)) {\n let p0 = textState.padding[0];\n let p1 = textState.padding[1];\n let p2 = textState.padding[2];\n let p3 = textState.padding[3];\n if (textState.scale[0] < 0) {\n p1 = -p1;\n p3 = -p3;\n }\n if (textState.scale[1] < 0) {\n p0 = -p0;\n p2 = -p2;\n }\n padding = [p0, p1, p2, p3];\n }\n\n // The image is unknown at this stage so we pass null; it will be computed at render time.\n // For clarity, we pass NaN for offsetX, offsetY, width and height, which will be computed at\n // render time.\n const pixelRatio = this.pixelRatio;\n this.instructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].DRAW_IMAGE, begin, end, null, NaN, NaN, NaN, 1, 0, 0, this.textRotateWithView_, this.textRotation_, [1, 1], NaN, undefined, this.declutterImageWithText_, padding == _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultPadding ? _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultPadding : padding.map(function (p) {\n return p * pixelRatio;\n }), !!textState.backgroundFill, !!textState.backgroundStroke, this.text_, this.textKey_, this.strokeKey_, this.fillKey_, this.textOffsetX_, this.textOffsetY_, geometryWidths]);\n const scale = 1 / pixelRatio;\n // Set default fill for hit detection background\n const currentFillStyle = this.state.fillStyle;\n if (textState.backgroundFill) {\n this.state.fillStyle = _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultFillStyle;\n this.hitDetectionInstructions.push(this.createFill(this.state));\n }\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].DRAW_IMAGE, begin, end, null, NaN, NaN, NaN, 1, 0, 0, this.textRotateWithView_, this.textRotation_, [scale, scale], NaN, undefined, this.declutterImageWithText_, padding, !!textState.backgroundFill, !!textState.backgroundStroke, this.text_, this.textKey_, this.strokeKey_, this.fillKey_ ? _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultFillStyle : this.fillKey_, this.textOffsetX_, this.textOffsetY_, geometryWidths]);\n // Reset previous fill\n if (textState.backgroundFill) {\n this.state.fillStyle = currentFillStyle;\n this.hitDetectionInstructions.push(this.createFill(this.state));\n }\n this.endGeometry(feature);\n }\n }\n\n /**\n * @private\n */\n saveTextStates_() {\n const strokeState = this.textStrokeState_;\n const textState = this.textState_;\n const fillState = this.textFillState_;\n const strokeKey = this.strokeKey_;\n if (strokeState) {\n if (!(strokeKey in this.strokeStates)) {\n this.strokeStates[strokeKey] = {\n strokeStyle: strokeState.strokeStyle,\n lineCap: strokeState.lineCap,\n lineDashOffset: strokeState.lineDashOffset,\n lineWidth: strokeState.lineWidth,\n lineJoin: strokeState.lineJoin,\n miterLimit: strokeState.miterLimit,\n lineDash: strokeState.lineDash\n };\n }\n }\n const textKey = this.textKey_;\n if (!(textKey in this.textStates)) {\n this.textStates[textKey] = {\n font: textState.font,\n textAlign: textState.textAlign || _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultTextAlign,\n justify: textState.justify,\n textBaseline: textState.textBaseline || _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultTextBaseline,\n scale: textState.scale\n };\n }\n const fillKey = this.fillKey_;\n if (fillState) {\n if (!(fillKey in this.fillStates)) {\n this.fillStates[fillKey] = {\n fillStyle: fillState.fillStyle\n };\n }\n }\n }\n\n /**\n * @private\n * @param {number} begin Begin.\n * @param {number} end End.\n */\n drawChars_(begin, end) {\n const strokeState = this.textStrokeState_;\n const textState = this.textState_;\n const strokeKey = this.strokeKey_;\n const textKey = this.textKey_;\n const fillKey = this.fillKey_;\n this.saveTextStates_();\n const pixelRatio = this.pixelRatio;\n const baseline = TEXT_ALIGN[textState.textBaseline];\n const offsetY = this.textOffsetY_ * pixelRatio;\n const text = this.text_;\n const strokeWidth = strokeState ? strokeState.lineWidth * Math.abs(textState.scale[0]) / 2 : 0;\n this.instructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].DRAW_CHARS, begin, end, baseline, textState.overflow, fillKey, textState.maxAngle, pixelRatio, offsetY, strokeKey, strokeWidth * pixelRatio, text, textKey, 1]);\n this.hitDetectionInstructions.push([_Instruction_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].DRAW_CHARS, begin, end, baseline, textState.overflow, fillKey ? _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultFillStyle : fillKey, textState.maxAngle, pixelRatio, offsetY, strokeKey, strokeWidth * pixelRatio, text, textKey, 1 / pixelRatio]);\n }\n\n /**\n * @param {import(\"../../style/Text.js\").default} textStyle Text style.\n * @param {Object} [sharedData] Shared data.\n */\n setTextStyle(textStyle, sharedData) {\n let textState, fillState, strokeState;\n if (!textStyle) {\n this.text_ = '';\n } else {\n const textFillStyle = textStyle.getFill();\n if (!textFillStyle) {\n fillState = null;\n this.textFillState_ = fillState;\n } else {\n fillState = this.textFillState_;\n if (!fillState) {\n fillState = /** @type {import(\"../canvas.js\").FillState} */{};\n this.textFillState_ = fillState;\n }\n fillState.fillStyle = (0,_colorlike_js__WEBPACK_IMPORTED_MODULE_7__.asColorLike)(textFillStyle.getColor() || _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultFillStyle);\n }\n const textStrokeStyle = textStyle.getStroke();\n if (!textStrokeStyle) {\n strokeState = null;\n this.textStrokeState_ = strokeState;\n } else {\n strokeState = this.textStrokeState_;\n if (!strokeState) {\n strokeState = /** @type {import(\"../canvas.js\").StrokeState} */{};\n this.textStrokeState_ = strokeState;\n }\n const lineDash = textStrokeStyle.getLineDash();\n const lineDashOffset = textStrokeStyle.getLineDashOffset();\n const lineWidth = textStrokeStyle.getWidth();\n const miterLimit = textStrokeStyle.getMiterLimit();\n strokeState.lineCap = textStrokeStyle.getLineCap() || _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultLineCap;\n strokeState.lineDash = lineDash ? lineDash.slice() : _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultLineDash;\n strokeState.lineDashOffset = lineDashOffset === undefined ? _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultLineDashOffset : lineDashOffset;\n strokeState.lineJoin = textStrokeStyle.getLineJoin() || _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultLineJoin;\n strokeState.lineWidth = lineWidth === undefined ? _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultLineWidth : lineWidth;\n strokeState.miterLimit = miterLimit === undefined ? _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultMiterLimit : miterLimit;\n strokeState.strokeStyle = (0,_colorlike_js__WEBPACK_IMPORTED_MODULE_7__.asColorLike)(textStrokeStyle.getColor() || _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultStrokeStyle);\n }\n textState = this.textState_;\n const font = textStyle.getFont() || _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultFont;\n (0,_canvas_js__WEBPACK_IMPORTED_MODULE_2__.registerFont)(font);\n const textScale = textStyle.getScaleArray();\n textState.overflow = textStyle.getOverflow();\n textState.font = font;\n textState.maxAngle = textStyle.getMaxAngle();\n textState.placement = textStyle.getPlacement();\n textState.textAlign = textStyle.getTextAlign();\n textState.repeat = textStyle.getRepeat();\n textState.justify = textStyle.getJustify();\n textState.textBaseline = textStyle.getTextBaseline() || _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultTextBaseline;\n textState.backgroundFill = textStyle.getBackgroundFill();\n textState.backgroundStroke = textStyle.getBackgroundStroke();\n textState.padding = textStyle.getPadding() || _canvas_js__WEBPACK_IMPORTED_MODULE_2__.defaultPadding;\n textState.scale = textScale === undefined ? [1, 1] : textScale;\n const textOffsetX = textStyle.getOffsetX();\n const textOffsetY = textStyle.getOffsetY();\n const textRotateWithView = textStyle.getRotateWithView();\n const textRotation = textStyle.getRotation();\n this.text_ = textStyle.getText() || '';\n this.textOffsetX_ = textOffsetX === undefined ? 0 : textOffsetX;\n this.textOffsetY_ = textOffsetY === undefined ? 0 : textOffsetY;\n this.textRotateWithView_ = textRotateWithView === undefined ? false : textRotateWithView;\n this.textRotation_ = textRotation === undefined ? 0 : textRotation;\n this.strokeKey_ = strokeState ? (typeof strokeState.strokeStyle == 'string' ? strokeState.strokeStyle : (0,_util_js__WEBPACK_IMPORTED_MODULE_8__.getUid)(strokeState.strokeStyle)) + strokeState.lineCap + strokeState.lineDashOffset + '|' + strokeState.lineWidth + strokeState.lineJoin + strokeState.miterLimit + '[' + strokeState.lineDash.join() + ']' : '';\n this.textKey_ = textState.font + textState.scale + (textState.textAlign || '?') + (textState.repeat || '?') + (textState.justify || '?') + (textState.textBaseline || '?');\n this.fillKey_ = fillState ? typeof fillState.fillStyle == 'string' ? fillState.fillStyle : '|' + (0,_util_js__WEBPACK_IMPORTED_MODULE_8__.getUid)(fillState.fillStyle) : '';\n }\n this.declutterImageWithText_ = sharedData;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (CanvasTextBuilder);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/canvas/TextBuilder.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/canvas/hitdetect.js":
|
||
/*!****************************************************!*\
|
||
!*** ./node_modules/ol/render/canvas/hitdetect.js ***!
|
||
\****************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ HIT_DETECT_RESOLUTION: function() { return /* binding */ HIT_DETECT_RESOLUTION; },\n/* harmony export */ createHitDetectionImageData: function() { return /* binding */ createHitDetectionImageData; },\n/* harmony export */ hitDetect: function() { return /* binding */ hitDetect; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Immediate_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Immediate.js */ \"./node_modules/ol/render/canvas/Immediate.js\");\n/* harmony import */ var _style_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../style.js */ \"./node_modules/ol/style/Icon.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../math.js */ \"./node_modules/ol/math.js\");\n/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../dom.js */ \"./node_modules/ol/dom.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../extent.js */ \"./node_modules/ol/extent.js\");\n\n/**\n * @module ol/render/canvas/hitdetect\n */\n\n\n\n\n\n\n\nconst HIT_DETECT_RESOLUTION = 0.5;\n\n/**\n * @param {import(\"../../size.js\").Size} size Canvas size in css pixels.\n * @param {Array<import(\"../../transform.js\").Transform>} transforms Transforms\n * for rendering features to all worlds of the viewport, from coordinates to css\n * pixels.\n * @param {Array<import(\"../../Feature.js\").FeatureLike>} features\n * Features to consider for hit detection.\n * @param {import(\"../../style/Style.js\").StyleFunction|undefined} styleFunction\n * Layer style function.\n * @param {import(\"../../extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @return {ImageData} Hit detection image data.\n */\nfunction createHitDetectionImageData(size, transforms, features, styleFunction, extent, resolution, rotation) {\n const width = size[0] * HIT_DETECT_RESOLUTION;\n const height = size[1] * HIT_DETECT_RESOLUTION;\n const context = (0,_dom_js__WEBPACK_IMPORTED_MODULE_1__.createCanvasContext2D)(width, height);\n context.imageSmoothingEnabled = false;\n const canvas = context.canvas;\n const renderer = new _Immediate_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](context, HIT_DETECT_RESOLUTION, extent, null, rotation);\n const featureCount = features.length;\n // Stretch hit detection index to use the whole available color range\n const indexFactor = Math.floor((256 * 256 * 256 - 1) / featureCount);\n const featuresByZIndex = {};\n for (let i = 1; i <= featureCount; ++i) {\n const feature = features[i - 1];\n const featureStyleFunction = feature.getStyleFunction() || styleFunction;\n if (!featureStyleFunction) {\n continue;\n }\n let styles = featureStyleFunction(feature, resolution);\n if (!styles) {\n continue;\n }\n if (!Array.isArray(styles)) {\n styles = [styles];\n }\n const index = i * indexFactor;\n const color = index.toString(16).padStart(7, '#00000');\n for (let j = 0, jj = styles.length; j < jj; ++j) {\n const originalStyle = styles[j];\n const geometry = originalStyle.getGeometryFunction()(feature);\n if (!geometry || !(0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.intersects)(extent, geometry.getExtent())) {\n continue;\n }\n const style = originalStyle.clone();\n const fill = style.getFill();\n if (fill) {\n fill.setColor(color);\n }\n const stroke = style.getStroke();\n if (stroke) {\n stroke.setColor(color);\n stroke.setLineDash(null);\n }\n style.setText(undefined);\n const image = originalStyle.getImage();\n if (image) {\n const imgSize = image.getImageSize();\n if (!imgSize) {\n continue;\n }\n const imgContext = (0,_dom_js__WEBPACK_IMPORTED_MODULE_1__.createCanvasContext2D)(imgSize[0], imgSize[1], undefined, {\n alpha: false\n });\n const img = imgContext.canvas;\n imgContext.fillStyle = color;\n imgContext.fillRect(0, 0, img.width, img.height);\n style.setImage(new _style_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]({\n img: img,\n anchor: image.getAnchor(),\n anchorXUnits: 'pixels',\n anchorYUnits: 'pixels',\n offset: image.getOrigin(),\n opacity: 1,\n size: image.getSize(),\n scale: image.getScale(),\n rotation: image.getRotation(),\n rotateWithView: image.getRotateWithView()\n }));\n }\n const zIndex = style.getZIndex() || 0;\n let byGeometryType = featuresByZIndex[zIndex];\n if (!byGeometryType) {\n byGeometryType = {};\n featuresByZIndex[zIndex] = byGeometryType;\n byGeometryType['Polygon'] = [];\n byGeometryType['Circle'] = [];\n byGeometryType['LineString'] = [];\n byGeometryType['Point'] = [];\n }\n const type = geometry.getType();\n if (type === 'GeometryCollection') {\n const geometries = /** @type {import(\"../../geom/GeometryCollection.js\").default} */geometry.getGeometriesArrayRecursive();\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n const geometry = geometries[i];\n byGeometryType[geometry.getType().replace('Multi', '')].push(geometry, style);\n }\n } else {\n byGeometryType[type.replace('Multi', '')].push(geometry, style);\n }\n }\n }\n const zIndexKeys = Object.keys(featuresByZIndex).map(Number).sort(_array_js__WEBPACK_IMPORTED_MODULE_5__.ascending);\n for (let i = 0, ii = zIndexKeys.length; i < ii; ++i) {\n const byGeometryType = featuresByZIndex[zIndexKeys[i]];\n for (const type in byGeometryType) {\n const geomAndStyle = byGeometryType[type];\n for (let j = 0, jj = geomAndStyle.length; j < jj; j += 2) {\n renderer.setStyle(geomAndStyle[j + 1]);\n for (let k = 0, kk = transforms.length; k < kk; ++k) {\n renderer.setTransform(transforms[k]);\n renderer.drawGeometry(geomAndStyle[j]);\n }\n }\n }\n }\n return context.getImageData(0, 0, canvas.width, canvas.height);\n}\n\n/**\n * @param {import(\"../../pixel\").Pixel} pixel Pixel coordinate on the hit\n * detection canvas in css pixels.\n * @param {Array<F>} features Features. Has to\n * match the `features` array that was passed to `createHitDetectionImageData()`.\n * @param {ImageData} imageData Hit detection image data generated by\n * `createHitDetectionImageData()`.\n * @return {Array<F>} Features.\n * @template {import(\"../../Feature.js\").FeatureLike} F\n */\nfunction hitDetect(pixel, features, imageData) {\n /** @type {Array<F>} */\n const resultFeatures = [];\n if (imageData) {\n const x = Math.floor(Math.round(pixel[0]) * HIT_DETECT_RESOLUTION);\n const y = Math.floor(Math.round(pixel[1]) * HIT_DETECT_RESOLUTION);\n // The pixel coordinate is clamped down to the hit-detect canvas' size to account\n // for browsers returning coordinates slightly larger than the actual canvas size\n // due to a non-integer pixel ratio.\n const index = ((0,_math_js__WEBPACK_IMPORTED_MODULE_6__.clamp)(x, 0, imageData.width - 1) + (0,_math_js__WEBPACK_IMPORTED_MODULE_6__.clamp)(y, 0, imageData.height - 1) * imageData.width) * 4;\n const r = imageData.data[index];\n const g = imageData.data[index + 1];\n const b = imageData.data[index + 2];\n const i = b + 256 * (g + 256 * r);\n const indexFactor = Math.floor((256 * 256 * 256 - 1) / features.length);\n if (i && i % indexFactor === 0) {\n resultFeatures.push(features[i / indexFactor - 1]);\n }\n }\n return resultFeatures;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/canvas/hitdetect.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/render/canvas/style.js":
|
||
/*!************************************************!*\
|
||
!*** ./node_modules/ol/render/canvas/style.js ***!
|
||
\************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ buildRuleSet: function() { return /* binding */ buildRuleSet; },\n/* harmony export */ buildStyle: function() { return /* binding */ buildStyle; },\n/* harmony export */ flatStylesToStyleFunction: function() { return /* binding */ flatStylesToStyleFunction; },\n/* harmony export */ rulesToStyleFunction: function() { return /* binding */ rulesToStyleFunction; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _style_Circle_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../style/Circle.js */ \"./node_modules/ol/style/Circle.js\");\n/* harmony import */ var _style_Fill_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../style/Fill.js */ \"./node_modules/ol/style/Fill.js\");\n/* harmony import */ var _style_Icon_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../style/Icon.js */ \"./node_modules/ol/style/Icon.js\");\n/* harmony import */ var _style_RegularShape_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../style/RegularShape.js */ \"./node_modules/ol/style/RegularShape.js\");\n/* harmony import */ var _style_Stroke_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../style/Stroke.js */ \"./node_modules/ol/style/Stroke.js\");\n/* harmony import */ var _style_Style_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../style/Style.js */ \"./node_modules/ol/style/Style.js\");\n/* harmony import */ var _style_Text_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../style/Text.js */ \"./node_modules/ol/style/Text.js\");\n/* harmony import */ var _expr_expression_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../expr/expression.js */ \"./node_modules/ol/expr/expression.js\");\n/* harmony import */ var _expr_cpu_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../expr/cpu.js */ \"./node_modules/ol/expr/cpu.js\");\n/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../obj.js */ \"./node_modules/ol/obj.js\");\n/* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../size.js */ \"./node_modules/ol/size.js\");\n\n/**\n * @module ol/render/canvas/style\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @fileoverview This module includes functions to build styles for the canvas renderer. Building\n * is composed of two steps: parsing and compiling. The parsing step takes an encoded expression\n * and returns an instance of one of the expression classes. The compiling step takes the\n * expression instance and returns a function that can be evaluated to return a literal value. The\n * evaluator function should do as little allocation and work as possible.\n */\n\n/**\n * @typedef {import(\"../../style/flat.js\").FlatStyle} FlatStyle\n */\n\n/**\n * @typedef {import(\"../../expr/expression.js\").EncodedExpression} EncodedExpression\n */\n\n/**\n * @typedef {import(\"../../expr/expression.js\").ParsingContext} ParsingContext\n */\n\n/**\n * @typedef {import(\"../../expr/expression.js\").CallExpression} CallExpression\n */\n\n/**\n * @typedef {import(\"../../expr/cpu.js\").EvaluationContext} EvaluationContext\n */\n\n/**\n * @typedef {import(\"../../expr/cpu.js\").ExpressionEvaluator} ExpressionEvaluator\n */\n\n/**\n * @param {EvaluationContext} context The evaluation context.\n * @return {boolean} Always true.\n */\nfunction always(context) {\n return true;\n}\n\n/**\n * This function adapts a rule evaluator to the existing style function interface.\n * After we have deprecated the style function, we can use the compiled rules directly\n * and pass a more complete evaluation context (variables, zoom, time, etc.).\n *\n * @param {Array<import('../../style/flat.js').Rule>} rules The rules.\n * @return {import('../../style/Style.js').StyleFunction} A style function.\n */\nfunction rulesToStyleFunction(rules) {\n const parsingContext = (0,_expr_expression_js__WEBPACK_IMPORTED_MODULE_1__.newParsingContext)();\n const evaluator = buildRuleSet(rules, parsingContext);\n const evaluationContext = (0,_expr_cpu_js__WEBPACK_IMPORTED_MODULE_2__.newEvaluationContext)();\n return function (feature, resolution) {\n evaluationContext.properties = feature.getPropertiesInternal();\n evaluationContext.resolution = resolution;\n if (parsingContext.featureId) {\n const id = feature.getId();\n if (id !== undefined) {\n evaluationContext.featureId = id;\n } else {\n evaluationContext.featureId = null;\n }\n }\n return evaluator(evaluationContext);\n };\n}\n\n/**\n * This function adapts a style evaluator to the existing style function interface.\n * After we have deprecated the style function, we can use the compiled rules directly\n * and pass a more complete evaluation context (variables, zoom, time, etc.).\n *\n * @param {Array<import('../../style/flat.js').FlatStyle>} flatStyles The flat styles.\n * @return {import('../../style/Style.js').StyleFunction} A style function.\n */\nfunction flatStylesToStyleFunction(flatStyles) {\n const parsingContext = (0,_expr_expression_js__WEBPACK_IMPORTED_MODULE_1__.newParsingContext)();\n const length = flatStyles.length;\n\n /**\n * @type {Array<StyleEvaluator>}\n */\n const evaluators = new Array(length);\n for (let i = 0; i < length; ++i) {\n evaluators[i] = buildStyle(flatStyles[i], parsingContext);\n }\n const evaluationContext = (0,_expr_cpu_js__WEBPACK_IMPORTED_MODULE_2__.newEvaluationContext)();\n\n /**\n * @type {Array<Style>}\n */\n const styles = new Array(length);\n return function (feature, resolution) {\n evaluationContext.properties = feature.getPropertiesInternal();\n evaluationContext.resolution = resolution;\n if (parsingContext.featureId) {\n const id = feature.getId();\n if (id !== undefined) {\n evaluationContext.featureId = id;\n } else {\n evaluationContext.featureId = null;\n }\n }\n let nonNullCount = 0;\n for (let i = 0; i < length; ++i) {\n const style = evaluators[i](evaluationContext);\n if (style) {\n styles[nonNullCount] = style;\n nonNullCount += 1;\n }\n }\n styles.length = nonNullCount;\n return styles;\n };\n}\n\n/**\n * @typedef {function(EvaluationContext):Array<Style>} RuleSetEvaluator\n */\n\n/**\n * @typedef {Object} CompiledRule\n * @property {ExpressionEvaluator} filter The compiled filter evaluator.\n * @property {Array<StyleEvaluator>} styles The list of compiled style evaluators.\n */\n\n/**\n * @param {Array<import('../../style/flat.js').Rule>} rules The rules.\n * @param {ParsingContext} context The parsing context.\n * @return {RuleSetEvaluator} The evaluator function.\n */\nfunction buildRuleSet(rules, context) {\n const length = rules.length;\n\n /**\n * @type {Array<CompiledRule>}\n */\n const compiledRules = new Array(length);\n for (let i = 0; i < length; ++i) {\n const rule = rules[i];\n const filter = 'filter' in rule ? (0,_expr_cpu_js__WEBPACK_IMPORTED_MODULE_2__.buildExpression)(rule.filter, _expr_expression_js__WEBPACK_IMPORTED_MODULE_1__.BooleanType, context) : always;\n\n /**\n * @type {Array<StyleEvaluator>}\n */\n let styles;\n if (Array.isArray(rule.style)) {\n const styleLength = rule.style.length;\n styles = new Array(styleLength);\n for (let j = 0; j < styleLength; ++j) {\n styles[j] = buildStyle(rule.style[j], context);\n }\n } else {\n styles = [buildStyle(rule.style, context)];\n }\n compiledRules[i] = {\n filter,\n styles\n };\n }\n return function (context) {\n /**\n * @type {Array<Style>}\n */\n const styles = [];\n let someMatched = false;\n for (let i = 0; i < length; ++i) {\n const filterEvaluator = compiledRules[i].filter;\n if (!filterEvaluator(context)) {\n continue;\n }\n if (rules[i].else && someMatched) {\n continue;\n }\n someMatched = true;\n for (const styleEvaluator of compiledRules[i].styles) {\n const style = styleEvaluator(context);\n if (!style) {\n continue;\n }\n styles.push(style);\n }\n }\n return styles;\n };\n}\n\n/**\n * @typedef {function(EvaluationContext):Style|null} StyleEvaluator\n */\n\n/**\n * @param {FlatStyle} flatStyle A flat style literal.\n * @param {ParsingContext} context The parsing context.\n * @return {StyleEvaluator} A function that evaluates to a style. The style returned by\n * this function will be reused between invocations.\n */\nfunction buildStyle(flatStyle, context) {\n const evaluateFill = buildFill(flatStyle, '', context);\n const evaluateStroke = buildStroke(flatStyle, '', context);\n const evaluateText = buildText(flatStyle, context);\n const evaluateImage = buildImage(flatStyle, context);\n const evaluateZIndex = numberEvaluator(flatStyle, 'z-index', context);\n if (!evaluateFill && !evaluateStroke && !evaluateText && !evaluateImage && !(0,_obj_js__WEBPACK_IMPORTED_MODULE_3__.isEmpty)(flatStyle)) {\n // assume this is a user error\n // would be nice to check the properties and suggest \"did you mean...\"\n throw new Error('No fill, stroke, point, or text symbolizer properties in style: ' + JSON.stringify(flatStyle));\n }\n const style = new _style_Style_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]();\n return function (context) {\n let empty = true;\n if (evaluateFill) {\n const fill = evaluateFill(context);\n if (fill) {\n empty = false;\n }\n style.setFill(fill);\n }\n if (evaluateStroke) {\n const stroke = evaluateStroke(context);\n if (stroke) {\n empty = false;\n }\n style.setStroke(stroke);\n }\n if (evaluateText) {\n const text = evaluateText(context);\n if (text) {\n empty = false;\n }\n style.setText(text);\n }\n if (evaluateImage) {\n const image = evaluateImage(context);\n if (image) {\n empty = false;\n }\n style.setImage(image);\n }\n if (evaluateZIndex) {\n style.setZIndex(evaluateZIndex(context));\n }\n if (empty) {\n return null;\n }\n return style;\n };\n}\n\n/**\n * @typedef {function(EvaluationContext):Fill|null} FillEvaluator\n */\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} prefix The property prefix.\n * @param {ParsingContext} context The parsing context.\n * @return {FillEvaluator?} A function that evaluates to a fill.\n */\nfunction buildFill(flatStyle, prefix, context) {\n const evaluateColor = colorLikeEvaluator(flatStyle, prefix + 'fill-color', context);\n if (!evaluateColor) {\n return null;\n }\n const fill = new _style_Fill_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]();\n return function (context) {\n const color = evaluateColor(context);\n if (color === 'none') {\n return null;\n }\n fill.setColor(color);\n return fill;\n };\n}\n\n/**\n * @typedef {function(EvaluationContext):Stroke|null} StrokeEvaluator\n */\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} prefix The property prefix.\n * @param {ParsingContext} context The parsing context.\n * @return {StrokeEvaluator?} A function the evaluates to a stroke.\n */\nfunction buildStroke(flatStyle, prefix, context) {\n const evaluateWidth = numberEvaluator(flatStyle, prefix + 'stroke-width', context);\n const evaluateColor = colorLikeEvaluator(flatStyle, prefix + 'stroke-color', context);\n if (!evaluateWidth && !evaluateColor) {\n return null;\n }\n const evaluateLineCap = stringEvaluator(flatStyle, prefix + 'stroke-line-cap', context);\n const evaluateLineJoin = stringEvaluator(flatStyle, prefix + 'stroke-line-join', context);\n const evaluateLineDash = numberArrayEvaluator(flatStyle, prefix + 'stroke-line-dash', context);\n const evaluateLineDashOffset = numberEvaluator(flatStyle, prefix + 'stroke-line-dash-offset', context);\n const evaluateMiterLimit = numberEvaluator(flatStyle, prefix + 'stroke-miter-limit', context);\n const stroke = new _style_Stroke_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]();\n return function (context) {\n if (evaluateColor) {\n const color = evaluateColor(context);\n if (color === 'none') {\n return null;\n }\n stroke.setColor(color);\n }\n if (evaluateWidth) {\n stroke.setWidth(evaluateWidth(context));\n }\n if (evaluateLineCap) {\n const lineCap = evaluateLineCap(context);\n if (lineCap !== 'butt' && lineCap !== 'round' && lineCap !== 'square') {\n throw new Error('Expected butt, round, or square line cap');\n }\n stroke.setLineCap(lineCap);\n }\n if (evaluateLineJoin) {\n const lineJoin = evaluateLineJoin(context);\n if (lineJoin !== 'bevel' && lineJoin !== 'round' && lineJoin !== 'miter') {\n throw new Error('Expected bevel, round, or miter line join');\n }\n stroke.setLineJoin(lineJoin);\n }\n if (evaluateLineDash) {\n stroke.setLineDash(evaluateLineDash(context));\n }\n if (evaluateLineDashOffset) {\n stroke.setLineDashOffset(evaluateLineDashOffset(context));\n }\n if (evaluateMiterLimit) {\n stroke.setMiterLimit(evaluateMiterLimit(context));\n }\n return stroke;\n };\n}\n\n/**\n * @typedef {function(EvaluationContext):Text} TextEvaluator\n */\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {ParsingContext} context The parsing context.\n * @return {TextEvaluator?} A function that evaluates to a text symbolizer.\n */\nfunction buildText(flatStyle, context) {\n const prefix = 'text-';\n\n // Currently, an Array<string> may be used for rich text support. This doesn't\n // work with our expression syntax where arrays of strings are interpreted as\n // call expressions. To support rich text, we could add a 'strings' operator\n // where all the following arguments would be string values.\n const evaluateValue = stringEvaluator(flatStyle, prefix + 'value', context);\n if (!evaluateValue) {\n return null;\n }\n const evaluateFill = buildFill(flatStyle, prefix, context);\n const evaluateBackgroundFill = buildFill(flatStyle, prefix + 'background-', context);\n const evaluateStroke = buildStroke(flatStyle, prefix, context);\n const evaluateBackgroundStroke = buildStroke(flatStyle, prefix + 'background-', context);\n const evaluateFont = stringEvaluator(flatStyle, prefix + 'font', context);\n const evaluateMaxAngle = numberEvaluator(flatStyle, prefix + 'max-angle', context);\n const evaluateOffsetX = numberEvaluator(flatStyle, prefix + 'offset-x', context);\n const evaluateOffsetY = numberEvaluator(flatStyle, prefix + 'offset-y', context);\n const evaluateOverflow = booleanEvaluator(flatStyle, prefix + 'overflow', context);\n const evaluatePlacement = stringEvaluator(flatStyle, prefix + 'placement', context);\n const evaluateRepeat = numberEvaluator(flatStyle, prefix + 'repeat', context);\n const evaluateScale = sizeLikeEvaluator(flatStyle, prefix + 'scale', context);\n const evaluateRotateWithView = booleanEvaluator(flatStyle, prefix + 'rotate-with-view', context);\n const evaluateRotation = numberEvaluator(flatStyle, prefix + 'rotation', context);\n const evaluateAlign = stringEvaluator(flatStyle, prefix + 'align', context);\n const evaluateJustify = stringEvaluator(flatStyle, prefix + 'justify', context);\n const evaluateBaseline = stringEvaluator(flatStyle, prefix + 'baseline', context);\n const evaluatePadding = numberArrayEvaluator(flatStyle, prefix + 'padding', context);\n const text = new _style_Text_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]({});\n return function (context) {\n text.setText(evaluateValue(context));\n if (evaluateFill) {\n text.setFill(evaluateFill(context));\n }\n if (evaluateBackgroundFill) {\n text.setBackgroundFill(evaluateBackgroundFill(context));\n }\n if (evaluateStroke) {\n text.setStroke(evaluateStroke(context));\n }\n if (evaluateBackgroundStroke) {\n text.setBackgroundStroke(evaluateBackgroundStroke(context));\n }\n if (evaluateFont) {\n text.setFont(evaluateFont(context));\n }\n if (evaluateMaxAngle) {\n text.setMaxAngle(evaluateMaxAngle(context));\n }\n if (evaluateOffsetX) {\n text.setOffsetX(evaluateOffsetX(context));\n }\n if (evaluateOffsetY) {\n text.setOffsetY(evaluateOffsetY(context));\n }\n if (evaluateOverflow) {\n text.setOverflow(evaluateOverflow(context));\n }\n if (evaluatePlacement) {\n const placement = evaluatePlacement(context);\n if (placement !== 'point' && placement !== 'line') {\n throw new Error('Expected point or line for text-placement');\n }\n text.setPlacement(placement);\n }\n if (evaluateRepeat) {\n text.setRepeat(evaluateRepeat(context));\n }\n if (evaluateScale) {\n text.setScale(evaluateScale(context));\n }\n if (evaluateRotateWithView) {\n text.setRotateWithView(evaluateRotateWithView(context));\n }\n if (evaluateRotation) {\n text.setRotation(evaluateRotation(context));\n }\n if (evaluateAlign) {\n const textAlign = evaluateAlign(context);\n if (textAlign !== 'left' && textAlign !== 'center' && textAlign !== 'right' && textAlign !== 'end' && textAlign !== 'start') {\n throw new Error('Expected left, right, center, start, or end for text-align');\n }\n text.setTextAlign(textAlign);\n }\n if (evaluateJustify) {\n const justify = evaluateJustify(context);\n if (justify !== 'left' && justify !== 'right' && justify !== 'center') {\n throw new Error('Expected left, right, or center for text-justify');\n }\n text.setJustify(justify);\n }\n if (evaluateBaseline) {\n const textBaseline = evaluateBaseline(context);\n if (textBaseline !== 'bottom' && textBaseline !== 'top' && textBaseline !== 'middle' && textBaseline !== 'alphabetic' && textBaseline !== 'hanging') {\n throw new Error('Expected bottom, top, middle, alphabetic, or hanging for text-baseline');\n }\n text.setTextBaseline(textBaseline);\n }\n if (evaluatePadding) {\n text.setPadding(evaluatePadding(context));\n }\n return text;\n };\n}\n\n/**\n * @typedef {function(EvaluationContext):import(\"../../style/Image.js\").default} ImageEvaluator\n */\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {ParsingContext} context The parsing context.\n * @return {ImageEvaluator?} A function that evaluates to an image symbolizer.\n */\nfunction buildImage(flatStyle, context) {\n if ('icon-src' in flatStyle) {\n return buildIcon(flatStyle, context);\n }\n if ('shape-points' in flatStyle) {\n return buildShape(flatStyle, context);\n }\n if ('circle-radius' in flatStyle) {\n return buildCircle(flatStyle, context);\n }\n return null;\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {ParsingContext} context The parsing context.\n * @return {ImageEvaluator} A function that evaluates to an image symbolizer.\n */\nfunction buildIcon(flatStyle, context) {\n const prefix = 'icon-';\n\n // required property\n const srcName = prefix + 'src';\n const src = requireString(flatStyle[srcName], srcName);\n\n // settable properties\n const evaluateAnchor = coordinateEvaluator(flatStyle, prefix + 'anchor', context);\n const evaluateScale = sizeLikeEvaluator(flatStyle, prefix + 'scale', context);\n const evaluateOpacity = numberEvaluator(flatStyle, prefix + 'opacity', context);\n const evaluateDisplacement = coordinateEvaluator(flatStyle, prefix + 'displacement', context);\n const evaluateRotation = numberEvaluator(flatStyle, prefix + 'rotation', context);\n const evaluateRotateWithView = booleanEvaluator(flatStyle, prefix + 'rotate-with-view', context);\n\n // the remaining symbolizer properties are not currently settable\n const anchorOrigin = optionalIconOrigin(flatStyle, prefix + 'anchor-origin');\n const anchorXUnits = optionalIconAnchorUnits(flatStyle, prefix + 'anchor-x-units');\n const anchorYUnits = optionalIconAnchorUnits(flatStyle, prefix + 'anchor-y-units');\n const color = optionalColorLike(flatStyle, prefix + 'color');\n const crossOrigin = optionalString(flatStyle, prefix + 'cross-origin');\n const offset = optionalNumberArray(flatStyle, prefix + 'offset');\n const offsetOrigin = optionalIconOrigin(flatStyle, prefix + 'offset-origin');\n const width = optionalNumber(flatStyle, prefix + 'width');\n const height = optionalNumber(flatStyle, prefix + 'height');\n const size = optionalSize(flatStyle, prefix + 'size');\n const declutterMode = optionalDeclutterMode(flatStyle, prefix + 'declutter');\n const icon = new _style_Icon_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"]({\n src,\n anchorOrigin,\n anchorXUnits,\n anchorYUnits,\n color,\n crossOrigin,\n offset,\n offsetOrigin,\n height,\n width,\n size,\n declutterMode\n });\n return function (context) {\n if (evaluateOpacity) {\n icon.setOpacity(evaluateOpacity(context));\n }\n if (evaluateDisplacement) {\n icon.setDisplacement(evaluateDisplacement(context));\n }\n if (evaluateRotation) {\n icon.setRotation(evaluateRotation(context));\n }\n if (evaluateRotateWithView) {\n icon.setRotateWithView(evaluateRotateWithView(context));\n }\n if (evaluateScale) {\n icon.setScale(evaluateScale(context));\n }\n if (evaluateAnchor) {\n icon.setAnchor(evaluateAnchor(context));\n }\n return icon;\n };\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {ParsingContext} context The parsing context.\n * @return {ImageEvaluator} A function that evaluates to an icon symbolizer.\n */\nfunction buildShape(flatStyle, context) {\n const prefix = 'shape-';\n\n // required property\n const pointsName = prefix + 'points';\n const points = requireNumber(flatStyle[pointsName], pointsName);\n\n // settable properties\n const evaluateFill = buildFill(flatStyle, prefix, context);\n const evaluateStroke = buildStroke(flatStyle, prefix, context);\n const evaluateScale = sizeLikeEvaluator(flatStyle, prefix + 'scale', context);\n const evaluateDisplacement = coordinateEvaluator(flatStyle, prefix + 'displacement', context);\n const evaluateRotation = numberEvaluator(flatStyle, prefix + 'rotation', context);\n const evaluateRotateWithView = booleanEvaluator(flatStyle, prefix + 'rotate-with-view', context);\n\n // the remaining properties are not currently settable\n const radius = optionalNumber(flatStyle, prefix + 'radius');\n const radius1 = optionalNumber(flatStyle, prefix + 'radius1');\n const radius2 = optionalNumber(flatStyle, prefix + 'radius2');\n const angle = optionalNumber(flatStyle, prefix + 'angle');\n const declutterMode = optionalDeclutterMode(flatStyle, prefix + 'declutter-mode');\n const shape = new _style_RegularShape_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"]({\n points,\n radius,\n radius1,\n radius2,\n angle,\n declutterMode\n });\n return function (context) {\n if (evaluateFill) {\n shape.setFill(evaluateFill(context));\n }\n if (evaluateStroke) {\n shape.setStroke(evaluateStroke(context));\n }\n if (evaluateDisplacement) {\n shape.setDisplacement(evaluateDisplacement(context));\n }\n if (evaluateRotation) {\n shape.setRotation(evaluateRotation(context));\n }\n if (evaluateRotateWithView) {\n shape.setRotateWithView(evaluateRotateWithView(context));\n }\n if (evaluateScale) {\n shape.setScale(evaluateScale(context));\n }\n return shape;\n };\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {ParsingContext} context The parsing context.\n * @return {ImageEvaluator} A function that evaluates to a circle symbolizer.\n */\nfunction buildCircle(flatStyle, context) {\n const prefix = 'circle-';\n\n // settable properties\n const evaluateFill = buildFill(flatStyle, prefix, context);\n const evaluateStroke = buildStroke(flatStyle, prefix, context);\n const evaluateRadius = numberEvaluator(flatStyle, prefix + 'radius', context);\n const evaluateScale = sizeLikeEvaluator(flatStyle, prefix + 'scale', context);\n const evaluateDisplacement = coordinateEvaluator(flatStyle, prefix + 'displacement', context);\n const evaluateRotation = numberEvaluator(flatStyle, prefix + 'rotation', context);\n const evaluateRotateWithView = booleanEvaluator(flatStyle, prefix + 'rotate-with-view', context);\n\n // the remaining properties are not currently settable\n const declutterMode = optionalDeclutterMode(flatStyle, prefix + 'declutter-mode');\n const circle = new _style_Circle_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"]({\n radius: 5,\n // this is arbitrary, but required - the evaluated radius is used below\n declutterMode\n });\n return function (context) {\n if (evaluateRadius) {\n circle.setRadius(evaluateRadius(context));\n }\n if (evaluateFill) {\n circle.setFill(evaluateFill(context));\n }\n if (evaluateStroke) {\n circle.setStroke(evaluateStroke(context));\n }\n if (evaluateDisplacement) {\n circle.setDisplacement(evaluateDisplacement(context));\n }\n if (evaluateRotation) {\n circle.setRotation(evaluateRotation(context));\n }\n if (evaluateRotateWithView) {\n circle.setRotateWithView(evaluateRotateWithView(context));\n }\n if (evaluateScale) {\n circle.setScale(evaluateScale(context));\n }\n return circle;\n };\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} name The property name.\n * @param {ParsingContext} context The parsing context.\n * @return {import('../../expr/cpu.js').NumberEvaluator|undefined} The expression evaluator or undefined.\n */\nfunction numberEvaluator(flatStyle, name, context) {\n if (!(name in flatStyle)) {\n return undefined;\n }\n const evaluator = (0,_expr_cpu_js__WEBPACK_IMPORTED_MODULE_2__.buildExpression)(flatStyle[name], _expr_expression_js__WEBPACK_IMPORTED_MODULE_1__.NumberType, context);\n return function (context) {\n return requireNumber(evaluator(context), name);\n };\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} name The property name.\n * @param {ParsingContext} context The parsing context.\n * @return {import('../../expr/cpu.js').StringEvaluator?} The expression evaluator.\n */\nfunction stringEvaluator(flatStyle, name, context) {\n if (!(name in flatStyle)) {\n return null;\n }\n const evaluator = (0,_expr_cpu_js__WEBPACK_IMPORTED_MODULE_2__.buildExpression)(flatStyle[name], _expr_expression_js__WEBPACK_IMPORTED_MODULE_1__.StringType, context);\n return function (context) {\n return requireString(evaluator(context), name);\n };\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} name The property name.\n * @param {ParsingContext} context The parsing context.\n * @return {import('../../expr/cpu.js').BooleanEvaluator?} The expression evaluator.\n */\nfunction booleanEvaluator(flatStyle, name, context) {\n if (!(name in flatStyle)) {\n return null;\n }\n const evaluator = (0,_expr_cpu_js__WEBPACK_IMPORTED_MODULE_2__.buildExpression)(flatStyle[name], _expr_expression_js__WEBPACK_IMPORTED_MODULE_1__.BooleanType, context);\n return function (context) {\n const value = evaluator(context);\n if (typeof value !== 'boolean') {\n throw new Error(`Expected a boolean for ${name}`);\n }\n return value;\n };\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} name The property name.\n * @param {ParsingContext} context The parsing context.\n * @return {import('../../expr/cpu.js').ColorLikeEvaluator?} The expression evaluator.\n */\nfunction colorLikeEvaluator(flatStyle, name, context) {\n if (!(name in flatStyle)) {\n return null;\n }\n const evaluator = (0,_expr_cpu_js__WEBPACK_IMPORTED_MODULE_2__.buildExpression)(flatStyle[name], _expr_expression_js__WEBPACK_IMPORTED_MODULE_1__.ColorType | _expr_expression_js__WEBPACK_IMPORTED_MODULE_1__.StringType, context);\n return function (context) {\n return requireColorLike(evaluator(context), name);\n };\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} name The property name.\n * @param {ParsingContext} context The parsing context.\n * @return {import('../../expr/cpu.js').NumberArrayEvaluator?} The expression evaluator.\n */\nfunction numberArrayEvaluator(flatStyle, name, context) {\n if (!(name in flatStyle)) {\n return null;\n }\n const evaluator = (0,_expr_cpu_js__WEBPACK_IMPORTED_MODULE_2__.buildExpression)(flatStyle[name], _expr_expression_js__WEBPACK_IMPORTED_MODULE_1__.NumberArrayType, context);\n return function (context) {\n return requireNumberArray(evaluator(context), name);\n };\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} name The property name.\n * @param {ParsingContext} context The parsing context.\n * @return {import('../../expr/cpu.js').CoordinateEvaluator?} The expression evaluator.\n */\nfunction coordinateEvaluator(flatStyle, name, context) {\n if (!(name in flatStyle)) {\n return null;\n }\n const evaluator = (0,_expr_cpu_js__WEBPACK_IMPORTED_MODULE_2__.buildExpression)(flatStyle[name], _expr_expression_js__WEBPACK_IMPORTED_MODULE_1__.NumberArrayType, context);\n return function (context) {\n const array = requireNumberArray(evaluator(context), name);\n if (array.length !== 2) {\n throw new Error(`Expected two numbers for ${name}`);\n }\n return array;\n };\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} name The property name.\n * @param {ParsingContext} context The parsing context.\n * @return {import('../../expr/cpu.js').SizeLikeEvaluator?} The expression evaluator.\n */\nfunction sizeLikeEvaluator(flatStyle, name, context) {\n if (!(name in flatStyle)) {\n return null;\n }\n const evaluator = (0,_expr_cpu_js__WEBPACK_IMPORTED_MODULE_2__.buildExpression)(flatStyle[name], _expr_expression_js__WEBPACK_IMPORTED_MODULE_1__.NumberArrayType | _expr_expression_js__WEBPACK_IMPORTED_MODULE_1__.NumberType, context);\n return function (context) {\n return requireSizeLike(evaluator(context), name);\n };\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} property The symbolizer property.\n * @return {number|undefined} A number or undefined.\n */\nfunction optionalNumber(flatStyle, property) {\n const value = flatStyle[property];\n if (value === undefined) {\n return undefined;\n }\n if (typeof value !== 'number') {\n throw new Error(`Expected a number for ${property}`);\n }\n return value;\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} property The symbolizer property.\n * @return {import(\"../../size.js\").Size|undefined} A size or undefined.\n */\nfunction optionalSize(flatStyle, property) {\n const encoded = flatStyle[property];\n if (encoded === undefined) {\n return undefined;\n }\n if (typeof encoded === 'number') {\n return (0,_size_js__WEBPACK_IMPORTED_MODULE_11__.toSize)(encoded);\n }\n if (!Array.isArray(encoded)) {\n throw new Error(`Expected a number or size array for ${property}`);\n }\n if (encoded.length !== 2 || typeof encoded[0] !== 'number' || typeof encoded[1] !== 'number') {\n throw new Error(`Expected a number or size array for ${property}`);\n }\n return encoded;\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} property The symbolizer property.\n * @return {string|undefined} A string or undefined.\n */\nfunction optionalString(flatStyle, property) {\n const encoded = flatStyle[property];\n if (encoded === undefined) {\n return undefined;\n }\n if (typeof encoded !== 'string') {\n throw new Error(`Expected a string for ${property}`);\n }\n return encoded;\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} property The symbolizer property.\n * @return {import(\"../../style/Icon.js\").IconOrigin|undefined} An icon origin or undefined.\n */\nfunction optionalIconOrigin(flatStyle, property) {\n const encoded = flatStyle[property];\n if (encoded === undefined) {\n return undefined;\n }\n if (encoded !== 'bottom-left' && encoded !== 'bottom-right' && encoded !== 'top-left' && encoded !== 'top-right') {\n throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${property}`);\n }\n return encoded;\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} property The symbolizer property.\n * @return {import(\"../../style/Icon.js\").IconAnchorUnits|undefined} Icon anchor units or undefined.\n */\nfunction optionalIconAnchorUnits(flatStyle, property) {\n const encoded = flatStyle[property];\n if (encoded === undefined) {\n return undefined;\n }\n if (encoded !== 'pixels' && encoded !== 'fraction') {\n throw new Error(`Expected pixels or fraction for ${property}`);\n }\n return encoded;\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} property The symbolizer property.\n * @return {Array<number>|undefined} An array of numbers or undefined.\n */\nfunction optionalNumberArray(flatStyle, property) {\n const encoded = flatStyle[property];\n if (encoded === undefined) {\n return undefined;\n }\n return requireNumberArray(encoded, property);\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} property The symbolizer property.\n * @return {\"declutter\"|\"obstacle\"|\"none\"|undefined} Icon declutter mode.\n */\nfunction optionalDeclutterMode(flatStyle, property) {\n const encoded = flatStyle[property];\n if (encoded === undefined) {\n return undefined;\n }\n if (typeof encoded !== 'string') {\n throw new Error(`Expected a string for ${property}`);\n }\n if (encoded !== 'declutter' && encoded !== 'obstacle' && encoded !== 'none') {\n throw new Error(`Expected declutter, obstacle, or none for ${property}`);\n }\n return encoded;\n}\n\n/**\n * @param {FlatStyle} flatStyle The flat style.\n * @param {string} property The symbolizer property.\n * @return {string|Array<number>|undefined} A string or an array of color values or undefined.\n */\nfunction optionalColorLike(flatStyle, property) {\n const encoded = flatStyle[property];\n if (encoded === undefined) {\n return undefined;\n }\n return requireColorLike(encoded, property);\n}\n\n/**\n * @param {any} value The value.\n * @param {string} property The property.\n * @return {Array<number>} An array of numbers.\n */\nfunction requireNumberArray(value, property) {\n if (!Array.isArray(value)) {\n throw new Error(`Expected an array for ${property}`);\n }\n const length = value.length;\n for (let i = 0; i < length; ++i) {\n if (typeof value[i] !== 'number') {\n throw new Error(`Expected an array of numbers for ${property}`);\n }\n }\n return value;\n}\n\n/**\n * @param {any} value The value.\n * @param {string} property The property.\n * @return {string} A string.\n */\nfunction requireString(value, property) {\n if (typeof value !== 'string') {\n throw new Error(`Expected a string for ${property}`);\n }\n return value;\n}\n\n/**\n * @param {any} value The value.\n * @param {string} property The property.\n * @return {number} A number.\n */\nfunction requireNumber(value, property) {\n if (typeof value !== 'number') {\n throw new Error(`Expected a number for ${property}`);\n }\n return value;\n}\n\n/**\n * @param {any} value The value.\n * @param {string} property The property.\n * @return {Array<number>|string} A color.\n */\nfunction requireColorLike(value, property) {\n if (typeof value === 'string') {\n return value;\n }\n const array = requireNumberArray(value, property);\n const length = array.length;\n if (length < 3 || length > 4) {\n throw new Error(`Expected a color with 3 or 4 values for ${property}`);\n }\n return array;\n}\n\n/**\n * @param {any} value The value.\n * @param {string} property The property.\n * @return {number|Array<number>} A number or an array of two numbers.\n */\nfunction requireSizeLike(value, property) {\n if (typeof value === 'number') {\n return value;\n }\n const size = requireNumberArray(value, property);\n if (size.length !== 2) {\n throw new Error(`Expected an array of two numbers for ${property}`);\n }\n return size;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/render/canvas/style.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/renderer/Composite.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ol/renderer/Composite.js ***!
|
||
\***********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Map_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Map.js */ \"./node_modules/ol/renderer/Map.js\");\n/* harmony import */ var _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ObjectEventType.js */ \"./node_modules/ol/ObjectEventType.js\");\n/* harmony import */ var _render_Event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../render/Event.js */ \"./node_modules/ol/render/Event.js\");\n/* harmony import */ var _render_EventType_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../render/EventType.js */ \"./node_modules/ol/render/EventType.js\");\n/* harmony import */ var _css_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../css.js */ \"./node_modules/ol/css.js\");\n/* harmony import */ var _render_canvas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../render/canvas.js */ \"./node_modules/ol/render/canvas.js\");\n/* harmony import */ var _layer_Layer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../layer/Layer.js */ \"./node_modules/ol/layer/Layer.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../events.js */ \"./node_modules/ol/events.js\");\n/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../dom.js */ \"./node_modules/ol/dom.js\");\n\n/**\n * @module ol/renderer/Composite\n */\n\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Canvas map renderer.\n * @api\n */\nclass CompositeMapRenderer extends _Map_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {import(\"../Map.js\").default} map Map.\n */\n constructor(map) {\n super(map);\n\n /**\n * @type {import(\"../events.js\").EventsKey}\n */\n this.fontChangeListenerKey_ = (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.listen)(_render_canvas_js__WEBPACK_IMPORTED_MODULE_3__.checkedFonts, _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].PROPERTYCHANGE, map.redrawText.bind(map));\n\n /**\n * @private\n * @type {HTMLDivElement}\n */\n this.element_ = document.createElement('div');\n const style = this.element_.style;\n style.position = 'absolute';\n style.width = '100%';\n style.height = '100%';\n style.zIndex = '0';\n this.element_.className = _css_js__WEBPACK_IMPORTED_MODULE_5__.CLASS_UNSELECTABLE + ' ol-layers';\n const container = map.getViewport();\n container.insertBefore(this.element_, container.firstChild || null);\n\n /**\n * @private\n * @type {Array<HTMLElement>}\n */\n this.children_ = [];\n\n /**\n * @private\n * @type {boolean}\n */\n this.renderedVisible_ = true;\n\n /**\n * @type {Array<import(\"../layer/BaseVector.js\").default>}\n */\n this.declutterLayers_ = [];\n }\n\n /**\n * @param {import(\"../render/EventType.js\").default} type Event type.\n * @param {import(\"../Map.js\").FrameState} frameState Frame state.\n */\n dispatchRenderEvent(type, frameState) {\n const map = this.getMap();\n if (map.hasListener(type)) {\n const event = new _render_Event_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](type, undefined, frameState);\n map.dispatchEvent(event);\n }\n }\n disposeInternal() {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_2__.unlistenByKey)(this.fontChangeListenerKey_);\n this.element_.parentNode.removeChild(this.element_);\n super.disposeInternal();\n }\n\n /**\n * Render.\n * @param {?import(\"../Map.js\").FrameState} frameState Frame state.\n */\n renderFrame(frameState) {\n if (!frameState) {\n if (this.renderedVisible_) {\n this.element_.style.display = 'none';\n this.renderedVisible_ = false;\n }\n return;\n }\n this.calculateMatrices2D(frameState);\n this.dispatchRenderEvent(_render_EventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].PRECOMPOSE, frameState);\n const layerStatesArray = frameState.layerStatesArray.sort(function (a, b) {\n return a.zIndex - b.zIndex;\n });\n const viewState = frameState.viewState;\n this.children_.length = 0;\n const declutterLayers = this.declutterLayers_;\n declutterLayers.length = 0;\n let previousElement = null;\n for (let i = 0, ii = layerStatesArray.length; i < ii; ++i) {\n const layerState = layerStatesArray[i];\n frameState.layerIndex = i;\n const layer = layerState.layer;\n const sourceState = layer.getSourceState();\n if (!(0,_layer_Layer_js__WEBPACK_IMPORTED_MODULE_8__.inView)(layerState, viewState) || sourceState != 'ready' && sourceState != 'undefined') {\n layer.unrender();\n continue;\n }\n const element = layer.render(frameState, previousElement);\n if (!element) {\n continue;\n }\n if (element !== previousElement) {\n this.children_.push(element);\n previousElement = element;\n }\n if ('getDeclutter' in layer) {\n declutterLayers.push(/** @type {import(\"../layer/BaseVector.js\").default} */layer);\n }\n }\n this.flushDeclutterItems(frameState);\n (0,_dom_js__WEBPACK_IMPORTED_MODULE_9__.replaceChildren)(this.element_, this.children_);\n this.dispatchRenderEvent(_render_EventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POSTCOMPOSE, frameState);\n if (!this.renderedVisible_) {\n this.element_.style.display = '';\n this.renderedVisible_ = true;\n }\n this.scheduleExpireIconCache(frameState);\n }\n\n /**\n * @param {import(\"../Map.js\").FrameState} frameState Frame state.\n */\n flushDeclutterItems(frameState) {\n const layers = this.declutterLayers_;\n for (let i = layers.length - 1; i >= 0; --i) {\n layers[i].renderDeclutter(frameState);\n }\n layers.length = 0;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (CompositeMapRenderer);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/renderer/Composite.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/renderer/Layer.js":
|
||
/*!*******************************************!*\
|
||
!*** ./node_modules/ol/renderer/Layer.js ***!
|
||
\*******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _ImageState_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../ImageState.js */ \"./node_modules/ol/ImageState.js\");\n/* harmony import */ var _Observable_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable.js */ \"./node_modules/ol/Observable.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n/**\n * @module ol/renderer/Layer\n */\n\n\n\n\n\n/**\n * @template {import(\"../layer/Layer.js\").default} LayerType\n */\nclass LayerRenderer extends _Observable_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {LayerType} layer Layer.\n */\n constructor(layer) {\n super();\n\n /**\n * The renderer is initialized and ready to render.\n * @type {boolean}\n */\n this.ready = true;\n\n /** @private */\n this.boundHandleImageChange_ = this.handleImageChange_.bind(this);\n\n /**\n * @protected\n * @type {LayerType}\n */\n this.layer_ = layer;\n\n /**\n * @type {import(\"../render/canvas/ExecutorGroup\").default}\n */\n this.declutterExecutorGroup = null;\n }\n\n /**\n * Asynchronous layer level hit detection.\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel.\n * @return {Promise<Array<import(\"../Feature\").FeatureLike>>} Promise that resolves with\n * an array of features.\n */\n getFeatures(pixel) {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.abstract)();\n }\n\n /**\n * @param {import(\"../pixel.js\").Pixel} pixel Pixel.\n * @return {Uint8ClampedArray|Uint8Array|Float32Array|DataView|null} Pixel data.\n */\n getData(pixel) {\n return null;\n }\n\n /**\n * Determine whether render should be called.\n * @abstract\n * @param {import(\"../Map.js\").FrameState} frameState Frame state.\n * @return {boolean} Layer is ready to be rendered.\n */\n prepareFrame(frameState) {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.abstract)();\n }\n\n /**\n * Render the layer.\n * @abstract\n * @param {import(\"../Map.js\").FrameState} frameState Frame state.\n * @param {HTMLElement|null} target Target that may be used to render content to.\n * @return {HTMLElement|null} The rendered element.\n */\n renderFrame(frameState, target) {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.abstract)();\n }\n\n /**\n * @param {Object<number, Object<string, import(\"../Tile.js\").default>>} tiles Lookup of loaded tiles by zoom level.\n * @param {number} zoom Zoom level.\n * @param {import(\"../Tile.js\").default} tile Tile.\n * @return {boolean|void} If `false`, the tile will not be considered loaded.\n */\n loadedTileCallback(tiles, zoom, tile) {\n if (!tiles[zoom]) {\n tiles[zoom] = {};\n }\n tiles[zoom][tile.tileCoord.toString()] = tile;\n return undefined;\n }\n\n /**\n * Create a function that adds loaded tiles to the tile lookup.\n * @param {import(\"../source/Tile.js\").default} source Tile source.\n * @param {import(\"../proj/Projection.js\").default} projection Projection of the tiles.\n * @param {Object<number, Object<string, import(\"../Tile.js\").default>>} tiles Lookup of loaded tiles by zoom level.\n * @return {function(number, import(\"../TileRange.js\").default):boolean} A function that can be\n * called with a zoom level and a tile range to add loaded tiles to the lookup.\n * @protected\n */\n createLoadedTileFinder(source, projection, tiles) {\n return (\n /**\n * @param {number} zoom Zoom level.\n * @param {import(\"../TileRange.js\").default} tileRange Tile range.\n * @return {boolean} The tile range is fully loaded.\n */\n (zoom, tileRange) => {\n const callback = this.loadedTileCallback.bind(this, tiles, zoom);\n return source.forEachLoadedTile(projection, zoom, tileRange, callback);\n }\n );\n }\n /**\n * @abstract\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"../Map.js\").FrameState} frameState Frame state.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {import(\"./vector.js\").FeatureCallback<T>} callback Feature callback.\n * @param {Array<import(\"./Map.js\").HitMatch<T>>} matches The hit detected matches with tolerance.\n * @return {T|undefined} Callback result.\n * @template T\n */\n forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, callback, matches) {\n return undefined;\n }\n\n /**\n * @return {LayerType} Layer.\n */\n getLayer() {\n return this.layer_;\n }\n\n /**\n * Perform action necessary to get the layer rendered after new fonts have loaded\n * @abstract\n */\n handleFontsChanged() {}\n\n /**\n * Handle changes in image state.\n * @param {import(\"../events/Event.js\").default} event Image change event.\n * @private\n */\n handleImageChange_(event) {\n const image = /** @type {import(\"../Image.js\").default} */event.target;\n if (image.getState() === _ImageState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].LOADED || image.getState() === _ImageState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ERROR) {\n this.renderIfReadyAndVisible();\n }\n }\n\n /**\n * Load the image if not already loaded, and register the image change\n * listener if needed.\n * @param {import(\"../Image.js\").default} image Image.\n * @return {boolean} `true` if the image is already loaded, `false` otherwise.\n * @protected\n */\n loadImage(image) {\n let imageState = image.getState();\n if (imageState != _ImageState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].LOADED && imageState != _ImageState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].ERROR) {\n image.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].CHANGE, this.boundHandleImageChange_);\n }\n if (imageState == _ImageState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].IDLE) {\n image.load();\n imageState = image.getState();\n }\n return imageState == _ImageState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].LOADED;\n }\n\n /**\n * @protected\n */\n renderIfReadyAndVisible() {\n const layer = this.getLayer();\n if (layer && layer.getVisible() && layer.getSourceState() === 'ready') {\n layer.changed();\n }\n }\n\n /**\n * Clean up.\n */\n disposeInternal() {\n delete this.layer_;\n super.disposeInternal();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayerRenderer);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/renderer/Layer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/renderer/Map.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ol/renderer/Map.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Disposable_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Disposable.js */ \"./node_modules/ol/Disposable.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../transform.js */ \"./node_modules/ol/transform.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _style_IconImageCache_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../style/IconImageCache.js */ \"./node_modules/ol/style/IconImageCache.js\");\n/* harmony import */ var _layer_Layer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../layer/Layer.js */ \"./node_modules/ol/layer/Layer.js\");\n/* harmony import */ var _coordinate_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../coordinate.js */ \"./node_modules/ol/coordinate.js\");\n\n/**\n * @module ol/renderer/Map\n */\n\n\n\n\n\n\n\n\n\n/**\n * @template T\n * @typedef HitMatch\n * @property {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @property {import(\"../layer/Layer.js\").default} layer Layer.\n * @property {import(\"../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @property {number} distanceSq Squared distance.\n * @property {import(\"./vector.js\").FeatureCallback<T>} callback Callback.\n */\n\n/**\n * @abstract\n */\nclass MapRenderer extends _Disposable_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {import(\"../Map.js\").default} map Map.\n */\n constructor(map) {\n super();\n\n /**\n * @private\n * @type {import(\"../Map.js\").default}\n */\n this.map_ = map;\n }\n\n /**\n * @abstract\n * @param {import(\"../render/EventType.js\").default} type Event type.\n * @param {import(\"../Map.js\").FrameState} frameState Frame state.\n */\n dispatchRenderEvent(type, frameState) {\n (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.abstract)();\n }\n\n /**\n * @param {import(\"../Map.js\").FrameState} frameState FrameState.\n * @protected\n */\n calculateMatrices2D(frameState) {\n const viewState = frameState.viewState;\n const coordinateToPixelTransform = frameState.coordinateToPixelTransform;\n const pixelToCoordinateTransform = frameState.pixelToCoordinateTransform;\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_3__.compose)(coordinateToPixelTransform, frameState.size[0] / 2, frameState.size[1] / 2, 1 / viewState.resolution, -1 / viewState.resolution, -viewState.rotation, -viewState.center[0], -viewState.center[1]);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_3__.makeInverse)(pixelToCoordinateTransform, coordinateToPixelTransform);\n }\n\n /**\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"../Map.js\").FrameState} frameState FrameState.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {boolean} checkWrapped Check for wrapped geometries.\n * @param {import(\"./vector.js\").FeatureCallback<T>} callback Feature callback.\n * @param {S} thisArg Value to use as `this` when executing `callback`.\n * @param {function(this: U, import(\"../layer/Layer.js\").default): boolean} layerFilter Layer filter\n * function, only layers which are visible and for which this function\n * returns `true` will be tested for features. By default, all visible\n * layers will be tested.\n * @param {U} thisArg2 Value to use as `this` when executing `layerFilter`.\n * @return {T|undefined} Callback result.\n * @template S,T,U\n */\n forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, checkWrapped, callback, thisArg, layerFilter, thisArg2) {\n let result;\n const viewState = frameState.viewState;\n\n /**\n * @param {boolean} managed Managed layer.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../layer/Layer.js\").default} layer Layer.\n * @param {import(\"../geom/Geometry.js\").default} geometry Geometry.\n * @return {T|undefined} Callback result.\n */\n function forEachFeatureAtCoordinate(managed, feature, layer, geometry) {\n return callback.call(thisArg, feature, managed ? layer : null, geometry);\n }\n const projection = viewState.projection;\n const translatedCoordinate = (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_4__.wrapX)(coordinate.slice(), projection);\n const offsets = [[0, 0]];\n if (projection.canWrapX() && checkWrapped) {\n const projectionExtent = projection.getExtent();\n const worldWidth = (0,_extent_js__WEBPACK_IMPORTED_MODULE_5__.getWidth)(projectionExtent);\n offsets.push([-worldWidth, 0], [worldWidth, 0]);\n }\n const layerStates = frameState.layerStatesArray;\n const numLayers = layerStates.length;\n const matches = /** @type {Array<HitMatch<T>>} */[];\n const tmpCoord = [];\n for (let i = 0; i < offsets.length; i++) {\n for (let j = numLayers - 1; j >= 0; --j) {\n const layerState = layerStates[j];\n const layer = layerState.layer;\n if (layer.hasRenderer() && (0,_layer_Layer_js__WEBPACK_IMPORTED_MODULE_6__.inView)(layerState, viewState) && layerFilter.call(thisArg2, layer)) {\n const layerRenderer = layer.getRenderer();\n const source = layer.getSource();\n if (layerRenderer && source) {\n const coordinates = source.getWrapX() ? translatedCoordinate : coordinate;\n const callback = forEachFeatureAtCoordinate.bind(null, layerState.managed);\n tmpCoord[0] = coordinates[0] + offsets[i][0];\n tmpCoord[1] = coordinates[1] + offsets[i][1];\n result = layerRenderer.forEachFeatureAtCoordinate(tmpCoord, frameState, hitTolerance, callback, matches);\n }\n if (result) {\n return result;\n }\n }\n }\n }\n if (matches.length === 0) {\n return undefined;\n }\n const order = 1 / matches.length;\n matches.forEach((m, i) => m.distanceSq += i * order);\n matches.sort((a, b) => a.distanceSq - b.distanceSq);\n matches.some(m => {\n return result = m.callback(m.feature, m.layer, m.geometry);\n });\n return result;\n }\n\n /**\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"../Map.js\").FrameState} frameState FrameState.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {boolean} checkWrapped Check for wrapped geometries.\n * @param {function(this: U, import(\"../layer/Layer.js\").default): boolean} layerFilter Layer filter\n * function, only layers which are visible and for which this function\n * returns `true` will be tested for features. By default, all visible\n * layers will be tested.\n * @param {U} thisArg Value to use as `this` when executing `layerFilter`.\n * @return {boolean} Is there a feature at the given coordinate?\n * @template U\n */\n hasFeatureAtCoordinate(coordinate, frameState, hitTolerance, checkWrapped, layerFilter, thisArg) {\n const hasFeature = this.forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, checkWrapped, _functions_js__WEBPACK_IMPORTED_MODULE_7__.TRUE, this, layerFilter, thisArg);\n return hasFeature !== undefined;\n }\n\n /**\n * @return {import(\"../Map.js\").default} Map.\n */\n getMap() {\n return this.map_;\n }\n\n /**\n * Render.\n * @abstract\n * @param {?import(\"../Map.js\").FrameState} frameState Frame state.\n */\n renderFrame(frameState) {\n (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.abstract)();\n }\n\n /**\n * @param {import(\"../Map.js\").FrameState} frameState Frame state.\n */\n flushDeclutterItems(frameState) {}\n\n /**\n * @param {import(\"../Map.js\").FrameState} frameState Frame state.\n * @protected\n */\n scheduleExpireIconCache(frameState) {\n if (_style_IconImageCache_js__WEBPACK_IMPORTED_MODULE_8__.shared.canExpireCache()) {\n frameState.postRenderFunctions.push(expireIconCache);\n }\n }\n}\n\n/**\n * @param {import(\"../Map.js\").default} map Map.\n * @param {import(\"../Map.js\").FrameState} frameState Frame state.\n */\nfunction expireIconCache(map, frameState) {\n _style_IconImageCache_js__WEBPACK_IMPORTED_MODULE_8__.shared.expire();\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (MapRenderer);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/renderer/Map.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/renderer/canvas/ImageLayer.js":
|
||
/*!*******************************************************!*\
|
||
!*** ./node_modules/ol/renderer/canvas/ImageLayer.js ***!
|
||
\*******************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Layer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Layer.js */ \"./node_modules/ol/renderer/canvas/Layer.js\");\n/* harmony import */ var _ImageState_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ImageState.js */ \"./node_modules/ol/ImageState.js\");\n/* harmony import */ var _ViewHint_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../ViewHint.js */ \"./node_modules/ol/ViewHint.js\");\n/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../transform.js */ \"./node_modules/ol/transform.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../proj.js */ \"./node_modules/ol/proj.js\");\n/**\n * @module ol/renderer/canvas/ImageLayer\n */\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Canvas renderer for image layers.\n * @api\n */\nclass CanvasImageLayerRenderer extends _Layer_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {import(\"../../layer/Image.js\").default} imageLayer Image layer.\n */\n constructor(imageLayer) {\n super(imageLayer);\n\n /**\n * @protected\n * @type {?import(\"../../Image.js\").default}\n */\n this.image_ = null;\n }\n\n /**\n * @return {import('../../DataTile.js').ImageLike} Image.\n */\n getImage() {\n return !this.image_ ? null : this.image_.getImage();\n }\n\n /**\n * Determine whether render should be called.\n * @param {import(\"../../Map.js\").FrameState} frameState Frame state.\n * @return {boolean} Layer is ready to be rendered.\n */\n prepareFrame(frameState) {\n const layerState = frameState.layerStatesArray[frameState.layerIndex];\n const pixelRatio = frameState.pixelRatio;\n const viewState = frameState.viewState;\n const viewResolution = viewState.resolution;\n const imageSource = this.getLayer().getSource();\n const hints = frameState.viewHints;\n let renderedExtent = frameState.extent;\n if (layerState.extent !== undefined) {\n renderedExtent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getIntersection)(renderedExtent, (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.fromUserExtent)(layerState.extent, viewState.projection));\n }\n if (!hints[_ViewHint_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].ANIMATING] && !hints[_ViewHint_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].INTERACTING] && !(0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.isEmpty)(renderedExtent)) {\n if (imageSource) {\n const projection = viewState.projection;\n const image = imageSource.getImage(renderedExtent, viewResolution, pixelRatio, projection);\n if (image) {\n if (this.loadImage(image)) {\n this.image_ = image;\n } else if (image.getState() === _ImageState_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].EMPTY) {\n this.image_ = null;\n }\n }\n } else {\n this.image_ = null;\n }\n }\n return !!this.image_;\n }\n\n /**\n * @param {import(\"../../pixel.js\").Pixel} pixel Pixel.\n * @return {Uint8ClampedArray} Data at the pixel location.\n */\n getData(pixel) {\n const frameState = this.frameState;\n if (!frameState) {\n return null;\n }\n const layer = this.getLayer();\n const coordinate = (0,_transform_js__WEBPACK_IMPORTED_MODULE_5__.apply)(frameState.pixelToCoordinateTransform, pixel.slice());\n const layerExtent = layer.getExtent();\n if (layerExtent) {\n if (!(0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.containsCoordinate)(layerExtent, coordinate)) {\n return null;\n }\n }\n const imageExtent = this.image_.getExtent();\n const img = this.image_.getImage();\n const imageMapWidth = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getWidth)(imageExtent);\n const col = Math.floor(img.width * ((coordinate[0] - imageExtent[0]) / imageMapWidth));\n if (col < 0 || col >= img.width) {\n return null;\n }\n const imageMapHeight = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getHeight)(imageExtent);\n const row = Math.floor(img.height * ((imageExtent[3] - coordinate[1]) / imageMapHeight));\n if (row < 0 || row >= img.height) {\n return null;\n }\n return this.getImageData(img, col, row);\n }\n\n /**\n * Render the layer.\n * @param {import(\"../../Map.js\").FrameState} frameState Frame state.\n * @param {HTMLElement} target Target that may be used to render content to.\n * @return {HTMLElement} The rendered element.\n */\n renderFrame(frameState, target) {\n const image = this.image_;\n const imageExtent = image.getExtent();\n const imageResolution = image.getResolution();\n const [imageResolutionX, imageResolutionY] = Array.isArray(imageResolution) ? imageResolution : [imageResolution, imageResolution];\n const imagePixelRatio = image.getPixelRatio();\n const layerState = frameState.layerStatesArray[frameState.layerIndex];\n const pixelRatio = frameState.pixelRatio;\n const viewState = frameState.viewState;\n const viewCenter = viewState.center;\n const viewResolution = viewState.resolution;\n const scaleX = pixelRatio * imageResolutionX / (viewResolution * imagePixelRatio);\n const scaleY = pixelRatio * imageResolutionY / (viewResolution * imagePixelRatio);\n const extent = frameState.extent;\n const resolution = viewState.resolution;\n const rotation = viewState.rotation;\n // desired dimensions of the canvas in pixels\n const width = Math.round((0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getWidth)(extent) / resolution * pixelRatio);\n const height = Math.round((0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getHeight)(extent) / resolution * pixelRatio);\n\n // set forward and inverse pixel transforms\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_5__.compose)(this.pixelTransform, frameState.size[0] / 2, frameState.size[1] / 2, 1 / pixelRatio, 1 / pixelRatio, rotation, -width / 2, -height / 2);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_5__.makeInverse)(this.inversePixelTransform, this.pixelTransform);\n const canvasTransform = (0,_transform_js__WEBPACK_IMPORTED_MODULE_5__.toString)(this.pixelTransform);\n this.useContainer(target, canvasTransform, this.getBackground(frameState));\n const context = this.context;\n const canvas = context.canvas;\n if (canvas.width != width || canvas.height != height) {\n canvas.width = width;\n canvas.height = height;\n } else if (!this.containerReused) {\n context.clearRect(0, 0, width, height);\n }\n\n // clipped rendering if layer extent is set\n let clipped = false;\n let render = true;\n if (layerState.extent) {\n const layerExtent = (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.fromUserExtent)(layerState.extent, viewState.projection);\n render = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.intersects)(layerExtent, frameState.extent);\n clipped = render && !(0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.containsExtent)(layerExtent, frameState.extent);\n if (clipped) {\n this.clipUnrotated(context, frameState, layerExtent);\n }\n }\n const img = image.getImage();\n const transform = (0,_transform_js__WEBPACK_IMPORTED_MODULE_5__.compose)(this.tempTransform, width / 2, height / 2, scaleX, scaleY, 0, imagePixelRatio * (imageExtent[0] - viewCenter[0]) / imageResolutionX, imagePixelRatio * (viewCenter[1] - imageExtent[3]) / imageResolutionY);\n this.renderedResolution = imageResolutionY * pixelRatio / imagePixelRatio;\n const dw = img.width * transform[0];\n const dh = img.height * transform[3];\n if (!this.getLayer().getSource().getInterpolate()) {\n context.imageSmoothingEnabled = false;\n }\n this.preRender(context, frameState);\n if (render && dw >= 0.5 && dh >= 0.5) {\n const dx = transform[4];\n const dy = transform[5];\n const opacity = layerState.opacity;\n let previousAlpha;\n if (opacity !== 1) {\n previousAlpha = context.globalAlpha;\n context.globalAlpha = opacity;\n }\n context.drawImage(img, 0, 0, +img.width, +img.height, dx, dy, dw, dh);\n if (opacity !== 1) {\n context.globalAlpha = previousAlpha;\n }\n }\n this.postRender(context, frameState);\n if (clipped) {\n context.restore();\n }\n context.imageSmoothingEnabled = true;\n if (canvasTransform !== canvas.style.transform) {\n canvas.style.transform = canvasTransform;\n }\n return this.container;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (CanvasImageLayerRenderer);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/renderer/canvas/ImageLayer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/renderer/canvas/Layer.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/ol/renderer/canvas/Layer.js ***!
|
||
\**************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ canvasPool: function() { return /* binding */ canvasPool; }\n/* harmony export */ });\n/* harmony import */ var _Layer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Layer.js */ \"./node_modules/ol/renderer/Layer.js\");\n/* harmony import */ var _render_Event_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../render/Event.js */ \"./node_modules/ol/render/Event.js\");\n/* harmony import */ var _render_EventType_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../render/EventType.js */ \"./node_modules/ol/render/EventType.js\");\n/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../transform.js */ \"./node_modules/ol/transform.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../color.js */ \"./node_modules/ol/color.js\");\n/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../dom.js */ \"./node_modules/ol/dom.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../extent.js */ \"./node_modules/ol/extent.js\");\n/**\n * @module ol/renderer/canvas/Layer\n */\n\n\n\n\n\n\n\n\n\n/**\n * @type {Array<HTMLCanvasElement>}\n */\nconst canvasPool = [];\n\n/**\n * @type {CanvasRenderingContext2D}\n */\nlet pixelContext = null;\nfunction createPixelContext() {\n pixelContext = (0,_dom_js__WEBPACK_IMPORTED_MODULE_0__.createCanvasContext2D)(1, 1, undefined, {\n willReadFrequently: true\n });\n}\n\n/**\n * @abstract\n * @template {import(\"../../layer/Layer.js\").default} LayerType\n * @extends {LayerRenderer<LayerType>}\n */\nclass CanvasLayerRenderer extends _Layer_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {LayerType} layer Layer.\n */\n constructor(layer) {\n super(layer);\n\n /**\n * @protected\n * @type {HTMLElement}\n */\n this.container = null;\n\n /**\n * @protected\n * @type {number}\n */\n this.renderedResolution;\n\n /**\n * A temporary transform. The values in this transform should only be used in a\n * function that sets the values.\n * @protected\n * @type {import(\"../../transform.js\").Transform}\n */\n this.tempTransform = (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.create)();\n\n /**\n * The transform for rendered pixels to viewport CSS pixels. This transform must\n * be set when rendering a frame and may be used by other functions after rendering.\n * @protected\n * @type {import(\"../../transform.js\").Transform}\n */\n this.pixelTransform = (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.create)();\n\n /**\n * The transform for viewport CSS pixels to rendered pixels. This transform must\n * be set when rendering a frame and may be used by other functions after rendering.\n * @protected\n * @type {import(\"../../transform.js\").Transform}\n */\n this.inversePixelTransform = (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.create)();\n\n /**\n * @type {CanvasRenderingContext2D}\n */\n this.context = null;\n\n /**\n * @type {boolean}\n */\n this.containerReused = false;\n\n /**\n * @private\n * @type {CanvasRenderingContext2D}\n */\n this.pixelContext_ = null;\n\n /**\n * @protected\n * @type {import(\"../../Map.js\").FrameState|null}\n */\n this.frameState = null;\n }\n\n /**\n * @param {import('../../DataTile.js').ImageLike} image Image.\n * @param {number} col The column index.\n * @param {number} row The row index.\n * @return {Uint8ClampedArray|null} The image data.\n */\n getImageData(image, col, row) {\n if (!pixelContext) {\n createPixelContext();\n }\n pixelContext.clearRect(0, 0, 1, 1);\n let data;\n try {\n pixelContext.drawImage(image, col, row, 1, 1, 0, 0, 1, 1);\n data = pixelContext.getImageData(0, 0, 1, 1).data;\n } catch (err) {\n pixelContext = null;\n return null;\n }\n return data;\n }\n\n /**\n * @param {import('../../Map.js').FrameState} frameState Frame state.\n * @return {string} Background color.\n */\n getBackground(frameState) {\n const layer = this.getLayer();\n let background = layer.getBackground();\n if (typeof background === 'function') {\n background = background(frameState.viewState.resolution);\n }\n return background || undefined;\n }\n\n /**\n * Get a rendering container from an existing target, if compatible.\n * @param {HTMLElement} target Potential render target.\n * @param {string} transform CSS Transform.\n * @param {string} [backgroundColor] Background color.\n */\n useContainer(target, transform, backgroundColor) {\n const layerClassName = this.getLayer().getClassName();\n let container, context;\n if (target && target.className === layerClassName && (!backgroundColor || target && target.style.backgroundColor && (0,_array_js__WEBPACK_IMPORTED_MODULE_3__.equals)((0,_color_js__WEBPACK_IMPORTED_MODULE_4__.asArray)(target.style.backgroundColor), (0,_color_js__WEBPACK_IMPORTED_MODULE_4__.asArray)(backgroundColor)))) {\n const canvas = target.firstElementChild;\n if (canvas instanceof HTMLCanvasElement) {\n context = canvas.getContext('2d');\n }\n }\n if (context && context.canvas.style.transform === transform) {\n // Container of the previous layer renderer can be used.\n this.container = target;\n this.context = context;\n this.containerReused = true;\n } else if (this.containerReused) {\n // Previously reused container cannot be used any more.\n this.container = null;\n this.context = null;\n this.containerReused = false;\n } else if (this.container) {\n this.container.style.backgroundColor = null;\n }\n if (!this.container) {\n container = document.createElement('div');\n container.className = layerClassName;\n let style = container.style;\n style.position = 'absolute';\n style.width = '100%';\n style.height = '100%';\n context = (0,_dom_js__WEBPACK_IMPORTED_MODULE_0__.createCanvasContext2D)();\n const canvas = context.canvas;\n container.appendChild(canvas);\n style = canvas.style;\n style.position = 'absolute';\n style.left = '0';\n style.transformOrigin = 'top left';\n this.container = container;\n this.context = context;\n }\n if (!this.containerReused && backgroundColor && !this.container.style.backgroundColor) {\n this.container.style.backgroundColor = backgroundColor;\n }\n }\n\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../Map.js\").FrameState} frameState Frame state.\n * @param {import(\"../../extent.js\").Extent} extent Clip extent.\n * @protected\n */\n clipUnrotated(context, frameState, extent) {\n const topLeft = (0,_extent_js__WEBPACK_IMPORTED_MODULE_5__.getTopLeft)(extent);\n const topRight = (0,_extent_js__WEBPACK_IMPORTED_MODULE_5__.getTopRight)(extent);\n const bottomRight = (0,_extent_js__WEBPACK_IMPORTED_MODULE_5__.getBottomRight)(extent);\n const bottomLeft = (0,_extent_js__WEBPACK_IMPORTED_MODULE_5__.getBottomLeft)(extent);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.apply)(frameState.coordinateToPixelTransform, topLeft);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.apply)(frameState.coordinateToPixelTransform, topRight);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.apply)(frameState.coordinateToPixelTransform, bottomRight);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.apply)(frameState.coordinateToPixelTransform, bottomLeft);\n const inverted = this.inversePixelTransform;\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.apply)(inverted, topLeft);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.apply)(inverted, topRight);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.apply)(inverted, bottomRight);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.apply)(inverted, bottomLeft);\n context.save();\n context.beginPath();\n context.moveTo(Math.round(topLeft[0]), Math.round(topLeft[1]));\n context.lineTo(Math.round(topRight[0]), Math.round(topRight[1]));\n context.lineTo(Math.round(bottomRight[0]), Math.round(bottomRight[1]));\n context.lineTo(Math.round(bottomLeft[0]), Math.round(bottomLeft[1]));\n context.clip();\n }\n\n /**\n * @param {import(\"../../render/EventType.js\").default} type Event type.\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../Map.js\").FrameState} frameState Frame state.\n * @private\n */\n dispatchRenderEvent_(type, context, frameState) {\n const layer = this.getLayer();\n if (layer.hasListener(type)) {\n const event = new _render_Event_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](type, this.inversePixelTransform, frameState, context);\n layer.dispatchEvent(event);\n }\n }\n\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../Map.js\").FrameState} frameState Frame state.\n * @protected\n */\n preRender(context, frameState) {\n this.frameState = frameState;\n this.dispatchRenderEvent_(_render_EventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].PRERENDER, context, frameState);\n }\n\n /**\n * @param {CanvasRenderingContext2D} context Context.\n * @param {import(\"../../Map.js\").FrameState} frameState Frame state.\n * @protected\n */\n postRender(context, frameState) {\n this.dispatchRenderEvent_(_render_EventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POSTRENDER, context, frameState);\n }\n\n /**\n * Creates a transform for rendering to an element that will be rotated after rendering.\n * @param {import(\"../../coordinate.js\").Coordinate} center Center.\n * @param {number} resolution Resolution.\n * @param {number} rotation Rotation.\n * @param {number} pixelRatio Pixel ratio.\n * @param {number} width Width of the rendered element (in pixels).\n * @param {number} height Height of the rendered element (in pixels).\n * @param {number} offsetX Offset on the x-axis in view coordinates.\n * @protected\n * @return {!import(\"../../transform.js\").Transform} Transform.\n */\n getRenderTransform(center, resolution, rotation, pixelRatio, width, height, offsetX) {\n const dx1 = width / 2;\n const dy1 = height / 2;\n const sx = pixelRatio / resolution;\n const sy = -sx;\n const dx2 = -center[0] + offsetX;\n const dy2 = -center[1];\n return (0,_transform_js__WEBPACK_IMPORTED_MODULE_2__.compose)(this.tempTransform, dx1, dy1, sx, sy, -rotation, dx2, dy2);\n }\n\n /**\n * Clean up.\n */\n disposeInternal() {\n delete this.frameState;\n super.disposeInternal();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (CanvasLayerRenderer);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/renderer/canvas/Layer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/renderer/canvas/VectorLayer.js":
|
||
/*!********************************************************!*\
|
||
!*** ./node_modules/ol/renderer/canvas/VectorLayer.js ***!
|
||
\********************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _render_canvas_BuilderGroup_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../render/canvas/BuilderGroup.js */ \"./node_modules/ol/render/canvas/BuilderGroup.js\");\n/* harmony import */ var _Layer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Layer.js */ \"./node_modules/ol/renderer/canvas/Layer.js\");\n/* harmony import */ var _render_canvas_ExecutorGroup_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../render/canvas/ExecutorGroup.js */ \"./node_modules/ol/render/canvas/ExecutorGroup.js\");\n/* harmony import */ var _render_EventType_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../render/EventType.js */ \"./node_modules/ol/render/EventType.js\");\n/* harmony import */ var _ViewHint_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ViewHint.js */ \"./node_modules/ol/ViewHint.js\");\n/* harmony import */ var _render_canvas_hitdetect_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../render/canvas/hitdetect.js */ \"./node_modules/ol/render/canvas/hitdetect.js\");\n/* harmony import */ var _transform_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../transform.js */ \"./node_modules/ol/transform.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../dom.js */ \"./node_modules/ol/dom.js\");\n/* harmony import */ var _vector_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../vector.js */ \"./node_modules/ol/renderer/vector.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../proj.js */ \"./node_modules/ol/proj.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _coordinate_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../coordinate.js */ \"./node_modules/ol/coordinate.js\");\n\n/**\n * @module ol/renderer/canvas/VectorLayer\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @classdesc\n * Canvas renderer for vector layers.\n * @api\n */\nclass CanvasVectorLayerRenderer extends _Layer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n /**\n * @param {import(\"../../layer/BaseVector.js\").default} vectorLayer Vector layer.\n */\n constructor(vectorLayer) {\n super(vectorLayer);\n\n /** @private */\n this.boundHandleStyleImageChange_ = this.handleStyleImageChange_.bind(this);\n\n /**\n * @type {boolean}\n */\n this.animatingOrInteracting_;\n\n /**\n * @type {ImageData|null}\n */\n this.hitDetectionImageData_ = null;\n\n /**\n * @type {Array<import(\"../../Feature.js\").default>}\n */\n this.renderedFeatures_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.renderedRevision_ = -1;\n\n /**\n * @private\n * @type {number}\n */\n this.renderedResolution_ = NaN;\n\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n this.renderedExtent_ = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.createEmpty)();\n\n /**\n * @private\n * @type {import(\"../../extent.js\").Extent}\n */\n this.wrappedRenderedExtent_ = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.createEmpty)();\n\n /**\n * @private\n * @type {number}\n */\n this.renderedRotation_;\n\n /**\n * @private\n * @type {import(\"../../coordinate\").Coordinate}\n */\n this.renderedCenter_ = null;\n\n /**\n * @private\n * @type {import(\"../../proj/Projection\").default}\n */\n this.renderedProjection_ = null;\n\n /**\n * @private\n * @type {function(import(\"../../Feature.js\").default, import(\"../../Feature.js\").default): number|null}\n */\n this.renderedRenderOrder_ = null;\n\n /**\n * @private\n * @type {import(\"../../render/canvas/ExecutorGroup\").default}\n */\n this.replayGroup_ = null;\n\n /**\n * A new replay group had to be created by `prepareFrame()`\n * @type {boolean}\n */\n this.replayGroupChanged = true;\n\n /**\n * @type {import(\"../../render/canvas/ExecutorGroup\").default}\n */\n this.declutterExecutorGroup = null;\n\n /**\n * Clipping to be performed by `renderFrame()`\n * @type {boolean}\n */\n this.clipping = true;\n\n /**\n * @private\n * @type {CanvasRenderingContext2D}\n */\n this.compositionContext_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.opacity_ = 1;\n }\n\n /**\n * @param {ExecutorGroup} executorGroup Executor group.\n * @param {import(\"../../Map.js\").FrameState} frameState Frame state.\n * @param {import(\"rbush\").default} [declutterTree] Declutter tree.\n */\n renderWorlds(executorGroup, frameState, declutterTree) {\n const extent = frameState.extent;\n const viewState = frameState.viewState;\n const center = viewState.center;\n const resolution = viewState.resolution;\n const projection = viewState.projection;\n const rotation = viewState.rotation;\n const projectionExtent = projection.getExtent();\n const vectorSource = this.getLayer().getSource();\n const pixelRatio = frameState.pixelRatio;\n const viewHints = frameState.viewHints;\n const snapToPixel = !(viewHints[_ViewHint_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ANIMATING] || viewHints[_ViewHint_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].INTERACTING]);\n const context = this.compositionContext_;\n const width = Math.round(frameState.size[0] * pixelRatio);\n const height = Math.round(frameState.size[1] * pixelRatio);\n const multiWorld = vectorSource.getWrapX() && projection.canWrapX();\n const worldWidth = multiWorld ? (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getWidth)(projectionExtent) : null;\n const endWorld = multiWorld ? Math.ceil((extent[2] - projectionExtent[2]) / worldWidth) + 1 : 1;\n let world = multiWorld ? Math.floor((extent[0] - projectionExtent[0]) / worldWidth) : 0;\n do {\n const transform = this.getRenderTransform(center, resolution, rotation, pixelRatio, width, height, world * worldWidth);\n executorGroup.execute(context, 1, transform, rotation, snapToPixel, undefined, declutterTree);\n } while (++world < endWorld);\n }\n setupCompositionContext_() {\n if (this.opacity_ !== 1) {\n const compositionContext = (0,_dom_js__WEBPACK_IMPORTED_MODULE_5__.createCanvasContext2D)(this.context.canvas.width, this.context.canvas.height, _Layer_js__WEBPACK_IMPORTED_MODULE_2__.canvasPool);\n this.compositionContext_ = compositionContext;\n } else {\n this.compositionContext_ = this.context;\n }\n }\n releaseCompositionContext_() {\n if (this.opacity_ !== 1) {\n const alpha = this.context.globalAlpha;\n this.context.globalAlpha = this.opacity_;\n this.context.drawImage(this.compositionContext_.canvas, 0, 0);\n this.context.globalAlpha = alpha;\n (0,_dom_js__WEBPACK_IMPORTED_MODULE_5__.releaseCanvas)(this.compositionContext_);\n _Layer_js__WEBPACK_IMPORTED_MODULE_2__.canvasPool.push(this.compositionContext_.canvas);\n this.compositionContext_ = null;\n }\n }\n\n /**\n * Render declutter items for this layer\n * @param {import(\"../../Map.js\").FrameState} frameState Frame state.\n */\n renderDeclutter(frameState) {\n if (this.declutterExecutorGroup) {\n this.setupCompositionContext_();\n this.renderWorlds(this.declutterExecutorGroup, frameState, frameState.declutterTree);\n this.releaseCompositionContext_();\n }\n }\n\n /**\n * Render the layer.\n * @param {import(\"../../Map.js\").FrameState} frameState Frame state.\n * @param {HTMLElement|null} target Target that may be used to render content to.\n * @return {HTMLElement|null} The rendered element.\n */\n renderFrame(frameState, target) {\n const pixelRatio = frameState.pixelRatio;\n const layerState = frameState.layerStatesArray[frameState.layerIndex];\n\n // set forward and inverse pixel transforms\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_6__.makeScale)(this.pixelTransform, 1 / pixelRatio, 1 / pixelRatio);\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_6__.makeInverse)(this.inversePixelTransform, this.pixelTransform);\n const canvasTransform = (0,_transform_js__WEBPACK_IMPORTED_MODULE_6__.toString)(this.pixelTransform);\n this.useContainer(target, canvasTransform, this.getBackground(frameState));\n const context = this.context;\n const canvas = context.canvas;\n const replayGroup = this.replayGroup_;\n const declutterExecutorGroup = this.declutterExecutorGroup;\n let render = replayGroup && !replayGroup.isEmpty() || declutterExecutorGroup && !declutterExecutorGroup.isEmpty();\n if (!render) {\n const hasRenderListeners = this.getLayer().hasListener(_render_EventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].PRERENDER) || this.getLayer().hasListener(_render_EventType_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"].POSTRENDER);\n if (!hasRenderListeners) {\n return null;\n }\n }\n\n // resize and clear\n const width = Math.round(frameState.size[0] * pixelRatio);\n const height = Math.round(frameState.size[1] * pixelRatio);\n if (canvas.width != width || canvas.height != height) {\n canvas.width = width;\n canvas.height = height;\n if (canvas.style.transform !== canvasTransform) {\n canvas.style.transform = canvasTransform;\n }\n } else if (!this.containerReused) {\n context.clearRect(0, 0, width, height);\n }\n this.preRender(context, frameState);\n const viewState = frameState.viewState;\n const projection = viewState.projection;\n this.opacity_ = layerState.opacity;\n this.setupCompositionContext_();\n\n // clipped rendering if layer extent is set\n let clipped = false;\n if (render && layerState.extent && this.clipping) {\n const layerExtent = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.fromUserExtent)(layerState.extent, projection);\n render = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.intersects)(layerExtent, frameState.extent);\n clipped = render && !(0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.containsExtent)(layerExtent, frameState.extent);\n if (clipped) {\n this.clipUnrotated(this.compositionContext_, frameState, layerExtent);\n }\n }\n if (render) {\n this.renderWorlds(replayGroup, frameState);\n }\n if (clipped) {\n this.compositionContext_.restore();\n }\n this.releaseCompositionContext_();\n this.postRender(context, frameState);\n if (this.renderedRotation_ !== viewState.rotation) {\n this.renderedRotation_ = viewState.rotation;\n this.hitDetectionImageData_ = null;\n }\n return this.container;\n }\n\n /**\n * Asynchronous layer level hit detection.\n * @param {import(\"../../pixel.js\").Pixel} pixel Pixel.\n * @return {Promise<Array<import(\"../../Feature\").default>>} Promise\n * that resolves with an array of features.\n */\n getFeatures(pixel) {\n return new Promise(resolve => {\n if (!this.hitDetectionImageData_ && !this.animatingOrInteracting_) {\n const size = [this.context.canvas.width, this.context.canvas.height];\n (0,_transform_js__WEBPACK_IMPORTED_MODULE_6__.apply)(this.pixelTransform, size);\n const center = this.renderedCenter_;\n const resolution = this.renderedResolution_;\n const rotation = this.renderedRotation_;\n const projection = this.renderedProjection_;\n const extent = this.wrappedRenderedExtent_;\n const layer = this.getLayer();\n const transforms = [];\n const width = size[0] * _render_canvas_hitdetect_js__WEBPACK_IMPORTED_MODULE_8__.HIT_DETECT_RESOLUTION;\n const height = size[1] * _render_canvas_hitdetect_js__WEBPACK_IMPORTED_MODULE_8__.HIT_DETECT_RESOLUTION;\n transforms.push(this.getRenderTransform(center, resolution, rotation, _render_canvas_hitdetect_js__WEBPACK_IMPORTED_MODULE_8__.HIT_DETECT_RESOLUTION, width, height, 0).slice());\n const source = layer.getSource();\n const projectionExtent = projection.getExtent();\n if (source.getWrapX() && projection.canWrapX() && !(0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.containsExtent)(projectionExtent, extent)) {\n let startX = extent[0];\n const worldWidth = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getWidth)(projectionExtent);\n let world = 0;\n let offsetX;\n while (startX < projectionExtent[0]) {\n --world;\n offsetX = worldWidth * world;\n transforms.push(this.getRenderTransform(center, resolution, rotation, _render_canvas_hitdetect_js__WEBPACK_IMPORTED_MODULE_8__.HIT_DETECT_RESOLUTION, width, height, offsetX).slice());\n startX += worldWidth;\n }\n world = 0;\n startX = extent[2];\n while (startX > projectionExtent[2]) {\n ++world;\n offsetX = worldWidth * world;\n transforms.push(this.getRenderTransform(center, resolution, rotation, _render_canvas_hitdetect_js__WEBPACK_IMPORTED_MODULE_8__.HIT_DETECT_RESOLUTION, width, height, offsetX).slice());\n startX -= worldWidth;\n }\n }\n this.hitDetectionImageData_ = (0,_render_canvas_hitdetect_js__WEBPACK_IMPORTED_MODULE_8__.createHitDetectionImageData)(size, transforms, this.renderedFeatures_, layer.getStyleFunction(), extent, resolution, rotation);\n }\n resolve((0,_render_canvas_hitdetect_js__WEBPACK_IMPORTED_MODULE_8__.hitDetect)(pixel, this.renderedFeatures_, this.hitDetectionImageData_));\n });\n }\n\n /**\n * @param {import(\"../../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {import(\"../../Map.js\").FrameState} frameState Frame state.\n * @param {number} hitTolerance Hit tolerance in pixels.\n * @param {import(\"../vector.js\").FeatureCallback<T>} callback Feature callback.\n * @param {Array<import(\"../Map.js\").HitMatch<T>>} matches The hit detected matches with tolerance.\n * @return {T|undefined} Callback result.\n * @template T\n */\n forEachFeatureAtCoordinate(coordinate, frameState, hitTolerance, callback, matches) {\n if (!this.replayGroup_) {\n return undefined;\n }\n const resolution = frameState.viewState.resolution;\n const rotation = frameState.viewState.rotation;\n const layer = this.getLayer();\n\n /** @type {!Object<string, import(\"../Map.js\").HitMatch<T>|true>} */\n const features = {};\n\n /**\n * @param {import(\"../../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../../geom/SimpleGeometry.js\").default} geometry Geometry.\n * @param {number} distanceSq The squared distance to the click position\n * @return {T|undefined} Callback result.\n */\n const featureCallback = function (feature, geometry, distanceSq) {\n const key = (0,_util_js__WEBPACK_IMPORTED_MODULE_9__.getUid)(feature);\n const match = features[key];\n if (!match) {\n if (distanceSq === 0) {\n features[key] = true;\n return callback(feature, layer, geometry);\n }\n matches.push(features[key] = {\n feature: feature,\n layer: layer,\n geometry: geometry,\n distanceSq: distanceSq,\n callback: callback\n });\n } else if (match !== true && distanceSq < match.distanceSq) {\n if (distanceSq === 0) {\n features[key] = true;\n matches.splice(matches.lastIndexOf(match), 1);\n return callback(feature, layer, geometry);\n }\n match.geometry = geometry;\n match.distanceSq = distanceSq;\n }\n return undefined;\n };\n let result;\n const executorGroups = [this.replayGroup_];\n if (this.declutterExecutorGroup) {\n executorGroups.push(this.declutterExecutorGroup);\n }\n executorGroups.some(executorGroup => {\n return result = executorGroup.forEachFeatureAtCoordinate(coordinate, resolution, rotation, hitTolerance, featureCallback, executorGroup === this.declutterExecutorGroup && frameState.declutterTree ? frameState.declutterTree.all().map(item => item.value) : null);\n });\n return result;\n }\n\n /**\n * Perform action necessary to get the layer rendered after new fonts have loaded\n */\n handleFontsChanged() {\n const layer = this.getLayer();\n if (layer.getVisible() && this.replayGroup_) {\n layer.changed();\n }\n }\n\n /**\n * Handle changes in image style state.\n * @param {import(\"../../events/Event.js\").default} event Image style change event.\n * @private\n */\n handleStyleImageChange_(event) {\n this.renderIfReadyAndVisible();\n }\n\n /**\n * Determine whether render should be called.\n * @param {import(\"../../Map.js\").FrameState} frameState Frame state.\n * @return {boolean} Layer is ready to be rendered.\n */\n prepareFrame(frameState) {\n const vectorLayer = this.getLayer();\n const vectorSource = vectorLayer.getSource();\n if (!vectorSource) {\n return false;\n }\n const animating = frameState.viewHints[_ViewHint_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].ANIMATING];\n const interacting = frameState.viewHints[_ViewHint_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].INTERACTING];\n const updateWhileAnimating = vectorLayer.getUpdateWhileAnimating();\n const updateWhileInteracting = vectorLayer.getUpdateWhileInteracting();\n if (this.ready && !updateWhileAnimating && animating || !updateWhileInteracting && interacting) {\n this.animatingOrInteracting_ = true;\n return true;\n }\n this.animatingOrInteracting_ = false;\n const frameStateExtent = frameState.extent;\n const viewState = frameState.viewState;\n const projection = viewState.projection;\n const resolution = viewState.resolution;\n const pixelRatio = frameState.pixelRatio;\n const vectorLayerRevision = vectorLayer.getRevision();\n const vectorLayerRenderBuffer = vectorLayer.getRenderBuffer();\n let vectorLayerRenderOrder = vectorLayer.getRenderOrder();\n if (vectorLayerRenderOrder === undefined) {\n vectorLayerRenderOrder = _vector_js__WEBPACK_IMPORTED_MODULE_10__.defaultOrder;\n }\n const center = viewState.center.slice();\n const extent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.buffer)(frameStateExtent, vectorLayerRenderBuffer * resolution);\n const renderedExtent = extent.slice();\n const loadExtents = [extent.slice()];\n const projectionExtent = projection.getExtent();\n if (vectorSource.getWrapX() && projection.canWrapX() && !(0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.containsExtent)(projectionExtent, frameState.extent)) {\n // For the replay group, we need an extent that intersects the real world\n // (-180° to +180°). To support geometries in a coordinate range from -540°\n // to +540°, we add at least 1 world width on each side of the projection\n // extent. If the viewport is wider than the world, we need to add half of\n // the viewport width to make sure we cover the whole viewport.\n const worldWidth = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getWidth)(projectionExtent);\n const gutter = Math.max((0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getWidth)(extent) / 2, worldWidth);\n extent[0] = projectionExtent[0] - gutter;\n extent[2] = projectionExtent[2] + gutter;\n (0,_coordinate_js__WEBPACK_IMPORTED_MODULE_11__.wrapX)(center, projection);\n const loadExtent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.wrapX)(loadExtents[0], projection);\n // If the extent crosses the date line, we load data for both edges of the worlds\n if (loadExtent[0] < projectionExtent[0] && loadExtent[2] < projectionExtent[2]) {\n loadExtents.push([loadExtent[0] + worldWidth, loadExtent[1], loadExtent[2] + worldWidth, loadExtent[3]]);\n } else if (loadExtent[0] > projectionExtent[0] && loadExtent[2] > projectionExtent[2]) {\n loadExtents.push([loadExtent[0] - worldWidth, loadExtent[1], loadExtent[2] - worldWidth, loadExtent[3]]);\n }\n }\n if (this.ready && this.renderedResolution_ == resolution && this.renderedRevision_ == vectorLayerRevision && this.renderedRenderOrder_ == vectorLayerRenderOrder && (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.containsExtent)(this.wrappedRenderedExtent_, extent)) {\n if (!(0,_array_js__WEBPACK_IMPORTED_MODULE_12__.equals)(this.renderedExtent_, renderedExtent)) {\n this.hitDetectionImageData_ = null;\n this.renderedExtent_ = renderedExtent;\n }\n this.renderedCenter_ = center;\n this.replayGroupChanged = false;\n return true;\n }\n this.replayGroup_ = null;\n const replayGroup = new _render_canvas_BuilderGroup_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"]((0,_vector_js__WEBPACK_IMPORTED_MODULE_10__.getTolerance)(resolution, pixelRatio), extent, resolution, pixelRatio);\n let declutterBuilderGroup;\n if (this.getLayer().getDeclutter()) {\n declutterBuilderGroup = new _render_canvas_BuilderGroup_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"]((0,_vector_js__WEBPACK_IMPORTED_MODULE_10__.getTolerance)(resolution, pixelRatio), extent, resolution, pixelRatio);\n }\n const userProjection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getUserProjection)();\n let userTransform;\n if (userProjection) {\n for (let i = 0, ii = loadExtents.length; i < ii; ++i) {\n const extent = loadExtents[i];\n const userExtent = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserExtent)(extent, projection);\n vectorSource.loadFeatures(userExtent, (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserResolution)(resolution, projection), userProjection);\n }\n userTransform = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getTransformFromProjections)(userProjection, projection);\n } else {\n for (let i = 0, ii = loadExtents.length; i < ii; ++i) {\n vectorSource.loadFeatures(loadExtents[i], resolution, projection);\n }\n }\n const squaredTolerance = (0,_vector_js__WEBPACK_IMPORTED_MODULE_10__.getSquaredTolerance)(resolution, pixelRatio);\n let ready = true;\n const render =\n /**\n * @param {import(\"../../Feature.js\").default} feature Feature.\n */\n feature => {\n let styles;\n const styleFunction = feature.getStyleFunction() || vectorLayer.getStyleFunction();\n if (styleFunction) {\n styles = styleFunction(feature, resolution);\n }\n if (styles) {\n const dirty = this.renderFeature(feature, squaredTolerance, styles, replayGroup, userTransform, declutterBuilderGroup);\n ready = ready && !dirty;\n }\n };\n const userExtent = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.toUserExtent)(extent, projection);\n /** @type {Array<import(\"../../Feature.js\").default>} */\n const features = vectorSource.getFeaturesInExtent(userExtent);\n if (vectorLayerRenderOrder) {\n features.sort(vectorLayerRenderOrder);\n }\n for (let i = 0, ii = features.length; i < ii; ++i) {\n render(features[i]);\n }\n this.renderedFeatures_ = features;\n this.ready = ready;\n const replayGroupInstructions = replayGroup.finish();\n const executorGroup = new _render_canvas_ExecutorGroup_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"](extent, resolution, pixelRatio, vectorSource.getOverlaps(), replayGroupInstructions, vectorLayer.getRenderBuffer());\n if (declutterBuilderGroup) {\n this.declutterExecutorGroup = new _render_canvas_ExecutorGroup_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"](extent, resolution, pixelRatio, vectorSource.getOverlaps(), declutterBuilderGroup.finish(), vectorLayer.getRenderBuffer());\n }\n this.renderedResolution_ = resolution;\n this.renderedRevision_ = vectorLayerRevision;\n this.renderedRenderOrder_ = vectorLayerRenderOrder;\n this.renderedExtent_ = renderedExtent;\n this.wrappedRenderedExtent_ = extent;\n this.renderedCenter_ = center;\n this.renderedProjection_ = projection;\n this.replayGroup_ = executorGroup;\n this.hitDetectionImageData_ = null;\n this.replayGroupChanged = true;\n return true;\n }\n\n /**\n * @param {import(\"../../Feature.js\").default} feature Feature.\n * @param {number} squaredTolerance Squared render tolerance.\n * @param {import(\"../../style/Style.js\").default|Array<import(\"../../style/Style.js\").default>} styles The style or array of styles.\n * @param {import(\"../../render/canvas/BuilderGroup.js\").default} builderGroup Builder group.\n * @param {import(\"../../proj.js\").TransformFunction} [transform] Transform from user to view projection.\n * @param {import(\"../../render/canvas/BuilderGroup.js\").default} [declutterBuilderGroup] Builder for decluttering.\n * @return {boolean} `true` if an image is loading.\n */\n renderFeature(feature, squaredTolerance, styles, builderGroup, transform, declutterBuilderGroup) {\n if (!styles) {\n return false;\n }\n let loading = false;\n if (Array.isArray(styles)) {\n for (let i = 0, ii = styles.length; i < ii; ++i) {\n loading = (0,_vector_js__WEBPACK_IMPORTED_MODULE_10__.renderFeature)(builderGroup, feature, styles[i], squaredTolerance, this.boundHandleStyleImageChange_, transform, declutterBuilderGroup) || loading;\n }\n } else {\n loading = (0,_vector_js__WEBPACK_IMPORTED_MODULE_10__.renderFeature)(builderGroup, feature, styles, squaredTolerance, this.boundHandleStyleImageChange_, transform, declutterBuilderGroup);\n }\n return loading;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (CanvasVectorLayerRenderer);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/renderer/canvas/VectorLayer.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/renderer/vector.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/renderer/vector.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ defaultOrder: function() { return /* binding */ defaultOrder; },\n/* harmony export */ getSquaredTolerance: function() { return /* binding */ getSquaredTolerance; },\n/* harmony export */ getTolerance: function() { return /* binding */ getTolerance; },\n/* harmony export */ renderFeature: function() { return /* binding */ renderFeature; }\n/* harmony export */ });\n/* harmony import */ var _ImageState_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ImageState.js */ \"./node_modules/ol/ImageState.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n/**\n * @module ol/renderer/vector\n */\n\n\n\n/**\n * Feature callback. The callback will be called with three arguments. The first\n * argument is one {@link module:ol/Feature~Feature feature} or {@link module:ol/render/Feature~RenderFeature render feature}\n * at the pixel, the second is the {@link module:ol/layer/Layer~Layer layer} of the feature and will be null for\n * unmanaged layers. The third is the {@link module:ol/geom/SimpleGeometry~SimpleGeometry} of the feature. For features\n * with a GeometryCollection geometry, it will be the first detected geometry from the collection.\n * @template T\n * @typedef {function(import(\"../Feature.js\").FeatureLike, import(\"../layer/Layer.js\").default<import(\"../source/Source\").default>, import(\"../geom/SimpleGeometry.js\").default): T} FeatureCallback\n */\n\n/**\n * Tolerance for geometry simplification in device pixels.\n * @type {number}\n */\nconst SIMPLIFY_TOLERANCE = 0.5;\n\n/**\n * @const\n * @type {Object<import(\"../geom/Geometry.js\").Type,\n * function(import(\"../render/canvas/BuilderGroup.js\").default, import(\"../geom/Geometry.js\").default,\n * import(\"../style/Style.js\").default, Object): void>}\n */\nconst GEOMETRY_RENDERERS = {\n 'Point': renderPointGeometry,\n 'LineString': renderLineStringGeometry,\n 'Polygon': renderPolygonGeometry,\n 'MultiPoint': renderMultiPointGeometry,\n 'MultiLineString': renderMultiLineStringGeometry,\n 'MultiPolygon': renderMultiPolygonGeometry,\n 'GeometryCollection': renderGeometryCollectionGeometry,\n 'Circle': renderCircleGeometry\n};\n\n/**\n * @param {import(\"../Feature.js\").FeatureLike} feature1 Feature 1.\n * @param {import(\"../Feature.js\").FeatureLike} feature2 Feature 2.\n * @return {number} Order.\n */\nfunction defaultOrder(feature1, feature2) {\n return parseInt((0,_util_js__WEBPACK_IMPORTED_MODULE_0__.getUid)(feature1), 10) - parseInt((0,_util_js__WEBPACK_IMPORTED_MODULE_0__.getUid)(feature2), 10);\n}\n\n/**\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} Squared pixel tolerance.\n */\nfunction getSquaredTolerance(resolution, pixelRatio) {\n const tolerance = getTolerance(resolution, pixelRatio);\n return tolerance * tolerance;\n}\n\n/**\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} Pixel tolerance.\n */\nfunction getTolerance(resolution, pixelRatio) {\n return SIMPLIFY_TOLERANCE * resolution / pixelRatio;\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Builder group.\n * @param {import(\"../geom/Circle.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} [declutterBuilderGroup] Builder for decluttering.\n */\nfunction renderCircleGeometry(builderGroup, geometry, style, feature, declutterBuilderGroup) {\n const fillStyle = style.getFill();\n const strokeStyle = style.getStroke();\n if (fillStyle || strokeStyle) {\n const circleReplay = builderGroup.getBuilder(style.getZIndex(), 'Circle');\n circleReplay.setFillStrokeStyle(fillStyle, strokeStyle);\n circleReplay.drawCircle(geometry, feature);\n }\n const textStyle = style.getText();\n if (textStyle && textStyle.getText()) {\n const textReplay = (declutterBuilderGroup || builderGroup).getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle);\n textReplay.drawText(geometry, feature);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} replayGroup Replay group.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n * @param {import(\"../proj.js\").TransformFunction} [transform] Transform from user to view projection.\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} [declutterBuilderGroup] Builder for decluttering.\n * @return {boolean} `true` if style is loading.\n */\nfunction renderFeature(replayGroup, feature, style, squaredTolerance, listener, transform, declutterBuilderGroup) {\n let loading = false;\n const imageStyle = style.getImage();\n if (imageStyle) {\n const imageState = imageStyle.getImageState();\n if (imageState == _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LOADED || imageState == _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ERROR) {\n imageStyle.unlistenImageChange(listener);\n } else {\n if (imageState == _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].IDLE) {\n imageStyle.load();\n }\n imageStyle.listenImageChange(listener);\n loading = true;\n }\n }\n renderFeatureInternal(replayGroup, feature, style, squaredTolerance, transform, declutterBuilderGroup);\n return loading;\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} replayGroup Replay group.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {number} squaredTolerance Squared tolerance.\n * @param {import(\"../proj.js\").TransformFunction} [transform] Optional transform function.\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} [declutterBuilderGroup] Builder for decluttering.\n */\nfunction renderFeatureInternal(replayGroup, feature, style, squaredTolerance, transform, declutterBuilderGroup) {\n const geometry = style.getGeometryFunction()(feature);\n if (!geometry) {\n return;\n }\n const simplifiedGeometry = geometry.simplifyTransformed(squaredTolerance, transform);\n const renderer = style.getRenderer();\n if (renderer) {\n renderGeometry(replayGroup, simplifiedGeometry, style, feature);\n } else {\n const geometryRenderer = GEOMETRY_RENDERERS[simplifiedGeometry.getType()];\n geometryRenderer(replayGroup, simplifiedGeometry, style, feature, declutterBuilderGroup);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} replayGroup Replay group.\n * @param {import(\"../geom/Geometry.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n */\nfunction renderGeometry(replayGroup, geometry, style, feature) {\n if (geometry.getType() == 'GeometryCollection') {\n const geometries = /** @type {import(\"../geom/GeometryCollection.js\").default} */geometry.getGeometries();\n for (let i = 0, ii = geometries.length; i < ii; ++i) {\n renderGeometry(replayGroup, geometries[i], style, feature);\n }\n return;\n }\n const replay = replayGroup.getBuilder(style.getZIndex(), 'Default');\n replay.drawCustom(/** @type {import(\"../geom/SimpleGeometry.js\").default} */geometry, feature, style.getRenderer(), style.getHitDetectionRenderer());\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} replayGroup Replay group.\n * @param {import(\"../geom/GeometryCollection.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} [declutterBuilderGroup] Builder for decluttering.\n */\nfunction renderGeometryCollectionGeometry(replayGroup, geometry, style, feature, declutterBuilderGroup) {\n const geometries = geometry.getGeometriesArray();\n let i, ii;\n for (i = 0, ii = geometries.length; i < ii; ++i) {\n const geometryRenderer = GEOMETRY_RENDERERS[geometries[i].getType()];\n geometryRenderer(replayGroup, geometries[i], style, feature, declutterBuilderGroup);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/LineString.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} [declutterBuilderGroup] Builder for decluttering.\n */\nfunction renderLineStringGeometry(builderGroup, geometry, style, feature, declutterBuilderGroup) {\n const strokeStyle = style.getStroke();\n if (strokeStyle) {\n const lineStringReplay = builderGroup.getBuilder(style.getZIndex(), 'LineString');\n lineStringReplay.setFillStrokeStyle(null, strokeStyle);\n lineStringReplay.drawLineString(geometry, feature);\n }\n const textStyle = style.getText();\n if (textStyle && textStyle.getText()) {\n const textReplay = (declutterBuilderGroup || builderGroup).getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle);\n textReplay.drawText(geometry, feature);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/MultiLineString.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} [declutterBuilderGroup] Builder for decluttering.\n */\nfunction renderMultiLineStringGeometry(builderGroup, geometry, style, feature, declutterBuilderGroup) {\n const strokeStyle = style.getStroke();\n if (strokeStyle) {\n const lineStringReplay = builderGroup.getBuilder(style.getZIndex(), 'LineString');\n lineStringReplay.setFillStrokeStyle(null, strokeStyle);\n lineStringReplay.drawMultiLineString(geometry, feature);\n }\n const textStyle = style.getText();\n if (textStyle && textStyle.getText()) {\n const textReplay = (declutterBuilderGroup || builderGroup).getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle);\n textReplay.drawText(geometry, feature);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/MultiPolygon.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").default} feature Feature.\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} [declutterBuilderGroup] Builder for decluttering.\n */\nfunction renderMultiPolygonGeometry(builderGroup, geometry, style, feature, declutterBuilderGroup) {\n const fillStyle = style.getFill();\n const strokeStyle = style.getStroke();\n if (strokeStyle || fillStyle) {\n const polygonReplay = builderGroup.getBuilder(style.getZIndex(), 'Polygon');\n polygonReplay.setFillStrokeStyle(fillStyle, strokeStyle);\n polygonReplay.drawMultiPolygon(geometry, feature);\n }\n const textStyle = style.getText();\n if (textStyle && textStyle.getText()) {\n const textReplay = (declutterBuilderGroup || builderGroup).getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle);\n textReplay.drawText(geometry, feature);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/Point.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} [declutterBuilderGroup] Builder for decluttering.\n */\nfunction renderPointGeometry(builderGroup, geometry, style, feature, declutterBuilderGroup) {\n const imageStyle = style.getImage();\n const textStyle = style.getText();\n /** @type {import(\"../render/canvas.js\").DeclutterImageWithText} */\n let declutterImageWithText;\n if (imageStyle) {\n if (imageStyle.getImageState() != _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LOADED) {\n return;\n }\n let imageBuilderGroup = builderGroup;\n if (declutterBuilderGroup) {\n const declutterMode = imageStyle.getDeclutterMode();\n if (declutterMode !== 'none') {\n imageBuilderGroup = declutterBuilderGroup;\n if (declutterMode === 'obstacle') {\n // draw in non-declutter group:\n const imageReplay = builderGroup.getBuilder(style.getZIndex(), 'Image');\n imageReplay.setImageStyle(imageStyle, declutterImageWithText);\n imageReplay.drawPoint(geometry, feature);\n } else if (textStyle && textStyle.getText()) {\n declutterImageWithText = {};\n }\n }\n }\n const imageReplay = imageBuilderGroup.getBuilder(style.getZIndex(), 'Image');\n imageReplay.setImageStyle(imageStyle, declutterImageWithText);\n imageReplay.drawPoint(geometry, feature);\n }\n if (textStyle && textStyle.getText()) {\n let textBuilderGroup = builderGroup;\n if (declutterBuilderGroup) {\n textBuilderGroup = declutterBuilderGroup;\n }\n const textReplay = textBuilderGroup.getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle, declutterImageWithText);\n textReplay.drawText(geometry, feature);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/MultiPoint.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} [declutterBuilderGroup] Builder for decluttering.\n */\nfunction renderMultiPointGeometry(builderGroup, geometry, style, feature, declutterBuilderGroup) {\n const imageStyle = style.getImage();\n const textStyle = style.getText();\n /** @type {import(\"../render/canvas.js\").DeclutterImageWithText} */\n let declutterImageWithText;\n if (imageStyle) {\n if (imageStyle.getImageState() != _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LOADED) {\n return;\n }\n let imageBuilderGroup = builderGroup;\n if (declutterBuilderGroup) {\n const declutterMode = imageStyle.getDeclutterMode();\n if (declutterMode !== 'none') {\n imageBuilderGroup = declutterBuilderGroup;\n if (declutterMode === 'obstacle') {\n // draw in non-declutter group:\n const imageReplay = builderGroup.getBuilder(style.getZIndex(), 'Image');\n imageReplay.setImageStyle(imageStyle, declutterImageWithText);\n imageReplay.drawMultiPoint(geometry, feature);\n } else if (textStyle && textStyle.getText()) {\n declutterImageWithText = {};\n }\n }\n }\n const imageReplay = imageBuilderGroup.getBuilder(style.getZIndex(), 'Image');\n imageReplay.setImageStyle(imageStyle, declutterImageWithText);\n imageReplay.drawMultiPoint(geometry, feature);\n }\n if (textStyle && textStyle.getText()) {\n let textBuilderGroup = builderGroup;\n if (declutterBuilderGroup) {\n textBuilderGroup = declutterBuilderGroup;\n }\n const textReplay = textBuilderGroup.getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle, declutterImageWithText);\n textReplay.drawText(geometry, feature);\n }\n}\n\n/**\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} builderGroup Replay group.\n * @param {import(\"../geom/Polygon.js\").default|import(\"../render/Feature.js\").default} geometry Geometry.\n * @param {import(\"../style/Style.js\").default} style Style.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {import(\"../render/canvas/BuilderGroup.js\").default} [declutterBuilderGroup] Builder for decluttering.\n */\nfunction renderPolygonGeometry(builderGroup, geometry, style, feature, declutterBuilderGroup) {\n const fillStyle = style.getFill();\n const strokeStyle = style.getStroke();\n if (fillStyle || strokeStyle) {\n const polygonReplay = builderGroup.getBuilder(style.getZIndex(), 'Polygon');\n polygonReplay.setFillStrokeStyle(fillStyle, strokeStyle);\n polygonReplay.drawPolygon(geometry, feature);\n }\n const textStyle = style.getText();\n if (textStyle && textStyle.getText()) {\n const textReplay = (declutterBuilderGroup || builderGroup).getBuilder(style.getZIndex(), 'Text');\n textReplay.setTextStyle(textStyle);\n textReplay.drawText(geometry, feature);\n }\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/renderer/vector.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/reproj.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/ol/reproj.js ***!
|
||
\***********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ calculateSourceExtentResolution: function() { return /* binding */ calculateSourceExtentResolution; },\n/* harmony export */ calculateSourceResolution: function() { return /* binding */ calculateSourceResolution; },\n/* harmony export */ canvasPool: function() { return /* binding */ canvasPool; },\n/* harmony export */ render: function() { return /* binding */ render; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dom.js */ \"./node_modules/ol/dom.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./proj.js */ \"./node_modules/ol/proj.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./math.js */ \"./node_modules/ol/math.js\");\n\n/**\n * @module ol/reproj\n */\n\n\n\n\nlet brokenDiagonalRendering_;\n\n/**\n * @type {Array<HTMLCanvasElement>}\n */\nconst canvasPool = [];\n\n/**\n * This draws a small triangle into a canvas by setting the triangle as the clip region\n * and then drawing a (too large) rectangle\n *\n * @param {CanvasRenderingContext2D} ctx The context in which to draw the triangle\n * @param {number} u1 The x-coordinate of the second point. The first point is 0,0.\n * @param {number} v1 The y-coordinate of the second point.\n * @param {number} u2 The x-coordinate of the third point.\n * @param {number} v2 The y-coordinate of the third point.\n */\nfunction drawTestTriangle(ctx, u1, v1, u2, v2) {\n ctx.beginPath();\n ctx.moveTo(0, 0);\n ctx.lineTo(u1, v1);\n ctx.lineTo(u2, v2);\n ctx.closePath();\n ctx.save();\n ctx.clip();\n ctx.fillRect(0, 0, Math.max(u1, u2) + 1, Math.max(v1, v2));\n ctx.restore();\n}\n\n/**\n * Given the data from getImageData, see if the right values appear at the provided offset.\n * Returns true if either the color or transparency is off\n *\n * @param {Uint8ClampedArray} data The data returned from getImageData\n * @param {number} offset The pixel offset from the start of data.\n * @return {boolean} true if the diagonal rendering is broken\n */\nfunction verifyBrokenDiagonalRendering(data, offset) {\n // the values ought to be close to the rgba(210, 0, 0, 0.75)\n return Math.abs(data[offset * 4] - 210) > 2 || Math.abs(data[offset * 4 + 3] - 0.75 * 255) > 2;\n}\n\n/**\n * Determines if the current browser configuration can render triangular clip regions correctly.\n * This value is cached so the function is only expensive the first time called.\n * Firefox on Windows (as of now) does not if HWA is enabled. See https://bugzilla.mozilla.org/show_bug.cgi?id=1606976\n * Chrome works, and everything seems to work on OSX and Android. This function caches the\n * result. I suppose that it is conceivably possible that a browser might flip modes while the app is\n * running, but lets hope not.\n *\n * @return {boolean} true if the Diagonal Rendering is broken.\n */\nfunction isBrokenDiagonalRendering() {\n if (brokenDiagonalRendering_ === undefined) {\n const ctx = (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.createCanvasContext2D)(6, 6, canvasPool);\n ctx.globalCompositeOperation = 'lighter';\n ctx.fillStyle = 'rgba(210, 0, 0, 0.75)';\n drawTestTriangle(ctx, 4, 5, 4, 0);\n drawTestTriangle(ctx, 4, 5, 0, 5);\n const data = ctx.getImageData(0, 0, 3, 3).data;\n brokenDiagonalRendering_ = verifyBrokenDiagonalRendering(data, 0) || verifyBrokenDiagonalRendering(data, 4) || verifyBrokenDiagonalRendering(data, 8);\n (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.releaseCanvas)(ctx);\n canvasPool.push(ctx.canvas);\n }\n return brokenDiagonalRendering_;\n}\n\n/**\n * Calculates ideal resolution to use from the source in order to achieve\n * pixel mapping as close as possible to 1:1 during reprojection.\n * The resolution is calculated regardless of what resolutions\n * are actually available in the dataset (TileGrid, Image, ...).\n *\n * @param {import(\"./proj/Projection.js\").default} sourceProj Source projection.\n * @param {import(\"./proj/Projection.js\").default} targetProj Target projection.\n * @param {import(\"./coordinate.js\").Coordinate} targetCenter Target center.\n * @param {number} targetResolution Target resolution.\n * @return {number} The best resolution to use. Can be +-Infinity, NaN or 0.\n */\nfunction calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution) {\n const sourceCenter = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.transform)(targetCenter, targetProj, sourceProj);\n\n // calculate the ideal resolution of the source data\n let sourceResolution = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getPointResolution)(targetProj, targetResolution, targetCenter);\n const targetMetersPerUnit = targetProj.getMetersPerUnit();\n if (targetMetersPerUnit !== undefined) {\n sourceResolution *= targetMetersPerUnit;\n }\n const sourceMetersPerUnit = sourceProj.getMetersPerUnit();\n if (sourceMetersPerUnit !== undefined) {\n sourceResolution /= sourceMetersPerUnit;\n }\n\n // Based on the projection properties, the point resolution at the specified\n // coordinates may be slightly different. We need to reverse-compensate this\n // in order to achieve optimal results.\n\n const sourceExtent = sourceProj.getExtent();\n if (!sourceExtent || (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.containsCoordinate)(sourceExtent, sourceCenter)) {\n const compensationFactor = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getPointResolution)(sourceProj, sourceResolution, sourceCenter) / sourceResolution;\n if (isFinite(compensationFactor) && compensationFactor > 0) {\n sourceResolution /= compensationFactor;\n }\n }\n return sourceResolution;\n}\n\n/**\n * Calculates ideal resolution to use from the source in order to achieve\n * pixel mapping as close as possible to 1:1 during reprojection.\n * The resolution is calculated regardless of what resolutions\n * are actually available in the dataset (TileGrid, Image, ...).\n *\n * @param {import(\"./proj/Projection.js\").default} sourceProj Source projection.\n * @param {import(\"./proj/Projection.js\").default} targetProj Target projection.\n * @param {import(\"./extent.js\").Extent} targetExtent Target extent\n * @param {number} targetResolution Target resolution.\n * @return {number} The best resolution to use. Can be +-Infinity, NaN or 0.\n */\nfunction calculateSourceExtentResolution(sourceProj, targetProj, targetExtent, targetResolution) {\n const targetCenter = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getCenter)(targetExtent);\n let sourceResolution = calculateSourceResolution(sourceProj, targetProj, targetCenter, targetResolution);\n if (!isFinite(sourceResolution) || sourceResolution <= 0) {\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.forEachCorner)(targetExtent, function (corner) {\n sourceResolution = calculateSourceResolution(sourceProj, targetProj, corner, targetResolution);\n return isFinite(sourceResolution) && sourceResolution > 0;\n });\n }\n return sourceResolution;\n}\n\n/**\n * @typedef {Object} ImageExtent\n * @property {import(\"./extent.js\").Extent} extent Extent.\n * @property {import('./DataTile.js').ImageLike} image Image.\n */\n\n/**\n * Renders the source data into new canvas based on the triangulation.\n *\n * @param {number} width Width of the canvas.\n * @param {number} height Height of the canvas.\n * @param {number} pixelRatio Pixel ratio.\n * @param {number} sourceResolution Source resolution.\n * @param {import(\"./extent.js\").Extent} sourceExtent Extent of the data source.\n * @param {number} targetResolution Target resolution.\n * @param {import(\"./extent.js\").Extent} targetExtent Target extent.\n * @param {import(\"./reproj/Triangulation.js\").default} triangulation Calculated triangulation.\n * @param {Array<ImageExtent>} sources Array of sources.\n * @param {number} gutter Gutter of the sources.\n * @param {boolean} [renderEdges] Render reprojection edges.\n * @param {boolean} [interpolate] Use linear interpolation when resampling.\n * @param {boolean} [drawSingle] Draw single source images directly without stitchContext.\n * @return {HTMLCanvasElement} Canvas with reprojected data.\n */\nfunction render(width, height, pixelRatio, sourceResolution, sourceExtent, targetResolution, targetExtent, triangulation, sources, gutter, renderEdges, interpolate, drawSingle) {\n const context = (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.createCanvasContext2D)(Math.round(pixelRatio * width), Math.round(pixelRatio * height), canvasPool);\n if (!interpolate) {\n context.imageSmoothingEnabled = false;\n }\n if (sources.length === 0) {\n return context.canvas;\n }\n context.scale(pixelRatio, pixelRatio);\n function pixelRound(value) {\n return Math.round(value * pixelRatio) / pixelRatio;\n }\n context.globalCompositeOperation = 'lighter';\n const sourceDataExtent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.createEmpty)();\n sources.forEach(function (src, i, arr) {\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.extend)(sourceDataExtent, src.extent);\n });\n let stitchContext;\n if (!drawSingle || sources.length !== 1 || gutter !== 0) {\n const canvasWidthInUnits = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getWidth)(sourceDataExtent);\n const canvasHeightInUnits = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getHeight)(sourceDataExtent);\n stitchContext = (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.createCanvasContext2D)(Math.round(pixelRatio * canvasWidthInUnits / sourceResolution), Math.round(pixelRatio * canvasHeightInUnits / sourceResolution), canvasPool);\n if (!interpolate) {\n stitchContext.imageSmoothingEnabled = false;\n }\n const stitchScale = pixelRatio / sourceResolution;\n sources.forEach(function (src, i, arr) {\n const xPos = src.extent[0] - sourceDataExtent[0];\n const yPos = -(src.extent[3] - sourceDataExtent[3]);\n const srcWidth = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getWidth)(src.extent);\n const srcHeight = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getHeight)(src.extent);\n\n // This test should never fail -- but it does. Need to find a fix the upstream condition\n if (src.image.width > 0 && src.image.height > 0) {\n stitchContext.drawImage(src.image, gutter, gutter, src.image.width - 2 * gutter, src.image.height - 2 * gutter, xPos * stitchScale, yPos * stitchScale, srcWidth * stitchScale, srcHeight * stitchScale);\n }\n });\n }\n const targetTopLeft = (0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getTopLeft)(targetExtent);\n triangulation.getTriangles().forEach(function (triangle, i, arr) {\n /* Calculate affine transform (src -> dst)\n * Resulting matrix can be used to transform coordinate\n * from `sourceProjection` to destination pixels.\n *\n * To optimize number of context calls and increase numerical stability,\n * we also do the following operations:\n * trans(-topLeftExtentCorner), scale(1 / targetResolution), scale(1, -1)\n * here before solving the linear system so [ui, vi] are pixel coordinates.\n *\n * Src points: xi, yi\n * Dst points: ui, vi\n * Affine coefficients: aij\n *\n * | x0 y0 1 0 0 0 | |a00| |u0|\n * | x1 y1 1 0 0 0 | |a01| |u1|\n * | x2 y2 1 0 0 0 | x |a02| = |u2|\n * | 0 0 0 x0 y0 1 | |a10| |v0|\n * | 0 0 0 x1 y1 1 | |a11| |v1|\n * | 0 0 0 x2 y2 1 | |a12| |v2|\n */\n const source = triangle.source;\n const target = triangle.target;\n let x0 = source[0][0],\n y0 = source[0][1];\n let x1 = source[1][0],\n y1 = source[1][1];\n let x2 = source[2][0],\n y2 = source[2][1];\n // Make sure that everything is on pixel boundaries\n const u0 = pixelRound((target[0][0] - targetTopLeft[0]) / targetResolution);\n const v0 = pixelRound(-(target[0][1] - targetTopLeft[1]) / targetResolution);\n const u1 = pixelRound((target[1][0] - targetTopLeft[0]) / targetResolution);\n const v1 = pixelRound(-(target[1][1] - targetTopLeft[1]) / targetResolution);\n const u2 = pixelRound((target[2][0] - targetTopLeft[0]) / targetResolution);\n const v2 = pixelRound(-(target[2][1] - targetTopLeft[1]) / targetResolution);\n\n // Shift all the source points to improve numerical stability\n // of all the subsequent calculations. The [x0, y0] is used here.\n // This is also used to simplify the linear system.\n const sourceNumericalShiftX = x0;\n const sourceNumericalShiftY = y0;\n x0 = 0;\n y0 = 0;\n x1 -= sourceNumericalShiftX;\n y1 -= sourceNumericalShiftY;\n x2 -= sourceNumericalShiftX;\n y2 -= sourceNumericalShiftY;\n const augmentedMatrix = [[x1, y1, 0, 0, u1 - u0], [x2, y2, 0, 0, u2 - u0], [0, 0, x1, y1, v1 - v0], [0, 0, x2, y2, v2 - v0]];\n const affineCoefs = (0,_math_js__WEBPACK_IMPORTED_MODULE_4__.solveLinearSystem)(augmentedMatrix);\n if (!affineCoefs) {\n return;\n }\n context.save();\n context.beginPath();\n if (isBrokenDiagonalRendering() || !interpolate) {\n // Make sure that all lines are horizontal or vertical\n context.moveTo(u1, v1);\n // This is the diagonal line. Do it in 4 steps\n const steps = 4;\n const ud = u0 - u1;\n const vd = v0 - v1;\n for (let step = 0; step < steps; step++) {\n // Go horizontally\n context.lineTo(u1 + pixelRound((step + 1) * ud / steps), v1 + pixelRound(step * vd / (steps - 1)));\n // Go vertically\n if (step != steps - 1) {\n context.lineTo(u1 + pixelRound((step + 1) * ud / steps), v1 + pixelRound((step + 1) * vd / (steps - 1)));\n }\n }\n // We are almost at u0r, v0r\n context.lineTo(u2, v2);\n } else {\n context.moveTo(u1, v1);\n context.lineTo(u0, v0);\n context.lineTo(u2, v2);\n }\n context.clip();\n context.transform(affineCoefs[0], affineCoefs[2], affineCoefs[1], affineCoefs[3], u0, v0);\n context.translate(sourceDataExtent[0] - sourceNumericalShiftX, sourceDataExtent[3] - sourceNumericalShiftY);\n let image;\n if (stitchContext) {\n image = stitchContext.canvas;\n context.scale(sourceResolution / pixelRatio, -sourceResolution / pixelRatio);\n } else {\n const source = sources[0];\n const extent = source.extent;\n image = source.image;\n context.scale((0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getWidth)(extent) / image.width, -(0,_extent_js__WEBPACK_IMPORTED_MODULE_3__.getHeight)(extent) / image.height);\n }\n context.drawImage(image, 0, 0);\n context.restore();\n });\n if (stitchContext) {\n (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.releaseCanvas)(stitchContext);\n canvasPool.push(stitchContext.canvas);\n }\n if (renderEdges) {\n context.save();\n context.globalCompositeOperation = 'source-over';\n context.strokeStyle = 'black';\n context.lineWidth = 1;\n triangulation.getTriangles().forEach(function (triangle, i, arr) {\n const target = triangle.target;\n const u0 = (target[0][0] - targetTopLeft[0]) / targetResolution;\n const v0 = -(target[0][1] - targetTopLeft[1]) / targetResolution;\n const u1 = (target[1][0] - targetTopLeft[0]) / targetResolution;\n const v1 = -(target[1][1] - targetTopLeft[1]) / targetResolution;\n const u2 = (target[2][0] - targetTopLeft[0]) / targetResolution;\n const v2 = -(target[2][1] - targetTopLeft[1]) / targetResolution;\n context.beginPath();\n context.moveTo(u1, v1);\n context.lineTo(u0, v0);\n context.lineTo(u2, v2);\n context.closePath();\n context.stroke();\n });\n context.restore();\n }\n return context.canvas;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/reproj.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/reproj/Image.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ol/reproj/Image.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./common.js */ \"./node_modules/ol/reproj/common.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _ImageState_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../ImageState.js */ \"./node_modules/ol/ImageState.js\");\n/* harmony import */ var _Image_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Image.js */ \"./node_modules/ol/Image.js\");\n/* harmony import */ var _Triangulation_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Triangulation.js */ \"./node_modules/ol/reproj/Triangulation.js\");\n/* harmony import */ var _reproj_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../reproj.js */ \"./node_modules/ol/reproj.js\");\n/* harmony import */ var _resolution_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../resolution.js */ \"./node_modules/ol/resolution.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../events.js */ \"./node_modules/ol/events.js\");\n/**\n * @module ol/reproj/Image\n */\n\n\n\n\n\n\n\n\n\n\n/**\n * @typedef {function(import(\"../extent.js\").Extent, number, number) : import(\"../Image.js\").default} FunctionType\n */\n\n/**\n * @classdesc\n * Class encapsulating single reprojected image.\n * See {@link module:ol/source/Image~ImageSource}.\n */\nclass ReprojImage extends _Image_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {import(\"../proj/Projection.js\").default} sourceProj Source projection (of the data).\n * @param {import(\"../proj/Projection.js\").default} targetProj Target projection.\n * @param {import(\"../extent.js\").Extent} targetExtent Target extent.\n * @param {number} targetResolution Target resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {FunctionType} getImageFunction\n * Function returning source images (extent, resolution, pixelRatio).\n * @param {boolean} interpolate Use linear interpolation when resampling.\n */\n constructor(sourceProj, targetProj, targetExtent, targetResolution, pixelRatio, getImageFunction, interpolate) {\n let maxSourceExtent = sourceProj.getExtent();\n if (maxSourceExtent && sourceProj.canWrapX()) {\n maxSourceExtent = maxSourceExtent.slice();\n maxSourceExtent[0] = -Infinity;\n maxSourceExtent[2] = Infinity;\n }\n let maxTargetExtent = targetProj.getExtent();\n if (maxTargetExtent && targetProj.canWrapX()) {\n maxTargetExtent = maxTargetExtent.slice();\n maxTargetExtent[0] = -Infinity;\n maxTargetExtent[2] = Infinity;\n }\n const limitedTargetExtent = maxTargetExtent ? (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.getIntersection)(targetExtent, maxTargetExtent) : targetExtent;\n const targetCenter = (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.getCenter)(limitedTargetExtent);\n const sourceResolution = (0,_reproj_js__WEBPACK_IMPORTED_MODULE_2__.calculateSourceResolution)(sourceProj, targetProj, targetCenter, targetResolution);\n const errorThresholdInPixels = _common_js__WEBPACK_IMPORTED_MODULE_3__.ERROR_THRESHOLD;\n const triangulation = new _Triangulation_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"](sourceProj, targetProj, limitedTargetExtent, maxSourceExtent, sourceResolution * errorThresholdInPixels, targetResolution);\n const sourceExtent = triangulation.calculateSourceExtent();\n const sourceImage = (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.isEmpty)(sourceExtent) ? null : getImageFunction(sourceExtent, sourceResolution, pixelRatio);\n const state = sourceImage ? _ImageState_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].IDLE : _ImageState_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].EMPTY;\n const sourcePixelRatio = sourceImage ? sourceImage.getPixelRatio() : 1;\n super(targetExtent, targetResolution, sourcePixelRatio, state);\n\n /**\n * @private\n * @type {import(\"../proj/Projection.js\").default}\n */\n this.targetProj_ = targetProj;\n\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.maxSourceExtent_ = maxSourceExtent;\n\n /**\n * @private\n * @type {!import(\"./Triangulation.js\").default}\n */\n this.triangulation_ = triangulation;\n\n /**\n * @private\n * @type {number}\n */\n this.targetResolution_ = targetResolution;\n\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.targetExtent_ = targetExtent;\n\n /**\n * @private\n * @type {import(\"../Image.js\").default}\n */\n this.sourceImage_ = sourceImage;\n\n /**\n * @private\n * @type {number}\n */\n this.sourcePixelRatio_ = sourcePixelRatio;\n\n /**\n * @private\n * @type {boolean}\n */\n this.interpolate_ = interpolate;\n\n /**\n * @private\n * @type {HTMLCanvasElement}\n */\n this.canvas_ = null;\n\n /**\n * @private\n * @type {?import(\"../events.js\").EventsKey}\n */\n this.sourceListenerKey_ = null;\n }\n\n /**\n * Clean up.\n */\n disposeInternal() {\n if (this.state == _ImageState_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].LOADING) {\n this.unlistenSource_();\n }\n super.disposeInternal();\n }\n\n /**\n * @return {HTMLCanvasElement} Image.\n */\n getImage() {\n return this.canvas_;\n }\n\n /**\n * @return {import(\"../proj/Projection.js\").default} Projection.\n */\n getProjection() {\n return this.targetProj_;\n }\n\n /**\n * @private\n */\n reproject_() {\n const sourceState = this.sourceImage_.getState();\n if (sourceState == _ImageState_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].LOADED) {\n const width = (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.getWidth)(this.targetExtent_) / this.targetResolution_;\n const height = (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.getHeight)(this.targetExtent_) / this.targetResolution_;\n this.canvas_ = (0,_reproj_js__WEBPACK_IMPORTED_MODULE_2__.render)(width, height, this.sourcePixelRatio_, (0,_resolution_js__WEBPACK_IMPORTED_MODULE_6__.fromResolutionLike)(this.sourceImage_.getResolution()), this.maxSourceExtent_, this.targetResolution_, this.targetExtent_, this.triangulation_, [{\n extent: this.sourceImage_.getExtent(),\n image: this.sourceImage_.getImage()\n }], 0, undefined, this.interpolate_, true);\n }\n this.state = sourceState;\n this.changed();\n }\n\n /**\n * Load not yet loaded URI.\n */\n load() {\n if (this.state == _ImageState_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].IDLE) {\n this.state = _ImageState_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].LOADING;\n this.changed();\n const sourceState = this.sourceImage_.getState();\n if (sourceState == _ImageState_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].LOADED || sourceState == _ImageState_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].ERROR) {\n this.reproject_();\n } else {\n this.sourceListenerKey_ = (0,_events_js__WEBPACK_IMPORTED_MODULE_7__.listen)(this.sourceImage_, _events_EventType_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"].CHANGE, function (e) {\n const sourceState = this.sourceImage_.getState();\n if (sourceState == _ImageState_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].LOADED || sourceState == _ImageState_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"].ERROR) {\n this.unlistenSource_();\n this.reproject_();\n }\n }, this);\n this.sourceImage_.load();\n }\n }\n }\n\n /**\n * @private\n */\n unlistenSource_() {\n (0,_events_js__WEBPACK_IMPORTED_MODULE_7__.unlistenByKey)(/** @type {!import(\"../events.js\").EventsKey} */this.sourceListenerKey_);\n this.sourceListenerKey_ = null;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (ReprojImage);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/reproj/Image.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/reproj/Triangulation.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/ol/reproj/Triangulation.js ***!
|
||
\*************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../proj.js */ \"./node_modules/ol/proj.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../math.js */ \"./node_modules/ol/math.js\");\n\n/**\n * @module ol/reproj/Triangulation\n */\n\n\n\n\n/**\n * Single triangle; consists of 3 source points and 3 target points.\n * @typedef {Object} Triangle\n * @property {Array<import(\"../coordinate.js\").Coordinate>} source Source.\n * @property {Array<import(\"../coordinate.js\").Coordinate>} target Target.\n */\n\n/**\n * Maximum number of subdivision steps during raster reprojection triangulation.\n * Prevents high memory usage and large number of proj4 calls (for certain\n * transformations and areas). At most `2*(2^this)` triangles are created for\n * each triangulated extent (tile/image).\n * @type {number}\n */\nconst MAX_SUBDIVISION = 10;\n\n/**\n * Maximum allowed size of triangle relative to world width. When transforming\n * corners of world extent between certain projections, the resulting\n * triangulation seems to have zero error and no subdivision is performed. If\n * the triangle width is more than this (relative to world width; 0-1),\n * subdivison is forced (up to `MAX_SUBDIVISION`). Default is `0.25`.\n * @type {number}\n */\nconst MAX_TRIANGLE_WIDTH = 0.25;\n\n/**\n * @classdesc\n * Class containing triangulation of the given target extent.\n * Used for determining source data and the reprojection itself.\n */\nclass Triangulation {\n /**\n * @param {import(\"../proj/Projection.js\").default} sourceProj Source projection.\n * @param {import(\"../proj/Projection.js\").default} targetProj Target projection.\n * @param {import(\"../extent.js\").Extent} targetExtent Target extent to triangulate.\n * @param {import(\"../extent.js\").Extent} maxSourceExtent Maximal source extent that can be used.\n * @param {number} errorThreshold Acceptable error (in source units).\n * @param {?number} destinationResolution The (optional) resolution of the destination.\n */\n constructor(sourceProj, targetProj, targetExtent, maxSourceExtent, errorThreshold, destinationResolution) {\n /**\n * @type {import(\"../proj/Projection.js\").default}\n * @private\n */\n this.sourceProj_ = sourceProj;\n\n /**\n * @type {import(\"../proj/Projection.js\").default}\n * @private\n */\n this.targetProj_ = targetProj;\n\n /** @type {!Object<string, import(\"../coordinate.js\").Coordinate>} */\n let transformInvCache = {};\n const transformInv = (0,_proj_js__WEBPACK_IMPORTED_MODULE_1__.getTransform)(this.targetProj_, this.sourceProj_);\n\n /**\n * @param {import(\"../coordinate.js\").Coordinate} c A coordinate.\n * @return {import(\"../coordinate.js\").Coordinate} Transformed coordinate.\n * @private\n */\n this.transformInv_ = function (c) {\n const key = c[0] + '/' + c[1];\n if (!transformInvCache[key]) {\n transformInvCache[key] = transformInv(c);\n }\n return transformInvCache[key];\n };\n\n /**\n * @type {import(\"../extent.js\").Extent}\n * @private\n */\n this.maxSourceExtent_ = maxSourceExtent;\n\n /**\n * @type {number}\n * @private\n */\n this.errorThresholdSquared_ = errorThreshold * errorThreshold;\n\n /**\n * @type {Array<Triangle>}\n * @private\n */\n this.triangles_ = [];\n\n /**\n * Indicates that the triangulation crosses edge of the source projection.\n * @type {boolean}\n * @private\n */\n this.wrapsXInSource_ = false;\n\n /**\n * @type {boolean}\n * @private\n */\n this.canWrapXInSource_ = this.sourceProj_.canWrapX() && !!maxSourceExtent && !!this.sourceProj_.getExtent() && (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getWidth)(maxSourceExtent) >= (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getWidth)(this.sourceProj_.getExtent());\n\n /**\n * @type {?number}\n * @private\n */\n this.sourceWorldWidth_ = this.sourceProj_.getExtent() ? (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getWidth)(this.sourceProj_.getExtent()) : null;\n\n /**\n * @type {?number}\n * @private\n */\n this.targetWorldWidth_ = this.targetProj_.getExtent() ? (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getWidth)(this.targetProj_.getExtent()) : null;\n const destinationTopLeft = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getTopLeft)(targetExtent);\n const destinationTopRight = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getTopRight)(targetExtent);\n const destinationBottomRight = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getBottomRight)(targetExtent);\n const destinationBottomLeft = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getBottomLeft)(targetExtent);\n const sourceTopLeft = this.transformInv_(destinationTopLeft);\n const sourceTopRight = this.transformInv_(destinationTopRight);\n const sourceBottomRight = this.transformInv_(destinationBottomRight);\n const sourceBottomLeft = this.transformInv_(destinationBottomLeft);\n\n /*\n * The maxSubdivision controls how many splittings of the target area can\n * be done. The idea here is to do a linear mapping of the target areas\n * but the actual overall reprojection (can be) extremely non-linear. The\n * default value of MAX_SUBDIVISION was chosen based on mapping a 256x256\n * tile size. However this function is also called to remap canvas rendered\n * layers which can be much larger. This calculation increases the maxSubdivision\n * value by the right factor so that each 256x256 pixel area has\n * MAX_SUBDIVISION divisions.\n */\n const maxSubdivision = MAX_SUBDIVISION + (destinationResolution ? Math.max(0, Math.ceil(Math.log2((0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getArea)(targetExtent) / (destinationResolution * destinationResolution * 256 * 256)))) : 0);\n this.addQuad_(destinationTopLeft, destinationTopRight, destinationBottomRight, destinationBottomLeft, sourceTopLeft, sourceTopRight, sourceBottomRight, sourceBottomLeft, maxSubdivision);\n if (this.wrapsXInSource_) {\n let leftBound = Infinity;\n this.triangles_.forEach(function (triangle, i, arr) {\n leftBound = Math.min(leftBound, triangle.source[0][0], triangle.source[1][0], triangle.source[2][0]);\n });\n\n // Shift triangles to be as close to `leftBound` as possible\n // (if the distance is more than `worldWidth / 2` it can be closer.\n this.triangles_.forEach(triangle => {\n if (Math.max(triangle.source[0][0], triangle.source[1][0], triangle.source[2][0]) - leftBound > this.sourceWorldWidth_ / 2) {\n const newTriangle = [[triangle.source[0][0], triangle.source[0][1]], [triangle.source[1][0], triangle.source[1][1]], [triangle.source[2][0], triangle.source[2][1]]];\n if (newTriangle[0][0] - leftBound > this.sourceWorldWidth_ / 2) {\n newTriangle[0][0] -= this.sourceWorldWidth_;\n }\n if (newTriangle[1][0] - leftBound > this.sourceWorldWidth_ / 2) {\n newTriangle[1][0] -= this.sourceWorldWidth_;\n }\n if (newTriangle[2][0] - leftBound > this.sourceWorldWidth_ / 2) {\n newTriangle[2][0] -= this.sourceWorldWidth_;\n }\n\n // Rarely (if the extent contains both the dateline and prime meridian)\n // the shift can in turn break some triangles.\n // Detect this here and don't shift in such cases.\n const minX = Math.min(newTriangle[0][0], newTriangle[1][0], newTriangle[2][0]);\n const maxX = Math.max(newTriangle[0][0], newTriangle[1][0], newTriangle[2][0]);\n if (maxX - minX < this.sourceWorldWidth_ / 2) {\n triangle.source = newTriangle;\n }\n }\n });\n }\n transformInvCache = {};\n }\n\n /**\n * Adds triangle to the triangulation.\n * @param {import(\"../coordinate.js\").Coordinate} a The target a coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} b The target b coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} c The target c coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} aSrc The source a coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} bSrc The source b coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} cSrc The source c coordinate.\n * @private\n */\n addTriangle_(a, b, c, aSrc, bSrc, cSrc) {\n this.triangles_.push({\n source: [aSrc, bSrc, cSrc],\n target: [a, b, c]\n });\n }\n\n /**\n * Adds quad (points in clock-wise order) to the triangulation\n * (and reprojects the vertices) if valid.\n * Performs quad subdivision if needed to increase precision.\n *\n * @param {import(\"../coordinate.js\").Coordinate} a The target a coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} b The target b coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} c The target c coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} d The target d coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} aSrc The source a coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} bSrc The source b coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} cSrc The source c coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} dSrc The source d coordinate.\n * @param {number} maxSubdivision Maximal allowed subdivision of the quad.\n * @private\n */\n addQuad_(a, b, c, d, aSrc, bSrc, cSrc, dSrc, maxSubdivision) {\n const sourceQuadExtent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.boundingExtent)([aSrc, bSrc, cSrc, dSrc]);\n const sourceCoverageX = this.sourceWorldWidth_ ? (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getWidth)(sourceQuadExtent) / this.sourceWorldWidth_ : null;\n const sourceWorldWidth = /** @type {number} */this.sourceWorldWidth_;\n\n // when the quad is wrapped in the source projection\n // it covers most of the projection extent, but not fully\n const wrapsX = this.sourceProj_.canWrapX() && sourceCoverageX > 0.5 && sourceCoverageX < 1;\n let needsSubdivision = false;\n if (maxSubdivision > 0) {\n if (this.targetProj_.isGlobal() && this.targetWorldWidth_) {\n const targetQuadExtent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.boundingExtent)([a, b, c, d]);\n const targetCoverageX = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.getWidth)(targetQuadExtent) / this.targetWorldWidth_;\n needsSubdivision = targetCoverageX > MAX_TRIANGLE_WIDTH || needsSubdivision;\n }\n if (!wrapsX && this.sourceProj_.isGlobal() && sourceCoverageX) {\n needsSubdivision = sourceCoverageX > MAX_TRIANGLE_WIDTH || needsSubdivision;\n }\n }\n if (!needsSubdivision && this.maxSourceExtent_) {\n if (isFinite(sourceQuadExtent[0]) && isFinite(sourceQuadExtent[1]) && isFinite(sourceQuadExtent[2]) && isFinite(sourceQuadExtent[3])) {\n if (!(0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.intersects)(sourceQuadExtent, this.maxSourceExtent_)) {\n // whole quad outside source projection extent -> ignore\n return;\n }\n }\n }\n let isNotFinite = 0;\n if (!needsSubdivision) {\n if (!isFinite(aSrc[0]) || !isFinite(aSrc[1]) || !isFinite(bSrc[0]) || !isFinite(bSrc[1]) || !isFinite(cSrc[0]) || !isFinite(cSrc[1]) || !isFinite(dSrc[0]) || !isFinite(dSrc[1])) {\n if (maxSubdivision > 0) {\n needsSubdivision = true;\n } else {\n // It might be the case that only 1 of the points is infinite. In this case\n // we can draw a single triangle with the other three points\n isNotFinite = (!isFinite(aSrc[0]) || !isFinite(aSrc[1]) ? 8 : 0) + (!isFinite(bSrc[0]) || !isFinite(bSrc[1]) ? 4 : 0) + (!isFinite(cSrc[0]) || !isFinite(cSrc[1]) ? 2 : 0) + (!isFinite(dSrc[0]) || !isFinite(dSrc[1]) ? 1 : 0);\n if (isNotFinite != 1 && isNotFinite != 2 && isNotFinite != 4 && isNotFinite != 8) {\n return;\n }\n }\n }\n }\n if (maxSubdivision > 0) {\n if (!needsSubdivision) {\n const center = [(a[0] + c[0]) / 2, (a[1] + c[1]) / 2];\n const centerSrc = this.transformInv_(center);\n let dx;\n if (wrapsX) {\n const centerSrcEstimX = ((0,_math_js__WEBPACK_IMPORTED_MODULE_3__.modulo)(aSrc[0], sourceWorldWidth) + (0,_math_js__WEBPACK_IMPORTED_MODULE_3__.modulo)(cSrc[0], sourceWorldWidth)) / 2;\n dx = centerSrcEstimX - (0,_math_js__WEBPACK_IMPORTED_MODULE_3__.modulo)(centerSrc[0], sourceWorldWidth);\n } else {\n dx = (aSrc[0] + cSrc[0]) / 2 - centerSrc[0];\n }\n const dy = (aSrc[1] + cSrc[1]) / 2 - centerSrc[1];\n const centerSrcErrorSquared = dx * dx + dy * dy;\n needsSubdivision = centerSrcErrorSquared > this.errorThresholdSquared_;\n }\n if (needsSubdivision) {\n if (Math.abs(a[0] - c[0]) <= Math.abs(a[1] - c[1])) {\n // split horizontally (top & bottom)\n const bc = [(b[0] + c[0]) / 2, (b[1] + c[1]) / 2];\n const bcSrc = this.transformInv_(bc);\n const da = [(d[0] + a[0]) / 2, (d[1] + a[1]) / 2];\n const daSrc = this.transformInv_(da);\n this.addQuad_(a, b, bc, da, aSrc, bSrc, bcSrc, daSrc, maxSubdivision - 1);\n this.addQuad_(da, bc, c, d, daSrc, bcSrc, cSrc, dSrc, maxSubdivision - 1);\n } else {\n // split vertically (left & right)\n const ab = [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2];\n const abSrc = this.transformInv_(ab);\n const cd = [(c[0] + d[0]) / 2, (c[1] + d[1]) / 2];\n const cdSrc = this.transformInv_(cd);\n this.addQuad_(a, ab, cd, d, aSrc, abSrc, cdSrc, dSrc, maxSubdivision - 1);\n this.addQuad_(ab, b, c, cd, abSrc, bSrc, cSrc, cdSrc, maxSubdivision - 1);\n }\n return;\n }\n }\n if (wrapsX) {\n if (!this.canWrapXInSource_) {\n return;\n }\n this.wrapsXInSource_ = true;\n }\n\n // Exactly zero or one of *Src is not finite\n // The triangles must have the diagonal line as the first side\n // This is to allow easy code in reproj.s to make it straight for broken\n // browsers that can't handle diagonal clipping\n if ((isNotFinite & 0xb) == 0) {\n this.addTriangle_(a, c, d, aSrc, cSrc, dSrc);\n }\n if ((isNotFinite & 0xe) == 0) {\n this.addTriangle_(a, c, b, aSrc, cSrc, bSrc);\n }\n if (isNotFinite) {\n // Try the other two triangles\n if ((isNotFinite & 0xd) == 0) {\n this.addTriangle_(b, d, a, bSrc, dSrc, aSrc);\n }\n if ((isNotFinite & 0x7) == 0) {\n this.addTriangle_(b, d, c, bSrc, dSrc, cSrc);\n }\n }\n }\n\n /**\n * Calculates extent of the `source` coordinates from all the triangles.\n *\n * @return {import(\"../extent.js\").Extent} Calculated extent.\n */\n calculateSourceExtent() {\n const extent = (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.createEmpty)();\n this.triangles_.forEach(function (triangle, i, arr) {\n const src = triangle.source;\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.extendCoordinate)(extent, src[0]);\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.extendCoordinate)(extent, src[1]);\n (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.extendCoordinate)(extent, src[2]);\n });\n return extent;\n }\n\n /**\n * @return {Array<Triangle>} Array of the calculated triangles.\n */\n getTriangles() {\n return this.triangles_;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Triangulation);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/reproj/Triangulation.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/reproj/common.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ol/reproj/common.js ***!
|
||
\******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ERROR_THRESHOLD: function() { return /* binding */ ERROR_THRESHOLD; }\n/* harmony export */ });\n/**\n * @module ol/reproj/common\n */\n\n/**\n * Default maximum allowed threshold (in pixels) for reprojection\n * triangulation.\n * @type {number}\n */\nconst ERROR_THRESHOLD = 0.5;\n\n//# sourceURL=webpack://complexes/./node_modules/ol/reproj/common.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/resolution.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/resolution.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ fromResolutionLike: function() { return /* binding */ fromResolutionLike; }\n/* harmony export */ });\n/**\n * @module ol/resolution\n */\n\n/**\n * @typedef {number|Array<number>} ResolutionLike\n */\n\n/**\n * @param {ResolutionLike} resolution Resolution.\n * @return {number} Resolution.\n */\nfunction fromResolutionLike(resolution) {\n if (Array.isArray(resolution)) {\n return Math.min(...resolution);\n }\n return resolution;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/resolution.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/resolutionconstraint.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/ol/resolutionconstraint.js ***!
|
||
\*************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createMinMaxResolution: function() { return /* binding */ createMinMaxResolution; },\n/* harmony export */ createSnapToPower: function() { return /* binding */ createSnapToPower; },\n/* harmony export */ createSnapToResolutions: function() { return /* binding */ createSnapToResolutions; }\n/* harmony export */ });\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./math.js */ \"./node_modules/ol/math.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./array.js */ \"./node_modules/ol/array.js\");\n/**\n * @module ol/resolutionconstraint\n */\n\n\n\n\n/**\n * @typedef {function((number|undefined), number, import(\"./size.js\").Size, boolean=): (number|undefined)} Type\n */\n\n/**\n * Returns a modified resolution taking into account the viewport size and maximum\n * allowed extent.\n * @param {number} resolution Resolution\n * @param {import(\"./extent.js\").Extent} maxExtent Maximum allowed extent.\n * @param {import(\"./size.js\").Size} viewportSize Viewport size.\n * @param {boolean} showFullExtent Whether to show the full extent.\n * @return {number} Capped resolution.\n */\nfunction getViewportClampedResolution(resolution, maxExtent, viewportSize, showFullExtent) {\n const xResolution = (0,_extent_js__WEBPACK_IMPORTED_MODULE_0__.getWidth)(maxExtent) / viewportSize[0];\n const yResolution = (0,_extent_js__WEBPACK_IMPORTED_MODULE_0__.getHeight)(maxExtent) / viewportSize[1];\n if (showFullExtent) {\n return Math.min(resolution, Math.max(xResolution, yResolution));\n }\n return Math.min(resolution, Math.min(xResolution, yResolution));\n}\n\n/**\n * Returns a modified resolution to be between maxResolution and minResolution while\n * still allowing the value to be slightly out of bounds.\n * Note: the computation is based on the logarithm function (ln):\n * - at 1, ln(x) is 0\n * - above 1, ln(x) keeps increasing but at a much slower pace than x\n * The final result is clamped to prevent getting too far away from bounds.\n * @param {number} resolution Resolution.\n * @param {number} maxResolution Max resolution.\n * @param {number} minResolution Min resolution.\n * @return {number} Smoothed resolution.\n */\nfunction getSmoothClampedResolution(resolution, maxResolution, minResolution) {\n let result = Math.min(resolution, maxResolution);\n const ratio = 50;\n result *= Math.log(1 + ratio * Math.max(0, resolution / maxResolution - 1)) / ratio + 1;\n if (minResolution) {\n result = Math.max(result, minResolution);\n result /= Math.log(1 + ratio * Math.max(0, minResolution / resolution - 1)) / ratio + 1;\n }\n return (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.clamp)(result, minResolution / 2, maxResolution * 2);\n}\n\n/**\n * @param {Array<number>} resolutions Resolutions.\n * @param {boolean} [smooth] If true, the view will be able to slightly exceed resolution limits. Default: true.\n * @param {import(\"./extent.js\").Extent} [maxExtent] Maximum allowed extent.\n * @param {boolean} [showFullExtent] If true, allows us to show the full extent. Default: false.\n * @return {Type} Zoom function.\n */\nfunction createSnapToResolutions(resolutions, smooth, maxExtent, showFullExtent) {\n smooth = smooth !== undefined ? smooth : true;\n return (\n /**\n * @param {number|undefined} resolution Resolution.\n * @param {number} direction Direction.\n * @param {import(\"./size.js\").Size} size Viewport size.\n * @param {boolean} [isMoving] True if an interaction or animation is in progress.\n * @return {number|undefined} Resolution.\n */\n function (resolution, direction, size, isMoving) {\n if (resolution !== undefined) {\n const maxResolution = resolutions[0];\n const minResolution = resolutions[resolutions.length - 1];\n const cappedMaxRes = maxExtent ? getViewportClampedResolution(maxResolution, maxExtent, size, showFullExtent) : maxResolution;\n\n // during interacting or animating, allow intermediary values\n if (isMoving) {\n if (!smooth) {\n return (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.clamp)(resolution, minResolution, cappedMaxRes);\n }\n return getSmoothClampedResolution(resolution, cappedMaxRes, minResolution);\n }\n const capped = Math.min(cappedMaxRes, resolution);\n const z = Math.floor((0,_array_js__WEBPACK_IMPORTED_MODULE_2__.linearFindNearest)(resolutions, capped, direction));\n if (resolutions[z] > cappedMaxRes && z < resolutions.length - 1) {\n return resolutions[z + 1];\n }\n return resolutions[z];\n }\n return undefined;\n }\n );\n}\n\n/**\n * @param {number} power Power.\n * @param {number} maxResolution Maximum resolution.\n * @param {number} [minResolution] Minimum resolution.\n * @param {boolean} [smooth] If true, the view will be able to slightly exceed resolution limits. Default: true.\n * @param {import(\"./extent.js\").Extent} [maxExtent] Maximum allowed extent.\n * @param {boolean} [showFullExtent] If true, allows us to show the full extent. Default: false.\n * @return {Type} Zoom function.\n */\nfunction createSnapToPower(power, maxResolution, minResolution, smooth, maxExtent, showFullExtent) {\n smooth = smooth !== undefined ? smooth : true;\n minResolution = minResolution !== undefined ? minResolution : 0;\n return (\n /**\n * @param {number|undefined} resolution Resolution.\n * @param {number} direction Direction.\n * @param {import(\"./size.js\").Size} size Viewport size.\n * @param {boolean} [isMoving] True if an interaction or animation is in progress.\n * @return {number|undefined} Resolution.\n */\n function (resolution, direction, size, isMoving) {\n if (resolution !== undefined) {\n const cappedMaxRes = maxExtent ? getViewportClampedResolution(maxResolution, maxExtent, size, showFullExtent) : maxResolution;\n\n // during interacting or animating, allow intermediary values\n if (isMoving) {\n if (!smooth) {\n return (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.clamp)(resolution, minResolution, cappedMaxRes);\n }\n return getSmoothClampedResolution(resolution, cappedMaxRes, minResolution);\n }\n const tolerance = 1e-9;\n const minZoomLevel = Math.ceil(Math.log(maxResolution / cappedMaxRes) / Math.log(power) - tolerance);\n const offset = -direction * (0.5 - tolerance) + 0.5;\n const capped = Math.min(cappedMaxRes, resolution);\n const cappedZoomLevel = Math.floor(Math.log(maxResolution / capped) / Math.log(power) + offset);\n const zoomLevel = Math.max(minZoomLevel, cappedZoomLevel);\n const newResolution = maxResolution / Math.pow(power, zoomLevel);\n return (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.clamp)(newResolution, minResolution, cappedMaxRes);\n }\n return undefined;\n }\n );\n}\n\n/**\n * @param {number} maxResolution Max resolution.\n * @param {number} minResolution Min resolution.\n * @param {boolean} [smooth] If true, the view will be able to slightly exceed resolution limits. Default: true.\n * @param {import(\"./extent.js\").Extent} [maxExtent] Maximum allowed extent.\n * @param {boolean} [showFullExtent] If true, allows us to show the full extent. Default: false.\n * @return {Type} Zoom function.\n */\nfunction createMinMaxResolution(maxResolution, minResolution, smooth, maxExtent, showFullExtent) {\n smooth = smooth !== undefined ? smooth : true;\n return (\n /**\n * @param {number|undefined} resolution Resolution.\n * @param {number} direction Direction.\n * @param {import(\"./size.js\").Size} size Viewport size.\n * @param {boolean} [isMoving] True if an interaction or animation is in progress.\n * @return {number|undefined} Resolution.\n */\n function (resolution, direction, size, isMoving) {\n if (resolution !== undefined) {\n const cappedMaxRes = maxExtent ? getViewportClampedResolution(maxResolution, maxExtent, size, showFullExtent) : maxResolution;\n if (!smooth || !isMoving) {\n return (0,_math_js__WEBPACK_IMPORTED_MODULE_1__.clamp)(resolution, minResolution, cappedMaxRes);\n }\n return getSmoothClampedResolution(resolution, cappedMaxRes, minResolution);\n }\n return undefined;\n }\n );\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/resolutionconstraint.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/rotationconstraint.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ol/rotationconstraint.js ***!
|
||
\***********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createSnapToN: function() { return /* binding */ createSnapToN; },\n/* harmony export */ createSnapToZero: function() { return /* binding */ createSnapToZero; },\n/* harmony export */ disable: function() { return /* binding */ disable; },\n/* harmony export */ none: function() { return /* binding */ none; }\n/* harmony export */ });\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ \"./node_modules/ol/math.js\");\n/**\n * @module ol/rotationconstraint\n */\n\n\n/**\n * @typedef {function((number|undefined), boolean=): (number|undefined)} Type\n */\n\n/**\n * @param {number|undefined} rotation Rotation.\n * @return {number|undefined} Rotation.\n */\nfunction disable(rotation) {\n if (rotation !== undefined) {\n return 0;\n }\n return undefined;\n}\n\n/**\n * @param {number|undefined} rotation Rotation.\n * @return {number|undefined} Rotation.\n */\nfunction none(rotation) {\n if (rotation !== undefined) {\n return rotation;\n }\n return undefined;\n}\n\n/**\n * @param {number} n N.\n * @return {Type} Rotation constraint.\n */\nfunction createSnapToN(n) {\n const theta = 2 * Math.PI / n;\n return (\n /**\n * @param {number|undefined} rotation Rotation.\n * @param {boolean} [isMoving] True if an interaction or animation is in progress.\n * @return {number|undefined} Rotation.\n */\n function (rotation, isMoving) {\n if (isMoving) {\n return rotation;\n }\n if (rotation !== undefined) {\n rotation = Math.floor(rotation / theta + 0.5) * theta;\n return rotation;\n }\n return undefined;\n }\n );\n}\n\n/**\n * @param {number} [tolerance] Tolerance.\n * @return {Type} Rotation constraint.\n */\nfunction createSnapToZero(tolerance) {\n const t = tolerance === undefined ? (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.toRadians)(5) : tolerance;\n return (\n /**\n * @param {number|undefined} rotation Rotation.\n * @param {boolean} [isMoving] True if an interaction or animation is in progress.\n * @return {number|undefined} Rotation.\n */\n function (rotation, isMoving) {\n if (isMoving || rotation === undefined) {\n return rotation;\n }\n if (Math.abs(rotation) <= t) {\n return 0;\n }\n return rotation;\n }\n );\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/rotationconstraint.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/size.js":
|
||
/*!*********************************!*\
|
||
!*** ./node_modules/ol/size.js ***!
|
||
\*********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ buffer: function() { return /* binding */ buffer; },\n/* harmony export */ hasArea: function() { return /* binding */ hasArea; },\n/* harmony export */ scale: function() { return /* binding */ scale; },\n/* harmony export */ toSize: function() { return /* binding */ toSize; }\n/* harmony export */ });\n/**\n * @module ol/size\n */\n\n/**\n * An array of numbers representing a size: `[width, height]`.\n * @typedef {Array<number>} Size\n * @api\n */\n\n/**\n * Returns a buffered size.\n * @param {Size} size Size.\n * @param {number} num The amount by which to buffer.\n * @param {Size} [dest] Optional reusable size array.\n * @return {Size} The buffered size.\n */\nfunction buffer(size, num, dest) {\n if (dest === undefined) {\n dest = [0, 0];\n }\n dest[0] = size[0] + 2 * num;\n dest[1] = size[1] + 2 * num;\n return dest;\n}\n\n/**\n * Determines if a size has a positive area.\n * @param {Size} size The size to test.\n * @return {boolean} The size has a positive area.\n */\nfunction hasArea(size) {\n return size[0] > 0 && size[1] > 0;\n}\n\n/**\n * Returns a size scaled by a ratio. The result will be an array of integers.\n * @param {Size} size Size.\n * @param {number} ratio Ratio.\n * @param {Size} [dest] Optional reusable size array.\n * @return {Size} The scaled size.\n */\nfunction scale(size, ratio, dest) {\n if (dest === undefined) {\n dest = [0, 0];\n }\n dest[0] = size[0] * ratio + 0.5 | 0;\n dest[1] = size[1] * ratio + 0.5 | 0;\n return dest;\n}\n\n/**\n * Returns an `Size` array for the passed in number (meaning: square) or\n * `Size` array.\n * (meaning: non-square),\n * @param {number|Size} size Width and height.\n * @param {Size} [dest] Optional reusable size array.\n * @return {Size} Size.\n * @api\n */\nfunction toSize(size, dest) {\n if (Array.isArray(size)) {\n return size;\n }\n if (dest === undefined) {\n dest = [size, size];\n } else {\n dest[0] = size;\n dest[1] = size;\n }\n return dest;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/size.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/source/Image.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ol/source/Image.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ImageSourceEvent: function() { return /* binding */ ImageSourceEvent; },\n/* harmony export */ ImageSourceEventType: function() { return /* binding */ ImageSourceEventType; },\n/* harmony export */ defaultImageLoadFunction: function() { return /* binding */ defaultImageLoadFunction; },\n/* harmony export */ getRequestExtent: function() { return /* binding */ getRequestExtent; }\n/* harmony export */ });\n/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events/Event.js */ \"./node_modules/ol/events/Event.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _ImageState_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../ImageState.js */ \"./node_modules/ol/ImageState.js\");\n/* harmony import */ var _Image_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Image.js */ \"./node_modules/ol/Image.js\");\n/* harmony import */ var _reproj_Image_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../reproj/Image.js */ \"./node_modules/ol/reproj/Image.js\");\n/* harmony import */ var _Source_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Source.js */ \"./node_modules/ol/source/Source.js\");\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./common.js */ \"./node_modules/ol/source/common.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../math.js */ \"./node_modules/ol/math.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../proj.js */ \"./node_modules/ol/proj.js\");\n/* harmony import */ var _resolution_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../resolution.js */ \"./node_modules/ol/resolution.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../array.js */ \"./node_modules/ol/array.js\");\n/**\n * @module ol/source/Image\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * @enum {string}\n */\nconst ImageSourceEventType = {\n /**\n * Triggered when an image starts loading.\n * @event module:ol/source/Image.ImageSourceEvent#imageloadstart\n * @api\n */\n IMAGELOADSTART: 'imageloadstart',\n /**\n * Triggered when an image finishes loading.\n * @event module:ol/source/Image.ImageSourceEvent#imageloadend\n * @api\n */\n IMAGELOADEND: 'imageloadend',\n /**\n * Triggered if image loading results in an error.\n * @event module:ol/source/Image.ImageSourceEvent#imageloaderror\n * @api\n */\n IMAGELOADERROR: 'imageloaderror'\n};\n\n/**\n * @typedef {'imageloadend'|'imageloaderror'|'imageloadstart'} ImageSourceEventTypes\n */\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/source/Image~ImageSource} instances are instances of this\n * type.\n */\nclass ImageSourceEvent extends _events_Event_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {string} type Type.\n * @param {import(\"../Image.js\").default} image The image.\n */\n constructor(type, image) {\n super(type);\n\n /**\n * The image related to the event.\n * @type {import(\"../Image.js\").default}\n * @api\n */\n this.image = image;\n }\n}\n\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature<import(\"../Observable\").EventTypes, import(\"../events/Event.js\").default, Return> &\n * import(\"../Observable\").OnSignature<import(\"../ObjectEventType\").Types, import(\"../Object\").ObjectEvent, Return> &\n * import(\"../Observable\").OnSignature<ImageSourceEventTypes, ImageSourceEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature<import(\"../Observable\").EventTypes|import(\"../ObjectEventType\").Types\n * |ImageSourceEventTypes, Return>} ImageSourceOnSignature\n */\n\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default,\n * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead.\n * @property {import(\"../Image.js\").Loader} [loader] Loader. Can either be a custom loader, or one of the\n * loaders created with a `createLoader()` function ({@link module:ol/source/wms.createLoader wms},\n * {@link module:ol/source/arcgisRest.createLoader arcgisRest}, {@link module:ol/source/mapguide.createLoader mapguide},\n * {@link module:ol/source/static.createLoader static}).\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection.\n * @property {Array<number>} [resolutions] Resolutions.\n * @property {import(\"./Source.js\").State} [state] State.\n */\n\n/**\n * @classdesc\n * Base class for sources providing a single image.\n * @fires module:ol/source/Image.ImageSourceEvent\n * @api\n */\nclass ImageSource extends _Source_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n /**\n * @param {Options} options Single image source options.\n */\n constructor(options) {\n super({\n attributions: options.attributions,\n projection: options.projection,\n state: options.state,\n interpolate: options.interpolate !== undefined ? options.interpolate : true\n });\n\n /***\n * @type {ImageSourceOnSignature<import(\"../events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {ImageSourceOnSignature<import(\"../events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {ImageSourceOnSignature<void>}\n */\n this.un;\n\n /**\n * @protected\n * @type {import(\"../Image.js\").Loader}\n */\n this.loader = options.loader || null;\n\n /**\n * @private\n * @type {Array<number>|null}\n */\n this.resolutions_ = options.resolutions !== undefined ? options.resolutions : null;\n\n /**\n * @private\n * @type {import(\"../reproj/Image.js\").default}\n */\n this.reprojectedImage_ = null;\n\n /**\n * @private\n * @type {number}\n */\n this.reprojectedRevision_ = 0;\n\n /**\n * @protected\n * @type {import(\"../Image.js\").default}\n */\n this.image = null;\n\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.wantedExtent_;\n\n /**\n * @private\n * @type {number}\n */\n this.wantedResolution_;\n\n /**\n * @private\n * @type {boolean}\n */\n this.static_ = options.loader ? options.loader.length === 0 : false;\n\n /**\n * @private\n * @type {import(\"../proj/Projection.js\").default}\n */\n this.wantedProjection_ = null;\n }\n\n /**\n * @return {Array<number>|null} Resolutions.\n */\n getResolutions() {\n return this.resolutions_;\n }\n\n /**\n * @param {Array<number>|null} resolutions Resolutions.\n */\n setResolutions(resolutions) {\n this.resolutions_ = resolutions;\n }\n\n /**\n * @protected\n * @param {number} resolution Resolution.\n * @return {number} Resolution.\n */\n findNearestResolution(resolution) {\n const resolutions = this.getResolutions();\n if (resolutions) {\n const idx = (0,_array_js__WEBPACK_IMPORTED_MODULE_3__.linearFindNearest)(resolutions, resolution, 0);\n resolution = resolutions[idx];\n }\n return resolution;\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {import(\"../Image.js\").default} Single image.\n */\n getImage(extent, resolution, pixelRatio, projection) {\n const sourceProjection = this.getProjection();\n if (!sourceProjection || !projection || (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.equivalent)(sourceProjection, projection)) {\n if (sourceProjection) {\n projection = sourceProjection;\n }\n return this.getImageInternal(extent, resolution, pixelRatio, projection);\n }\n if (this.reprojectedImage_) {\n if (this.reprojectedRevision_ == this.getRevision() && (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.equivalent)(this.reprojectedImage_.getProjection(), projection) && this.reprojectedImage_.getResolution() == resolution && (0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.equals)(this.reprojectedImage_.getExtent(), extent)) {\n return this.reprojectedImage_;\n }\n this.reprojectedImage_.dispose();\n this.reprojectedImage_ = null;\n }\n this.reprojectedImage_ = new _reproj_Image_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"](sourceProjection, projection, extent, resolution, pixelRatio, (extent, resolution, pixelRatio) => this.getImageInternal(extent, resolution, pixelRatio, sourceProjection), this.getInterpolate());\n this.reprojectedRevision_ = this.getRevision();\n return this.reprojectedImage_;\n }\n\n /**\n * @abstract\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {import(\"../Image.js\").default} Single image.\n * @protected\n */\n getImageInternal(extent, resolution, pixelRatio, projection) {\n if (this.loader) {\n const requestExtent = getRequestExtent(extent, resolution, pixelRatio, 1);\n const requestResolution = this.findNearestResolution(resolution);\n if (this.image && (this.static_ || this.wantedProjection_ === projection && (this.wantedExtent_ && (0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.containsExtent)(this.wantedExtent_, requestExtent) || (0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.containsExtent)(this.image.getExtent(), requestExtent)) && (this.wantedResolution_ && (0,_resolution_js__WEBPACK_IMPORTED_MODULE_6__.fromResolutionLike)(this.wantedResolution_) === requestResolution || (0,_resolution_js__WEBPACK_IMPORTED_MODULE_6__.fromResolutionLike)(this.image.getResolution()) === requestResolution))) {\n return this.image;\n }\n this.wantedProjection_ = projection;\n this.wantedExtent_ = requestExtent;\n this.wantedResolution_ = requestResolution;\n this.image = new _Image_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"](requestExtent, requestResolution, pixelRatio, this.loader);\n this.image.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"].CHANGE, this.handleImageChange.bind(this));\n }\n return this.image;\n }\n\n /**\n * Handle image change events.\n * @param {import(\"../events/Event.js\").default} event Event.\n * @protected\n */\n handleImageChange(event) {\n const image = /** @type {import(\"../Image.js\").default} */event.target;\n let type;\n switch (image.getState()) {\n case _ImageState_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"].LOADING:\n this.loading = true;\n type = ImageSourceEventType.IMAGELOADSTART;\n break;\n case _ImageState_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"].LOADED:\n this.loading = false;\n type = ImageSourceEventType.IMAGELOADEND;\n break;\n case _ImageState_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"].ERROR:\n this.loading = false;\n type = ImageSourceEventType.IMAGELOADERROR;\n break;\n default:\n return;\n }\n if (this.hasListener(type)) {\n this.dispatchEvent(new ImageSourceEvent(type, image));\n }\n }\n}\n\n/**\n * Default image load function for image sources that use import(\"../Image.js\").Image image\n * instances.\n * @param {import(\"../Image.js\").default} image Image.\n * @param {string} src Source.\n */\nfunction defaultImageLoadFunction(image, src) {\n /** @type {HTMLImageElement|HTMLVideoElement} */image.getImage().src = src;\n}\n\n/**\n * Adjusts the extent so it aligns with pixel boundaries.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} resolution Reolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {number} ratio Ratio between request size and view size.\n * @return {import(\"../extent.js\").Extent} Request extent.\n */\nfunction getRequestExtent(extent, resolution, pixelRatio, ratio) {\n const imageResolution = resolution / pixelRatio;\n const center = (0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.getCenter)(extent);\n const viewWidth = (0,_math_js__WEBPACK_IMPORTED_MODULE_10__.ceil)((0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.getWidth)(extent) / imageResolution, _common_js__WEBPACK_IMPORTED_MODULE_11__.DECIMALS);\n const viewHeight = (0,_math_js__WEBPACK_IMPORTED_MODULE_10__.ceil)((0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.getHeight)(extent) / imageResolution, _common_js__WEBPACK_IMPORTED_MODULE_11__.DECIMALS);\n const marginWidth = (0,_math_js__WEBPACK_IMPORTED_MODULE_10__.ceil)((ratio - 1) * viewWidth / 2, _common_js__WEBPACK_IMPORTED_MODULE_11__.DECIMALS);\n const requestWidth = viewWidth + 2 * marginWidth;\n const marginHeight = (0,_math_js__WEBPACK_IMPORTED_MODULE_10__.ceil)((ratio - 1) * viewHeight / 2, _common_js__WEBPACK_IMPORTED_MODULE_11__.DECIMALS);\n const requestHeight = viewHeight + 2 * marginHeight;\n return (0,_extent_js__WEBPACK_IMPORTED_MODULE_4__.getForViewAndSize)(center, imageResolution, 0, [requestWidth, requestHeight]);\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (ImageSource);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/source/Image.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/source/ImageStatic.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ol/source/ImageStatic.js ***!
|
||
\***********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _Image_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Image.js */ \"./node_modules/ol/source/Image.js\");\n/* harmony import */ var _Image_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Image.js */ \"./node_modules/ol/Image.js\");\n/* harmony import */ var _static_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./static.js */ \"./node_modules/ol/source/static.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../proj.js */ \"./node_modules/ol/proj.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/**\n * @module ol/source/ImageStatic\n */\n\n\n\n\n\n\n\n\n/**\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {import(\"../extent.js\").Extent} imageExtent Extent of the image in map coordinates.\n * This is the [left, bottom, right, top] map coordinates of your image.\n * @property {import(\"../Image.js\").LoadFunction} [imageLoadFunction] Optional function to load an image given a URL.\n * @property {boolean} [interpolate=true] Use interpolated values when resampling. By default,\n * linear interpolation is used when resampling. Set to false to use the nearest neighbor instead.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection. Default is the view projection.\n * @property {string} url Image URL.\n */\n\n/**\n * @classdesc\n * A layer source for displaying a single, static image.\n * @api\n */\nclass Static extends _Image_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {Options} options ImageStatic options.\n */\n constructor(options) {\n const crossOrigin = options.crossOrigin !== undefined ? options.crossOrigin : null;\n const /** @type {import(\"../Image.js\").LoadFunction} */imageLoadFunction = options.imageLoadFunction !== undefined ? options.imageLoadFunction : _Image_js__WEBPACK_IMPORTED_MODULE_1__.defaultImageLoadFunction;\n super({\n attributions: options.attributions,\n interpolate: options.interpolate,\n projection: (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.get)(options.projection)\n });\n\n /**\n * @private\n * @type {string}\n */\n this.url_ = options.url;\n\n /**\n * @private\n * @type {import(\"../extent.js\").Extent}\n */\n this.imageExtent_ = options.imageExtent;\n\n /**\n * @private\n * @type {import(\"../Image.js\").default}\n */\n this.image = null;\n this.image = new _Image_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"](this.imageExtent_, undefined, 1, (0,_static_js__WEBPACK_IMPORTED_MODULE_3__.createLoader)({\n url: options.url,\n imageExtent: options.imageExtent,\n crossOrigin,\n load: (image, src) => {\n this.image.setImage(image);\n imageLoadFunction(this.image, src);\n return (0,_Image_js__WEBPACK_IMPORTED_MODULE_2__.decode)(image);\n }\n }));\n this.image.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"].CHANGE, this.handleImageChange.bind(this));\n }\n\n /**\n * Returns the image extent\n * @return {import(\"../extent.js\").Extent} image extent.\n * @api\n */\n getImageExtent() {\n return this.imageExtent_;\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {number} pixelRatio Pixel ratio.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n * @return {import(\"../Image.js\").default} Single image.\n */\n getImageInternal(extent, resolution, pixelRatio, projection) {\n if ((0,_extent_js__WEBPACK_IMPORTED_MODULE_5__.intersects)(extent, this.image.getExtent())) {\n return this.image;\n }\n return null;\n }\n\n /**\n * Return the URL used for this image source.\n * @return {string} URL.\n * @api\n */\n getUrl() {\n return this.url_;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Static);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/source/ImageStatic.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/source/Source.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ol/source/Source.js ***!
|
||
\******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Object_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Object.js */ \"./node_modules/ol/Object.js\");\n/* harmony import */ var _proj_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../proj.js */ \"./node_modules/ol/proj.js\");\n/**\n * @module ol/source/Source\n */\n\n\n\n/**\n * @typedef {'undefined' | 'loading' | 'ready' | 'error'} State\n * State of the source, one of 'undefined', 'loading', 'ready' or 'error'.\n */\n\n/**\n * A function that takes a {@link import(\"../View.js\").ViewStateLayerStateExtent} and returns a string or\n * an array of strings representing source attributions.\n *\n * @typedef {function(import(\"../View.js\").ViewStateLayerStateExtent): (string|Array<string>)} Attribution\n */\n\n/**\n * A type that can be used to provide attribution information for data sources.\n *\n * It represents either\n * * a simple string (e.g. `'© Acme Inc.'`)\n * * an array of simple strings (e.g. `['© Acme Inc.', '© Bacme Inc.']`)\n * * a function that returns a string or array of strings ({@link module:ol/source/Source~Attribution})\n *\n * @typedef {string|Array<string>|Attribution} AttributionLike\n */\n\n/**\n * @typedef {Object} Options\n * @property {AttributionLike} [attributions] Attributions.\n * @property {boolean} [attributionsCollapsible=true] Attributions are collapsible.\n * @property {import(\"../proj.js\").ProjectionLike} [projection] Projection. Default is the view projection.\n * @property {import(\"./Source.js\").State} [state='ready'] State.\n * @property {boolean} [wrapX=false] WrapX.\n * @property {boolean} [interpolate=false] Use interpolated values when resampling. By default,\n * the nearest neighbor is used when resampling.\n */\n\n/**\n * @classdesc\n * Abstract base class; normally only used for creating subclasses and not\n * instantiated in apps.\n * Base class for {@link module:ol/layer/Layer~Layer} sources.\n *\n * A generic `change` event is triggered when the state of the source changes.\n * @abstract\n * @api\n */\nclass Source extends _Object_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {Options} options Source options.\n */\n constructor(options) {\n super();\n\n /**\n * @protected\n * @type {import(\"../proj/Projection.js\").default|null}\n */\n this.projection = (0,_proj_js__WEBPACK_IMPORTED_MODULE_0__.get)(options.projection);\n\n /**\n * @private\n * @type {?Attribution}\n */\n this.attributions_ = adaptAttributions(options.attributions);\n\n /**\n * @private\n * @type {boolean}\n */\n this.attributionsCollapsible_ = options.attributionsCollapsible !== undefined ? options.attributionsCollapsible : true;\n\n /**\n * This source is currently loading data. Sources that defer loading to the\n * map's tile queue never set this to `true`.\n * @type {boolean}\n */\n this.loading = false;\n\n /**\n * @private\n * @type {import(\"./Source.js\").State}\n */\n this.state_ = options.state !== undefined ? options.state : 'ready';\n\n /**\n * @private\n * @type {boolean}\n */\n this.wrapX_ = options.wrapX !== undefined ? options.wrapX : false;\n\n /**\n * @private\n * @type {boolean}\n */\n this.interpolate_ = !!options.interpolate;\n\n /**\n * @protected\n * @type {function(import(\"../View.js\").ViewOptions):void}\n */\n this.viewResolver = null;\n\n /**\n * @protected\n * @type {function(Error):void}\n */\n this.viewRejector = null;\n const self = this;\n /**\n * @private\n * @type {Promise<import(\"../View.js\").ViewOptions>}\n */\n this.viewPromise_ = new Promise(function (resolve, reject) {\n self.viewResolver = resolve;\n self.viewRejector = reject;\n });\n }\n\n /**\n * Get the attribution function for the source.\n * @return {?Attribution} Attribution function.\n * @api\n */\n getAttributions() {\n return this.attributions_;\n }\n\n /**\n * @return {boolean} Attributions are collapsible.\n * @api\n */\n getAttributionsCollapsible() {\n return this.attributionsCollapsible_;\n }\n\n /**\n * Get the projection of the source.\n * @return {import(\"../proj/Projection.js\").default|null} Projection.\n * @api\n */\n getProjection() {\n return this.projection;\n }\n\n /**\n * @param {import(\"../proj/Projection\").default} [projection] Projection.\n * @return {Array<number>|null} Resolutions.\n */\n getResolutions(projection) {\n return null;\n }\n\n /**\n * @return {Promise<import(\"../View.js\").ViewOptions>} A promise for view-related properties.\n */\n getView() {\n return this.viewPromise_;\n }\n\n /**\n * Get the state of the source, see {@link import(\"./Source.js\").State} for possible states.\n * @return {import(\"./Source.js\").State} State.\n * @api\n */\n getState() {\n return this.state_;\n }\n\n /**\n * @return {boolean|undefined} Wrap X.\n */\n getWrapX() {\n return this.wrapX_;\n }\n\n /**\n * @return {boolean} Use linear interpolation when resampling.\n */\n getInterpolate() {\n return this.interpolate_;\n }\n\n /**\n * Refreshes the source. The source will be cleared, and data from the server will be reloaded.\n * @api\n */\n refresh() {\n this.changed();\n }\n\n /**\n * Set the attributions of the source.\n * @param {AttributionLike|undefined} attributions Attributions.\n * Can be passed as `string`, `Array<string>`, {@link module:ol/source/Source~Attribution},\n * or `undefined`.\n * @api\n */\n setAttributions(attributions) {\n this.attributions_ = adaptAttributions(attributions);\n this.changed();\n }\n\n /**\n * Set the state of the source.\n * @param {import(\"./Source.js\").State} state State.\n */\n setState(state) {\n this.state_ = state;\n this.changed();\n }\n}\n\n/**\n * Turns the attributions option into an attributions function.\n * @param {AttributionLike|undefined} attributionLike The attribution option.\n * @return {Attribution|null} An attribution function (or null).\n */\nfunction adaptAttributions(attributionLike) {\n if (!attributionLike) {\n return null;\n }\n if (Array.isArray(attributionLike)) {\n return function (frameState) {\n return attributionLike;\n };\n }\n if (typeof attributionLike === 'function') {\n return attributionLike;\n }\n return function (frameState) {\n return [attributionLike];\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Source);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/source/Source.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/source/Vector.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ol/source/Vector.js ***!
|
||
\******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ VectorSourceEvent: function() { return /* binding */ VectorSourceEvent; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _Collection_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Collection.js */ \"./node_modules/ol/Collection.js\");\n/* harmony import */ var _CollectionEventType_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../CollectionEventType.js */ \"./node_modules/ol/CollectionEventType.js\");\n/* harmony import */ var _events_Event_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../events/Event.js */ \"./node_modules/ol/events/Event.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../ObjectEventType.js */ \"./node_modules/ol/ObjectEventType.js\");\n/* harmony import */ var _structs_RBush_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../structs/RBush.js */ \"./node_modules/ol/structs/RBush.js\");\n/* harmony import */ var _render_Feature_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../render/Feature.js */ \"./node_modules/ol/render/Feature.js\");\n/* harmony import */ var _Source_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Source.js */ \"./node_modules/ol/source/Source.js\");\n/* harmony import */ var _VectorEventType_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./VectorEventType.js */ \"./node_modules/ol/source/VectorEventType.js\");\n/* harmony import */ var _functions_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../functions.js */ \"./node_modules/ol/functions.js\");\n/* harmony import */ var _loadingstrategy_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../loadingstrategy.js */ \"./node_modules/ol/loadingstrategy.js\");\n/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../asserts.js */ \"./node_modules/ol/asserts.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../array.js */ \"./node_modules/ol/array.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../obj.js */ \"./node_modules/ol/obj.js\");\n/* harmony import */ var _events_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../events.js */ \"./node_modules/ol/events.js\");\n/* harmony import */ var _featureloader_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../featureloader.js */ \"./node_modules/ol/featureloader.js\");\n\n/**\n * @module ol/source/Vector\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * A function that takes an {@link module:ol/extent~Extent} and a resolution as arguments, and\n * returns an array of {@link module:ol/extent~Extent} with the extents to load. Usually this\n * is one of the standard {@link module:ol/loadingstrategy} strategies.\n *\n * @typedef {function(import(\"../extent.js\").Extent, number, import(\"../proj/Projection.js\").default): Array<import(\"../extent.js\").Extent>} LoadingStrategy\n * @api\n */\n\n/**\n * @classdesc\n * Events emitted by {@link module:ol/source/Vector~VectorSource} instances are instances of this\n * type.\n * @template {import(\"../Feature.js\").FeatureLike} [FeatureClass=import(\"../Feature.js\").default]\n */\nclass VectorSourceEvent extends _events_Event_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n /**\n * @param {string} type Type.\n * @param {FeatureClass} [feature] Feature.\n * @param {Array<FeatureClass>} [features] Features.\n */\n constructor(type, feature, features) {\n super(type);\n\n /**\n * The added or removed feature for the `ADDFEATURE` and `REMOVEFEATURE` events, `undefined` otherwise.\n * @type {FeatureClass|undefined}\n * @api\n */\n this.feature = feature;\n\n /**\n * The loaded features for the `FEATURESLOADED` event, `undefined` otherwise.\n * @type {Array<FeatureClass>|undefined}\n * @api\n */\n this.features = features;\n }\n}\n\n/***\n * @template Return\n * @typedef {import(\"../Observable\").OnSignature<import(\"../Observable\").EventTypes, import(\"../events/Event.js\").default, Return> &\n * import(\"../Observable\").OnSignature<import(\"../ObjectEventType\").Types, import(\"../Object\").ObjectEvent, Return> &\n * import(\"../Observable\").OnSignature<import(\"./VectorEventType\").VectorSourceEventTypes, VectorSourceEvent, Return> &\n * import(\"../Observable\").CombinedOnSignature<import(\"../Observable\").EventTypes|import(\"../ObjectEventType\").Types|\n * import(\"./VectorEventType\").VectorSourceEventTypes, Return>} VectorSourceOnSignature\n */\n\n/**\n * @template {import(\"../Feature.js\").FeatureLike} [FeatureClass=import(\"../Feature.js\").default]\n * @typedef {Object} Options\n * @property {import(\"./Source.js\").AttributionLike} [attributions] Attributions.\n * @property {Array<FeatureClass>|Collection<FeatureClass>} [features]\n * Features. If provided as {@link module:ol/Collection~Collection}, the features in the source\n * and the collection will stay in sync.\n * @property {import(\"../format/Feature.js\").default} [format] The feature format used by the XHR\n * feature loader when `url` is set. Required if `url` is set, otherwise ignored.\n * @property {import(\"../featureloader.js\").FeatureLoader} [loader]\n * The loader function used to load features, from a remote source for example.\n * If this is not set and `url` is set, the source will create and use an XHR\n * feature loader. The `'featuresloadend'` and `'featuresloaderror'` events\n * will only fire if the `success` and `failure` callbacks are used.\n *\n * Example:\n *\n * ```js\n * import Vector from 'ol/source/Vector.js';\n * import GeoJSON from 'ol/format/GeoJSON.js';\n * import {bbox} from 'ol/loadingstrategy.js';\n *\n * const vectorSource = new Vector({\n * format: new GeoJSON(),\n * loader: function(extent, resolution, projection, success, failure) {\n * const proj = projection.getCode();\n * const url = 'https://ahocevar.com/geoserver/wfs?service=WFS&' +\n * 'version=1.1.0&request=GetFeature&typename=osm:water_areas&' +\n * 'outputFormat=application/json&srsname=' + proj + '&' +\n * 'bbox=' + extent.join(',') + ',' + proj;\n * const xhr = new XMLHttpRequest();\n * xhr.open('GET', url);\n * const onError = function() {\n * vectorSource.removeLoadedExtent(extent);\n * failure();\n * }\n * xhr.onerror = onError;\n * xhr.onload = function() {\n * if (xhr.status == 200) {\n * const features = vectorSource.getFormat().readFeatures(xhr.responseText);\n * vectorSource.addFeatures(features);\n * success(features);\n * } else {\n * onError();\n * }\n * }\n * xhr.send();\n * },\n * strategy: bbox,\n * });\n * ```\n * @property {boolean} [overlaps=true] This source may have overlapping geometries.\n * Setting this to `false` (e.g. for sources with polygons that represent administrative\n * boundaries or TopoJSON sources) allows the renderer to optimise fill and\n * stroke operations.\n * @property {LoadingStrategy} [strategy] The loading strategy to use.\n * By default an {@link module:ol/loadingstrategy.all}\n * strategy is used, a one-off strategy which loads all features at once.\n * @property {string|import(\"../featureloader.js\").FeatureUrlFunction} [url]\n * Setting this option instructs the source to load features using an XHR loader\n * (see {@link module:ol/featureloader.xhr}). Use a `string` and an\n * {@link module:ol/loadingstrategy.all} for a one-off download of all features from\n * the given URL. Use a {@link module:ol/featureloader~FeatureUrlFunction} to generate the url with\n * other loading strategies.\n * Requires `format` to be set as well.\n * When default XHR feature loader is provided, the features will\n * be transformed from the data projection to the view projection\n * during parsing. If your remote data source does not advertise its projection\n * properly, this transformation will be incorrect. For some formats, the\n * default projection (usually EPSG:4326) can be overridden by setting the\n * dataProjection constructor option on the format.\n * Note that if a source contains non-feature data, such as a GeoJSON geometry\n * or a KML NetworkLink, these will be ignored. Use a custom loader to load these.\n * @property {boolean} [useSpatialIndex=true]\n * By default, an RTree is used as spatial index. When features are removed and\n * added frequently, and the total number of features is low, setting this to\n * `false` may improve performance.\n *\n * Note that\n * {@link module:ol/source/Vector~VectorSource#getFeaturesInExtent},\n * {@link module:ol/source/Vector~VectorSource#getClosestFeatureToCoordinate} and\n * {@link module:ol/source/Vector~VectorSource#getExtent} cannot be used when `useSpatialIndex` is\n * set to `false`, and {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent} will loop\n * through all features.\n *\n * When set to `false`, the features will be maintained in an\n * {@link module:ol/Collection~Collection}, which can be retrieved through\n * {@link module:ol/source/Vector~VectorSource#getFeaturesCollection}.\n * @property {boolean} [wrapX=true] Wrap the world horizontally. For vector editing across the\n * -180° and 180° meridians to work properly, this should be set to `false`. The\n * resulting geometry coordinates will then exceed the world bounds.\n */\n\n/**\n * @classdesc\n * Provides a source of features for vector layers. Vector features provided\n * by this source are suitable for editing. See {@link module:ol/source/VectorTile~VectorTile} for\n * vector data that is optimized for rendering.\n *\n * @fires VectorSourceEvent\n * @api\n * @template {import(\"../Feature.js\").FeatureLike} [FeatureClass=import(\"../Feature.js\").default]\n */\nclass VectorSource extends _Source_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n /**\n * @param {Options<FeatureClass>} [options] Vector source options.\n */\n constructor(options) {\n options = options || {};\n super({\n attributions: options.attributions,\n interpolate: true,\n projection: undefined,\n state: 'ready',\n wrapX: options.wrapX !== undefined ? options.wrapX : true\n });\n\n /***\n * @type {VectorSourceOnSignature<import(\"../events\").EventsKey>}\n */\n this.on;\n\n /***\n * @type {VectorSourceOnSignature<import(\"../events\").EventsKey>}\n */\n this.once;\n\n /***\n * @type {VectorSourceOnSignature<void>}\n */\n this.un;\n\n /**\n * @private\n * @type {import(\"../featureloader.js\").FeatureLoader}\n */\n this.loader_ = _functions_js__WEBPACK_IMPORTED_MODULE_3__.VOID;\n\n /**\n * @private\n * @type {import(\"../format/Feature.js\").default|undefined}\n */\n this.format_ = options.format;\n\n /**\n * @private\n * @type {boolean}\n */\n this.overlaps_ = options.overlaps === undefined ? true : options.overlaps;\n\n /**\n * @private\n * @type {string|import(\"../featureloader.js\").FeatureUrlFunction|undefined}\n */\n this.url_ = options.url;\n if (options.loader !== undefined) {\n this.loader_ = options.loader;\n } else if (this.url_ !== undefined) {\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_4__.assert)(this.format_, '`format` must be set when `url` is set');\n // create a XHR feature loader for \"url\" and \"format\"\n this.loader_ = (0,_featureloader_js__WEBPACK_IMPORTED_MODULE_5__.xhr)(this.url_, /** @type {import(\"../format/Feature.js\").default} */this.format_);\n }\n\n /**\n * @private\n * @type {LoadingStrategy}\n */\n this.strategy_ = options.strategy !== undefined ? options.strategy : _loadingstrategy_js__WEBPACK_IMPORTED_MODULE_6__.all;\n const useSpatialIndex = options.useSpatialIndex !== undefined ? options.useSpatialIndex : true;\n\n /**\n * @private\n * @type {RBush<FeatureClass>}\n */\n this.featuresRtree_ = useSpatialIndex ? new _structs_RBush_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]() : null;\n\n /**\n * @private\n * @type {RBush<{extent: import(\"../extent.js\").Extent}>}\n */\n this.loadedExtentsRtree_ = new _structs_RBush_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]();\n\n /**\n * @type {number}\n * @private\n */\n this.loadingExtentsCount_ = 0;\n\n /**\n * @private\n * @type {!Object<string, FeatureClass>}\n */\n this.nullGeometryFeatures_ = {};\n\n /**\n * A lookup of features by id (the return from feature.getId()).\n * @private\n * @type {!Object<string, FeatureClass|Array<RenderFeature>>}\n */\n this.idIndex_ = {};\n\n /**\n * A lookup of features by uid (using getUid(feature)).\n * @private\n * @type {!Object<string, FeatureClass>}\n */\n this.uidIndex_ = {};\n\n /**\n * @private\n * @type {Object<string, Array<import(\"../events.js\").EventsKey>>}\n */\n this.featureChangeKeys_ = {};\n\n /**\n * @private\n * @type {Collection<FeatureClass>|null}\n */\n this.featuresCollection_ = null;\n\n /** @type {Collection<FeatureClass>} */\n let collection;\n /** @type {Array<FeatureClass>} */\n let features;\n if (Array.isArray(options.features)) {\n features = options.features;\n } else if (options.features) {\n collection = options.features;\n features = collection.getArray();\n }\n if (!useSpatialIndex && collection === undefined) {\n collection = new _Collection_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"](features);\n }\n if (features !== undefined) {\n this.addFeaturesInternal(features);\n }\n if (collection !== undefined) {\n this.bindFeaturesCollection_(collection);\n }\n }\n\n /**\n * Add a single feature to the source. If you want to add a batch of features\n * at once, call {@link module:ol/source/Vector~VectorSource#addFeatures #addFeatures()}\n * instead. A feature will not be added to the source if feature with\n * the same id is already there. The reason for this behavior is to avoid\n * feature duplication when using bbox or tile loading strategies.\n * Note: this also applies if an {@link module:ol/Collection~Collection} is used for features,\n * meaning that if a feature with a duplicate id is added in the collection, it will\n * be removed from it right away.\n * @param {FeatureClass} feature Feature to add.\n * @api\n */\n addFeature(feature) {\n this.addFeatureInternal(feature);\n this.changed();\n }\n\n /**\n * Add a feature without firing a `change` event.\n * @param {FeatureClass} feature Feature.\n * @protected\n */\n addFeatureInternal(feature) {\n const featureKey = (0,_util_js__WEBPACK_IMPORTED_MODULE_9__.getUid)(feature);\n if (!this.addToIndex_(featureKey, feature)) {\n if (this.featuresCollection_) {\n this.featuresCollection_.remove(feature);\n }\n return;\n }\n this.setupChangeEvents_(featureKey, feature);\n const geometry = feature.getGeometry();\n if (geometry) {\n const extent = geometry.getExtent();\n if (this.featuresRtree_) {\n this.featuresRtree_.insert(extent, feature);\n }\n } else {\n this.nullGeometryFeatures_[featureKey] = feature;\n }\n this.dispatchEvent(new VectorSourceEvent(_VectorEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].ADDFEATURE, feature));\n }\n\n /**\n * @param {string} featureKey Unique identifier for the feature.\n * @param {FeatureClass} feature The feature.\n * @private\n */\n setupChangeEvents_(featureKey, feature) {\n if (feature instanceof _render_Feature_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"]) {\n return;\n }\n this.featureChangeKeys_[featureKey] = [(0,_events_js__WEBPACK_IMPORTED_MODULE_12__.listen)(feature, _events_EventType_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"].CHANGE, this.handleFeatureChange_, this), (0,_events_js__WEBPACK_IMPORTED_MODULE_12__.listen)(feature, _ObjectEventType_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"].PROPERTYCHANGE, this.handleFeatureChange_, this)];\n }\n\n /**\n * @param {string} featureKey Unique identifier for the feature.\n * @param {FeatureClass} feature The feature.\n * @return {boolean} The feature is \"valid\", in the sense that it is also a\n * candidate for insertion into the Rtree.\n * @private\n */\n addToIndex_(featureKey, feature) {\n let valid = true;\n if (feature.getId() !== undefined) {\n const id = String(feature.getId());\n if (!(id in this.idIndex_)) {\n this.idIndex_[id] = feature;\n } else if (feature instanceof _render_Feature_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"]) {\n const indexedFeature = this.idIndex_[id];\n if (!(indexedFeature instanceof _render_Feature_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"])) {\n valid = false;\n } else {\n if (!Array.isArray(indexedFeature)) {\n this.idIndex_[id] = [indexedFeature, feature];\n } else {\n indexedFeature.push(feature);\n }\n }\n } else {\n valid = false;\n }\n }\n if (valid) {\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_4__.assert)(!(featureKey in this.uidIndex_), 'The passed `feature` was already added to the source');\n this.uidIndex_[featureKey] = feature;\n }\n return valid;\n }\n\n /**\n * Add a batch of features to the source.\n * @param {Array<FeatureClass>} features Features to add.\n * @api\n */\n addFeatures(features) {\n this.addFeaturesInternal(features);\n this.changed();\n }\n\n /**\n * Add features without firing a `change` event.\n * @param {Array<FeatureClass>} features Features.\n * @protected\n */\n addFeaturesInternal(features) {\n const extents = [];\n /** @type {Array<FeatureClass>} */\n const newFeatures = [];\n /** @type Array<FeatureClass> */\n const geometryFeatures = [];\n for (let i = 0, length = features.length; i < length; i++) {\n const feature = features[i];\n const featureKey = (0,_util_js__WEBPACK_IMPORTED_MODULE_9__.getUid)(feature);\n if (this.addToIndex_(featureKey, feature)) {\n newFeatures.push(feature);\n }\n }\n for (let i = 0, length = newFeatures.length; i < length; i++) {\n const feature = newFeatures[i];\n const featureKey = (0,_util_js__WEBPACK_IMPORTED_MODULE_9__.getUid)(feature);\n this.setupChangeEvents_(featureKey, feature);\n const geometry = feature.getGeometry();\n if (geometry) {\n const extent = geometry.getExtent();\n extents.push(extent);\n geometryFeatures.push(feature);\n } else {\n this.nullGeometryFeatures_[featureKey] = feature;\n }\n }\n if (this.featuresRtree_) {\n this.featuresRtree_.load(extents, geometryFeatures);\n }\n if (this.hasListener(_VectorEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].ADDFEATURE)) {\n for (let i = 0, length = newFeatures.length; i < length; i++) {\n this.dispatchEvent(new VectorSourceEvent(_VectorEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].ADDFEATURE, newFeatures[i]));\n }\n }\n }\n\n /**\n * @param {!Collection<FeatureClass>} collection Collection.\n * @private\n */\n bindFeaturesCollection_(collection) {\n let modifyingCollection = false;\n this.addEventListener(_VectorEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].ADDFEATURE,\n /**\n * @param {VectorSourceEvent<FeatureClass>} evt The vector source event\n */\n function (evt) {\n if (!modifyingCollection) {\n modifyingCollection = true;\n collection.push(evt.feature);\n modifyingCollection = false;\n }\n });\n this.addEventListener(_VectorEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].REMOVEFEATURE,\n /**\n * @param {VectorSourceEvent<FeatureClass>} evt The vector source event\n */\n function (evt) {\n if (!modifyingCollection) {\n modifyingCollection = true;\n collection.remove(evt.feature);\n modifyingCollection = false;\n }\n });\n collection.addEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"].ADD,\n /**\n * @param {import(\"../Collection.js\").CollectionEvent<FeatureClass>} evt The collection event\n */\n evt => {\n if (!modifyingCollection) {\n modifyingCollection = true;\n this.addFeature(evt.element);\n modifyingCollection = false;\n }\n });\n collection.addEventListener(_CollectionEventType_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"].REMOVE,\n /**\n * @param {import(\"../Collection.js\").CollectionEvent<FeatureClass>} evt The collection event\n */\n evt => {\n if (!modifyingCollection) {\n modifyingCollection = true;\n this.removeFeature(evt.element);\n modifyingCollection = false;\n }\n });\n this.featuresCollection_ = collection;\n }\n\n /**\n * Remove all features from the source.\n * @param {boolean} [fast] Skip dispatching of {@link module:ol/source/Vector.VectorSourceEvent#event:removefeature} events.\n * @api\n */\n clear(fast) {\n if (fast) {\n for (const featureId in this.featureChangeKeys_) {\n const keys = this.featureChangeKeys_[featureId];\n keys.forEach(_events_js__WEBPACK_IMPORTED_MODULE_12__.unlistenByKey);\n }\n if (!this.featuresCollection_) {\n this.featureChangeKeys_ = {};\n this.idIndex_ = {};\n this.uidIndex_ = {};\n }\n } else {\n if (this.featuresRtree_) {\n const removeAndIgnoreReturn = feature => {\n this.removeFeatureInternal(feature);\n };\n this.featuresRtree_.forEach(removeAndIgnoreReturn);\n for (const id in this.nullGeometryFeatures_) {\n this.removeFeatureInternal(this.nullGeometryFeatures_[id]);\n }\n }\n }\n if (this.featuresCollection_) {\n this.featuresCollection_.clear();\n }\n if (this.featuresRtree_) {\n this.featuresRtree_.clear();\n }\n this.nullGeometryFeatures_ = {};\n const clearEvent = new VectorSourceEvent(_VectorEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].CLEAR);\n this.dispatchEvent(clearEvent);\n this.changed();\n }\n\n /**\n * Iterate through all features on the source, calling the provided callback\n * with each one. If the callback returns any \"truthy\" value, iteration will\n * stop and the function will return the same value.\n * Note: this function only iterate through the feature that have a defined geometry.\n *\n * @param {function(FeatureClass): T} callback Called with each feature\n * on the source. Return a truthy value to stop iteration.\n * @return {T|undefined} The return value from the last call to the callback.\n * @template T\n * @api\n */\n forEachFeature(callback) {\n if (this.featuresRtree_) {\n return this.featuresRtree_.forEach(callback);\n }\n if (this.featuresCollection_) {\n this.featuresCollection_.forEach(callback);\n }\n }\n\n /**\n * Iterate through all features whose geometries contain the provided\n * coordinate, calling the callback with each feature. If the callback returns\n * a \"truthy\" value, iteration will stop and the function will return the same\n * value.\n *\n * For {@link module:ol/render/Feature~RenderFeature} features, the callback will be\n * called for all features.\n *\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {function(FeatureClass): T} callback Called with each feature\n * whose goemetry contains the provided coordinate.\n * @return {T|undefined} The return value from the last call to the callback.\n * @template T\n */\n forEachFeatureAtCoordinateDirect(coordinate, callback) {\n const extent = [coordinate[0], coordinate[1], coordinate[0], coordinate[1]];\n return this.forEachFeatureInExtent(extent, function (feature) {\n const geometry = feature.getGeometry();\n if (geometry instanceof _render_Feature_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"] || geometry.intersectsCoordinate(coordinate)) {\n return callback(feature);\n }\n return undefined;\n });\n }\n\n /**\n * Iterate through all features whose bounding box intersects the provided\n * extent (note that the feature's geometry may not intersect the extent),\n * calling the callback with each feature. If the callback returns a \"truthy\"\n * value, iteration will stop and the function will return the same value.\n *\n * If you are interested in features whose geometry intersects an extent, call\n * the {@link module:ol/source/Vector~VectorSource#forEachFeatureIntersectingExtent #forEachFeatureIntersectingExtent()} method instead.\n *\n * When `useSpatialIndex` is set to false, this method will loop through all\n * features, equivalent to {@link module:ol/source/Vector~VectorSource#forEachFeature #forEachFeature()}.\n *\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {function(FeatureClass): T} callback Called with each feature\n * whose bounding box intersects the provided extent.\n * @return {T|undefined} The return value from the last call to the callback.\n * @template T\n * @api\n */\n forEachFeatureInExtent(extent, callback) {\n if (this.featuresRtree_) {\n return this.featuresRtree_.forEachInExtent(extent, callback);\n }\n if (this.featuresCollection_) {\n this.featuresCollection_.forEach(callback);\n }\n }\n\n /**\n * Iterate through all features whose geometry intersects the provided extent,\n * calling the callback with each feature. If the callback returns a \"truthy\"\n * value, iteration will stop and the function will return the same value.\n *\n * If you only want to test for bounding box intersection, call the\n * {@link module:ol/source/Vector~VectorSource#forEachFeatureInExtent #forEachFeatureInExtent()} method instead.\n *\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {function(FeatureClass): T} callback Called with each feature\n * whose geometry intersects the provided extent.\n * @return {T|undefined} The return value from the last call to the callback.\n * @template T\n * @api\n */\n forEachFeatureIntersectingExtent(extent, callback) {\n return this.forEachFeatureInExtent(extent,\n /**\n * @param {FeatureClass} feature Feature.\n * @return {T|undefined} The return value from the last call to the callback.\n */\n function (feature) {\n const geometry = feature.getGeometry();\n if (geometry instanceof _render_Feature_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"] || geometry.intersectsExtent(extent)) {\n const result = callback(feature);\n if (result) {\n return result;\n }\n }\n });\n }\n\n /**\n * Get the features collection associated with this source. Will be `null`\n * unless the source was configured with `useSpatialIndex` set to `false`, or\n * with an {@link module:ol/Collection~Collection} as `features`.\n * @return {Collection<FeatureClass>|null} The collection of features.\n * @api\n */\n getFeaturesCollection() {\n return this.featuresCollection_;\n }\n\n /**\n * Get a snapshot of the features currently on the source in random order. The returned array\n * is a copy, the features are references to the features in the source.\n * @return {Array<FeatureClass>} Features.\n * @api\n */\n getFeatures() {\n let features;\n if (this.featuresCollection_) {\n features = this.featuresCollection_.getArray().slice(0);\n } else if (this.featuresRtree_) {\n features = this.featuresRtree_.getAll();\n if (!(0,_obj_js__WEBPACK_IMPORTED_MODULE_16__.isEmpty)(this.nullGeometryFeatures_)) {\n (0,_array_js__WEBPACK_IMPORTED_MODULE_17__.extend)(features, Object.values(this.nullGeometryFeatures_));\n }\n }\n return features;\n }\n\n /**\n * Get all features whose geometry intersects the provided coordinate.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @return {Array<import(\"../Feature.js\").default>} Features.\n * @api\n */\n getFeaturesAtCoordinate(coordinate) {\n const features = [];\n this.forEachFeatureAtCoordinateDirect(coordinate, function (feature) {\n features.push(feature);\n });\n return features;\n }\n\n /**\n * Get all features whose bounding box intersects the provided extent. Note that this returns an array of\n * all features intersecting the given extent in random order (so it may include\n * features whose geometries do not intersect the extent).\n *\n * When `useSpatialIndex` is set to false, this method will return all\n * features.\n *\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {import(\"../proj/Projection.js\").default} [projection] Include features\n * where `extent` exceeds the x-axis bounds of `projection` and wraps around the world.\n * @return {Array<FeatureClass>} Features.\n * @api\n */\n getFeaturesInExtent(extent, projection) {\n if (this.featuresRtree_) {\n const multiWorld = projection && projection.canWrapX() && this.getWrapX();\n if (!multiWorld) {\n return this.featuresRtree_.getInExtent(extent);\n }\n const extents = (0,_extent_js__WEBPACK_IMPORTED_MODULE_18__.wrapAndSliceX)(extent, projection);\n return [].concat(...extents.map(anExtent => this.featuresRtree_.getInExtent(anExtent)));\n }\n if (this.featuresCollection_) {\n return this.featuresCollection_.getArray().slice(0);\n }\n return [];\n }\n\n /**\n * Get the closest feature to the provided coordinate.\n *\n * This method is not available when the source is configured with\n * `useSpatialIndex` set to `false` and the features in this source are of type\n * {@link module:ol/Feature~Feature}.\n * @param {import(\"../coordinate.js\").Coordinate} coordinate Coordinate.\n * @param {function(FeatureClass):boolean} [filter] Feature filter function.\n * The filter function will receive one argument, the {@link module:ol/Feature~Feature feature}\n * and it should return a boolean value. By default, no filtering is made.\n * @return {FeatureClass} Closest feature.\n * @api\n */\n getClosestFeatureToCoordinate(coordinate, filter) {\n // Find the closest feature using branch and bound. We start searching an\n // infinite extent, and find the distance from the first feature found. This\n // becomes the closest feature. We then compute a smaller extent which any\n // closer feature must intersect. We continue searching with this smaller\n // extent, trying to find a closer feature. Every time we find a closer\n // feature, we update the extent being searched so that any even closer\n // feature must intersect it. We continue until we run out of features.\n const x = coordinate[0];\n const y = coordinate[1];\n let closestFeature = null;\n const closestPoint = [NaN, NaN];\n let minSquaredDistance = Infinity;\n const extent = [-Infinity, -Infinity, Infinity, Infinity];\n filter = filter ? filter : _functions_js__WEBPACK_IMPORTED_MODULE_3__.TRUE;\n this.featuresRtree_.forEachInExtent(extent,\n /**\n * @param {FeatureClass} feature Feature.\n */\n function (feature) {\n if (filter(feature)) {\n const geometry = feature.getGeometry();\n const previousMinSquaredDistance = minSquaredDistance;\n minSquaredDistance = geometry instanceof _render_Feature_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"] ? 0 : geometry.closestPointXY(x, y, closestPoint, minSquaredDistance);\n if (minSquaredDistance < previousMinSquaredDistance) {\n closestFeature = feature;\n // This is sneaky. Reduce the extent that it is currently being\n // searched while the R-Tree traversal using this same extent object\n // is still in progress. This is safe because the new extent is\n // strictly contained by the old extent.\n const minDistance = Math.sqrt(minSquaredDistance);\n extent[0] = x - minDistance;\n extent[1] = y - minDistance;\n extent[2] = x + minDistance;\n extent[3] = y + minDistance;\n }\n }\n });\n return closestFeature;\n }\n\n /**\n * Get the extent of the features currently in the source.\n *\n * This method is not available when the source is configured with\n * `useSpatialIndex` set to `false`.\n * @param {import(\"../extent.js\").Extent} [extent] Destination extent. If provided, no new extent\n * will be created. Instead, that extent's coordinates will be overwritten.\n * @return {import(\"../extent.js\").Extent} Extent.\n * @api\n */\n getExtent(extent) {\n return this.featuresRtree_.getExtent(extent);\n }\n\n /**\n * Get a feature by its identifier (the value returned by feature.getId()). When `RenderFeature`s\n * are used, `getFeatureById()` can return an array of `RenderFeature`s. This allows for handling\n * of `GeometryCollection` geometries, where format readers create one `RenderFeature` per\n * `GeometryCollection` member.\n * Note that the index treats string and numeric identifiers as the same. So\n * `source.getFeatureById(2)` will return a feature with id `'2'` or `2`.\n *\n * @param {string|number} id Feature identifier.\n * @return {FeatureClass|Array<RenderFeature>|null} The feature (or `null` if not found).\n * @api\n */\n getFeatureById(id) {\n const feature = this.idIndex_[id.toString()];\n return feature !== undefined ? feature : null;\n }\n\n /**\n * Get a feature by its internal unique identifier (using `getUid`).\n *\n * @param {string} uid Feature identifier.\n * @return {FeatureClass|null} The feature (or `null` if not found).\n */\n getFeatureByUid(uid) {\n const feature = this.uidIndex_[uid];\n return feature !== undefined ? feature : null;\n }\n\n /**\n * Get the format associated with this source.\n *\n * @return {import(\"../format/Feature.js\").default|undefined} The feature format.\n * @api\n */\n getFormat() {\n return this.format_;\n }\n\n /**\n * @return {boolean} The source can have overlapping geometries.\n */\n getOverlaps() {\n return this.overlaps_;\n }\n\n /**\n * Get the url associated with this source.\n *\n * @return {string|import(\"../featureloader.js\").FeatureUrlFunction|undefined} The url.\n * @api\n */\n getUrl() {\n return this.url_;\n }\n\n /**\n * @param {Event} event Event.\n * @private\n */\n handleFeatureChange_(event) {\n const feature = /** @type {FeatureClass} */event.target;\n const featureKey = (0,_util_js__WEBPACK_IMPORTED_MODULE_9__.getUid)(feature);\n const geometry = feature.getGeometry();\n if (!geometry) {\n if (!(featureKey in this.nullGeometryFeatures_)) {\n if (this.featuresRtree_) {\n this.featuresRtree_.remove(feature);\n }\n this.nullGeometryFeatures_[featureKey] = feature;\n }\n } else {\n const extent = geometry.getExtent();\n if (featureKey in this.nullGeometryFeatures_) {\n delete this.nullGeometryFeatures_[featureKey];\n if (this.featuresRtree_) {\n this.featuresRtree_.insert(extent, feature);\n }\n } else {\n if (this.featuresRtree_) {\n this.featuresRtree_.update(extent, feature);\n }\n }\n }\n const id = feature.getId();\n if (id !== undefined) {\n const sid = id.toString();\n if (this.idIndex_[sid] !== feature) {\n this.removeFromIdIndex_(feature);\n this.idIndex_[sid] = feature;\n }\n } else {\n this.removeFromIdIndex_(feature);\n this.uidIndex_[featureKey] = feature;\n }\n this.changed();\n this.dispatchEvent(new VectorSourceEvent(_VectorEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].CHANGEFEATURE, feature));\n }\n\n /**\n * Returns true if the feature is contained within the source.\n * @param {FeatureClass} feature Feature.\n * @return {boolean} Has feature.\n * @api\n */\n hasFeature(feature) {\n const id = feature.getId();\n if (id !== undefined) {\n return id in this.idIndex_;\n }\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_9__.getUid)(feature) in this.uidIndex_;\n }\n\n /**\n * @return {boolean} Is empty.\n */\n isEmpty() {\n if (this.featuresRtree_) {\n return this.featuresRtree_.isEmpty() && (0,_obj_js__WEBPACK_IMPORTED_MODULE_16__.isEmpty)(this.nullGeometryFeatures_);\n }\n if (this.featuresCollection_) {\n return this.featuresCollection_.getLength() === 0;\n }\n return true;\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {number} resolution Resolution.\n * @param {import(\"../proj/Projection.js\").default} projection Projection.\n */\n loadFeatures(extent, resolution, projection) {\n const loadedExtentsRtree = this.loadedExtentsRtree_;\n const extentsToLoad = this.strategy_(extent, resolution, projection);\n for (let i = 0, ii = extentsToLoad.length; i < ii; ++i) {\n const extentToLoad = extentsToLoad[i];\n const alreadyLoaded = loadedExtentsRtree.forEachInExtent(extentToLoad,\n /**\n * @param {{extent: import(\"../extent.js\").Extent}} object Object.\n * @return {boolean} Contains.\n */\n function (object) {\n return (0,_extent_js__WEBPACK_IMPORTED_MODULE_18__.containsExtent)(object.extent, extentToLoad);\n });\n if (!alreadyLoaded) {\n ++this.loadingExtentsCount_;\n this.dispatchEvent(new VectorSourceEvent(_VectorEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].FEATURESLOADSTART));\n this.loader_.call(this, extentToLoad, resolution, projection, features => {\n --this.loadingExtentsCount_;\n this.dispatchEvent(new VectorSourceEvent(_VectorEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].FEATURESLOADEND, undefined, features));\n }, () => {\n --this.loadingExtentsCount_;\n this.dispatchEvent(new VectorSourceEvent(_VectorEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].FEATURESLOADERROR));\n });\n loadedExtentsRtree.insert(extentToLoad, {\n extent: extentToLoad.slice()\n });\n }\n }\n this.loading = this.loader_.length < 4 ? false : this.loadingExtentsCount_ > 0;\n }\n refresh() {\n this.clear(true);\n this.loadedExtentsRtree_.clear();\n super.refresh();\n }\n\n /**\n * Remove an extent from the list of loaded extents.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @api\n */\n removeLoadedExtent(extent) {\n const loadedExtentsRtree = this.loadedExtentsRtree_;\n let obj;\n loadedExtentsRtree.forEachInExtent(extent, function (object) {\n if ((0,_extent_js__WEBPACK_IMPORTED_MODULE_18__.equals)(object.extent, extent)) {\n obj = object;\n return true;\n }\n });\n if (obj) {\n loadedExtentsRtree.remove(obj);\n }\n }\n\n /**\n * Remove a single feature from the source. If you want to remove all features\n * at once, use the {@link module:ol/source/Vector~VectorSource#clear #clear()} method\n * instead.\n * @param {FeatureClass} feature Feature to remove.\n * @api\n */\n removeFeature(feature) {\n if (!feature) {\n return;\n }\n const featureKey = (0,_util_js__WEBPACK_IMPORTED_MODULE_9__.getUid)(feature);\n if (featureKey in this.nullGeometryFeatures_) {\n delete this.nullGeometryFeatures_[featureKey];\n } else {\n if (this.featuresRtree_) {\n this.featuresRtree_.remove(feature);\n }\n }\n const result = this.removeFeatureInternal(feature);\n if (result) {\n this.changed();\n }\n }\n\n /**\n * Remove feature without firing a `change` event.\n * @param {FeatureClass} feature Feature.\n * @return {FeatureClass|undefined} The removed feature\n * (or undefined if the feature was not found).\n * @protected\n */\n removeFeatureInternal(feature) {\n const featureKey = (0,_util_js__WEBPACK_IMPORTED_MODULE_9__.getUid)(feature);\n const featureChangeKeys = this.featureChangeKeys_[featureKey];\n if (!featureChangeKeys) {\n return;\n }\n featureChangeKeys.forEach(_events_js__WEBPACK_IMPORTED_MODULE_12__.unlistenByKey);\n delete this.featureChangeKeys_[featureKey];\n const id = feature.getId();\n if (id !== undefined) {\n delete this.idIndex_[id.toString()];\n }\n delete this.uidIndex_[featureKey];\n this.dispatchEvent(new VectorSourceEvent(_VectorEventType_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"].REMOVEFEATURE, feature));\n return feature;\n }\n\n /**\n * Remove a feature from the id index. Called internally when the feature id\n * may have changed.\n * @param {FeatureClass} feature The feature.\n * @return {boolean} Removed the feature from the index.\n * @private\n */\n removeFromIdIndex_(feature) {\n let removed = false;\n for (const id in this.idIndex_) {\n const indexedFeature = this.idIndex_[id];\n if (feature instanceof _render_Feature_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"] && Array.isArray(indexedFeature) && indexedFeature.includes(feature)) {\n indexedFeature.splice(indexedFeature.indexOf(feature), 1);\n } else if (this.idIndex_[id] === feature) {\n delete this.idIndex_[id];\n removed = true;\n break;\n }\n }\n return removed;\n }\n\n /**\n * Set the new loader of the source. The next render cycle will use the\n * new loader.\n * @param {import(\"../featureloader.js\").FeatureLoader} loader The loader to set.\n * @api\n */\n setLoader(loader) {\n this.loader_ = loader;\n }\n\n /**\n * Points the source to a new url. The next render cycle will use the new url.\n * @param {string|import(\"../featureloader.js\").FeatureUrlFunction} url Url.\n * @api\n */\n setUrl(url) {\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_4__.assert)(this.format_, '`format` must be set when `url` is set');\n this.url_ = url;\n this.setLoader((0,_featureloader_js__WEBPACK_IMPORTED_MODULE_5__.xhr)(url, this.format_));\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (VectorSource);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/source/Vector.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/source/VectorEventType.js":
|
||
/*!***************************************************!*\
|
||
!*** ./node_modules/ol/source/VectorEventType.js ***!
|
||
\***************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/source/VectorEventType\n */\n\n/**\n * @enum {string}\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n /**\n * Triggered when a feature is added to the source.\n * @event module:ol/source/Vector.VectorSourceEvent#addfeature\n * @api\n */\n ADDFEATURE: 'addfeature',\n /**\n * Triggered when a feature is updated.\n * @event module:ol/source/Vector.VectorSourceEvent#changefeature\n * @api\n */\n CHANGEFEATURE: 'changefeature',\n /**\n * Triggered when the clear method is called on the source.\n * @event module:ol/source/Vector.VectorSourceEvent#clear\n * @api\n */\n CLEAR: 'clear',\n /**\n * Triggered when a feature is removed from the source.\n * See {@link module:ol/source/Vector~VectorSource#clear source.clear()} for exceptions.\n * @event module:ol/source/Vector.VectorSourceEvent#removefeature\n * @api\n */\n REMOVEFEATURE: 'removefeature',\n /**\n * Triggered when features starts loading.\n * @event module:ol/source/Vector.VectorSourceEvent#featuresloadstart\n * @api\n */\n FEATURESLOADSTART: 'featuresloadstart',\n /**\n * Triggered when features finishes loading.\n * @event module:ol/source/Vector.VectorSourceEvent#featuresloadend\n * @api\n */\n FEATURESLOADEND: 'featuresloadend',\n /**\n * Triggered if feature loading results in an error.\n * @event module:ol/source/Vector.VectorSourceEvent#featuresloaderror\n * @api\n */\n FEATURESLOADERROR: 'featuresloaderror'\n});\n\n/**\n * @typedef {'addfeature'|'changefeature'|'clear'|'removefeature'|'featuresloadstart'|'featuresloadend'|'featuresloaderror'} VectorSourceEventTypes\n */\n\n//# sourceURL=webpack://complexes/./node_modules/ol/source/VectorEventType.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/source/common.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ol/source/common.js ***!
|
||
\******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DECIMALS: function() { return /* binding */ DECIMALS; },\n/* harmony export */ DEFAULT_WMS_VERSION: function() { return /* binding */ DEFAULT_WMS_VERSION; }\n/* harmony export */ });\n/**\n * @module ol/source/common\n */\n\n/**\n * Default WMS version.\n * @type {string}\n */\nconst DEFAULT_WMS_VERSION = '1.3.0';\n\n/**\n * Number of decimal digits to consider in integer values when rounding.\n * @type {number}\n */\nconst DECIMALS = 4;\n\n//# sourceURL=webpack://complexes/./node_modules/ol/source/common.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/source/static.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ol/source/static.js ***!
|
||
\******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createLoader: function() { return /* binding */ createLoader; }\n/* harmony export */ });\n/* harmony import */ var _Image_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Image.js */ \"./node_modules/ol/Image.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/**\n * @module ol/source/static\n */\n\n\n\n\n/**\n * @typedef {Object} LoaderOptions\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that\n * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {import(\"../extent.js\").Extent} [imageExtent] Extent of the image in map coordinates.\n * This is the [left, bottom, right, top] map coordinates of your image. When using this loader with an\n * `ol/source/Image`, the same extent must be set as `extent` of the `ol/layer/Image`.\n * @property {string} url Image URL.\n * @property {function(HTMLImageElement, string): Promise<import('../DataTile.js').ImageLike>} [load] Function\n * to perform loading of the image. Receives the created `HTMLImageElement` and the desired `src` as argument and\n * returns a promise resolving to the loaded or decoded image. Default is {@link module:ol/Image.decode}.\n */\n\n/**\n * Creates a loader for static images.\n * @param {LoaderOptions} options Loader options.\n * @return {import(\"../Image.js\").ImageObjectPromiseLoader} Loader.\n * @api\n */\nfunction createLoader(options) {\n const load = options.load || _Image_js__WEBPACK_IMPORTED_MODULE_0__.decode;\n const extent = options.imageExtent;\n const image = new Image();\n if (options.crossOrigin !== null) {\n image.crossOrigin = options.crossOrigin;\n }\n return () => load(image, options.url).then(image => {\n const resolutionX = (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.getWidth)(extent) / image.width;\n const resolutionY = (0,_extent_js__WEBPACK_IMPORTED_MODULE_1__.getHeight)(extent) / image.height;\n const resolution = resolutionX !== resolutionY ? [resolutionX, resolutionY] : resolutionY;\n return {\n image,\n extent,\n resolution,\n pixelRatio: 1\n };\n });\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/source/static.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/sphere.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/ol/sphere.js ***!
|
||
\***********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DEFAULT_RADIUS: function() { return /* binding */ DEFAULT_RADIUS; },\n/* harmony export */ getArea: function() { return /* binding */ getArea; },\n/* harmony export */ getDistance: function() { return /* binding */ getDistance; },\n/* harmony export */ getLength: function() { return /* binding */ getLength; },\n/* harmony export */ offset: function() { return /* binding */ offset; }\n/* harmony export */ });\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ \"./node_modules/ol/math.js\");\n/**\n * @module ol/sphere\n */\n\n\n/**\n * Object literal with options for the {@link getLength} or {@link getArea}\n * functions.\n * @typedef {Object} SphereMetricOptions\n * @property {import(\"./proj.js\").ProjectionLike} [projection='EPSG:3857']\n * Projection of the geometry. By default, the geometry is assumed to be in\n * Web Mercator.\n * @property {number} [radius=6371008.8] Sphere radius. By default, the\n * [mean Earth radius](https://en.wikipedia.org/wiki/Earth_radius#Mean_radius)\n * for the WGS84 ellipsoid is used.\n */\n\n/**\n * The mean Earth radius (1/3 * (2a + b)) for the WGS84 ellipsoid.\n * https://en.wikipedia.org/wiki/Earth_radius#Mean_radius\n * @type {number}\n */\nconst DEFAULT_RADIUS = 6371008.8;\n\n/**\n * Get the great circle distance (in meters) between two geographic coordinates.\n * @param {Array} c1 Starting coordinate.\n * @param {Array} c2 Ending coordinate.\n * @param {number} [radius] The sphere radius to use. Defaults to the Earth's\n * mean radius using the WGS84 ellipsoid.\n * @return {number} The great circle distance between the points (in meters).\n * @api\n */\nfunction getDistance(c1, c2, radius) {\n radius = radius || DEFAULT_RADIUS;\n const lat1 = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.toRadians)(c1[1]);\n const lat2 = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.toRadians)(c2[1]);\n const deltaLatBy2 = (lat2 - lat1) / 2;\n const deltaLonBy2 = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.toRadians)(c2[0] - c1[0]) / 2;\n const a = Math.sin(deltaLatBy2) * Math.sin(deltaLatBy2) + Math.sin(deltaLonBy2) * Math.sin(deltaLonBy2) * Math.cos(lat1) * Math.cos(lat2);\n return 2 * radius * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n}\n\n/**\n * Get the cumulative great circle length of linestring coordinates (geographic).\n * @param {Array} coordinates Linestring coordinates.\n * @param {number} radius The sphere radius to use.\n * @return {number} The length (in meters).\n */\nfunction getLengthInternal(coordinates, radius) {\n let length = 0;\n for (let i = 0, ii = coordinates.length; i < ii - 1; ++i) {\n length += getDistance(coordinates[i], coordinates[i + 1], radius);\n }\n return length;\n}\n\n/**\n * Get the spherical length of a geometry. This length is the sum of the\n * great circle distances between coordinates. For polygons, the length is\n * the sum of all rings. For points, the length is zero. For multi-part\n * geometries, the length is the sum of the length of each part.\n * @param {import(\"./geom/Geometry.js\").default} geometry A geometry.\n * @param {SphereMetricOptions} [options] Options for the\n * length calculation. By default, geometries are assumed to be in 'EPSG:3857'.\n * You can change this by providing a `projection` option.\n * @return {number} The spherical length (in meters).\n * @api\n */\nfunction getLength(geometry, options) {\n options = options || {};\n const radius = options.radius || DEFAULT_RADIUS;\n const projection = options.projection || 'EPSG:3857';\n const type = geometry.getType();\n if (type !== 'GeometryCollection') {\n geometry = geometry.clone().transform(projection, 'EPSG:4326');\n }\n let length = 0;\n let coordinates, coords, i, ii, j, jj;\n switch (type) {\n case 'Point':\n case 'MultiPoint':\n {\n break;\n }\n case 'LineString':\n case 'LinearRing':\n {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */geometry.getCoordinates();\n length = getLengthInternal(coordinates, radius);\n break;\n }\n case 'MultiLineString':\n case 'Polygon':\n {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */geometry.getCoordinates();\n for (i = 0, ii = coordinates.length; i < ii; ++i) {\n length += getLengthInternal(coordinates[i], radius);\n }\n break;\n }\n case 'MultiPolygon':\n {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */geometry.getCoordinates();\n for (i = 0, ii = coordinates.length; i < ii; ++i) {\n coords = coordinates[i];\n for (j = 0, jj = coords.length; j < jj; ++j) {\n length += getLengthInternal(coords[j], radius);\n }\n }\n break;\n }\n case 'GeometryCollection':\n {\n const geometries = /** @type {import(\"./geom/GeometryCollection.js\").default} */geometry.getGeometries();\n for (i = 0, ii = geometries.length; i < ii; ++i) {\n length += getLength(geometries[i], options);\n }\n break;\n }\n default:\n {\n throw new Error('Unsupported geometry type: ' + type);\n }\n }\n return length;\n}\n\n/**\n * Returns the spherical area for a list of coordinates.\n *\n * [Reference](https://trs.jpl.nasa.gov/handle/2014/40409)\n * Robert. G. Chamberlain and William H. Duquette, \"Some Algorithms for\n * Polygons on a Sphere\", JPL Publication 07-03, Jet Propulsion\n * Laboratory, Pasadena, CA, June 2007\n *\n * @param {Array<import(\"./coordinate.js\").Coordinate>} coordinates List of coordinates of a linear\n * ring. If the ring is oriented clockwise, the area will be positive,\n * otherwise it will be negative.\n * @param {number} radius The sphere radius.\n * @return {number} Area (in square meters).\n */\nfunction getAreaInternal(coordinates, radius) {\n let area = 0;\n const len = coordinates.length;\n let x1 = coordinates[len - 1][0];\n let y1 = coordinates[len - 1][1];\n for (let i = 0; i < len; i++) {\n const x2 = coordinates[i][0];\n const y2 = coordinates[i][1];\n area += (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.toRadians)(x2 - x1) * (2 + Math.sin((0,_math_js__WEBPACK_IMPORTED_MODULE_0__.toRadians)(y1)) + Math.sin((0,_math_js__WEBPACK_IMPORTED_MODULE_0__.toRadians)(y2)));\n x1 = x2;\n y1 = y2;\n }\n return area * radius * radius / 2.0;\n}\n\n/**\n * Get the spherical area of a geometry. This is the area (in meters) assuming\n * that polygon edges are segments of great circles on a sphere.\n * @param {import(\"./geom/Geometry.js\").default} geometry A geometry.\n * @param {SphereMetricOptions} [options] Options for the area\n * calculation. By default, geometries are assumed to be in 'EPSG:3857'.\n * You can change this by providing a `projection` option.\n * @return {number} The spherical area (in square meters).\n * @api\n */\nfunction getArea(geometry, options) {\n options = options || {};\n const radius = options.radius || DEFAULT_RADIUS;\n const projection = options.projection || 'EPSG:3857';\n const type = geometry.getType();\n if (type !== 'GeometryCollection') {\n geometry = geometry.clone().transform(projection, 'EPSG:4326');\n }\n let area = 0;\n let coordinates, coords, i, ii, j, jj;\n switch (type) {\n case 'Point':\n case 'MultiPoint':\n case 'LineString':\n case 'MultiLineString':\n case 'LinearRing':\n {\n break;\n }\n case 'Polygon':\n {\n coordinates = /** @type {import(\"./geom/Polygon.js\").default} */geometry.getCoordinates();\n area = Math.abs(getAreaInternal(coordinates[0], radius));\n for (i = 1, ii = coordinates.length; i < ii; ++i) {\n area -= Math.abs(getAreaInternal(coordinates[i], radius));\n }\n break;\n }\n case 'MultiPolygon':\n {\n coordinates = /** @type {import(\"./geom/SimpleGeometry.js\").default} */geometry.getCoordinates();\n for (i = 0, ii = coordinates.length; i < ii; ++i) {\n coords = coordinates[i];\n area += Math.abs(getAreaInternal(coords[0], radius));\n for (j = 1, jj = coords.length; j < jj; ++j) {\n area -= Math.abs(getAreaInternal(coords[j], radius));\n }\n }\n break;\n }\n case 'GeometryCollection':\n {\n const geometries = /** @type {import(\"./geom/GeometryCollection.js\").default} */geometry.getGeometries();\n for (i = 0, ii = geometries.length; i < ii; ++i) {\n area += getArea(geometries[i], options);\n }\n break;\n }\n default:\n {\n throw new Error('Unsupported geometry type: ' + type);\n }\n }\n return area;\n}\n\n/**\n * Returns the coordinate at the given distance and bearing from `c1`.\n *\n * @param {import(\"./coordinate.js\").Coordinate} c1 The origin point (`[lon, lat]` in degrees).\n * @param {number} distance The great-circle distance between the origin\n * point and the target point.\n * @param {number} bearing The bearing (in radians).\n * @param {number} [radius] The sphere radius to use. Defaults to the Earth's\n * mean radius using the WGS84 ellipsoid.\n * @return {import(\"./coordinate.js\").Coordinate} The target point.\n */\nfunction offset(c1, distance, bearing, radius) {\n radius = radius || DEFAULT_RADIUS;\n const lat1 = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.toRadians)(c1[1]);\n const lon1 = (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.toRadians)(c1[0]);\n const dByR = distance / radius;\n const lat = Math.asin(Math.sin(lat1) * Math.cos(dByR) + Math.cos(lat1) * Math.sin(dByR) * Math.cos(bearing));\n const lon = lon1 + Math.atan2(Math.sin(bearing) * Math.sin(dByR) * Math.cos(lat1), Math.cos(dByR) - Math.sin(lat1) * Math.sin(lat));\n return [(0,_math_js__WEBPACK_IMPORTED_MODULE_0__.toDegrees)(lon), (0,_math_js__WEBPACK_IMPORTED_MODULE_0__.toDegrees)(lat)];\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/sphere.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/string.js":
|
||
/*!***********************************!*\
|
||
!*** ./node_modules/ol/string.js ***!
|
||
\***********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ compareVersions: function() { return /* binding */ compareVersions; },\n/* harmony export */ padNumber: function() { return /* binding */ padNumber; }\n/* harmony export */ });\n/**\n * @module ol/string\n */\n\n/**\n * @param {number} number Number to be formatted\n * @param {number} width The desired width\n * @param {number} [precision] Precision of the output string (i.e. number of decimal places)\n * @return {string} Formatted string\n */\nfunction padNumber(number, width, precision) {\n const numberString = precision !== undefined ? number.toFixed(precision) : '' + number;\n let decimal = numberString.indexOf('.');\n decimal = decimal === -1 ? numberString.length : decimal;\n return decimal > width ? numberString : new Array(1 + width - decimal).join('0') + numberString;\n}\n\n/**\n * Adapted from https://github.com/omichelsen/compare-versions/blob/master/index.js\n * @param {string|number} v1 First version\n * @param {string|number} v2 Second version\n * @return {number} Value\n */\nfunction compareVersions(v1, v2) {\n const s1 = ('' + v1).split('.');\n const s2 = ('' + v2).split('.');\n for (let i = 0; i < Math.max(s1.length, s2.length); i++) {\n const n1 = parseInt(s1[i] || '0', 10);\n const n2 = parseInt(s2[i] || '0', 10);\n if (n1 > n2) {\n return 1;\n }\n if (n2 > n1) {\n return -1;\n }\n }\n return 0;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/string.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/structs/PriorityQueue.js":
|
||
/*!**************************************************!*\
|
||
!*** ./node_modules/ol/structs/PriorityQueue.js ***!
|
||
\**************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DROP: function() { return /* binding */ DROP; }\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../asserts.js */ \"./node_modules/ol/asserts.js\");\n/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../obj.js */ \"./node_modules/ol/obj.js\");\n\n/**\n * @module ol/structs/PriorityQueue\n */\n\n\n\n/**\n * @type {number}\n */\nconst DROP = Infinity;\n\n/**\n * @classdesc\n * Priority queue.\n *\n * The implementation is inspired from the Closure Library's Heap class and\n * Python's heapq module.\n *\n * See https://github.com/google/closure-library/blob/master/closure/goog/structs/heap.js\n * and https://hg.python.org/cpython/file/2.7/Lib/heapq.py.\n *\n * @template T\n */\nclass PriorityQueue {\n /**\n * @param {function(T): number} priorityFunction Priority function.\n * @param {function(T): string} keyFunction Key function.\n */\n constructor(priorityFunction, keyFunction) {\n /**\n * @type {function(T): number}\n * @private\n */\n this.priorityFunction_ = priorityFunction;\n\n /**\n * @type {function(T): string}\n * @private\n */\n this.keyFunction_ = keyFunction;\n\n /**\n * @type {Array<T>}\n * @private\n */\n this.elements_ = [];\n\n /**\n * @type {Array<number>}\n * @private\n */\n this.priorities_ = [];\n\n /**\n * @type {!Object<string, boolean>}\n * @private\n */\n this.queuedElements_ = {};\n }\n\n /**\n * FIXME empty description for jsdoc\n */\n clear() {\n this.elements_.length = 0;\n this.priorities_.length = 0;\n (0,_obj_js__WEBPACK_IMPORTED_MODULE_1__.clear)(this.queuedElements_);\n }\n\n /**\n * Remove and return the highest-priority element. O(log N).\n * @return {T} Element.\n */\n dequeue() {\n const elements = this.elements_;\n const priorities = this.priorities_;\n const element = elements[0];\n if (elements.length == 1) {\n elements.length = 0;\n priorities.length = 0;\n } else {\n elements[0] = /** @type {T} */elements.pop();\n priorities[0] = /** @type {number} */priorities.pop();\n this.siftUp_(0);\n }\n const elementKey = this.keyFunction_(element);\n delete this.queuedElements_[elementKey];\n return element;\n }\n\n /**\n * Enqueue an element. O(log N).\n * @param {T} element Element.\n * @return {boolean} The element was added to the queue.\n */\n enqueue(element) {\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_2__.assert)(!(this.keyFunction_(element) in this.queuedElements_), 'Tried to enqueue an `element` that was already added to the queue');\n const priority = this.priorityFunction_(element);\n if (priority != DROP) {\n this.elements_.push(element);\n this.priorities_.push(priority);\n this.queuedElements_[this.keyFunction_(element)] = true;\n this.siftDown_(0, this.elements_.length - 1);\n return true;\n }\n return false;\n }\n\n /**\n * @return {number} Count.\n */\n getCount() {\n return this.elements_.length;\n }\n\n /**\n * Gets the index of the left child of the node at the given index.\n * @param {number} index The index of the node to get the left child for.\n * @return {number} The index of the left child.\n * @private\n */\n getLeftChildIndex_(index) {\n return index * 2 + 1;\n }\n\n /**\n * Gets the index of the right child of the node at the given index.\n * @param {number} index The index of the node to get the right child for.\n * @return {number} The index of the right child.\n * @private\n */\n getRightChildIndex_(index) {\n return index * 2 + 2;\n }\n\n /**\n * Gets the index of the parent of the node at the given index.\n * @param {number} index The index of the node to get the parent for.\n * @return {number} The index of the parent.\n * @private\n */\n getParentIndex_(index) {\n return index - 1 >> 1;\n }\n\n /**\n * Make this a heap. O(N).\n * @private\n */\n heapify_() {\n let i;\n for (i = (this.elements_.length >> 1) - 1; i >= 0; i--) {\n this.siftUp_(i);\n }\n }\n\n /**\n * @return {boolean} Is empty.\n */\n isEmpty() {\n return this.elements_.length === 0;\n }\n\n /**\n * @param {string} key Key.\n * @return {boolean} Is key queued.\n */\n isKeyQueued(key) {\n return key in this.queuedElements_;\n }\n\n /**\n * @param {T} element Element.\n * @return {boolean} Is queued.\n */\n isQueued(element) {\n return this.isKeyQueued(this.keyFunction_(element));\n }\n\n /**\n * @param {number} index The index of the node to move down.\n * @private\n */\n siftUp_(index) {\n const elements = this.elements_;\n const priorities = this.priorities_;\n const count = elements.length;\n const element = elements[index];\n const priority = priorities[index];\n const startIndex = index;\n while (index < count >> 1) {\n const lIndex = this.getLeftChildIndex_(index);\n const rIndex = this.getRightChildIndex_(index);\n const smallerChildIndex = rIndex < count && priorities[rIndex] < priorities[lIndex] ? rIndex : lIndex;\n elements[index] = elements[smallerChildIndex];\n priorities[index] = priorities[smallerChildIndex];\n index = smallerChildIndex;\n }\n elements[index] = element;\n priorities[index] = priority;\n this.siftDown_(startIndex, index);\n }\n\n /**\n * @param {number} startIndex The index of the root.\n * @param {number} index The index of the node to move up.\n * @private\n */\n siftDown_(startIndex, index) {\n const elements = this.elements_;\n const priorities = this.priorities_;\n const element = elements[index];\n const priority = priorities[index];\n while (index > startIndex) {\n const parentIndex = this.getParentIndex_(index);\n if (priorities[parentIndex] > priority) {\n elements[index] = elements[parentIndex];\n priorities[index] = priorities[parentIndex];\n index = parentIndex;\n } else {\n break;\n }\n }\n elements[index] = element;\n priorities[index] = priority;\n }\n\n /**\n * FIXME empty description for jsdoc\n */\n reprioritize() {\n const priorityFunction = this.priorityFunction_;\n const elements = this.elements_;\n const priorities = this.priorities_;\n let index = 0;\n const n = elements.length;\n let element, i, priority;\n for (i = 0; i < n; ++i) {\n element = elements[i];\n priority = priorityFunction(element);\n if (priority == DROP) {\n delete this.queuedElements_[this.keyFunction_(element)];\n } else {\n priorities[index] = priority;\n elements[index++] = element;\n }\n }\n elements.length = index;\n priorities.length = index;\n this.heapify_();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (PriorityQueue);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/structs/PriorityQueue.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/structs/RBush.js":
|
||
/*!******************************************!*\
|
||
!*** ./node_modules/ol/structs/RBush.js ***!
|
||
\******************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var rbush__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rbush */ \"./node_modules/rbush/rbush.min.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../extent.js */ \"./node_modules/ol/extent.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _obj_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../obj.js */ \"./node_modules/ol/obj.js\");\n/**\n * @module ol/structs/RBush\n */\n\n\n\n\n\n/**\n * @typedef {Object} Entry\n * @property {number} minX MinX.\n * @property {number} minY MinY.\n * @property {number} maxX MaxX.\n * @property {number} maxY MaxY.\n * @property {Object} [value] Value.\n */\n\n/**\n * @classdesc\n * Wrapper around the RBush by Vladimir Agafonkin.\n * See https://github.com/mourner/rbush.\n *\n * @template T\n */\nclass RBush {\n /**\n * @param {number} [maxEntries] Max entries.\n */\n constructor(maxEntries) {\n /**\n * @private\n */\n this.rbush_ = new rbush__WEBPACK_IMPORTED_MODULE_0__(maxEntries);\n\n /**\n * A mapping between the objects added to this rbush wrapper\n * and the objects that are actually added to the internal rbush.\n * @private\n * @type {Object<string, Entry>}\n */\n this.items_ = {};\n }\n\n /**\n * Insert a value into the RBush.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {T} value Value.\n */\n insert(extent, value) {\n /** @type {Entry} */\n const item = {\n minX: extent[0],\n minY: extent[1],\n maxX: extent[2],\n maxY: extent[3],\n value: value\n };\n this.rbush_.insert(item);\n this.items_[(0,_util_js__WEBPACK_IMPORTED_MODULE_1__.getUid)(value)] = item;\n }\n\n /**\n * Bulk-insert values into the RBush.\n * @param {Array<import(\"../extent.js\").Extent>} extents Extents.\n * @param {Array<T>} values Values.\n */\n load(extents, values) {\n const items = new Array(values.length);\n for (let i = 0, l = values.length; i < l; i++) {\n const extent = extents[i];\n const value = values[i];\n\n /** @type {Entry} */\n const item = {\n minX: extent[0],\n minY: extent[1],\n maxX: extent[2],\n maxY: extent[3],\n value: value\n };\n items[i] = item;\n this.items_[(0,_util_js__WEBPACK_IMPORTED_MODULE_1__.getUid)(value)] = item;\n }\n this.rbush_.load(items);\n }\n\n /**\n * Remove a value from the RBush.\n * @param {T} value Value.\n * @return {boolean} Removed.\n */\n remove(value) {\n const uid = (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.getUid)(value);\n\n // get the object in which the value was wrapped when adding to the\n // internal rbush. then use that object to do the removal.\n const item = this.items_[uid];\n delete this.items_[uid];\n return this.rbush_.remove(item) !== null;\n }\n\n /**\n * Update the extent of a value in the RBush.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {T} value Value.\n */\n update(extent, value) {\n const item = this.items_[(0,_util_js__WEBPACK_IMPORTED_MODULE_1__.getUid)(value)];\n const bbox = [item.minX, item.minY, item.maxX, item.maxY];\n if (!(0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.equals)(bbox, extent)) {\n this.remove(value);\n this.insert(extent, value);\n }\n }\n\n /**\n * Return all values in the RBush.\n * @return {Array<T>} All.\n */\n getAll() {\n const items = this.rbush_.all();\n return items.map(function (item) {\n return item.value;\n });\n }\n\n /**\n * Return all values in the given extent.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @return {Array<T>} All in extent.\n */\n getInExtent(extent) {\n /** @type {Entry} */\n const bbox = {\n minX: extent[0],\n minY: extent[1],\n maxX: extent[2],\n maxY: extent[3]\n };\n const items = this.rbush_.search(bbox);\n return items.map(function (item) {\n return item.value;\n });\n }\n\n /**\n * Calls a callback function with each value in the tree.\n * If the callback returns a truthy value, this value is returned without\n * checking the rest of the tree.\n * @param {function(T): *} callback Callback.\n * @return {*} Callback return value.\n */\n forEach(callback) {\n return this.forEach_(this.getAll(), callback);\n }\n\n /**\n * Calls a callback function with each value in the provided extent.\n * @param {import(\"../extent.js\").Extent} extent Extent.\n * @param {function(T): *} callback Callback.\n * @return {*} Callback return value.\n */\n forEachInExtent(extent, callback) {\n return this.forEach_(this.getInExtent(extent), callback);\n }\n\n /**\n * @param {Array<T>} values Values.\n * @param {function(T): *} callback Callback.\n * @private\n * @return {*} Callback return value.\n */\n forEach_(values, callback) {\n let result;\n for (let i = 0, l = values.length; i < l; i++) {\n result = callback(values[i]);\n if (result) {\n return result;\n }\n }\n return result;\n }\n\n /**\n * @return {boolean} Is empty.\n */\n isEmpty() {\n return (0,_obj_js__WEBPACK_IMPORTED_MODULE_3__.isEmpty)(this.items_);\n }\n\n /**\n * Remove all values from the RBush.\n */\n clear() {\n this.rbush_.clear();\n this.items_ = {};\n }\n\n /**\n * @param {import(\"../extent.js\").Extent} [extent] Extent.\n * @return {import(\"../extent.js\").Extent} Extent.\n */\n getExtent(extent) {\n const data = this.rbush_.toJSON();\n return (0,_extent_js__WEBPACK_IMPORTED_MODULE_2__.createOrUpdate)(data.minX, data.minY, data.maxX, data.maxY, extent);\n }\n\n /**\n * @param {RBush} rbush R-Tree.\n */\n concat(rbush) {\n this.rbush_.load(rbush.rbush_.all());\n for (const i in rbush.items_) {\n this.items_[i] = rbush.items_[i];\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (RBush);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/structs/RBush.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/style/Circle.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ol/style/Circle.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _RegularShape_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RegularShape.js */ \"./node_modules/ol/style/RegularShape.js\");\n/**\n * @module ol/style/Circle\n */\n\n\n\n/**\n * @typedef {Object} Options\n * @property {import(\"./Fill.js\").default} [fill] Fill style.\n * @property {number} radius Circle radius.\n * @property {import(\"./Stroke.js\").default} [stroke] Stroke style.\n * @property {Array<number>} [displacement=[0,0]] displacement\n * @property {number|import(\"../size.js\").Size} [scale=1] Scale. A two dimensional scale will produce an ellipse.\n * Unless two dimensional scaling is required a better result may be obtained with an appropriate setting for `radius`.\n * @property {number} [rotation=0] Rotation in radians\n * (positive rotation clockwise, meaningful only when used in conjunction with a two dimensional scale).\n * @property {boolean} [rotateWithView=false] Whether to rotate the shape with the view\n * (meaningful only when used in conjunction with a two dimensional scale).\n * @property {\"declutter\"|\"obstacle\"|\"none\"|undefined} [declutterMode] Declutter mode\n */\n\n/**\n * @classdesc\n * Set circle style for vector features.\n * @api\n */\nclass CircleStyle extends _RegularShape_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options ? options : {\n radius: 5\n };\n super({\n points: Infinity,\n fill: options.fill,\n radius: options.radius,\n stroke: options.stroke,\n scale: options.scale !== undefined ? options.scale : 1,\n rotation: options.rotation !== undefined ? options.rotation : 0,\n rotateWithView: options.rotateWithView !== undefined ? options.rotateWithView : false,\n displacement: options.displacement !== undefined ? options.displacement : [0, 0],\n declutterMode: options.declutterMode\n });\n }\n\n /**\n * Clones the style.\n * @return {CircleStyle} The cloned style.\n * @api\n */\n clone() {\n const scale = this.getScale();\n const style = new CircleStyle({\n fill: this.getFill() ? this.getFill().clone() : undefined,\n stroke: this.getStroke() ? this.getStroke().clone() : undefined,\n radius: this.getRadius(),\n scale: Array.isArray(scale) ? scale.slice() : scale,\n rotation: this.getRotation(),\n rotateWithView: this.getRotateWithView(),\n displacement: this.getDisplacement().slice(),\n declutterMode: this.getDeclutterMode()\n });\n style.setOpacity(this.getOpacity());\n return style;\n }\n\n /**\n * Set the circle radius.\n *\n * @param {number} radius Circle radius.\n * @api\n */\n setRadius(radius) {\n this.radius_ = radius;\n this.render();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (CircleStyle);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/style/Circle.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/style/Fill.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/style/Fill.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/style/Fill\n */\n\n/**\n * @typedef {Object} Options\n * @property {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike|null} [color=null] A color, gradient or pattern.\n * See {@link module:ol/color~Color} and {@link module:ol/colorlike~ColorLike} for possible formats.\n * Default null; if null, the Canvas/renderer default black will be used.\n */\n\n/**\n * @classdesc\n * Set fill style for vector features.\n * @api\n */\nclass Fill {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options || {};\n\n /**\n * @private\n * @type {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike|null}\n */\n this.color_ = options.color !== undefined ? options.color : null;\n }\n\n /**\n * Clones the style. The color is not cloned if it is an {@link module:ol/colorlike~ColorLike}.\n * @return {Fill} The cloned style.\n * @api\n */\n clone() {\n const color = this.getColor();\n return new Fill({\n color: Array.isArray(color) ? color.slice() : color || undefined\n });\n }\n\n /**\n * Get the fill color.\n * @return {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike|null} Color.\n * @api\n */\n getColor() {\n return this.color_;\n }\n\n /**\n * Set the color.\n *\n * @param {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike|null} color Color.\n * @api\n */\n setColor(color) {\n this.color_ = color;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Fill);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/style/Fill.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/style/Icon.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/style/Icon.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _ImageState_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ImageState.js */ \"./node_modules/ol/ImageState.js\");\n/* harmony import */ var _Image_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Image.js */ \"./node_modules/ol/style/Image.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../color.js */ \"./node_modules/ol/color.js\");\n/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../asserts.js */ \"./node_modules/ol/asserts.js\");\n/* harmony import */ var _IconImage_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./IconImage.js */ \"./node_modules/ol/style/IconImage.js\");\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n/**\n * @module ol/style/Icon\n */\n\n\n\n\n\n\n\n\n/**\n * @typedef {'fraction' | 'pixels'} IconAnchorUnits\n * Anchor unit can be either a fraction of the icon size or in pixels.\n */\n\n/**\n * @typedef {'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'} IconOrigin\n * Icon origin. One of 'bottom-left', 'bottom-right', 'top-left', 'top-right'.\n */\n\n/**\n * @typedef {Object} Options\n * @property {Array<number>} [anchor=[0.5, 0.5]] Anchor. Default value is the icon center.\n * @property {IconOrigin} [anchorOrigin='top-left'] Origin of the anchor: `bottom-left`, `bottom-right`,\n * `top-left` or `top-right`.\n * @property {IconAnchorUnits} [anchorXUnits='fraction'] Units in which the anchor x value is\n * specified. A value of `'fraction'` indicates the x value is a fraction of the icon. A value of `'pixels'` indicates\n * the x value in pixels.\n * @property {IconAnchorUnits} [anchorYUnits='fraction'] Units in which the anchor y value is\n * specified. A value of `'fraction'` indicates the y value is a fraction of the icon. A value of `'pixels'` indicates\n * the y value in pixels.\n * @property {import(\"../color.js\").Color|string} [color] Color to tint the icon. If not specified,\n * the icon will be left as is.\n * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that you must provide a\n * `crossOrigin` value if you want to access pixel data with the Canvas renderer.\n * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.\n * @property {HTMLImageElement|HTMLCanvasElement|ImageBitmap} [img] Image object for the icon.\n * @property {Array<number>} [displacement=[0, 0]] Displacement of the icon in pixels.\n * Positive values will shift the icon right and up.\n * @property {number} [opacity=1] Opacity of the icon.\n * @property {number} [width] The width of the icon in pixels. This can't be used together with `scale`.\n * @property {number} [height] The height of the icon in pixels. This can't be used together with `scale`.\n * @property {number|import(\"../size.js\").Size} [scale=1] Scale.\n * @property {boolean} [rotateWithView=false] Whether to rotate the icon with the view.\n * @property {number} [rotation=0] Rotation in radians (positive rotation clockwise).\n * @property {Array<number>} [offset=[0, 0]] Offset which, together with `size` and `offsetOrigin`, defines the\n * sub-rectangle to use from the original (sprite) image.\n * @property {IconOrigin} [offsetOrigin='top-left'] Origin of the offset: `bottom-left`, `bottom-right`,\n * `top-left` or `top-right`.\n * @property {import(\"../size.js\").Size} [size] Icon size in pixels. Used together with `offset` to define the\n * sub-rectangle to use from the original (sprite) image.\n * @property {string} [src] Image source URI.\n * @property {\"declutter\"|\"obstacle\"|\"none\"|undefined} [declutterMode] Declutter mode.\n */\n\n/**\n * @param {number} width The width.\n * @param {number} height The height.\n * @param {number|undefined} wantedWidth The wanted width.\n * @param {number|undefined} wantedHeight The wanted height.\n * @return {number|Array<number>} The scale.\n */\nfunction calculateScale(width, height, wantedWidth, wantedHeight) {\n if (wantedWidth !== undefined && wantedHeight !== undefined) {\n return [wantedWidth / width, wantedHeight / height];\n }\n if (wantedWidth !== undefined) {\n return wantedWidth / width;\n }\n if (wantedHeight !== undefined) {\n return wantedHeight / height;\n }\n return 1;\n}\n\n/**\n * @classdesc\n * Set icon style for vector features.\n * @api\n */\nclass Icon extends _Image_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options || {};\n\n /**\n * @type {number}\n */\n const opacity = options.opacity !== undefined ? options.opacity : 1;\n\n /**\n * @type {number}\n */\n const rotation = options.rotation !== undefined ? options.rotation : 0;\n\n /**\n * @type {number|import(\"../size.js\").Size}\n */\n const scale = options.scale !== undefined ? options.scale : 1;\n\n /**\n * @type {boolean}\n */\n const rotateWithView = options.rotateWithView !== undefined ? options.rotateWithView : false;\n super({\n opacity: opacity,\n rotation: rotation,\n scale: scale,\n displacement: options.displacement !== undefined ? options.displacement : [0, 0],\n rotateWithView: rotateWithView,\n declutterMode: options.declutterMode\n });\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.anchor_ = options.anchor !== undefined ? options.anchor : [0.5, 0.5];\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.normalizedAnchor_ = null;\n\n /**\n * @private\n * @type {IconOrigin}\n */\n this.anchorOrigin_ = options.anchorOrigin !== undefined ? options.anchorOrigin : 'top-left';\n\n /**\n * @private\n * @type {IconAnchorUnits}\n */\n this.anchorXUnits_ = options.anchorXUnits !== undefined ? options.anchorXUnits : 'fraction';\n\n /**\n * @private\n * @type {IconAnchorUnits}\n */\n this.anchorYUnits_ = options.anchorYUnits !== undefined ? options.anchorYUnits : 'fraction';\n\n /**\n * @private\n * @type {?string}\n */\n this.crossOrigin_ = options.crossOrigin !== undefined ? options.crossOrigin : null;\n const image = options.img !== undefined ? options.img : null;\n let cacheKey = options.src;\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_1__.assert)(!(cacheKey !== undefined && image), '`image` and `src` cannot be provided at the same time');\n if ((cacheKey === undefined || cacheKey.length === 0) && image) {\n cacheKey = /** @type {HTMLImageElement} */image.src || (0,_util_js__WEBPACK_IMPORTED_MODULE_2__.getUid)(image);\n }\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_1__.assert)(cacheKey !== undefined && cacheKey.length > 0, 'A defined and non-empty `src` or `image` must be provided');\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_1__.assert)(!((options.width !== undefined || options.height !== undefined) && options.scale !== undefined), '`width` or `height` cannot be provided together with `scale`');\n let imageState;\n if (options.src !== undefined) {\n imageState = _ImageState_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].IDLE;\n } else if (image !== undefined) {\n if (image instanceof HTMLImageElement) {\n if (image.complete) {\n imageState = image.src ? _ImageState_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].LOADED : _ImageState_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].IDLE;\n } else {\n imageState = _ImageState_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].LOADING;\n }\n } else {\n imageState = _ImageState_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].LOADED;\n }\n }\n\n /**\n * @private\n * @type {import(\"../color.js\").Color}\n */\n this.color_ = options.color !== undefined ? (0,_color_js__WEBPACK_IMPORTED_MODULE_4__.asArray)(options.color) : null;\n\n /**\n * @private\n * @type {import(\"./IconImage.js\").default}\n */\n this.iconImage_ = (0,_IconImage_js__WEBPACK_IMPORTED_MODULE_5__.get)(image, /** @type {string} */cacheKey, this.crossOrigin_, imageState, this.color_);\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.offset_ = options.offset !== undefined ? options.offset : [0, 0];\n /**\n * @private\n * @type {IconOrigin}\n */\n this.offsetOrigin_ = options.offsetOrigin !== undefined ? options.offsetOrigin : 'top-left';\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.origin_ = null;\n\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n this.size_ = options.size !== undefined ? options.size : null;\n\n /**\n * Calculate the scale if width or height were given.\n */\n if (options.width !== undefined || options.height !== undefined) {\n let width, height;\n if (options.size) {\n [width, height] = options.size;\n } else {\n const image = this.getImage(1);\n if (image.width && image.height) {\n width = image.width;\n height = image.height;\n } else if (image instanceof HTMLImageElement) {\n this.initialOptions_ = options;\n const onload = () => {\n this.unlistenImageChange(onload);\n if (!this.initialOptions_) {\n return;\n }\n const imageSize = this.iconImage_.getSize();\n this.setScale(calculateScale(imageSize[0], imageSize[1], options.width, options.height));\n };\n this.listenImageChange(onload);\n return;\n }\n }\n if (width !== undefined) {\n this.setScale(calculateScale(width, height, options.width, options.height));\n }\n }\n }\n\n /**\n * Clones the style. The underlying Image/HTMLCanvasElement is not cloned.\n * @return {Icon} The cloned style.\n * @api\n */\n clone() {\n let scale, width, height;\n if (this.initialOptions_) {\n width = this.initialOptions_.width;\n height = this.initialOptions_.height;\n } else {\n scale = this.getScale();\n scale = Array.isArray(scale) ? scale.slice() : scale;\n }\n return new Icon({\n anchor: this.anchor_.slice(),\n anchorOrigin: this.anchorOrigin_,\n anchorXUnits: this.anchorXUnits_,\n anchorYUnits: this.anchorYUnits_,\n color: this.color_ && this.color_.slice ? this.color_.slice() : this.color_ || undefined,\n crossOrigin: this.crossOrigin_,\n offset: this.offset_.slice(),\n offsetOrigin: this.offsetOrigin_,\n opacity: this.getOpacity(),\n rotateWithView: this.getRotateWithView(),\n rotation: this.getRotation(),\n scale,\n width,\n height,\n size: this.size_ !== null ? this.size_.slice() : undefined,\n src: this.getSrc(),\n displacement: this.getDisplacement().slice(),\n declutterMode: this.getDeclutterMode()\n });\n }\n\n /**\n * Get the anchor point in pixels. The anchor determines the center point for the\n * symbolizer.\n * @return {Array<number>} Anchor.\n * @api\n */\n getAnchor() {\n let anchor = this.normalizedAnchor_;\n if (!anchor) {\n anchor = this.anchor_;\n const size = this.getSize();\n if (this.anchorXUnits_ == 'fraction' || this.anchorYUnits_ == 'fraction') {\n if (!size) {\n return null;\n }\n anchor = this.anchor_.slice();\n if (this.anchorXUnits_ == 'fraction') {\n anchor[0] *= size[0];\n }\n if (this.anchorYUnits_ == 'fraction') {\n anchor[1] *= size[1];\n }\n }\n if (this.anchorOrigin_ != 'top-left') {\n if (!size) {\n return null;\n }\n if (anchor === this.anchor_) {\n anchor = this.anchor_.slice();\n }\n if (this.anchorOrigin_ == 'top-right' || this.anchorOrigin_ == 'bottom-right') {\n anchor[0] = -anchor[0] + size[0];\n }\n if (this.anchorOrigin_ == 'bottom-left' || this.anchorOrigin_ == 'bottom-right') {\n anchor[1] = -anchor[1] + size[1];\n }\n }\n this.normalizedAnchor_ = anchor;\n }\n const displacement = this.getDisplacement();\n const scale = this.getScaleArray();\n // anchor is scaled by renderer but displacement should not be scaled\n // so divide by scale here\n return [anchor[0] - displacement[0] / scale[0], anchor[1] + displacement[1] / scale[1]];\n }\n\n /**\n * Set the anchor point. The anchor determines the center point for the\n * symbolizer.\n *\n * @param {Array<number>} anchor Anchor.\n * @api\n */\n setAnchor(anchor) {\n this.anchor_ = anchor;\n this.normalizedAnchor_ = null;\n }\n\n /**\n * Get the icon color.\n * @return {import(\"../color.js\").Color} Color.\n * @api\n */\n getColor() {\n return this.color_;\n }\n\n /**\n * Get the image icon.\n * @param {number} pixelRatio Pixel ratio.\n * @return {HTMLImageElement|HTMLCanvasElement|ImageBitmap} Image or Canvas element. If the Icon\n * style was configured with `src` or with a not let loaded `img`, an `ImageBitmap` will be returned.\n * @api\n */\n getImage(pixelRatio) {\n return this.iconImage_.getImage(pixelRatio);\n }\n\n /**\n * Get the pixel ratio.\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} The pixel ratio of the image.\n * @api\n */\n getPixelRatio(pixelRatio) {\n return this.iconImage_.getPixelRatio(pixelRatio);\n }\n\n /**\n * @return {import(\"../size.js\").Size} Image size.\n */\n getImageSize() {\n return this.iconImage_.getSize();\n }\n\n /**\n * @return {import(\"../ImageState.js\").default} Image state.\n */\n getImageState() {\n return this.iconImage_.getImageState();\n }\n\n /**\n * @return {HTMLImageElement|HTMLCanvasElement|ImageBitmap} Image element.\n */\n getHitDetectionImage() {\n return this.iconImage_.getHitDetectionImage();\n }\n\n /**\n * Get the origin of the symbolizer.\n * @return {Array<number>} Origin.\n * @api\n */\n getOrigin() {\n if (this.origin_) {\n return this.origin_;\n }\n let offset = this.offset_;\n if (this.offsetOrigin_ != 'top-left') {\n const size = this.getSize();\n const iconImageSize = this.iconImage_.getSize();\n if (!size || !iconImageSize) {\n return null;\n }\n offset = offset.slice();\n if (this.offsetOrigin_ == 'top-right' || this.offsetOrigin_ == 'bottom-right') {\n offset[0] = iconImageSize[0] - size[0] - offset[0];\n }\n if (this.offsetOrigin_ == 'bottom-left' || this.offsetOrigin_ == 'bottom-right') {\n offset[1] = iconImageSize[1] - size[1] - offset[1];\n }\n }\n this.origin_ = offset;\n return this.origin_;\n }\n\n /**\n * Get the image URL.\n * @return {string|undefined} Image src.\n * @api\n */\n getSrc() {\n return this.iconImage_.getSrc();\n }\n\n /**\n * Get the size of the icon (in pixels).\n * @return {import(\"../size.js\").Size} Image size.\n * @api\n */\n getSize() {\n return !this.size_ ? this.iconImage_.getSize() : this.size_;\n }\n\n /**\n * Get the width of the icon (in pixels). Will return undefined when the icon image is not yet loaded.\n * @return {number} Icon width (in pixels).\n * @api\n */\n getWidth() {\n const scale = this.getScaleArray();\n if (this.size_) {\n return this.size_[0] * scale[0];\n }\n if (this.iconImage_.getImageState() == _ImageState_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].LOADED) {\n return this.iconImage_.getSize()[0] * scale[0];\n }\n return undefined;\n }\n\n /**\n * Get the height of the icon (in pixels). Will return undefined when the icon image is not yet loaded.\n * @return {number} Icon height (in pixels).\n * @api\n */\n getHeight() {\n const scale = this.getScaleArray();\n if (this.size_) {\n return this.size_[1] * scale[1];\n }\n if (this.iconImage_.getImageState() == _ImageState_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].LOADED) {\n return this.iconImage_.getSize()[1] * scale[1];\n }\n return undefined;\n }\n\n /**\n * Set the scale.\n *\n * @param {number|import(\"../size.js\").Size} scale Scale.\n * @api\n */\n setScale(scale) {\n delete this.initialOptions_;\n super.setScale(scale);\n }\n\n /**\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n */\n listenImageChange(listener) {\n this.iconImage_.addEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].CHANGE, listener);\n }\n\n /**\n * Load not yet loaded URI.\n * When rendering a feature with an icon style, the vector renderer will\n * automatically call this method. However, you might want to call this\n * method yourself for preloading or other purposes.\n * @api\n */\n load() {\n this.iconImage_.load();\n }\n\n /**\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n */\n unlistenImageChange(listener) {\n this.iconImage_.removeEventListener(_events_EventType_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"].CHANGE, listener);\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Icon);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/style/Icon.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/style/IconImage.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/style/IconImage.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ get: function() { return /* binding */ get; }\n/* harmony export */ });\n/* harmony import */ var _events_Target_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../events/Target.js */ \"./node_modules/ol/events/Target.js\");\n/* harmony import */ var _events_EventType_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../events/EventType.js */ \"./node_modules/ol/events/EventType.js\");\n/* harmony import */ var _ImageState_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ImageState.js */ \"./node_modules/ol/ImageState.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../color.js */ \"./node_modules/ol/color.js\");\n/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../dom.js */ \"./node_modules/ol/dom.js\");\n/* harmony import */ var _Image_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Image.js */ \"./node_modules/ol/Image.js\");\n/* harmony import */ var _IconImageCache_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./IconImageCache.js */ \"./node_modules/ol/style/IconImageCache.js\");\n/**\n * @module ol/style/IconImage\n */\n\n\n\n\n\n\n\n\n\n/**\n * @type {CanvasRenderingContext2D}\n */\nlet taintedTestContext = null;\nclass IconImage extends _events_Target_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {HTMLImageElement|HTMLCanvasElement|ImageBitmap} image Image.\n * @param {string|undefined} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../ImageState.js\").default} imageState Image state.\n * @param {import(\"../color.js\").Color} color Color.\n */\n constructor(image, src, crossOrigin, imageState, color) {\n super();\n\n /**\n * @private\n * @type {HTMLImageElement|HTMLCanvasElement|ImageBitmap}\n */\n this.hitDetectionImage_ = null;\n\n /**\n * @private\n * @type {HTMLImageElement|HTMLCanvasElement|ImageBitmap}\n */\n this.image_ = image;\n\n /**\n * @private\n * @type {string|null}\n */\n this.crossOrigin_ = crossOrigin;\n\n /**\n * @private\n * @type {Object<number, HTMLCanvasElement>}\n */\n this.canvas_ = {};\n\n /**\n * @private\n * @type {import(\"../color.js\").Color}\n */\n this.color_ = color;\n\n /**\n * @private\n * @type {import(\"../ImageState.js\").default}\n */\n this.imageState_ = imageState === undefined ? _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].IDLE : imageState;\n\n /**\n * @private\n * @type {import(\"../size.js\").Size|null}\n */\n this.size_ = image && image.width && image.height ? [image.width, image.height] : null;\n\n /**\n * @private\n * @type {string|undefined}\n */\n this.src_ = src;\n\n /**\n * @private\n */\n this.tainted_;\n }\n\n /**\n * @private\n */\n initializeImage_() {\n this.image_ = new Image();\n if (this.crossOrigin_ !== null) {\n this.image_.crossOrigin = this.crossOrigin_;\n }\n }\n\n /**\n * @private\n * @return {boolean} The image canvas is tainted.\n */\n isTainted_() {\n if (this.tainted_ === undefined && this.imageState_ === _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LOADED) {\n if (!taintedTestContext) {\n taintedTestContext = (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.createCanvasContext2D)(1, 1, undefined, {\n willReadFrequently: true\n });\n }\n taintedTestContext.drawImage(this.image_, 0, 0);\n try {\n taintedTestContext.getImageData(0, 0, 1, 1);\n this.tainted_ = false;\n } catch (e) {\n taintedTestContext = null;\n this.tainted_ = true;\n }\n }\n return this.tainted_ === true;\n }\n\n /**\n * @private\n */\n dispatchChangeEvent_() {\n this.dispatchEvent(_events_EventType_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].CHANGE);\n }\n\n /**\n * @private\n */\n handleImageError_() {\n this.imageState_ = _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ERROR;\n this.dispatchChangeEvent_();\n }\n\n /**\n * @private\n */\n handleImageLoad_() {\n this.imageState_ = _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LOADED;\n this.size_ = [this.image_.width, this.image_.height];\n this.dispatchChangeEvent_();\n }\n\n /**\n * @param {number} pixelRatio Pixel ratio.\n * @return {HTMLImageElement|HTMLCanvasElement|ImageBitmap} Image or Canvas element or image bitmap.\n */\n getImage(pixelRatio) {\n if (!this.image_) {\n this.initializeImage_();\n }\n this.replaceColor_(pixelRatio);\n return this.canvas_[pixelRatio] ? this.canvas_[pixelRatio] : this.image_;\n }\n\n /**\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} Image or Canvas element.\n */\n getPixelRatio(pixelRatio) {\n this.replaceColor_(pixelRatio);\n return this.canvas_[pixelRatio] ? pixelRatio : 1;\n }\n\n /**\n * @return {import(\"../ImageState.js\").default} Image state.\n */\n getImageState() {\n return this.imageState_;\n }\n\n /**\n * @return {HTMLImageElement|HTMLCanvasElement|ImageBitmap} Image element.\n */\n getHitDetectionImage() {\n if (!this.image_) {\n this.initializeImage_();\n }\n if (!this.hitDetectionImage_) {\n if (this.isTainted_()) {\n const width = this.size_[0];\n const height = this.size_[1];\n const context = (0,_dom_js__WEBPACK_IMPORTED_MODULE_2__.createCanvasContext2D)(width, height);\n context.fillRect(0, 0, width, height);\n this.hitDetectionImage_ = context.canvas;\n } else {\n this.hitDetectionImage_ = this.image_;\n }\n }\n return this.hitDetectionImage_;\n }\n\n /**\n * Get the size of the icon (in pixels).\n * @return {import(\"../size.js\").Size} Image size.\n */\n getSize() {\n return this.size_;\n }\n\n /**\n * @return {string|undefined} Image src.\n */\n getSrc() {\n return this.src_;\n }\n\n /**\n * Load not yet loaded URI.\n */\n load() {\n if (this.imageState_ !== _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].IDLE) {\n return;\n }\n if (!this.image_) {\n this.initializeImage_();\n }\n this.imageState_ = _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LOADING;\n try {\n if (this.src_ !== undefined) {\n /** @type {HTMLImageElement} */this.image_.src = this.src_;\n }\n } catch (e) {\n this.handleImageError_();\n }\n if (this.image_ instanceof HTMLImageElement) {\n (0,_Image_js__WEBPACK_IMPORTED_MODULE_4__.decodeFallback)(this.image_, this.src_).then(image => {\n this.image_ = image;\n this.handleImageLoad_();\n }).catch(this.handleImageError_.bind(this));\n }\n }\n\n /**\n * @param {number} pixelRatio Pixel ratio.\n * @private\n */\n replaceColor_(pixelRatio) {\n if (!this.color_ || this.canvas_[pixelRatio] || this.imageState_ !== _ImageState_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].LOADED) {\n return;\n }\n const image = this.image_;\n const canvas = document.createElement('canvas');\n canvas.width = Math.ceil(image.width * pixelRatio);\n canvas.height = Math.ceil(image.height * pixelRatio);\n const ctx = canvas.getContext('2d');\n ctx.scale(pixelRatio, pixelRatio);\n ctx.drawImage(image, 0, 0);\n ctx.globalCompositeOperation = 'multiply';\n ctx.fillStyle = (0,_color_js__WEBPACK_IMPORTED_MODULE_5__.asString)(this.color_);\n ctx.fillRect(0, 0, canvas.width / pixelRatio, canvas.height / pixelRatio);\n ctx.globalCompositeOperation = 'destination-in';\n ctx.drawImage(image, 0, 0);\n this.canvas_[pixelRatio] = canvas;\n }\n}\n\n/**\n * @param {HTMLImageElement|HTMLCanvasElement|ImageBitmap} image Image.\n * @param {string} cacheKey Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../ImageState.js\").default} imageState Image state.\n * @param {import(\"../color.js\").Color} color Color.\n * @return {IconImage} Icon image.\n */\nfunction get(image, cacheKey, crossOrigin, imageState, color) {\n let iconImage = cacheKey === undefined ? undefined : _IconImageCache_js__WEBPACK_IMPORTED_MODULE_6__.shared.get(cacheKey, crossOrigin, color);\n if (!iconImage) {\n iconImage = new IconImage(image, image instanceof HTMLImageElement ? image.src || undefined : cacheKey, crossOrigin, imageState, color);\n _IconImageCache_js__WEBPACK_IMPORTED_MODULE_6__.shared.set(cacheKey, crossOrigin, color, iconImage);\n }\n return iconImage;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (IconImage);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/style/IconImage.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/style/IconImageCache.js":
|
||
/*!*************************************************!*\
|
||
!*** ./node_modules/ol/style/IconImageCache.js ***!
|
||
\*************************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ shared: function() { return /* binding */ shared; }\n/* harmony export */ });\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../color.js */ \"./node_modules/ol/color.js\");\n/**\n * @module ol/style/IconImageCache\n */\n\n\n/**\n * @classdesc\n * Singleton class. Available through {@link module:ol/style/IconImageCache.shared}.\n */\nclass IconImageCache {\n constructor() {\n /**\n * @type {!Object<string, import(\"./IconImage.js\").default>}\n * @private\n */\n this.cache_ = {};\n\n /**\n * @type {number}\n * @private\n */\n this.cacheSize_ = 0;\n\n /**\n * @type {number}\n * @private\n */\n this.maxCacheSize_ = 32;\n }\n\n /**\n * FIXME empty description for jsdoc\n */\n clear() {\n this.cache_ = {};\n this.cacheSize_ = 0;\n }\n\n /**\n * @return {boolean} Can expire cache.\n */\n canExpireCache() {\n return this.cacheSize_ > this.maxCacheSize_;\n }\n\n /**\n * FIXME empty description for jsdoc\n */\n expire() {\n if (this.canExpireCache()) {\n let i = 0;\n for (const key in this.cache_) {\n const iconImage = this.cache_[key];\n if ((i++ & 3) === 0 && !iconImage.hasListener()) {\n delete this.cache_[key];\n --this.cacheSize_;\n }\n }\n }\n }\n\n /**\n * @param {string} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../color.js\").Color} color Color.\n * @return {import(\"./IconImage.js\").default} Icon image.\n */\n get(src, crossOrigin, color) {\n const key = getKey(src, crossOrigin, color);\n return key in this.cache_ ? this.cache_[key] : null;\n }\n\n /**\n * @param {string} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../color.js\").Color} color Color.\n * @param {import(\"./IconImage.js\").default} iconImage Icon image.\n */\n set(src, crossOrigin, color, iconImage) {\n const key = getKey(src, crossOrigin, color);\n this.cache_[key] = iconImage;\n ++this.cacheSize_;\n }\n\n /**\n * Set the cache size of the icon cache. Default is `32`. Change this value when\n * your map uses more than 32 different icon images and you are not caching icon\n * styles on the application level.\n * @param {number} maxCacheSize Cache max size.\n * @api\n */\n setSize(maxCacheSize) {\n this.maxCacheSize_ = maxCacheSize;\n this.expire();\n }\n}\n\n/**\n * @param {string} src Src.\n * @param {?string} crossOrigin Cross origin.\n * @param {import(\"../color.js\").Color} color Color.\n * @return {string} Cache key.\n */\nfunction getKey(src, crossOrigin, color) {\n const colorString = color ? (0,_color_js__WEBPACK_IMPORTED_MODULE_0__.asString)(color) : 'null';\n return crossOrigin + ':' + src + ':' + colorString;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (IconImageCache);\n\n/**\n * The {@link module:ol/style/IconImageCache~IconImageCache} for\n * {@link module:ol/style/Icon~Icon} images.\n * @api\n */\nconst shared = new IconImageCache();\n\n//# sourceURL=webpack://complexes/./node_modules/ol/style/IconImageCache.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/style/Image.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/ol/style/Image.js ***!
|
||
\****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util.js */ \"./node_modules/ol/util.js\");\n/* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../size.js */ \"./node_modules/ol/size.js\");\n/**\n * @module ol/style/Image\n */\n\n\n\n/**\n * @typedef {Object} Options\n * @property {number} opacity Opacity.\n * @property {boolean} rotateWithView If the image should get rotated with the view.\n * @property {number} rotation Rotation.\n * @property {number|import(\"../size.js\").Size} scale Scale.\n * @property {Array<number>} displacement Displacement.\n * @property {\"declutter\"|\"obstacle\"|\"none\"|undefined} declutterMode Declutter mode: `declutter`, `obstacle`, 'none */\n\n/**\n * @classdesc\n * A base class used for creating subclasses and not instantiated in\n * apps. Base class for {@link module:ol/style/Icon~Icon}, {@link module:ol/style/Circle~CircleStyle} and\n * {@link module:ol/style/RegularShape~RegularShape}.\n * @abstract\n * @api\n */\nclass ImageStyle {\n /**\n * @param {Options} options Options.\n */\n constructor(options) {\n /**\n * @private\n * @type {number}\n */\n this.opacity_ = options.opacity;\n\n /**\n * @private\n * @type {boolean}\n */\n this.rotateWithView_ = options.rotateWithView;\n\n /**\n * @private\n * @type {number}\n */\n this.rotation_ = options.rotation;\n\n /**\n * @private\n * @type {number|import(\"../size.js\").Size}\n */\n this.scale_ = options.scale;\n\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n this.scaleArray_ = (0,_size_js__WEBPACK_IMPORTED_MODULE_0__.toSize)(options.scale);\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.displacement_ = options.displacement;\n\n /**\n * @private\n * @type {\"declutter\"|\"obstacle\"|\"none\"|undefined}\n */\n this.declutterMode_ = options.declutterMode;\n }\n\n /**\n * Clones the style.\n * @return {ImageStyle} The cloned style.\n * @api\n */\n clone() {\n const scale = this.getScale();\n return new ImageStyle({\n opacity: this.getOpacity(),\n scale: Array.isArray(scale) ? scale.slice() : scale,\n rotation: this.getRotation(),\n rotateWithView: this.getRotateWithView(),\n displacement: this.getDisplacement().slice(),\n declutterMode: this.getDeclutterMode()\n });\n }\n\n /**\n * Get the symbolizer opacity.\n * @return {number} Opacity.\n * @api\n */\n getOpacity() {\n return this.opacity_;\n }\n\n /**\n * Determine whether the symbolizer rotates with the map.\n * @return {boolean} Rotate with map.\n * @api\n */\n getRotateWithView() {\n return this.rotateWithView_;\n }\n\n /**\n * Get the symoblizer rotation.\n * @return {number} Rotation.\n * @api\n */\n getRotation() {\n return this.rotation_;\n }\n\n /**\n * Get the symbolizer scale.\n * @return {number|import(\"../size.js\").Size} Scale.\n * @api\n */\n getScale() {\n return this.scale_;\n }\n\n /**\n * Get the symbolizer scale array.\n * @return {import(\"../size.js\").Size} Scale array.\n */\n getScaleArray() {\n return this.scaleArray_;\n }\n\n /**\n * Get the displacement of the shape\n * @return {Array<number>} Shape's center displacement\n * @api\n */\n getDisplacement() {\n return this.displacement_;\n }\n\n /**\n * Get the declutter mode of the shape\n * @return {\"declutter\"|\"obstacle\"|\"none\"|undefined} Shape's declutter mode\n * @api\n */\n getDeclutterMode() {\n return this.declutterMode_;\n }\n\n /**\n * Get the anchor point in pixels. The anchor determines the center point for the\n * symbolizer.\n * @abstract\n * @return {Array<number>} Anchor.\n */\n getAnchor() {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.abstract)();\n }\n\n /**\n * Get the image element for the symbolizer.\n * @abstract\n * @param {number} pixelRatio Pixel ratio.\n * @return {import('../DataTile.js').ImageLike} Image element.\n */\n getImage(pixelRatio) {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.abstract)();\n }\n\n /**\n * @abstract\n * @return {import('../DataTile.js').ImageLike} Image element.\n */\n getHitDetectionImage() {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.abstract)();\n }\n\n /**\n * Get the image pixel ratio.\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} Pixel ratio.\n */\n getPixelRatio(pixelRatio) {\n return 1;\n }\n\n /**\n * @abstract\n * @return {import(\"../ImageState.js\").default} Image state.\n */\n getImageState() {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.abstract)();\n }\n\n /**\n * @abstract\n * @return {import(\"../size.js\").Size} Image size.\n */\n getImageSize() {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.abstract)();\n }\n\n /**\n * Get the origin of the symbolizer.\n * @abstract\n * @return {Array<number>} Origin.\n */\n getOrigin() {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.abstract)();\n }\n\n /**\n * Get the size of the symbolizer (in pixels).\n * @abstract\n * @return {import(\"../size.js\").Size} Size.\n */\n getSize() {\n return (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.abstract)();\n }\n\n /**\n * Set the displacement.\n *\n * @param {Array<number>} displacement Displacement.\n * @api\n */\n setDisplacement(displacement) {\n this.displacement_ = displacement;\n }\n\n /**\n * Set the opacity.\n *\n * @param {number} opacity Opacity.\n * @api\n */\n setOpacity(opacity) {\n this.opacity_ = opacity;\n }\n\n /**\n * Set whether to rotate the style with the view.\n *\n * @param {boolean} rotateWithView Rotate with map.\n * @api\n */\n setRotateWithView(rotateWithView) {\n this.rotateWithView_ = rotateWithView;\n }\n\n /**\n * Set the rotation.\n *\n * @param {number} rotation Rotation.\n * @api\n */\n setRotation(rotation) {\n this.rotation_ = rotation;\n }\n\n /**\n * Set the scale.\n *\n * @param {number|import(\"../size.js\").Size} scale Scale.\n * @api\n */\n setScale(scale) {\n this.scale_ = scale;\n this.scaleArray_ = (0,_size_js__WEBPACK_IMPORTED_MODULE_0__.toSize)(scale);\n }\n\n /**\n * @abstract\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n */\n listenImageChange(listener) {\n (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.abstract)();\n }\n\n /**\n * Load not yet loaded URI.\n * @abstract\n */\n load() {\n (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.abstract)();\n }\n\n /**\n * @abstract\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n */\n unlistenImageChange(listener) {\n (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.abstract)();\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (ImageStyle);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/style/Image.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/style/RegularShape.js":
|
||
/*!***********************************************!*\
|
||
!*** ./node_modules/ol/style/RegularShape.js ***!
|
||
\***********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ImageState_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../ImageState.js */ \"./node_modules/ol/ImageState.js\");\n/* harmony import */ var _Image_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Image.js */ \"./node_modules/ol/style/Image.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../color.js */ \"./node_modules/ol/color.js\");\n/* harmony import */ var _colorlike_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../colorlike.js */ \"./node_modules/ol/colorlike.js\");\n/* harmony import */ var _dom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../dom.js */ \"./node_modules/ol/dom.js\");\n/* harmony import */ var _render_canvas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../render/canvas.js */ \"./node_modules/ol/render/canvas.js\");\n/**\n * @module ol/style/RegularShape\n */\n\n\n\n\n\n\n\n\n/**\n * Specify radius for regular polygons, or radius1 and radius2 for stars.\n * @typedef {Object} Options\n * @property {import(\"./Fill.js\").default} [fill] Fill style.\n * @property {number} points Number of points for stars and regular polygons. In case of a polygon, the number of points\n * is the number of sides.\n * @property {number} [radius] Radius of a regular polygon.\n * @property {number} [radius1] First radius of a star. Ignored if radius is set.\n * @property {number} [radius2] Second radius of a star.\n * @property {number} [angle=0] Shape's angle in radians. A value of 0 will have one of the shape's points facing up.\n * @property {Array<number>} [displacement=[0, 0]] Displacement of the shape in pixels.\n * Positive values will shift the shape right and up.\n * @property {import(\"./Stroke.js\").default} [stroke] Stroke style.\n * @property {number} [rotation=0] Rotation in radians (positive rotation clockwise).\n * @property {boolean} [rotateWithView=false] Whether to rotate the shape with the view.\n * @property {number|import(\"../size.js\").Size} [scale=1] Scale. Unless two dimensional scaling is required a better\n * result may be obtained with appropriate settings for `radius`, `radius1` and `radius2`.\n * @property {\"declutter\"|\"obstacle\"|\"none\"|undefined} [declutterMode] Declutter mode.\n */\n\n/**\n * @typedef {Object} RenderOptions\n * @property {import(\"../colorlike.js\").ColorLike|undefined} strokeStyle StrokeStyle.\n * @property {number} strokeWidth StrokeWidth.\n * @property {number} size Size.\n * @property {CanvasLineCap} lineCap LineCap.\n * @property {Array<number>|null} lineDash LineDash.\n * @property {number} lineDashOffset LineDashOffset.\n * @property {CanvasLineJoin} lineJoin LineJoin.\n * @property {number} miterLimit MiterLimit.\n */\n\n/**\n * @classdesc\n * Set regular shape style for vector features. The resulting shape will be\n * a regular polygon when `radius` is provided, or a star when `radius1` and\n * `radius2` are provided.\n * @api\n */\nclass RegularShape extends _Image_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n /**\n * @param {Options} options Options.\n */\n constructor(options) {\n /**\n * @type {boolean}\n */\n const rotateWithView = options.rotateWithView !== undefined ? options.rotateWithView : false;\n super({\n opacity: 1,\n rotateWithView: rotateWithView,\n rotation: options.rotation !== undefined ? options.rotation : 0,\n scale: options.scale !== undefined ? options.scale : 1,\n displacement: options.displacement !== undefined ? options.displacement : [0, 0],\n declutterMode: options.declutterMode\n });\n\n /**\n * @private\n * @type {Object<number, HTMLCanvasElement>}\n */\n this.canvases_;\n\n /**\n * @private\n * @type {HTMLCanvasElement|null}\n */\n this.hitDetectionCanvas_ = null;\n\n /**\n * @private\n * @type {import(\"./Fill.js\").default|null}\n */\n this.fill_ = options.fill !== undefined ? options.fill : null;\n\n /**\n * @private\n * @type {Array<number>}\n */\n this.origin_ = [0, 0];\n\n /**\n * @private\n * @type {number}\n */\n this.points_ = options.points;\n\n /**\n * @protected\n * @type {number}\n */\n this.radius_ = options.radius !== undefined ? options.radius : options.radius1;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.radius2_ = options.radius2;\n\n /**\n * @private\n * @type {number}\n */\n this.angle_ = options.angle !== undefined ? options.angle : 0;\n\n /**\n * @private\n * @type {import(\"./Stroke.js\").default|null}\n */\n this.stroke_ = options.stroke !== undefined ? options.stroke : null;\n\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n this.size_;\n\n /**\n * @private\n * @type {RenderOptions}\n */\n this.renderOptions_;\n this.render();\n }\n\n /**\n * Clones the style.\n * @return {RegularShape} The cloned style.\n * @api\n */\n clone() {\n const scale = this.getScale();\n const style = new RegularShape({\n fill: this.getFill() ? this.getFill().clone() : undefined,\n points: this.getPoints(),\n radius: this.getRadius(),\n radius2: this.getRadius2(),\n angle: this.getAngle(),\n stroke: this.getStroke() ? this.getStroke().clone() : undefined,\n rotation: this.getRotation(),\n rotateWithView: this.getRotateWithView(),\n scale: Array.isArray(scale) ? scale.slice() : scale,\n displacement: this.getDisplacement().slice(),\n declutterMode: this.getDeclutterMode()\n });\n style.setOpacity(this.getOpacity());\n return style;\n }\n\n /**\n * Get the anchor point in pixels. The anchor determines the center point for the\n * symbolizer.\n * @return {Array<number>} Anchor.\n * @api\n */\n getAnchor() {\n const size = this.size_;\n const displacement = this.getDisplacement();\n const scale = this.getScaleArray();\n // anchor is scaled by renderer but displacement should not be scaled\n // so divide by scale here\n return [size[0] / 2 - displacement[0] / scale[0], size[1] / 2 + displacement[1] / scale[1]];\n }\n\n /**\n * Get the angle used in generating the shape.\n * @return {number} Shape's rotation in radians.\n * @api\n */\n getAngle() {\n return this.angle_;\n }\n\n /**\n * Get the fill style for the shape.\n * @return {import(\"./Fill.js\").default|null} Fill style.\n * @api\n */\n getFill() {\n return this.fill_;\n }\n\n /**\n * Set the fill style.\n * @param {import(\"./Fill.js\").default|null} fill Fill style.\n * @api\n */\n setFill(fill) {\n this.fill_ = fill;\n this.render();\n }\n\n /**\n * @return {HTMLCanvasElement} Image element.\n */\n getHitDetectionImage() {\n if (!this.hitDetectionCanvas_) {\n this.hitDetectionCanvas_ = this.createHitDetectionCanvas_(this.renderOptions_);\n }\n return this.hitDetectionCanvas_;\n }\n\n /**\n * Get the image icon.\n * @param {number} pixelRatio Pixel ratio.\n * @return {HTMLCanvasElement} Image or Canvas element.\n * @api\n */\n getImage(pixelRatio) {\n let image = this.canvases_[pixelRatio];\n if (!image) {\n const renderOptions = this.renderOptions_;\n const context = (0,_dom_js__WEBPACK_IMPORTED_MODULE_1__.createCanvasContext2D)(renderOptions.size * pixelRatio, renderOptions.size * pixelRatio);\n this.draw_(renderOptions, context, pixelRatio);\n image = context.canvas;\n this.canvases_[pixelRatio] = image;\n }\n return image;\n }\n\n /**\n * Get the image pixel ratio.\n * @param {number} pixelRatio Pixel ratio.\n * @return {number} Pixel ratio.\n */\n getPixelRatio(pixelRatio) {\n return pixelRatio;\n }\n\n /**\n * @return {import(\"../size.js\").Size} Image size.\n */\n getImageSize() {\n return this.size_;\n }\n\n /**\n * @return {import(\"../ImageState.js\").default} Image state.\n */\n getImageState() {\n return _ImageState_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].LOADED;\n }\n\n /**\n * Get the origin of the symbolizer.\n * @return {Array<number>} Origin.\n * @api\n */\n getOrigin() {\n return this.origin_;\n }\n\n /**\n * Get the number of points for generating the shape.\n * @return {number} Number of points for stars and regular polygons.\n * @api\n */\n getPoints() {\n return this.points_;\n }\n\n /**\n * Get the (primary) radius for the shape.\n * @return {number} Radius.\n * @api\n */\n getRadius() {\n return this.radius_;\n }\n\n /**\n * Get the secondary radius for the shape.\n * @return {number|undefined} Radius2.\n * @api\n */\n getRadius2() {\n return this.radius2_;\n }\n\n /**\n * Get the size of the symbolizer (in pixels).\n * @return {import(\"../size.js\").Size} Size.\n * @api\n */\n getSize() {\n return this.size_;\n }\n\n /**\n * Get the stroke style for the shape.\n * @return {import(\"./Stroke.js\").default|null} Stroke style.\n * @api\n */\n getStroke() {\n return this.stroke_;\n }\n\n /**\n * Set the stroke style.\n * @param {import(\"./Stroke.js\").default|null} stroke Stroke style.\n * @api\n */\n setStroke(stroke) {\n this.stroke_ = stroke;\n this.render();\n }\n\n /**\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n */\n listenImageChange(listener) {}\n\n /**\n * Load not yet loaded URI.\n */\n load() {}\n\n /**\n * @param {function(import(\"../events/Event.js\").default): void} listener Listener function.\n */\n unlistenImageChange(listener) {}\n\n /**\n * Calculate additional canvas size needed for the miter.\n * @param {string} lineJoin Line join\n * @param {number} strokeWidth Stroke width\n * @param {number} miterLimit Miter limit\n * @return {number} Additional canvas size needed\n * @private\n */\n calculateLineJoinSize_(lineJoin, strokeWidth, miterLimit) {\n if (strokeWidth === 0 || this.points_ === Infinity || lineJoin !== 'bevel' && lineJoin !== 'miter') {\n return strokeWidth;\n }\n // m | ^\n // i | |\\ .\n // t >| #\\\n // e | |\\ \\ .\n // r \\s\\\n // | \\t\\ . .\n // \\r\\ . .\n // | \\o\\ . . . . .\n // e \\k\\ . . . .\n // | \\e\\ . . . . .\n // d \\ \\ . . . .\n // | _ _a_ _\\# . . .\n // r1 / ` . .\n // | . .\n // b / . .\n // | . .\n // / r2 . .\n // | . .\n // / . .\n // |α . .\n // / . .\n // ° center\n let r1 = this.radius_;\n let r2 = this.radius2_ === undefined ? r1 : this.radius2_;\n if (r1 < r2) {\n const tmp = r1;\n r1 = r2;\n r2 = tmp;\n }\n const points = this.radius2_ === undefined ? this.points_ : this.points_ * 2;\n const alpha = 2 * Math.PI / points;\n const a = r2 * Math.sin(alpha);\n const b = Math.sqrt(r2 * r2 - a * a);\n const d = r1 - b;\n const e = Math.sqrt(a * a + d * d);\n const miterRatio = e / a;\n if (lineJoin === 'miter' && miterRatio <= miterLimit) {\n return miterRatio * strokeWidth;\n }\n // Calculate the distance from center to the stroke corner where\n // it was cut short because of the miter limit.\n // l\n // ----+---- <= distance from center to here is maxr\n // /####|k ##\\\n // /#####^#####\\\n // /#### /+\\# s #\\\n // /### h/+++\\# t #\\\n // /### t/+++++\\# r #\\\n // /### a/+++++++\\# o #\\\n // /### p/++ fill +\\# k #\\\n ///#### /+++++^+++++\\# e #\\\n //#####/+++++/+\\+++++\\#####\\\n const k = strokeWidth / 2 / miterRatio;\n const l = strokeWidth / 2 * (d / e);\n const maxr = Math.sqrt((r1 + k) * (r1 + k) + l * l);\n const bevelAdd = maxr - r1;\n if (this.radius2_ === undefined || lineJoin === 'bevel') {\n return bevelAdd * 2;\n }\n // If outer miter is over the miter limit the inner miter may reach through the\n // center and be longer than the bevel, same calculation as above but swap r1 / r2.\n const aa = r1 * Math.sin(alpha);\n const bb = Math.sqrt(r1 * r1 - aa * aa);\n const dd = r2 - bb;\n const ee = Math.sqrt(aa * aa + dd * dd);\n const innerMiterRatio = ee / aa;\n if (innerMiterRatio <= miterLimit) {\n const innerLength = innerMiterRatio * strokeWidth / 2 - r2 - r1;\n return 2 * Math.max(bevelAdd, innerLength);\n }\n return bevelAdd * 2;\n }\n\n /**\n * @return {RenderOptions} The render options\n * @protected\n */\n createRenderOptions() {\n let lineCap = _render_canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineCap;\n let lineJoin = _render_canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineJoin;\n let miterLimit = 0;\n let lineDash = null;\n let lineDashOffset = 0;\n let strokeStyle;\n let strokeWidth = 0;\n if (this.stroke_) {\n strokeStyle = (0,_colorlike_js__WEBPACK_IMPORTED_MODULE_4__.asColorLike)(this.stroke_.getColor() ?? _render_canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultStrokeStyle);\n strokeWidth = this.stroke_.getWidth() ?? _render_canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineWidth;\n lineDash = this.stroke_.getLineDash();\n lineDashOffset = this.stroke_.getLineDashOffset() ?? 0;\n lineJoin = this.stroke_.getLineJoin() ?? _render_canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineJoin;\n lineCap = this.stroke_.getLineCap() ?? _render_canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultLineCap;\n miterLimit = this.stroke_.getMiterLimit() ?? _render_canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultMiterLimit;\n }\n const add = this.calculateLineJoinSize_(lineJoin, strokeWidth, miterLimit);\n const maxRadius = Math.max(this.radius_, this.radius2_ || 0);\n const size = Math.ceil(2 * maxRadius + add);\n return {\n strokeStyle: strokeStyle,\n strokeWidth: strokeWidth,\n size: size,\n lineCap: lineCap,\n lineDash: lineDash,\n lineDashOffset: lineDashOffset,\n lineJoin: lineJoin,\n miterLimit: miterLimit\n };\n }\n\n /**\n * @protected\n */\n render() {\n this.renderOptions_ = this.createRenderOptions();\n const size = this.renderOptions_.size;\n this.canvases_ = {};\n this.hitDetectionCanvas_ = null;\n this.size_ = [size, size];\n }\n\n /**\n * @private\n * @param {RenderOptions} renderOptions Render options.\n * @param {CanvasRenderingContext2D} context The rendering context.\n * @param {number} pixelRatio The pixel ratio.\n */\n draw_(renderOptions, context, pixelRatio) {\n context.scale(pixelRatio, pixelRatio);\n // set origin to canvas center\n context.translate(renderOptions.size / 2, renderOptions.size / 2);\n this.createPath_(context);\n if (this.fill_) {\n let color = this.fill_.getColor();\n if (color === null) {\n color = _render_canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultFillStyle;\n }\n context.fillStyle = (0,_colorlike_js__WEBPACK_IMPORTED_MODULE_4__.asColorLike)(color);\n context.fill();\n }\n if (renderOptions.strokeStyle) {\n context.strokeStyle = renderOptions.strokeStyle;\n context.lineWidth = renderOptions.strokeWidth;\n if (renderOptions.lineDash) {\n context.setLineDash(renderOptions.lineDash);\n context.lineDashOffset = renderOptions.lineDashOffset;\n }\n context.lineCap = renderOptions.lineCap;\n context.lineJoin = renderOptions.lineJoin;\n context.miterLimit = renderOptions.miterLimit;\n context.stroke();\n }\n }\n\n /**\n * @private\n * @param {RenderOptions} renderOptions Render options.\n * @return {HTMLCanvasElement} Canvas containing the icon\n */\n createHitDetectionCanvas_(renderOptions) {\n let context;\n if (this.fill_) {\n let color = this.fill_.getColor();\n\n // determine if fill is transparent (or pattern or gradient)\n let opacity = 0;\n if (typeof color === 'string') {\n color = (0,_color_js__WEBPACK_IMPORTED_MODULE_5__.asArray)(color);\n }\n if (color === null) {\n opacity = 1;\n } else if (Array.isArray(color)) {\n opacity = color.length === 4 ? color[3] : 1;\n }\n if (opacity === 0) {\n // if a transparent fill style is set, create an extra hit-detection image\n // with a default fill style\n context = (0,_dom_js__WEBPACK_IMPORTED_MODULE_1__.createCanvasContext2D)(renderOptions.size, renderOptions.size);\n this.drawHitDetectionCanvas_(renderOptions, context);\n }\n }\n return context ? context.canvas : this.getImage(1);\n }\n\n /**\n * @private\n * @param {CanvasRenderingContext2D} context The context to draw in.\n */\n createPath_(context) {\n let points = this.points_;\n const radius = this.radius_;\n if (points === Infinity) {\n context.arc(0, 0, radius, 0, 2 * Math.PI);\n } else {\n const radius2 = this.radius2_ === undefined ? radius : this.radius2_;\n if (this.radius2_ !== undefined) {\n points *= 2;\n }\n const startAngle = this.angle_ - Math.PI / 2;\n const step = 2 * Math.PI / points;\n for (let i = 0; i < points; i++) {\n const angle0 = startAngle + i * step;\n const radiusC = i % 2 === 0 ? radius : radius2;\n context.lineTo(radiusC * Math.cos(angle0), radiusC * Math.sin(angle0));\n }\n context.closePath();\n }\n }\n\n /**\n * @private\n * @param {RenderOptions} renderOptions Render options.\n * @param {CanvasRenderingContext2D} context The context.\n */\n drawHitDetectionCanvas_(renderOptions, context) {\n // set origin to canvas center\n context.translate(renderOptions.size / 2, renderOptions.size / 2);\n this.createPath_(context);\n context.fillStyle = _render_canvas_js__WEBPACK_IMPORTED_MODULE_3__.defaultFillStyle;\n context.fill();\n if (renderOptions.strokeStyle) {\n context.strokeStyle = renderOptions.strokeStyle;\n context.lineWidth = renderOptions.strokeWidth;\n if (renderOptions.lineDash) {\n context.setLineDash(renderOptions.lineDash);\n context.lineDashOffset = renderOptions.lineDashOffset;\n }\n context.lineJoin = renderOptions.lineJoin;\n context.miterLimit = renderOptions.miterLimit;\n context.stroke();\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (RegularShape);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/style/RegularShape.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/style/Stroke.js":
|
||
/*!*****************************************!*\
|
||
!*** ./node_modules/ol/style/Stroke.js ***!
|
||
\*****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @module ol/style/Stroke\n */\n\n/**\n * @typedef {Object} Options\n * @property {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike} [color] A color, gradient or pattern.\n * See {@link module:ol/color~Color} and {@link module:ol/colorlike~ColorLike} for possible formats.\n * Default null; if null, the Canvas/renderer default black will be used.\n * @property {CanvasLineCap} [lineCap='round'] Line cap style: `butt`, `round`, or `square`.\n * @property {CanvasLineJoin} [lineJoin='round'] Line join style: `bevel`, `round`, or `miter`.\n * @property {Array<number>} [lineDash] Line dash pattern. Default is `null` (no dash).\n * @property {number} [lineDashOffset=0] Line dash offset.\n * @property {number} [miterLimit=10] Miter limit.\n * @property {number} [width] Width.\n */\n\n/**\n * @classdesc\n * Set stroke style for vector features.\n * Note that the defaults given are the Canvas defaults, which will be used if\n * option is not defined. The `get` functions return whatever was entered in\n * the options; they will not return the default.\n * @api\n */\nclass Stroke {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options || {};\n\n /**\n * @private\n * @type {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike}\n */\n this.color_ = options.color !== undefined ? options.color : null;\n\n /**\n * @private\n * @type {CanvasLineCap|undefined}\n */\n this.lineCap_ = options.lineCap;\n\n /**\n * @private\n * @type {Array<number>|null}\n */\n this.lineDash_ = options.lineDash !== undefined ? options.lineDash : null;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.lineDashOffset_ = options.lineDashOffset;\n\n /**\n * @private\n * @type {CanvasLineJoin|undefined}\n */\n this.lineJoin_ = options.lineJoin;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.miterLimit_ = options.miterLimit;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.width_ = options.width;\n }\n\n /**\n * Clones the style.\n * @return {Stroke} The cloned style.\n * @api\n */\n clone() {\n const color = this.getColor();\n return new Stroke({\n color: Array.isArray(color) ? color.slice() : color || undefined,\n lineCap: this.getLineCap(),\n lineDash: this.getLineDash() ? this.getLineDash().slice() : undefined,\n lineDashOffset: this.getLineDashOffset(),\n lineJoin: this.getLineJoin(),\n miterLimit: this.getMiterLimit(),\n width: this.getWidth()\n });\n }\n\n /**\n * Get the stroke color.\n * @return {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike} Color.\n * @api\n */\n getColor() {\n return this.color_;\n }\n\n /**\n * Get the line cap type for the stroke.\n * @return {CanvasLineCap|undefined} Line cap.\n * @api\n */\n getLineCap() {\n return this.lineCap_;\n }\n\n /**\n * Get the line dash style for the stroke.\n * @return {Array<number>|null} Line dash.\n * @api\n */\n getLineDash() {\n return this.lineDash_;\n }\n\n /**\n * Get the line dash offset for the stroke.\n * @return {number|undefined} Line dash offset.\n * @api\n */\n getLineDashOffset() {\n return this.lineDashOffset_;\n }\n\n /**\n * Get the line join type for the stroke.\n * @return {CanvasLineJoin|undefined} Line join.\n * @api\n */\n getLineJoin() {\n return this.lineJoin_;\n }\n\n /**\n * Get the miter limit for the stroke.\n * @return {number|undefined} Miter limit.\n * @api\n */\n getMiterLimit() {\n return this.miterLimit_;\n }\n\n /**\n * Get the stroke width.\n * @return {number|undefined} Width.\n * @api\n */\n getWidth() {\n return this.width_;\n }\n\n /**\n * Set the color.\n *\n * @param {import(\"../color.js\").Color|import(\"../colorlike.js\").ColorLike} color Color.\n * @api\n */\n setColor(color) {\n this.color_ = color;\n }\n\n /**\n * Set the line cap.\n *\n * @param {CanvasLineCap|undefined} lineCap Line cap.\n * @api\n */\n setLineCap(lineCap) {\n this.lineCap_ = lineCap;\n }\n\n /**\n * Set the line dash.\n *\n * @param {Array<number>|null} lineDash Line dash.\n * @api\n */\n setLineDash(lineDash) {\n this.lineDash_ = lineDash;\n }\n\n /**\n * Set the line dash offset.\n *\n * @param {number|undefined} lineDashOffset Line dash offset.\n * @api\n */\n setLineDashOffset(lineDashOffset) {\n this.lineDashOffset_ = lineDashOffset;\n }\n\n /**\n * Set the line join.\n *\n * @param {CanvasLineJoin|undefined} lineJoin Line join.\n * @api\n */\n setLineJoin(lineJoin) {\n this.lineJoin_ = lineJoin;\n }\n\n /**\n * Set the miter limit.\n *\n * @param {number|undefined} miterLimit Miter limit.\n * @api\n */\n setMiterLimit(miterLimit) {\n this.miterLimit_ = miterLimit;\n }\n\n /**\n * Set the width.\n *\n * @param {number|undefined} width Width.\n * @api\n */\n setWidth(width) {\n this.width_ = width;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Stroke);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/style/Stroke.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/style/Style.js":
|
||
/*!****************************************!*\
|
||
!*** ./node_modules/ol/style/Style.js ***!
|
||
\****************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createDefaultStyle: function() { return /* binding */ createDefaultStyle; },\n/* harmony export */ createEditingStyle: function() { return /* binding */ createEditingStyle; },\n/* harmony export */ toFunction: function() { return /* binding */ toFunction; }\n/* harmony export */ });\n/* harmony import */ var _Circle_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Circle.js */ \"./node_modules/ol/style/Circle.js\");\n/* harmony import */ var _Fill_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Fill.js */ \"./node_modules/ol/style/Fill.js\");\n/* harmony import */ var _Stroke_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Stroke.js */ \"./node_modules/ol/style/Stroke.js\");\n/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../asserts.js */ \"./node_modules/ol/asserts.js\");\n/**\n * @module ol/style/Style\n */\n\n\n\n\n\n\n/**\n * A function that takes an {@link module:ol/Feature~Feature} and a `{number}`\n * representing the view's resolution. The function should return a\n * {@link module:ol/style/Style~Style} or an array of them. This way e.g. a\n * vector layer can be styled. If the function returns `undefined`, the\n * feature will not be rendered.\n *\n * @typedef {function(import(\"../Feature.js\").FeatureLike, number):(Style|Array<Style>|void)} StyleFunction\n */\n\n/**\n * A {@link Style}, an array of {@link Style}, or a {@link StyleFunction}.\n * @typedef {Style|Array<Style>|StyleFunction} StyleLike\n */\n\n/**\n * A function that takes an {@link module:ol/Feature~Feature} as argument and returns an\n * {@link module:ol/geom/Geometry~Geometry} that will be rendered and styled for the feature.\n *\n * @typedef {function(import(\"../Feature.js\").FeatureLike):\n * (import(\"../geom/Geometry.js\").default|import(\"../render/Feature.js\").default|undefined)} GeometryFunction\n */\n\n/**\n * Custom renderer function. Takes two arguments:\n *\n * 1. The pixel coordinates of the geometry in GeoJSON notation.\n * 2. The {@link module:ol/render~State} of the layer renderer.\n *\n * @typedef {function((import(\"../coordinate.js\").Coordinate|Array<import(\"../coordinate.js\").Coordinate>|Array<Array<import(\"../coordinate.js\").Coordinate>>|Array<Array<Array<import(\"../coordinate.js\").Coordinate>>>),import(\"../render.js\").State): void} RenderFunction\n */\n\n/**\n * @typedef {Object} Options\n * @property {string|import(\"../geom/Geometry.js\").default|GeometryFunction} [geometry] Feature property or geometry\n * or function returning a geometry to render for this style.\n * @property {import(\"./Fill.js\").default} [fill] Fill style.\n * @property {import(\"./Image.js\").default} [image] Image style.\n * @property {RenderFunction} [renderer] Custom renderer. When configured, `fill`, `stroke` and `image` will be\n * ignored, and the provided function will be called with each render frame for each geometry.\n * @property {RenderFunction} [hitDetectionRenderer] Custom renderer for hit detection. If provided will be used\n * in hit detection rendering.\n * @property {import(\"./Stroke.js\").default} [stroke] Stroke style.\n * @property {import(\"./Text.js\").default} [text] Text style.\n * @property {number} [zIndex] Z index.\n */\n\n/**\n * @classdesc\n * Container for vector feature rendering styles. Any changes made to the style\n * or its children through `set*()` methods will not take effect until the\n * feature or layer that uses the style is re-rendered.\n *\n * ## Feature styles\n *\n * If no style is defined, the following default style is used:\n * ```js\n * import {Circle, Fill, Stroke, Style} from 'ol/style.js';\n *\n * const fill = new Fill({\n * color: 'rgba(255,255,255,0.4)',\n * });\n * const stroke = new Stroke({\n * color: '#3399CC',\n * width: 1.25,\n * });\n * const styles = [\n * new Style({\n * image: new Circle({\n * fill: fill,\n * stroke: stroke,\n * radius: 5,\n * }),\n * fill: fill,\n * stroke: stroke,\n * }),\n * ];\n * ```\n *\n * A separate editing style has the following defaults:\n * ```js\n * import {Circle, Fill, Stroke, Style} from 'ol/style.js';\n *\n * const styles = {};\n * const white = [255, 255, 255, 1];\n * const blue = [0, 153, 255, 1];\n * const width = 3;\n * styles['Polygon'] = [\n * new Style({\n * fill: new Fill({\n * color: [255, 255, 255, 0.5],\n * }),\n * }),\n * ];\n * styles['MultiPolygon'] =\n * styles['Polygon'];\n * styles['LineString'] = [\n * new Style({\n * stroke: new Stroke({\n * color: white,\n * width: width + 2,\n * }),\n * }),\n * new Style({\n * stroke: new Stroke({\n * color: blue,\n * width: width,\n * }),\n * }),\n * ];\n * styles['MultiLineString'] = styles['LineString'];\n *\n * styles['Circle'] = styles['Polygon'].concat(\n * styles['LineString']\n * );\n *\n * styles['Point'] = [\n * new Style({\n * image: new Circle({\n * radius: width * 2,\n * fill: new Fill({\n * color: blue,\n * }),\n * stroke: new Stroke({\n * color: white,\n * width: width / 2,\n * }),\n * }),\n * zIndex: Infinity,\n * }),\n * ];\n * styles['MultiPoint'] =\n * styles['Point'];\n * styles['GeometryCollection'] =\n * styles['Polygon'].concat(\n * styles['LineString'],\n * styles['Point']\n * );\n * ```\n *\n * @api\n */\nclass Style {\n /**\n * @param {Options} [options] Style options.\n */\n constructor(options) {\n options = options || {};\n\n /**\n * @private\n * @type {string|import(\"../geom/Geometry.js\").default|GeometryFunction|null}\n */\n this.geometry_ = null;\n\n /**\n * @private\n * @type {!GeometryFunction}\n */\n this.geometryFunction_ = defaultGeometryFunction;\n if (options.geometry !== undefined) {\n this.setGeometry(options.geometry);\n }\n\n /**\n * @private\n * @type {import(\"./Fill.js\").default|null}\n */\n this.fill_ = options.fill !== undefined ? options.fill : null;\n\n /**\n * @private\n * @type {import(\"./Image.js\").default|null}\n */\n this.image_ = options.image !== undefined ? options.image : null;\n\n /**\n * @private\n * @type {RenderFunction|null}\n */\n this.renderer_ = options.renderer !== undefined ? options.renderer : null;\n\n /**\n * @private\n * @type {RenderFunction|null}\n */\n this.hitDetectionRenderer_ = options.hitDetectionRenderer !== undefined ? options.hitDetectionRenderer : null;\n\n /**\n * @private\n * @type {import(\"./Stroke.js\").default|null}\n */\n this.stroke_ = options.stroke !== undefined ? options.stroke : null;\n\n /**\n * @private\n * @type {import(\"./Text.js\").default|null}\n */\n this.text_ = options.text !== undefined ? options.text : null;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.zIndex_ = options.zIndex;\n }\n\n /**\n * Clones the style.\n * @return {Style} The cloned style.\n * @api\n */\n clone() {\n let geometry = this.getGeometry();\n if (geometry && typeof geometry === 'object') {\n geometry = /** @type {import(\"../geom/Geometry.js\").default} */geometry.clone();\n }\n return new Style({\n geometry: geometry ?? undefined,\n fill: this.getFill() ? this.getFill().clone() : undefined,\n image: this.getImage() ? this.getImage().clone() : undefined,\n renderer: this.getRenderer() ?? undefined,\n stroke: this.getStroke() ? this.getStroke().clone() : undefined,\n text: this.getText() ? this.getText().clone() : undefined,\n zIndex: this.getZIndex()\n });\n }\n\n /**\n * Get the custom renderer function that was configured with\n * {@link #setRenderer} or the `renderer` constructor option.\n * @return {RenderFunction|null} Custom renderer function.\n * @api\n */\n getRenderer() {\n return this.renderer_;\n }\n\n /**\n * Sets a custom renderer function for this style. When set, `fill`, `stroke`\n * and `image` options of the style will be ignored.\n * @param {RenderFunction|null} renderer Custom renderer function.\n * @api\n */\n setRenderer(renderer) {\n this.renderer_ = renderer;\n }\n\n /**\n * Sets a custom renderer function for this style used\n * in hit detection.\n * @param {RenderFunction|null} renderer Custom renderer function.\n * @api\n */\n setHitDetectionRenderer(renderer) {\n this.hitDetectionRenderer_ = renderer;\n }\n\n /**\n * Get the custom renderer function that was configured with\n * {@link #setHitDetectionRenderer} or the `hitDetectionRenderer` constructor option.\n * @return {RenderFunction|null} Custom renderer function.\n * @api\n */\n getHitDetectionRenderer() {\n return this.hitDetectionRenderer_;\n }\n\n /**\n * Get the geometry to be rendered.\n * @return {string|import(\"../geom/Geometry.js\").default|GeometryFunction|null}\n * Feature property or geometry or function that returns the geometry that will\n * be rendered with this style.\n * @api\n */\n getGeometry() {\n return this.geometry_;\n }\n\n /**\n * Get the function used to generate a geometry for rendering.\n * @return {!GeometryFunction} Function that is called with a feature\n * and returns the geometry to render instead of the feature's geometry.\n * @api\n */\n getGeometryFunction() {\n return this.geometryFunction_;\n }\n\n /**\n * Get the fill style.\n * @return {import(\"./Fill.js\").default|null} Fill style.\n * @api\n */\n getFill() {\n return this.fill_;\n }\n\n /**\n * Set the fill style.\n * @param {import(\"./Fill.js\").default|null} fill Fill style.\n * @api\n */\n setFill(fill) {\n this.fill_ = fill;\n }\n\n /**\n * Get the image style.\n * @return {import(\"./Image.js\").default|null} Image style.\n * @api\n */\n getImage() {\n return this.image_;\n }\n\n /**\n * Set the image style.\n * @param {import(\"./Image.js\").default} image Image style.\n * @api\n */\n setImage(image) {\n this.image_ = image;\n }\n\n /**\n * Get the stroke style.\n * @return {import(\"./Stroke.js\").default|null} Stroke style.\n * @api\n */\n getStroke() {\n return this.stroke_;\n }\n\n /**\n * Set the stroke style.\n * @param {import(\"./Stroke.js\").default|null} stroke Stroke style.\n * @api\n */\n setStroke(stroke) {\n this.stroke_ = stroke;\n }\n\n /**\n * Get the text style.\n * @return {import(\"./Text.js\").default|null} Text style.\n * @api\n */\n getText() {\n return this.text_;\n }\n\n /**\n * Set the text style.\n * @param {import(\"./Text.js\").default} text Text style.\n * @api\n */\n setText(text) {\n this.text_ = text;\n }\n\n /**\n * Get the z-index for the style.\n * @return {number|undefined} ZIndex.\n * @api\n */\n getZIndex() {\n return this.zIndex_;\n }\n\n /**\n * Set a geometry that is rendered instead of the feature's geometry.\n *\n * @param {string|import(\"../geom/Geometry.js\").default|GeometryFunction} geometry\n * Feature property or geometry or function returning a geometry to render\n * for this style.\n * @api\n */\n setGeometry(geometry) {\n if (typeof geometry === 'function') {\n this.geometryFunction_ = geometry;\n } else if (typeof geometry === 'string') {\n this.geometryFunction_ = function (feature) {\n return /** @type {import(\"../geom/Geometry.js\").default} */feature.get(geometry);\n };\n } else if (!geometry) {\n this.geometryFunction_ = defaultGeometryFunction;\n } else if (geometry !== undefined) {\n this.geometryFunction_ = function () {\n return /** @type {import(\"../geom/Geometry.js\").default} */geometry;\n };\n }\n this.geometry_ = geometry;\n }\n\n /**\n * Set the z-index.\n *\n * @param {number|undefined} zIndex ZIndex.\n * @api\n */\n setZIndex(zIndex) {\n this.zIndex_ = zIndex;\n }\n}\n\n/**\n * Convert the provided object into a style function. Functions passed through\n * unchanged. Arrays of Style or single style objects wrapped in a\n * new style function.\n * @param {StyleFunction|Array<Style>|Style} obj\n * A style function, a single style, or an array of styles.\n * @return {StyleFunction} A style function.\n */\nfunction toFunction(obj) {\n let styleFunction;\n if (typeof obj === 'function') {\n styleFunction = obj;\n } else {\n /**\n * @type {Array<Style>}\n */\n let styles;\n if (Array.isArray(obj)) {\n styles = obj;\n } else {\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof (/** @type {?} */obj.getZIndex) === 'function', 'Expected an `Style` or an array of `Style`');\n const style = /** @type {Style} */obj;\n styles = [style];\n }\n styleFunction = function () {\n return styles;\n };\n }\n return styleFunction;\n}\n\n/**\n * @type {Array<Style>|null}\n */\nlet defaultStyles = null;\n\n/**\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature.\n * @param {number} resolution Resolution.\n * @return {Array<Style>} Style.\n */\nfunction createDefaultStyle(feature, resolution) {\n // We don't use an immediately-invoked function\n // and a closure so we don't get an error at script evaluation time in\n // browsers that do not support Canvas. (import(\"./Circle.js\").CircleStyle does\n // canvas.getContext('2d') at construction time, which will cause an.error\n // in such browsers.)\n if (!defaultStyles) {\n const fill = new _Fill_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]({\n color: 'rgba(255,255,255,0.4)'\n });\n const stroke = new _Stroke_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n color: '#3399CC',\n width: 1.25\n });\n defaultStyles = [new Style({\n image: new _Circle_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n fill: fill,\n stroke: stroke,\n radius: 5\n }),\n fill: fill,\n stroke: stroke\n })];\n }\n return defaultStyles;\n}\n\n/**\n * Default styles for editing features.\n * @return {Object<import(\"../geom/Geometry.js\").Type, Array<Style>>} Styles\n */\nfunction createEditingStyle() {\n /** @type {Object<import(\"../geom/Geometry.js\").Type, Array<Style>>} */\n const styles = {};\n const white = [255, 255, 255, 1];\n const blue = [0, 153, 255, 1];\n const width = 3;\n styles['Polygon'] = [new Style({\n fill: new _Fill_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]({\n color: [255, 255, 255, 0.5]\n })\n })];\n styles['MultiPolygon'] = styles['Polygon'];\n styles['LineString'] = [new Style({\n stroke: new _Stroke_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n color: white,\n width: width + 2\n })\n }), new Style({\n stroke: new _Stroke_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n color: blue,\n width: width\n })\n })];\n styles['MultiLineString'] = styles['LineString'];\n styles['Circle'] = styles['Polygon'].concat(styles['LineString']);\n styles['Point'] = [new Style({\n image: new _Circle_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n radius: width * 2,\n fill: new _Fill_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]({\n color: blue\n }),\n stroke: new _Stroke_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n color: white,\n width: width / 2\n })\n }),\n zIndex: Infinity\n })];\n styles['MultiPoint'] = styles['Point'];\n styles['GeometryCollection'] = styles['Polygon'].concat(styles['LineString'], styles['Point']);\n return styles;\n}\n\n/**\n * Function that is called with a feature and returns its default geometry.\n * @param {import(\"../Feature.js\").FeatureLike} feature Feature to get the geometry for.\n * @return {import(\"../geom/Geometry.js\").default|import(\"../render/Feature.js\").default|undefined} Geometry to render.\n */\nfunction defaultGeometryFunction(feature) {\n return feature.getGeometry();\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Style);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/style/Style.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/style/Text.js":
|
||
/*!***************************************!*\
|
||
!*** ./node_modules/ol/style/Text.js ***!
|
||
\***************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Fill_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Fill.js */ \"./node_modules/ol/style/Fill.js\");\n/* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../size.js */ \"./node_modules/ol/size.js\");\n/**\n * @module ol/style/Text\n */\n\n\n\n/**\n * @typedef {'point' | 'line'} TextPlacement\n * Default text placement is `'point'`. Note that\n * `'line'` requires the underlying geometry to be a {@link module:ol/geom/LineString~LineString},\n * {@link module:ol/geom/Polygon~Polygon}, {@link module:ol/geom/MultiLineString~MultiLineString} or\n * {@link module:ol/geom/MultiPolygon~MultiPolygon}.\n */\n\n/**\n * @typedef {'left' | 'center' | 'right'} TextJustify\n */\n\n/**\n * The default fill color to use if no fill was set at construction time; a\n * blackish `#333`.\n *\n * @const {string}\n */\nconst DEFAULT_FILL_COLOR = '#333';\n\n/**\n * @typedef {Object} Options\n * @property {string} [font] Font style as CSS `font` value, see:\n * https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font. Default is `'10px sans-serif'`\n * @property {number} [maxAngle=Math.PI/4] When `placement` is set to `'line'`, allow a maximum angle between adjacent characters.\n * The expected value is in radians, and the default is 45° (`Math.PI / 4`).\n * @property {number} [offsetX=0] Horizontal text offset in pixels. A positive will shift the text right.\n * @property {number} [offsetY=0] Vertical text offset in pixels. A positive will shift the text down.\n * @property {boolean} [overflow=false] For polygon labels or when `placement` is set to `'line'`, allow text to exceed\n * the width of the polygon at the label position or the length of the path that it follows.\n * @property {TextPlacement} [placement='point'] Text placement.\n * @property {number} [repeat] Repeat interval. When set, the text will be repeated at this interval, which specifies\n * the distance between two text anchors in pixels. Only available when `placement` is set to `'line'`. Overrides 'textAlign'.\n * @property {number|import(\"../size.js\").Size} [scale] Scale.\n * @property {boolean} [rotateWithView=false] Whether to rotate the text with the view.\n * @property {number} [rotation=0] Rotation in radians (positive rotation clockwise).\n * @property {string|Array<string>} [text] Text content or rich text content. For plain text provide a string, which can\n * contain line breaks (`\\n`). For rich text provide an array of text/font tuples. A tuple consists of the text to\n * render and the font to use (or `''` to use the text style's font). A line break has to be a separate tuple (i.e. `'\\n', ''`).\n * **Example:** `['foo', 'bold 10px sans-serif', ' bar', 'italic 10px sans-serif', ' baz', '']` will yield \"**foo** *bar* baz\".\n * **Note:** Rich text is not supported for `placement: 'line'` or the immediate rendering API.\n * @property {CanvasTextAlign} [textAlign] Text alignment. Possible values: `'left'`, `'right'`, `'center'`, `'end'` or `'start'`.\n * Default is `'center'` for `placement: 'point'`. For `placement: 'line'`, the default is to let the renderer choose a\n * placement where `maxAngle` is not exceeded.\n * @property {TextJustify} [justify] Text justification within the text box.\n * If not set, text is justified towards the `textAlign` anchor.\n * Otherwise, use options `'left'`, `'center'`, or `'right'` to justify the text within the text box.\n * **Note:** `justify` is ignored for immediate rendering and also for `placement: 'line'`.\n * @property {CanvasTextBaseline} [textBaseline='middle'] Text base line. Possible values: `'bottom'`, `'top'`, `'middle'`, `'alphabetic'`,\n * `'hanging'`, `'ideographic'`.\n * @property {import(\"./Fill.js\").default|null} [fill] Fill style. If none is provided, we'll use a dark fill-style (#333). Specify `null` for no fill.\n * @property {import(\"./Stroke.js\").default} [stroke] Stroke style.\n * @property {import(\"./Fill.js\").default} [backgroundFill] Fill style for the text background when `placement` is\n * `'point'`. Default is no fill.\n * @property {import(\"./Stroke.js\").default} [backgroundStroke] Stroke style for the text background when `placement`\n * is `'point'`. Default is no stroke.\n * @property {Array<number>} [padding=[0, 0, 0, 0]] Padding in pixels around the text for decluttering and background. The order of\n * values in the array is `[top, right, bottom, left]`.\n */\n\n/**\n * @classdesc\n * Set text style for vector features.\n * @api\n */\nclass Text {\n /**\n * @param {Options} [options] Options.\n */\n constructor(options) {\n options = options || {};\n\n /**\n * @private\n * @type {string|undefined}\n */\n this.font_ = options.font;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.rotation_ = options.rotation;\n\n /**\n * @private\n * @type {boolean|undefined}\n */\n this.rotateWithView_ = options.rotateWithView;\n\n /**\n * @private\n * @type {number|import(\"../size.js\").Size|undefined}\n */\n this.scale_ = options.scale;\n\n /**\n * @private\n * @type {import(\"../size.js\").Size}\n */\n this.scaleArray_ = (0,_size_js__WEBPACK_IMPORTED_MODULE_0__.toSize)(options.scale !== undefined ? options.scale : 1);\n\n /**\n * @private\n * @type {string|Array<string>|undefined}\n */\n this.text_ = options.text;\n\n /**\n * @private\n * @type {CanvasTextAlign|undefined}\n */\n this.textAlign_ = options.textAlign;\n\n /**\n * @private\n * @type {TextJustify|undefined}\n */\n this.justify_ = options.justify;\n\n /**\n * @private\n * @type {number|undefined}\n */\n this.repeat_ = options.repeat;\n\n /**\n * @private\n * @type {CanvasTextBaseline|undefined}\n */\n this.textBaseline_ = options.textBaseline;\n\n /**\n * @private\n * @type {import(\"./Fill.js\").default|null}\n */\n this.fill_ = options.fill !== undefined ? options.fill : new _Fill_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]({\n color: DEFAULT_FILL_COLOR\n });\n\n /**\n * @private\n * @type {number}\n */\n this.maxAngle_ = options.maxAngle !== undefined ? options.maxAngle : Math.PI / 4;\n\n /**\n * @private\n * @type {TextPlacement}\n */\n this.placement_ = options.placement !== undefined ? options.placement : 'point';\n\n /**\n * @private\n * @type {boolean}\n */\n this.overflow_ = !!options.overflow;\n\n /**\n * @private\n * @type {import(\"./Stroke.js\").default|null}\n */\n this.stroke_ = options.stroke !== undefined ? options.stroke : null;\n\n /**\n * @private\n * @type {number}\n */\n this.offsetX_ = options.offsetX !== undefined ? options.offsetX : 0;\n\n /**\n * @private\n * @type {number}\n */\n this.offsetY_ = options.offsetY !== undefined ? options.offsetY : 0;\n\n /**\n * @private\n * @type {import(\"./Fill.js\").default|null}\n */\n this.backgroundFill_ = options.backgroundFill ? options.backgroundFill : null;\n\n /**\n * @private\n * @type {import(\"./Stroke.js\").default|null}\n */\n this.backgroundStroke_ = options.backgroundStroke ? options.backgroundStroke : null;\n\n /**\n * @private\n * @type {Array<number>|null}\n */\n this.padding_ = options.padding === undefined ? null : options.padding;\n }\n\n /**\n * Clones the style.\n * @return {Text} The cloned style.\n * @api\n */\n clone() {\n const scale = this.getScale();\n return new Text({\n font: this.getFont(),\n placement: this.getPlacement(),\n repeat: this.getRepeat(),\n maxAngle: this.getMaxAngle(),\n overflow: this.getOverflow(),\n rotation: this.getRotation(),\n rotateWithView: this.getRotateWithView(),\n scale: Array.isArray(scale) ? scale.slice() : scale,\n text: this.getText(),\n textAlign: this.getTextAlign(),\n justify: this.getJustify(),\n textBaseline: this.getTextBaseline(),\n fill: this.getFill() ? this.getFill().clone() : undefined,\n stroke: this.getStroke() ? this.getStroke().clone() : undefined,\n offsetX: this.getOffsetX(),\n offsetY: this.getOffsetY(),\n backgroundFill: this.getBackgroundFill() ? this.getBackgroundFill().clone() : undefined,\n backgroundStroke: this.getBackgroundStroke() ? this.getBackgroundStroke().clone() : undefined,\n padding: this.getPadding() || undefined\n });\n }\n\n /**\n * Get the `overflow` configuration.\n * @return {boolean} Let text overflow the length of the path they follow.\n * @api\n */\n getOverflow() {\n return this.overflow_;\n }\n\n /**\n * Get the font name.\n * @return {string|undefined} Font.\n * @api\n */\n getFont() {\n return this.font_;\n }\n\n /**\n * Get the maximum angle between adjacent characters.\n * @return {number} Angle in radians.\n * @api\n */\n getMaxAngle() {\n return this.maxAngle_;\n }\n\n /**\n * Get the label placement.\n * @return {TextPlacement} Text placement.\n * @api\n */\n getPlacement() {\n return this.placement_;\n }\n\n /**\n * Get the repeat interval of the text.\n * @return {number|undefined} Repeat interval in pixels.\n * @api\n */\n getRepeat() {\n return this.repeat_;\n }\n\n /**\n * Get the x-offset for the text.\n * @return {number} Horizontal text offset.\n * @api\n */\n getOffsetX() {\n return this.offsetX_;\n }\n\n /**\n * Get the y-offset for the text.\n * @return {number} Vertical text offset.\n * @api\n */\n getOffsetY() {\n return this.offsetY_;\n }\n\n /**\n * Get the fill style for the text.\n * @return {import(\"./Fill.js\").default|null} Fill style.\n * @api\n */\n getFill() {\n return this.fill_;\n }\n\n /**\n * Determine whether the text rotates with the map.\n * @return {boolean|undefined} Rotate with map.\n * @api\n */\n getRotateWithView() {\n return this.rotateWithView_;\n }\n\n /**\n * Get the text rotation.\n * @return {number|undefined} Rotation.\n * @api\n */\n getRotation() {\n return this.rotation_;\n }\n\n /**\n * Get the text scale.\n * @return {number|import(\"../size.js\").Size|undefined} Scale.\n * @api\n */\n getScale() {\n return this.scale_;\n }\n\n /**\n * Get the symbolizer scale array.\n * @return {import(\"../size.js\").Size} Scale array.\n */\n getScaleArray() {\n return this.scaleArray_;\n }\n\n /**\n * Get the stroke style for the text.\n * @return {import(\"./Stroke.js\").default|null} Stroke style.\n * @api\n */\n getStroke() {\n return this.stroke_;\n }\n\n /**\n * Get the text to be rendered.\n * @return {string|Array<string>|undefined} Text.\n * @api\n */\n getText() {\n return this.text_;\n }\n\n /**\n * Get the text alignment.\n * @return {CanvasTextAlign|undefined} Text align.\n * @api\n */\n getTextAlign() {\n return this.textAlign_;\n }\n\n /**\n * Get the justification.\n * @return {TextJustify|undefined} Justification.\n * @api\n */\n getJustify() {\n return this.justify_;\n }\n\n /**\n * Get the text baseline.\n * @return {CanvasTextBaseline|undefined} Text baseline.\n * @api\n */\n getTextBaseline() {\n return this.textBaseline_;\n }\n\n /**\n * Get the background fill style for the text.\n * @return {import(\"./Fill.js\").default|null} Fill style.\n * @api\n */\n getBackgroundFill() {\n return this.backgroundFill_;\n }\n\n /**\n * Get the background stroke style for the text.\n * @return {import(\"./Stroke.js\").default|null} Stroke style.\n * @api\n */\n getBackgroundStroke() {\n return this.backgroundStroke_;\n }\n\n /**\n * Get the padding for the text.\n * @return {Array<number>|null} Padding.\n * @api\n */\n getPadding() {\n return this.padding_;\n }\n\n /**\n * Set the `overflow` property.\n *\n * @param {boolean} overflow Let text overflow the path that it follows.\n * @api\n */\n setOverflow(overflow) {\n this.overflow_ = overflow;\n }\n\n /**\n * Set the font.\n *\n * @param {string|undefined} font Font.\n * @api\n */\n setFont(font) {\n this.font_ = font;\n }\n\n /**\n * Set the maximum angle between adjacent characters.\n *\n * @param {number} maxAngle Angle in radians.\n * @api\n */\n setMaxAngle(maxAngle) {\n this.maxAngle_ = maxAngle;\n }\n\n /**\n * Set the x offset.\n *\n * @param {number} offsetX Horizontal text offset.\n * @api\n */\n setOffsetX(offsetX) {\n this.offsetX_ = offsetX;\n }\n\n /**\n * Set the y offset.\n *\n * @param {number} offsetY Vertical text offset.\n * @api\n */\n setOffsetY(offsetY) {\n this.offsetY_ = offsetY;\n }\n\n /**\n * Set the text placement.\n *\n * @param {TextPlacement} placement Placement.\n * @api\n */\n setPlacement(placement) {\n this.placement_ = placement;\n }\n\n /**\n * Set the repeat interval of the text.\n * @param {number|undefined} [repeat] Repeat interval in pixels.\n * @api\n */\n setRepeat(repeat) {\n this.repeat_ = repeat;\n }\n\n /**\n * Set whether to rotate the text with the view.\n *\n * @param {boolean} rotateWithView Rotate with map.\n * @api\n */\n setRotateWithView(rotateWithView) {\n this.rotateWithView_ = rotateWithView;\n }\n\n /**\n * Set the fill.\n *\n * @param {import(\"./Fill.js\").default|null} fill Fill style.\n * @api\n */\n setFill(fill) {\n this.fill_ = fill;\n }\n\n /**\n * Set the rotation.\n *\n * @param {number|undefined} rotation Rotation.\n * @api\n */\n setRotation(rotation) {\n this.rotation_ = rotation;\n }\n\n /**\n * Set the scale.\n *\n * @param {number|import(\"../size.js\").Size|undefined} scale Scale.\n * @api\n */\n setScale(scale) {\n this.scale_ = scale;\n this.scaleArray_ = (0,_size_js__WEBPACK_IMPORTED_MODULE_0__.toSize)(scale !== undefined ? scale : 1);\n }\n\n /**\n * Set the stroke.\n *\n * @param {import(\"./Stroke.js\").default|null} stroke Stroke style.\n * @api\n */\n setStroke(stroke) {\n this.stroke_ = stroke;\n }\n\n /**\n * Set the text.\n *\n * @param {string|Array<string>|undefined} text Text.\n * @api\n */\n setText(text) {\n this.text_ = text;\n }\n\n /**\n * Set the text alignment.\n *\n * @param {CanvasTextAlign|undefined} textAlign Text align.\n * @api\n */\n setTextAlign(textAlign) {\n this.textAlign_ = textAlign;\n }\n\n /**\n * Set the justification.\n *\n * @param {TextJustify|undefined} justify Justification.\n * @api\n */\n setJustify(justify) {\n this.justify_ = justify;\n }\n\n /**\n * Set the text baseline.\n *\n * @param {CanvasTextBaseline|undefined} textBaseline Text baseline.\n * @api\n */\n setTextBaseline(textBaseline) {\n this.textBaseline_ = textBaseline;\n }\n\n /**\n * Set the background fill.\n *\n * @param {import(\"./Fill.js\").default|null} fill Fill style.\n * @api\n */\n setBackgroundFill(fill) {\n this.backgroundFill_ = fill;\n }\n\n /**\n * Set the background stroke.\n *\n * @param {import(\"./Stroke.js\").default|null} stroke Stroke style.\n * @api\n */\n setBackgroundStroke(stroke) {\n this.backgroundStroke_ = stroke;\n }\n\n /**\n * Set the padding (`[top, right, bottom, left]`).\n *\n * @param {Array<number>|null} padding Padding.\n * @api\n */\n setPadding(padding) {\n this.padding_ = padding;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Text);\n\n//# sourceURL=webpack://complexes/./node_modules/ol/style/Text.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/tilegrid/common.js":
|
||
/*!********************************************!*\
|
||
!*** ./node_modules/ol/tilegrid/common.js ***!
|
||
\********************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DEFAULT_MAX_ZOOM: function() { return /* binding */ DEFAULT_MAX_ZOOM; },\n/* harmony export */ DEFAULT_TILE_SIZE: function() { return /* binding */ DEFAULT_TILE_SIZE; }\n/* harmony export */ });\n/**\n * @module ol/tilegrid/common\n */\n\n/**\n * Default maximum zoom for default tile grids.\n * @type {number}\n */\nconst DEFAULT_MAX_ZOOM = 42;\n\n/**\n * Default tile size.\n * @type {number}\n */\nconst DEFAULT_TILE_SIZE = 256;\n\n//# sourceURL=webpack://complexes/./node_modules/ol/tilegrid/common.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/transform.js":
|
||
/*!**************************************!*\
|
||
!*** ./node_modules/ol/transform.js ***!
|
||
\**************************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ apply: function() { return /* binding */ apply; },\n/* harmony export */ compose: function() { return /* binding */ compose; },\n/* harmony export */ composeCssTransform: function() { return /* binding */ composeCssTransform; },\n/* harmony export */ create: function() { return /* binding */ create; },\n/* harmony export */ determinant: function() { return /* binding */ determinant; },\n/* harmony export */ invert: function() { return /* binding */ invert; },\n/* harmony export */ makeInverse: function() { return /* binding */ makeInverse; },\n/* harmony export */ makeScale: function() { return /* binding */ makeScale; },\n/* harmony export */ multiply: function() { return /* binding */ multiply; },\n/* harmony export */ reset: function() { return /* binding */ reset; },\n/* harmony export */ rotate: function() { return /* binding */ rotate; },\n/* harmony export */ scale: function() { return /* binding */ scale; },\n/* harmony export */ set: function() { return /* binding */ set; },\n/* harmony export */ setFromArray: function() { return /* binding */ setFromArray; },\n/* harmony export */ toString: function() { return /* binding */ toString; },\n/* harmony export */ translate: function() { return /* binding */ translate; }\n/* harmony export */ });\n/* harmony import */ var _has_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./has.js */ \"./node_modules/ol/has.js\");\n/* harmony import */ var _asserts_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./asserts.js */ \"./node_modules/ol/asserts.js\");\n/**\n * @module ol/transform\n */\n\n\n\n/**\n * An array representing an affine 2d transformation for use with\n * {@link module:ol/transform} functions. The array has 6 elements.\n * @typedef {!Array<number>} Transform\n * @api\n */\n\n/**\n * Collection of affine 2d transformation functions. The functions work on an\n * array of 6 elements. The element order is compatible with the [SVGMatrix\n * interface](https://developer.mozilla.org/en-US/docs/Web/API/SVGMatrix) and is\n * a subset (elements a to f) of a 3×3 matrix:\n * ```\n * [ a c e ]\n * [ b d f ]\n * [ 0 0 1 ]\n * ```\n */\n\n/**\n * @private\n * @type {Transform}\n */\nconst tmp_ = new Array(6);\n\n/**\n * Create an identity transform.\n * @return {!Transform} Identity transform.\n */\nfunction create() {\n return [1, 0, 0, 1, 0, 0];\n}\n\n/**\n * Resets the given transform to an identity transform.\n * @param {!Transform} transform Transform.\n * @return {!Transform} Transform.\n */\nfunction reset(transform) {\n return set(transform, 1, 0, 0, 1, 0, 0);\n}\n\n/**\n * Multiply the underlying matrices of two transforms and return the result in\n * the first transform.\n * @param {!Transform} transform1 Transform parameters of matrix 1.\n * @param {!Transform} transform2 Transform parameters of matrix 2.\n * @return {!Transform} transform1 multiplied with transform2.\n */\nfunction multiply(transform1, transform2) {\n const a1 = transform1[0];\n const b1 = transform1[1];\n const c1 = transform1[2];\n const d1 = transform1[3];\n const e1 = transform1[4];\n const f1 = transform1[5];\n const a2 = transform2[0];\n const b2 = transform2[1];\n const c2 = transform2[2];\n const d2 = transform2[3];\n const e2 = transform2[4];\n const f2 = transform2[5];\n transform1[0] = a1 * a2 + c1 * b2;\n transform1[1] = b1 * a2 + d1 * b2;\n transform1[2] = a1 * c2 + c1 * d2;\n transform1[3] = b1 * c2 + d1 * d2;\n transform1[4] = a1 * e2 + c1 * f2 + e1;\n transform1[5] = b1 * e2 + d1 * f2 + f1;\n return transform1;\n}\n\n/**\n * Set the transform components a-f on a given transform.\n * @param {!Transform} transform Transform.\n * @param {number} a The a component of the transform.\n * @param {number} b The b component of the transform.\n * @param {number} c The c component of the transform.\n * @param {number} d The d component of the transform.\n * @param {number} e The e component of the transform.\n * @param {number} f The f component of the transform.\n * @return {!Transform} Matrix with transform applied.\n */\nfunction set(transform, a, b, c, d, e, f) {\n transform[0] = a;\n transform[1] = b;\n transform[2] = c;\n transform[3] = d;\n transform[4] = e;\n transform[5] = f;\n return transform;\n}\n\n/**\n * Set transform on one matrix from another matrix.\n * @param {!Transform} transform1 Matrix to set transform to.\n * @param {!Transform} transform2 Matrix to set transform from.\n * @return {!Transform} transform1 with transform from transform2 applied.\n */\nfunction setFromArray(transform1, transform2) {\n transform1[0] = transform2[0];\n transform1[1] = transform2[1];\n transform1[2] = transform2[2];\n transform1[3] = transform2[3];\n transform1[4] = transform2[4];\n transform1[5] = transform2[5];\n return transform1;\n}\n\n/**\n * Transforms the given coordinate with the given transform returning the\n * resulting, transformed coordinate. The coordinate will be modified in-place.\n *\n * @param {Transform} transform The transformation.\n * @param {import(\"./coordinate.js\").Coordinate|import(\"./pixel.js\").Pixel} coordinate The coordinate to transform.\n * @return {import(\"./coordinate.js\").Coordinate|import(\"./pixel.js\").Pixel} return coordinate so that operations can be\n * chained together.\n */\nfunction apply(transform, coordinate) {\n const x = coordinate[0];\n const y = coordinate[1];\n coordinate[0] = transform[0] * x + transform[2] * y + transform[4];\n coordinate[1] = transform[1] * x + transform[3] * y + transform[5];\n return coordinate;\n}\n\n/**\n * Applies rotation to the given transform.\n * @param {!Transform} transform Transform.\n * @param {number} angle Angle in radians.\n * @return {!Transform} The rotated transform.\n */\nfunction rotate(transform, angle) {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n return multiply(transform, set(tmp_, cos, sin, -sin, cos, 0, 0));\n}\n\n/**\n * Applies scale to a given transform.\n * @param {!Transform} transform Transform.\n * @param {number} x Scale factor x.\n * @param {number} y Scale factor y.\n * @return {!Transform} The scaled transform.\n */\nfunction scale(transform, x, y) {\n return multiply(transform, set(tmp_, x, 0, 0, y, 0, 0));\n}\n\n/**\n * Creates a scale transform.\n * @param {!Transform} target Transform to overwrite.\n * @param {number} x Scale factor x.\n * @param {number} y Scale factor y.\n * @return {!Transform} The scale transform.\n */\nfunction makeScale(target, x, y) {\n return set(target, x, 0, 0, y, 0, 0);\n}\n\n/**\n * Applies translation to the given transform.\n * @param {!Transform} transform Transform.\n * @param {number} dx Translation x.\n * @param {number} dy Translation y.\n * @return {!Transform} The translated transform.\n */\nfunction translate(transform, dx, dy) {\n return multiply(transform, set(tmp_, 1, 0, 0, 1, dx, dy));\n}\n\n/**\n * Creates a composite transform given an initial translation, scale, rotation, and\n * final translation (in that order only, not commutative).\n * @param {!Transform} transform The transform (will be modified in place).\n * @param {number} dx1 Initial translation x.\n * @param {number} dy1 Initial translation y.\n * @param {number} sx Scale factor x.\n * @param {number} sy Scale factor y.\n * @param {number} angle Rotation (in counter-clockwise radians).\n * @param {number} dx2 Final translation x.\n * @param {number} dy2 Final translation y.\n * @return {!Transform} The composite transform.\n */\nfunction compose(transform, dx1, dy1, sx, sy, angle, dx2, dy2) {\n const sin = Math.sin(angle);\n const cos = Math.cos(angle);\n transform[0] = sx * cos;\n transform[1] = sy * sin;\n transform[2] = -sx * sin;\n transform[3] = sy * cos;\n transform[4] = dx2 * sx * cos - dy2 * sx * sin + dx1;\n transform[5] = dx2 * sy * sin + dy2 * sy * cos + dy1;\n return transform;\n}\n\n/**\n * Creates a composite transform given an initial translation, scale, rotation, and\n * final translation (in that order only, not commutative). The resulting transform\n * string can be applied as `transform` property of an HTMLElement's style.\n * @param {number} dx1 Initial translation x.\n * @param {number} dy1 Initial translation y.\n * @param {number} sx Scale factor x.\n * @param {number} sy Scale factor y.\n * @param {number} angle Rotation (in counter-clockwise radians).\n * @param {number} dx2 Final translation x.\n * @param {number} dy2 Final translation y.\n * @return {string} The composite css transform.\n * @api\n */\nfunction composeCssTransform(dx1, dy1, sx, sy, angle, dx2, dy2) {\n return toString(compose(create(), dx1, dy1, sx, sy, angle, dx2, dy2));\n}\n\n/**\n * Invert the given transform.\n * @param {!Transform} source The source transform to invert.\n * @return {!Transform} The inverted (source) transform.\n */\nfunction invert(source) {\n return makeInverse(source, source);\n}\n\n/**\n * Invert the given transform.\n * @param {!Transform} target Transform to be set as the inverse of\n * the source transform.\n * @param {!Transform} source The source transform to invert.\n * @return {!Transform} The inverted (target) transform.\n */\nfunction makeInverse(target, source) {\n const det = determinant(source);\n (0,_asserts_js__WEBPACK_IMPORTED_MODULE_0__.assert)(det !== 0, 'Transformation matrix cannot be inverted');\n const a = source[0];\n const b = source[1];\n const c = source[2];\n const d = source[3];\n const e = source[4];\n const f = source[5];\n target[0] = d / det;\n target[1] = -b / det;\n target[2] = -c / det;\n target[3] = a / det;\n target[4] = (c * f - d * e) / det;\n target[5] = -(a * f - b * e) / det;\n return target;\n}\n\n/**\n * Returns the determinant of the given matrix.\n * @param {!Transform} mat Matrix.\n * @return {number} Determinant.\n */\nfunction determinant(mat) {\n return mat[0] * mat[3] - mat[1] * mat[2];\n}\n\n/**\n * @type {HTMLElement}\n * @private\n */\nlet transformStringDiv;\n\n/**\n * A rounded string version of the transform. This can be used\n * for CSS transforms.\n * @param {!Transform} mat Matrix.\n * @return {string} The transform as a string.\n */\nfunction toString(mat) {\n const transformString = 'matrix(' + mat.join(', ') + ')';\n if (_has_js__WEBPACK_IMPORTED_MODULE_1__.WORKER_OFFSCREEN_CANVAS) {\n return transformString;\n }\n const node = transformStringDiv || (transformStringDiv = document.createElement('div'));\n node.style.transform = transformString;\n return node.style.transform;\n}\n\n//# sourceURL=webpack://complexes/./node_modules/ol/transform.js?");
|
||
|
||
/***/ }),
|
||
|
||
/***/ "./node_modules/ol/util.js":
|
||
/*!*********************************!*\
|
||
!*** ./node_modules/ol/util.js ***!
|
||
\*********************************/
|
||
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
||
|
||
"use strict";
|
||
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ VERSION: function() { return /* binding */ VERSION; },\n/* harmony export */ abstract: function() { return /* binding */ abstract; },\n/* harmony export */ getUid: function() { return /* binding */ getUid; }\n/* harmony export */ });\n/**\n * @module ol/util\n */\n\n/**\n * @return {never} Any return.\n */\nfunction abstract() {\n throw new Error('Unimplemented abstract method.');\n}\n\n/**\n * Counter for getUid.\n * @type {number}\n * @private\n */\nlet uidCounter_ = 0;\n\n/**\n * Gets a unique ID for an object. This mutates the object so that further calls\n * with the same object as a parameter returns the same value. Unique IDs are generated\n * as a strictly increasing sequence. Adapted from goog.getUid.\n *\n * @param {Object} obj The object to get the unique ID for.\n * @return {string} The unique ID for the object.\n * @api\n */\nfunction getUid(obj) {\n return obj.ol_uid || (obj.ol_uid = String(++uidCounter_));\n}\n\n/**\n * OpenLayers version.\n * @type {string}\n */\nconst VERSION = '8.2.0';\n\n//# sourceURL=webpack://complexes/./node_modules/ol/util.js?");
|
||
|
||
/***/ })
|
||
|
||
}]); |