@opengeoweb/webmap 6.0.4 → 6.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -2,337 +2,342 @@ import { debounce, throttle } from 'throttle-debounce';
2
2
  import { dateUtils } from '@opengeoweb/shared';
3
3
  import proj4 from 'proj4';
4
4
 
5
- function _iterableToArrayLimit(arr, i) {
6
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
7
- if (null != _i) {
8
- var _s,
9
- _e,
10
- _x,
11
- _r,
12
- _arr = [],
13
- _n = !0,
14
- _d = !1;
5
+ function _iterableToArrayLimit(r, l) {
6
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
7
+ if (null != t) {
8
+ var e,
9
+ n,
10
+ i,
11
+ u,
12
+ a = [],
13
+ f = !0,
14
+ o = !1;
15
15
  try {
16
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
17
- if (Object(_i) !== _i) return;
18
- _n = !1;
19
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
20
- } catch (err) {
21
- _d = !0, _e = err;
16
+ if (i = (t = t.call(r)).next, 0 === l) {
17
+ if (Object(t) !== t) return;
18
+ f = !1;
19
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
20
+ } catch (r) {
21
+ o = !0, n = r;
22
22
  } finally {
23
23
  try {
24
- if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
24
+ if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
25
25
  } finally {
26
- if (_d) throw _e;
26
+ if (o) throw n;
27
27
  }
28
28
  }
29
- return _arr;
29
+ return a;
30
30
  }
31
31
  }
32
32
  function _regeneratorRuntime() {
33
33
  _regeneratorRuntime = function () {
34
- return exports;
34
+ return e;
35
35
  };
36
- var exports = {},
37
- Op = Object.prototype,
38
- hasOwn = Op.hasOwnProperty,
39
- defineProperty = Object.defineProperty || function (obj, key, desc) {
40
- obj[key] = desc.value;
36
+ var t,
37
+ e = {},
38
+ r = Object.prototype,
39
+ n = r.hasOwnProperty,
40
+ o = Object.defineProperty || function (t, e, r) {
41
+ t[e] = r.value;
41
42
  },
42
- $Symbol = "function" == typeof Symbol ? Symbol : {},
43
- iteratorSymbol = $Symbol.iterator || "@@iterator",
44
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
45
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
46
- function define(obj, key, value) {
47
- return Object.defineProperty(obj, key, {
48
- value: value,
43
+ i = "function" == typeof Symbol ? Symbol : {},
44
+ a = i.iterator || "@@iterator",
45
+ c = i.asyncIterator || "@@asyncIterator",
46
+ u = i.toStringTag || "@@toStringTag";
47
+ function define(t, e, r) {
48
+ return Object.defineProperty(t, e, {
49
+ value: r,
49
50
  enumerable: !0,
50
51
  configurable: !0,
51
52
  writable: !0
52
- }), obj[key];
53
+ }), t[e];
53
54
  }
54
55
  try {
55
56
  define({}, "");
56
- } catch (err) {
57
- define = function (obj, key, value) {
58
- return obj[key] = value;
57
+ } catch (t) {
58
+ define = function (t, e, r) {
59
+ return t[e] = r;
59
60
  };
60
61
  }
61
- function wrap(innerFn, outerFn, self, tryLocsList) {
62
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
63
- generator = Object.create(protoGenerator.prototype),
64
- context = new Context(tryLocsList || []);
65
- return defineProperty(generator, "_invoke", {
66
- value: makeInvokeMethod(innerFn, self, context)
67
- }), generator;
62
+ function wrap(t, e, r, n) {
63
+ var i = e && e.prototype instanceof Generator ? e : Generator,
64
+ a = Object.create(i.prototype),
65
+ c = new Context(n || []);
66
+ return o(a, "_invoke", {
67
+ value: makeInvokeMethod(t, r, c)
68
+ }), a;
68
69
  }
69
- function tryCatch(fn, obj, arg) {
70
+ function tryCatch(t, e, r) {
70
71
  try {
71
72
  return {
72
73
  type: "normal",
73
- arg: fn.call(obj, arg)
74
+ arg: t.call(e, r)
74
75
  };
75
- } catch (err) {
76
+ } catch (t) {
76
77
  return {
77
78
  type: "throw",
78
- arg: err
79
+ arg: t
79
80
  };
80
81
  }
81
82
  }
82
- exports.wrap = wrap;
83
- var ContinueSentinel = {};
83
+ e.wrap = wrap;
84
+ var h = "suspendedStart",
85
+ l = "suspendedYield",
86
+ f = "executing",
87
+ s = "completed",
88
+ y = {};
84
89
  function Generator() {}
85
90
  function GeneratorFunction() {}
86
91
  function GeneratorFunctionPrototype() {}
87
- var IteratorPrototype = {};
88
- define(IteratorPrototype, iteratorSymbol, function () {
92
+ var p = {};
93
+ define(p, a, function () {
89
94
  return this;
90
95
  });
91
- var getProto = Object.getPrototypeOf,
92
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
93
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
94
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
95
- function defineIteratorMethods(prototype) {
96
- ["next", "throw", "return"].forEach(function (method) {
97
- define(prototype, method, function (arg) {
98
- return this._invoke(method, arg);
96
+ var d = Object.getPrototypeOf,
97
+ v = d && d(d(values([])));
98
+ v && v !== r && n.call(v, a) && (p = v);
99
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
100
+ function defineIteratorMethods(t) {
101
+ ["next", "throw", "return"].forEach(function (e) {
102
+ define(t, e, function (t) {
103
+ return this._invoke(e, t);
99
104
  });
100
105
  });
101
106
  }
102
- function AsyncIterator(generator, PromiseImpl) {
103
- function invoke(method, arg, resolve, reject) {
104
- var record = tryCatch(generator[method], generator, arg);
105
- if ("throw" !== record.type) {
106
- var result = record.arg,
107
- value = result.value;
108
- return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
109
- invoke("next", value, resolve, reject);
110
- }, function (err) {
111
- invoke("throw", err, resolve, reject);
112
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
113
- result.value = unwrapped, resolve(result);
114
- }, function (error) {
115
- return invoke("throw", error, resolve, reject);
107
+ function AsyncIterator(t, e) {
108
+ function invoke(r, o, i, a) {
109
+ var c = tryCatch(t[r], t, o);
110
+ if ("throw" !== c.type) {
111
+ var u = c.arg,
112
+ h = u.value;
113
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
114
+ invoke("next", t, i, a);
115
+ }, function (t) {
116
+ invoke("throw", t, i, a);
117
+ }) : e.resolve(h).then(function (t) {
118
+ u.value = t, i(u);
119
+ }, function (t) {
120
+ return invoke("throw", t, i, a);
116
121
  });
117
122
  }
118
- reject(record.arg);
123
+ a(c.arg);
119
124
  }
120
- var previousPromise;
121
- defineProperty(this, "_invoke", {
122
- value: function (method, arg) {
125
+ var r;
126
+ o(this, "_invoke", {
127
+ value: function (t, n) {
123
128
  function callInvokeWithMethodAndArg() {
124
- return new PromiseImpl(function (resolve, reject) {
125
- invoke(method, arg, resolve, reject);
129
+ return new e(function (e, r) {
130
+ invoke(t, n, e, r);
126
131
  });
127
132
  }
128
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
133
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
129
134
  }
130
135
  });
131
136
  }
132
- function makeInvokeMethod(innerFn, self, context) {
133
- var state = "suspendedStart";
134
- return function (method, arg) {
135
- if ("executing" === state) throw new Error("Generator is already running");
136
- if ("completed" === state) {
137
- if ("throw" === method) throw arg;
137
+ function makeInvokeMethod(e, r, n) {
138
+ var o = h;
139
+ return function (i, a) {
140
+ if (o === f) throw new Error("Generator is already running");
141
+ if (o === s) {
142
+ if ("throw" === i) throw a;
138
143
  return {
139
- value: void 0,
144
+ value: t,
140
145
  done: !0
141
146
  };
142
147
  }
143
- for (context.method = method, context.arg = arg;;) {
144
- var delegate = context.delegate;
145
- if (delegate) {
146
- var delegateResult = maybeInvokeDelegate(delegate, context);
147
- if (delegateResult) {
148
- if (delegateResult === ContinueSentinel) continue;
149
- return delegateResult;
148
+ for (n.method = i, n.arg = a;;) {
149
+ var c = n.delegate;
150
+ if (c) {
151
+ var u = maybeInvokeDelegate(c, n);
152
+ if (u) {
153
+ if (u === y) continue;
154
+ return u;
150
155
  }
151
156
  }
152
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
153
- if ("suspendedStart" === state) throw state = "completed", context.arg;
154
- context.dispatchException(context.arg);
155
- } else "return" === context.method && context.abrupt("return", context.arg);
156
- state = "executing";
157
- var record = tryCatch(innerFn, self, context);
158
- if ("normal" === record.type) {
159
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
157
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
158
+ if (o === h) throw o = s, n.arg;
159
+ n.dispatchException(n.arg);
160
+ } else "return" === n.method && n.abrupt("return", n.arg);
161
+ o = f;
162
+ var p = tryCatch(e, r, n);
163
+ if ("normal" === p.type) {
164
+ if (o = n.done ? s : l, p.arg === y) continue;
160
165
  return {
161
- value: record.arg,
162
- done: context.done
166
+ value: p.arg,
167
+ done: n.done
163
168
  };
164
169
  }
165
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
170
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
166
171
  }
167
172
  };
168
173
  }
169
- function maybeInvokeDelegate(delegate, context) {
170
- var methodName = context.method,
171
- method = delegate.iterator[methodName];
172
- if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
173
- var record = tryCatch(method, delegate.iterator, context.arg);
174
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
175
- var info = record.arg;
176
- return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
174
+ function maybeInvokeDelegate(e, r) {
175
+ var n = r.method,
176
+ o = e.iterator[n];
177
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
178
+ var i = tryCatch(o, e.iterator, r.arg);
179
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
180
+ var a = i.arg;
181
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
177
182
  }
178
- function pushTryEntry(locs) {
179
- var entry = {
180
- tryLoc: locs[0]
183
+ function pushTryEntry(t) {
184
+ var e = {
185
+ tryLoc: t[0]
181
186
  };
182
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
187
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
183
188
  }
184
- function resetTryEntry(entry) {
185
- var record = entry.completion || {};
186
- record.type = "normal", delete record.arg, entry.completion = record;
189
+ function resetTryEntry(t) {
190
+ var e = t.completion || {};
191
+ e.type = "normal", delete e.arg, t.completion = e;
187
192
  }
188
- function Context(tryLocsList) {
193
+ function Context(t) {
189
194
  this.tryEntries = [{
190
195
  tryLoc: "root"
191
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
196
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
192
197
  }
193
- function values(iterable) {
194
- if (iterable || "" === iterable) {
195
- var iteratorMethod = iterable[iteratorSymbol];
196
- if (iteratorMethod) return iteratorMethod.call(iterable);
197
- if ("function" == typeof iterable.next) return iterable;
198
- if (!isNaN(iterable.length)) {
199
- var i = -1,
200
- next = function next() {
201
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
202
- return next.value = undefined, next.done = !0, next;
198
+ function values(e) {
199
+ if (e || "" === e) {
200
+ var r = e[a];
201
+ if (r) return r.call(e);
202
+ if ("function" == typeof e.next) return e;
203
+ if (!isNaN(e.length)) {
204
+ var o = -1,
205
+ i = function next() {
206
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
207
+ return next.value = t, next.done = !0, next;
203
208
  };
204
- return next.next = next;
209
+ return i.next = i;
205
210
  }
206
211
  }
207
- throw new TypeError(typeof iterable + " is not iterable");
212
+ throw new TypeError(typeof e + " is not iterable");
208
213
  }
209
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
214
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
210
215
  value: GeneratorFunctionPrototype,
211
216
  configurable: !0
212
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
217
+ }), o(GeneratorFunctionPrototype, "constructor", {
213
218
  value: GeneratorFunction,
214
219
  configurable: !0
215
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
216
- var ctor = "function" == typeof genFun && genFun.constructor;
217
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
218
- }, exports.mark = function (genFun) {
219
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
220
- }, exports.awrap = function (arg) {
220
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
221
+ var e = "function" == typeof t && t.constructor;
222
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
223
+ }, e.mark = function (t) {
224
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
225
+ }, e.awrap = function (t) {
221
226
  return {
222
- __await: arg
227
+ __await: t
223
228
  };
224
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
229
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
225
230
  return this;
226
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
227
- void 0 === PromiseImpl && (PromiseImpl = Promise);
228
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
229
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
230
- return result.done ? result.value : iter.next();
231
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
232
+ void 0 === i && (i = Promise);
233
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
234
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
235
+ return t.done ? t.value : a.next();
231
236
  });
232
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
237
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
233
238
  return this;
234
- }), define(Gp, "toString", function () {
239
+ }), define(g, "toString", function () {
235
240
  return "[object Generator]";
236
- }), exports.keys = function (val) {
237
- var object = Object(val),
238
- keys = [];
239
- for (var key in object) keys.push(key);
240
- return keys.reverse(), function next() {
241
- for (; keys.length;) {
242
- var key = keys.pop();
243
- if (key in object) return next.value = key, next.done = !1, next;
241
+ }), e.keys = function (t) {
242
+ var e = Object(t),
243
+ r = [];
244
+ for (var n in e) r.push(n);
245
+ return r.reverse(), function next() {
246
+ for (; r.length;) {
247
+ var t = r.pop();
248
+ if (t in e) return next.value = t, next.done = !1, next;
244
249
  }
245
250
  return next.done = !0, next;
246
251
  };
247
- }, exports.values = values, Context.prototype = {
252
+ }, e.values = values, Context.prototype = {
248
253
  constructor: Context,
249
- reset: function (skipTempReset) {
250
- if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
254
+ reset: function (e) {
255
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
251
256
  },
252
257
  stop: function () {
253
258
  this.done = !0;
254
- var rootRecord = this.tryEntries[0].completion;
255
- if ("throw" === rootRecord.type) throw rootRecord.arg;
259
+ var t = this.tryEntries[0].completion;
260
+ if ("throw" === t.type) throw t.arg;
256
261
  return this.rval;
257
262
  },
258
- dispatchException: function (exception) {
259
- if (this.done) throw exception;
260
- var context = this;
261
- function handle(loc, caught) {
262
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
263
- }
264
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
265
- var entry = this.tryEntries[i],
266
- record = entry.completion;
267
- if ("root" === entry.tryLoc) return handle("end");
268
- if (entry.tryLoc <= this.prev) {
269
- var hasCatch = hasOwn.call(entry, "catchLoc"),
270
- hasFinally = hasOwn.call(entry, "finallyLoc");
271
- if (hasCatch && hasFinally) {
272
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
273
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
274
- } else if (hasCatch) {
275
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
263
+ dispatchException: function (e) {
264
+ if (this.done) throw e;
265
+ var r = this;
266
+ function handle(n, o) {
267
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
268
+ }
269
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
270
+ var i = this.tryEntries[o],
271
+ a = i.completion;
272
+ if ("root" === i.tryLoc) return handle("end");
273
+ if (i.tryLoc <= this.prev) {
274
+ var c = n.call(i, "catchLoc"),
275
+ u = n.call(i, "finallyLoc");
276
+ if (c && u) {
277
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
278
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
279
+ } else if (c) {
280
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
276
281
  } else {
277
- if (!hasFinally) throw new Error("try statement without catch or finally");
278
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
282
+ if (!u) throw new Error("try statement without catch or finally");
283
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
279
284
  }
280
285
  }
281
286
  }
282
287
  },
283
- abrupt: function (type, arg) {
284
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
285
- var entry = this.tryEntries[i];
286
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
287
- var finallyEntry = entry;
288
+ abrupt: function (t, e) {
289
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
290
+ var o = this.tryEntries[r];
291
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
292
+ var i = o;
288
293
  break;
289
294
  }
290
295
  }
291
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
292
- var record = finallyEntry ? finallyEntry.completion : {};
293
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
296
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
297
+ var a = i ? i.completion : {};
298
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
294
299
  },
295
- complete: function (record, afterLoc) {
296
- if ("throw" === record.type) throw record.arg;
297
- return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
300
+ complete: function (t, e) {
301
+ if ("throw" === t.type) throw t.arg;
302
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
298
303
  },
299
- finish: function (finallyLoc) {
300
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
301
- var entry = this.tryEntries[i];
302
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
304
+ finish: function (t) {
305
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
306
+ var r = this.tryEntries[e];
307
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
303
308
  }
304
309
  },
305
- catch: function (tryLoc) {
306
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
307
- var entry = this.tryEntries[i];
308
- if (entry.tryLoc === tryLoc) {
309
- var record = entry.completion;
310
- if ("throw" === record.type) {
311
- var thrown = record.arg;
312
- resetTryEntry(entry);
310
+ catch: function (t) {
311
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
312
+ var r = this.tryEntries[e];
313
+ if (r.tryLoc === t) {
314
+ var n = r.completion;
315
+ if ("throw" === n.type) {
316
+ var o = n.arg;
317
+ resetTryEntry(r);
313
318
  }
314
- return thrown;
319
+ return o;
315
320
  }
316
321
  }
317
322
  throw new Error("illegal catch attempt");
318
323
  },
319
- delegateYield: function (iterable, resultName, nextLoc) {
324
+ delegateYield: function (e, r, n) {
320
325
  return this.delegate = {
321
- iterator: values(iterable),
322
- resultName: resultName,
323
- nextLoc: nextLoc
324
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
326
+ iterator: values(e),
327
+ resultName: r,
328
+ nextLoc: n
329
+ }, "next" === this.method && (this.arg = t), y;
325
330
  }
326
- }, exports;
331
+ }, e;
327
332
  }
328
- function _typeof$1(obj) {
333
+ function _typeof$1(o) {
329
334
  "@babel/helpers - typeof";
330
335
 
331
- return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
332
- return typeof obj;
333
- } : function (obj) {
334
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
335
- }, _typeof$1(obj);
336
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
337
+ return typeof o;
338
+ } : function (o) {
339
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
340
+ }, _typeof$1(o);
336
341
  }
337
342
  function _classCallCheck(instance, Constructor) {
338
343
  if (!(instance instanceof Constructor)) {
@@ -17870,14 +17875,14 @@ var getCorrectWMSDimName = function getCorrectWMSDimName(origDimName) {
17870
17875
  /* Returns all dimensions with its current values as URL */
17871
17876
  var getMapDimURL = function getMapDimURL(layer) {
17872
17877
  var request = '';
17873
- for (var j = 0; j < layer.dimensions.length; j += 1) {
17874
- var currentValue = layer.dimensions[j].getValue();
17875
- request += "&".concat(getCorrectWMSDimName(layer.dimensions[j].name));
17878
+ layer.dimensions.forEach(function (dimension) {
17879
+ var currentValue = dimension.getValue();
17880
+ request += "&".concat(getCorrectWMSDimName(dimension.name));
17876
17881
  request += "=".concat(URLEncode(currentValue));
17877
17882
  if (currentValue === WMDateOutSideRange || currentValue === WMDateTooEarlyString || currentValue === WMDateTooLateString) {
17878
17883
  throw new Error(WMDateOutSideRange);
17879
17884
  }
17880
- }
17885
+ });
17881
17886
  return request;
17882
17887
  };
17883
17888
  /**
@@ -18262,6 +18267,11 @@ var WMImage = /*#__PURE__*/function () {
18262
18267
  }
18263
18268
  return this._isLoaded;
18264
18269
  }
18270
+ }, {
18271
+ key: "isLoadedWithoutErrors",
18272
+ value: function isLoadedWithoutErrors() {
18273
+ return this.isLoaded() && !this.hasError();
18274
+ }
18265
18275
  /**
18266
18276
  * Returns true if the image is still loading
18267
18277
  */
@@ -18393,6 +18403,7 @@ var WMImage = /*#__PURE__*/function () {
18393
18403
  }, {
18394
18404
  key: "_load",
18395
18405
  value: function _load() {
18406
+ var _a;
18396
18407
  this._hasError = false;
18397
18408
  if (this._isLoaded === true) {
18398
18409
  this._loadEvent(false);
@@ -18418,7 +18429,7 @@ var WMImage = /*#__PURE__*/function () {
18418
18429
  this._loadEvent(false);
18419
18430
  return;
18420
18431
  }
18421
- if (this.headers && this.headers.length > 0) {
18432
+ if ((_a = this.headers) === null || _a === void 0 ? void 0 : _a.length) {
18422
18433
  /* Get an image which needs headers */
18423
18434
  this._getImageWithHeaders(this.srcToLoad, this.headers);
18424
18435
  } else if (this.randomize) {
@@ -18430,19 +18441,19 @@ var WMImage = /*#__PURE__*/function () {
18430
18441
  newSrc += "random=".concat(Math.random());
18431
18442
  this.getElement().src = newSrc;
18432
18443
  } else {
18444
+ // setting src loads the image and the 'load' callback is called when its finished loading
18433
18445
  this.getElement().src = this.srcToLoad;
18434
18446
  }
18435
18447
  }
18436
18448
  }, {
18437
18449
  key: "_loadEvent",
18438
18450
  value: function _loadEvent(hasError) {
18451
+ var _a;
18439
18452
  this._hasError = hasError;
18440
18453
  this._isLoading = false;
18441
18454
  this._isLoaded = true;
18442
18455
  this._srcLoaded = this.srcToLoad;
18443
- if (isDefined(this.loadEventCallback)) {
18444
- this.loadEventCallback(this);
18445
- }
18456
+ (_a = this.loadEventCallback) === null || _a === void 0 ? void 0 : _a.call(this, this);
18446
18457
  }
18447
18458
  /**
18448
18459
  * Get the width of the current image
@@ -18954,20 +18965,19 @@ var makeQueryStringWithoutGeoInfo = function makeQueryStringWithoutGeoInfo(image
18954
18965
  * @param newLayer A canvaslayer object to add.
18955
18966
  */
18956
18967
  var addAlternativeImage = function addAlternativeImage(newLayer) {
18968
+ var _a;
18957
18969
  /* Get a signature for images which belong to each other */
18958
18970
  var sigImageUrl = makeQueryStringWithoutGeoInfo(newLayer.imageSource);
18959
18971
  /* Make an entry for these images in the sharedImagesList */
18960
- if (!sharedImagesList[sigImageUrl]) {
18961
- sharedImagesList[sigImageUrl] = [];
18962
- }
18972
+ (_a = sharedImagesList[sigImageUrl]) !== null && _a !== void 0 ? _a : sharedImagesList[sigImageUrl] = [];
18963
18973
  /* Get the images for this signature */
18964
18974
  var imagesForUrl = sharedImagesList[sigImageUrl];
18965
18975
  /* Check if the image is not already in the sharedImagesList */
18966
- var imageIsAlreadyIndex = imagesForUrl.findIndex(function (i) {
18976
+ var imageIsAlreadyIndex = imagesForUrl.find(function (i) {
18967
18977
  return i.imageSource === newLayer.imageSource;
18968
18978
  });
18969
18979
  /* It is not in the list, so add it */
18970
- if (imageIsAlreadyIndex === -1) {
18980
+ if (!imageIsAlreadyIndex) {
18971
18981
  /* Ensure that the oldest images are removed, keep a maximum of 10 images per signature url */
18972
18982
  while (sharedImagesList[sigImageUrl].length >= 10) {
18973
18983
  sharedImagesList[sigImageUrl].pop();
@@ -19019,18 +19029,14 @@ var getAlternativeImage = function getAlternativeImage(imageUrl, imageStore,
19019
19029
  _bbox) {
19020
19030
  var sigImageUrl = makeQueryStringWithoutGeoInfo(imageUrl);
19021
19031
  var imagesForUrl = sharedImagesList[sigImageUrl];
19022
- if (imagesForUrl && imagesForUrl.length > 0) {
19032
+ if (imagesForUrl === null || imagesForUrl === void 0 ? void 0 : imagesForUrl.length) {
19023
19033
  var sortedImagesForUrl = sortByImageDate(imagesForUrl);
19024
- /* Find the first image in this list which is also loaded and has no error */
19025
- var index = sortedImagesForUrl.findIndex(function (altImage) {
19034
+ return sortedImagesForUrl.find(function (altImage) {
19026
19035
  var cachedImage = imageStore.getImageForSrc(altImage.imageSource);
19027
- return cachedImage && cachedImage.isLoaded() && !cachedImage.isLoading() && !cachedImage.hasError();
19036
+ return cachedImage === null || cachedImage === void 0 ? void 0 : cachedImage.isLoadedWithoutErrors();
19028
19037
  });
19029
- if (index !== -1) {
19030
- return sortedImagesForUrl[index];
19031
- }
19032
19038
  }
19033
- return null;
19039
+ return undefined;
19034
19040
  };
19035
19041
  var WMCanvasBuffer = /*#__PURE__*/function () {
19036
19042
  function WMCanvasBuffer(webmapJSCallback, _imageStore, w, h, internalCallbacks) {
@@ -19148,6 +19154,8 @@ var WMCanvasBuffer = /*#__PURE__*/function () {
19148
19154
  }, {
19149
19155
  key: "display",
19150
19156
  value: function display() {
19157
+ var _this2 = this;
19158
+ var _a, _b, _c, _d, _e, _f;
19151
19159
  this._ctx.globalAlpha = 1;
19152
19160
  this._ctx.fillStyle = 'white';
19153
19161
  this._ctx.beginPath();
@@ -19159,47 +19167,37 @@ var WMCanvasBuffer = /*#__PURE__*/function () {
19159
19167
  }
19160
19168
  /* Reset errors */
19161
19169
  this._errorList.length = 0;
19162
- for (var j = 0; j < this.layers.length; j += 1) {
19163
- var imageToDisplay = this._imageStore.getImageForSrc(this.layers[j].imageSource);
19164
- if (imageToDisplay && imageToDisplay.isLoaded() && !imageToDisplay.isLoading() && !imageToDisplay.hasError()) {
19170
+ this.layers.forEach(function (layer) {
19171
+ var imageToDisplay = _this2._imageStore.getImageForSrc(layer.imageSource);
19172
+ if (imageToDisplay === null || imageToDisplay === void 0 ? void 0 : imageToDisplay.isLoadedWithoutErrors()) {
19165
19173
  // Draw this image, it is loaded and OK
19166
- this._drawImage(this.layers[j]);
19167
- } else {
19168
- /**
19169
- * Check if this image has an error.
19170
- * If the error has occured some time ago, and the amount of retries is low, just retry to load the image.
19171
- */
19172
- if (imageToDisplay.hasError()) {
19173
- if (imageToDisplay.isLoading() === false && imageToDisplay.getLastErrorMSecondsAgo() > 5000) {
19174
- if (imageToDisplay.getNumFailedAttempts() < 10) {
19175
- imageToDisplay.forceReload();
19176
- }
19177
- }
19178
- }
19179
- /* Find closest alternative and display instead image */
19180
- var im = getAlternativeImage(this.layers[j].imageSource, this._imageStore, this._currentnewbbox);
19181
- if (im) {
19182
- this._drawImage(im);
19183
- }
19174
+ _this2._drawImage(layer);
19175
+ return;
19184
19176
  }
19185
- }
19177
+ /**
19178
+ * Check if this image has an error.
19179
+ * If the error has occured some time ago, and the amount of retries is low, just retry to load the image.
19180
+ */
19181
+ if (imageToDisplay.hasError() && imageToDisplay.isLoading() === false && imageToDisplay.getLastErrorMSecondsAgo() > 5000 && imageToDisplay.getNumFailedAttempts() < 10) {
19182
+ imageToDisplay.forceReload();
19183
+ }
19184
+ /* Find closest alternative and display instead image */
19185
+ var im = getAlternativeImage(layer.imageSource, _this2._imageStore, _this2._currentnewbbox);
19186
+ if (im) {
19187
+ _this2._drawImage(im);
19188
+ }
19189
+ });
19186
19190
  this._ctx.globalAlpha = 1;
19187
19191
  /* Display errors */
19188
19192
  if (this._errorList.length > 0) {
19189
19193
  this._webmapJSCallback.triggerEvent('canvasonerror', this._errorList);
19190
- if (this._internalCallbacks && this._internalCallbacks.canvasonerror) {
19191
- this._internalCallbacks.canvasonerror(this._errorList);
19192
- }
19194
+ (_b = (_a = this._internalCallbacks) === null || _a === void 0 ? void 0 : _a.canvasonerror) === null || _b === void 0 ? void 0 : _b.call(_a, this._errorList);
19193
19195
  }
19194
19196
  this._webmapJSCallback.triggerEvent('beforecanvasdisplay', this._ctx);
19195
- if (this._internalCallbacks && this._internalCallbacks.beforecanvasdisplay) {
19196
- this._internalCallbacks.beforecanvasdisplay(this._ctx);
19197
- }
19197
+ (_d = (_c = this._internalCallbacks) === null || _c === void 0 ? void 0 : _c.beforecanvasdisplay) === null || _d === void 0 ? void 0 : _d.call(_c, this._ctx);
19198
19198
  this.canvas.style.display = 'inline-block';
19199
19199
  this._webmapJSCallback.triggerEvent('aftercanvasdisplay', this._ctx);
19200
- if (this._internalCallbacks && this._internalCallbacks.aftercanvasdisplay) {
19201
- this._internalCallbacks.aftercanvasdisplay(this._ctx);
19202
- }
19200
+ (_f = (_e = this._internalCallbacks) === null || _e === void 0 ? void 0 : _e.aftercanvasdisplay) === null || _f === void 0 ? void 0 : _f.call(_e, this._ctx);
19203
19201
  }
19204
19202
  }, {
19205
19203
  key: "finishedLoading",
@@ -19250,12 +19248,13 @@ var WMCanvasBuffer = /*#__PURE__*/function () {
19250
19248
  }, {
19251
19249
  key: "setSrc",
19252
19250
  value: function setSrc(layerIndex, imageSource, linkedInfo, opacity, bbox) {
19251
+ var _a, _b;
19253
19252
  if (!isDefined(imageSource)) {
19254
19253
  debug(DebugType.Warning);
19255
19254
  return;
19256
19255
  }
19257
19256
  /* HTTP Headers for the image, necessary in case of certain authentication forms */
19258
- var headers = linkedInfo && linkedInfo.layer && linkedInfo.layer.headers ? linkedInfo.layer.headers : [];
19257
+ var headers = (_b = (_a = linkedInfo === null || linkedInfo === void 0 ? void 0 : linkedInfo.layer) === null || _a === void 0 ? void 0 : _a.headers) !== null && _b !== void 0 ? _b : [];
19259
19258
  /* Make a new CanvasLayer */
19260
19259
  var newLayer = {
19261
19260
  imageSource: imageSource,
@@ -19318,24 +19317,24 @@ var WMCanvasBuffer = /*#__PURE__*/function () {
19318
19317
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
19319
19318
  var prefetch = function prefetch(requests) {
19320
19319
  var prefetching = [];
19321
- for (var j = 0; j < requests.length; j += 1) {
19322
- var image = getMapImageStore.getImage(requests[j].url, {
19323
- headers: requests[j].headers
19320
+ requests.forEach(function (request) {
19321
+ var image = getMapImageStore.getImage(request.url, {
19322
+ headers: request.headers
19324
19323
  });
19325
19324
  if (image.isLoaded() === false && image.isLoading() === false) {
19326
19325
  prefetching.push(image);
19327
19326
  image.load();
19328
19327
  }
19329
- }
19328
+ });
19330
19329
  return prefetching;
19331
19330
  };
19332
19331
  var WMJSAnimate = /*#__PURE__*/function () {
19333
19332
  function WMJSAnimate(_map) {
19334
19333
  _classCallCheck(this, WMJSAnimate);
19334
+ this._imageStore = getMapImageStore;
19335
19335
  this.isNextTimeCloseToWallClockTime = false;
19336
19336
  _map.animationDelay = 100;
19337
19337
  this._callBack = _map.getListener();
19338
- this._imageStore = getMapImageStore;
19339
19338
  this._divAnimationInfo = document.createElement('div');
19340
19339
  _map.currentAnimationStep = 0;
19341
19340
  _map.animationList = undefined;
@@ -19362,10 +19361,10 @@ var WMJSAnimate = /*#__PURE__*/function () {
19362
19361
  /* Bind */
19363
19362
  this._animate = this._animate.bind(this);
19364
19363
  this._animateLoop = this._animateLoop.bind(this);
19365
- this.checkAnimation = this.checkAnimation.bind(this);
19364
+ this.prefetchImagesForAnimationSteps = this.prefetchImagesForAnimationSteps.bind(this);
19366
19365
  this.stopAnimating = this.stopAnimating.bind(this);
19367
19366
  _map.stopAnimating = this.stopAnimating;
19368
- _map.checkAnimation = this.checkAnimation;
19367
+ _map.checkAnimation = this.prefetchImagesForAnimationSteps;
19369
19368
  }
19370
19369
  _createClass(WMJSAnimate, [{
19371
19370
  key: "isCurrentAnimationTimeCloseToWallClockTime",
@@ -19409,67 +19408,70 @@ var WMJSAnimate = /*#__PURE__*/function () {
19409
19408
  this._map.setDimension(animationStep.name, animationStep.value, false);
19410
19409
  this._callBack.triggerEvent('ondimchange');
19411
19410
  this._callBack.triggerEvent('onnextanimationstep', this._map);
19412
- this._map._pdraw();
19411
+ this._map.addLayersToCanvasAndDisplayThem();
19413
19412
  this._map.animateBusy = false;
19414
19413
  }
19415
19414
  }, {
19416
19415
  key: "_animateLoop",
19417
19416
  value: function _animateLoop() {
19417
+ var _this = this;
19418
19418
  if (this._map.isAnimating === false) {
19419
19419
  this._map.isAnimatingLoopRunning = false;
19420
19420
  return;
19421
19421
  }
19422
19422
  var animationDelay = this._map.animationDelay;
19423
+ var animationSteps = this._map.animationList;
19423
19424
  if (this._map.currentAnimationStep === 0) {
19424
19425
  animationDelay *= 3;
19425
- } else if (this._map.currentAnimationStep === this._map.animationList.length - 1) {
19426
+ } else if (this._map.currentAnimationStep === animationSteps.length - 1) {
19426
19427
  animationDelay *= 5;
19427
19428
  } else if (this.isCurrentAnimationTimeCloseToWallClockTime()) {
19428
19429
  animationDelay *= 5;
19429
19430
  }
19431
+ // set up timer for next animation step
19430
19432
  this._map.animationTimer.init(animationDelay, this._animateLoop);
19431
- this.checkAnimation();
19432
- if (this._map.mouseHoverAnimationBox === false) {
19433
- this._animate();
19434
- var nextStep = this._map.currentAnimationStep + 1;
19435
- if (nextStep >= this._map.animationList.length) {
19436
- nextStep = 0;
19437
- }
19438
- var continueAnimation = false;
19439
- var numReady = 0;
19440
- var animationStep = this._map.animationList[nextStep];
19441
- this._map.setDimension(animationStep.name, animationStep.value, false);
19442
- this._map.animationList[nextStep].requests = this._map.getWMSRequests();
19443
- animationStep = this._map.animationList[this._map.currentAnimationStep];
19444
- this._map.setDimension(animationStep.name, animationStep.value, false);
19445
- for (var i = 0; i < this._map.animationList[nextStep].requests.length; i += 1) {
19446
- var url = this._map.animationList[nextStep].requests[i].url;
19447
- var image = getMapImageStore.getImageForSrc(url);
19448
- /* Get a loaded image which has no error */
19449
- if (image && image.isLoaded() && !image.isLoading() && !image.hasError()) {
19450
- numReady += 1;
19451
- } else {
19452
- /* Check if a similar image is available instead, then we can continue with the smoother animation */
19453
- var im = getAlternativeImage(url, getMapImageStore, this._map.getDrawBBOX());
19454
- if (im) {
19455
- numReady += 1;
19456
- } else if (!(image && image.isLoading())) {
19457
- /* No alternatives and current image is not loading, so lets continue the animation */
19458
- numReady += 1;
19459
- }
19460
- }
19433
+ this.prefetchImagesForAnimationSteps();
19434
+ if (this._map.mouseHoverAnimationBox !== false) {
19435
+ return;
19436
+ }
19437
+ this._animate();
19438
+ var nextAnimationStepIndex = this._map.currentAnimationStep + 1;
19439
+ if (nextAnimationStepIndex >= animationSteps.length) {
19440
+ nextAnimationStepIndex = 0;
19441
+ }
19442
+ // get urls for images in next animation step
19443
+ var nextAnimationStep = animationSteps[nextAnimationStepIndex];
19444
+ nextAnimationStep.requests = this.getRequestsForAnimationStep(animationSteps, nextAnimationStepIndex);
19445
+ // if images for next animation step is ready or haven't started loading
19446
+ // change map animation step to next step
19447
+ var numberOfImagesReadyForNextAnimationStep = 0;
19448
+ nextAnimationStep.requests.forEach(function (request) {
19449
+ var url = request.url;
19450
+ var image = getMapImageStore.getImageForSrc(url);
19451
+ /* Get a loaded image which has no error */
19452
+ if (image === null || image === void 0 ? void 0 : image.isLoadedWithoutErrors()) {
19453
+ numberOfImagesReadyForNextAnimationStep += 1;
19454
+ return;
19461
19455
  }
19462
- if (numReady >= this._map.animationList[nextStep].requests.length) {
19463
- continueAnimation = true;
19456
+ /* Check if a similar image is available instead, then we can continue with the smoother animation */
19457
+ var alternativeImage = getAlternativeImage(url, getMapImageStore, _this._map.getDrawBBOX());
19458
+ if (alternativeImage) {
19459
+ numberOfImagesReadyForNextAnimationStep += 1;
19460
+ return;
19464
19461
  }
19465
- if (continueAnimation) {
19466
- this._map.currentAnimationStep = nextStep;
19462
+ var imageHasntStartedLoading = !(image === null || image === void 0 ? void 0 : image.isLoading());
19463
+ if (imageHasntStartedLoading) {
19464
+ /* No alternatives and current image is not loading, so lets continue the animation */
19465
+ numberOfImagesReadyForNextAnimationStep += 1;
19467
19466
  }
19467
+ });
19468
+ if (numberOfImagesReadyForNextAnimationStep >= nextAnimationStep.requests.length) {
19469
+ this._map.currentAnimationStep = nextAnimationStepIndex;
19468
19470
  }
19469
19471
  }
19470
19472
  }, {
19471
- key: "checkAnimation",
19472
- value: function checkAnimation() {
19473
+ key: "prefetchImagesForAnimationSteps",
19474
+ value: function prefetchImagesForAnimationSteps() {
19473
19475
  if (this._map.isAnimating === false) {
19474
19476
  this._map.isAnimatingLoopRunning = false;
19475
19477
  return;
@@ -19477,37 +19479,32 @@ var WMJSAnimate = /*#__PURE__*/function () {
19477
19479
  if (!this._map.animationTimer) {
19478
19480
  this._map.animationTimer = new WMTimer();
19479
19481
  }
19480
- if (this._map.mouseHoverAnimationBox === false) {
19481
- var maxSimultaneousLoads = 4;
19482
- var getNumImagesLoading = this._imageStore.getNumImagesLoading();
19483
- if (getNumImagesLoading < maxSimultaneousLoads) {
19484
- var numberPreCacheSteps = this._map.animationList.length;
19485
- if (this._map.animationList.length > 0) {
19486
- for (var j = 0; j < numberPreCacheSteps; j += 1) {
19487
- var index = j + this._map.currentAnimationStep;
19488
- while (index < 0) {
19489
- index += this._map.animationList.length;
19490
- }
19491
- while (index >= this._map.animationList.length) {
19492
- index -= this._map.animationList.length;
19493
- }
19494
- if (index < 0) {
19495
- index = 0;
19496
- }
19497
- if (index >= 0) {
19498
- var animationStep = this._map.animationList[index];
19499
- this._map.setDimension(animationStep.name, animationStep.value, false);
19500
- this._map.animationList[index].requests = this._map.getWMSRequests();
19501
- animationStep = this._map.animationList[this._map.currentAnimationStep];
19502
- this._map.setDimension(animationStep.name, animationStep.value, false);
19503
- this._map.animationList[index].imagesInPrefetch = prefetch(this._map.animationList[index].requests);
19504
- getNumImagesLoading = this._imageStore.getNumImagesLoading();
19505
- if (getNumImagesLoading > maxSimultaneousLoads - 1) {
19506
- break;
19507
- }
19508
- }
19509
- }
19482
+ var animationSteps = this._map.animationList;
19483
+ var countAnimationSteps = animationSteps === null || animationSteps === void 0 ? void 0 : animationSteps.length;
19484
+ if (countAnimationSteps && this._map.mouseHoverAnimationBox === false) {
19485
+ for (var j = 0; j < countAnimationSteps; j += 1) {
19486
+ // dont prefetch if already prefetching too many images
19487
+ var maxSimultaneousLoads = 4;
19488
+ var countImagesLoading = this._imageStore.getNumImagesLoading();
19489
+ if (countImagesLoading > maxSimultaneousLoads - 1) {
19490
+ break;
19491
+ }
19492
+ // start prefecthing images for the next animation step first
19493
+ var index = j + this._map.currentAnimationStep;
19494
+ while (index < 0) {
19495
+ index += countAnimationSteps;
19510
19496
  }
19497
+ while (index >= countAnimationSteps) {
19498
+ index -= countAnimationSteps;
19499
+ }
19500
+ if (index < 0) {
19501
+ index = 0;
19502
+ }
19503
+ // get urls for animation step
19504
+ var animationStep = animationSteps[index];
19505
+ animationStep.requests = this.getRequestsForAnimationStep(animationSteps, index);
19506
+ // prefetch images for animation step
19507
+ animationStep.imagesInPrefetch = prefetch(animationStep.requests);
19511
19508
  }
19512
19509
  }
19513
19510
  if (this._map.isAnimatingLoopRunning === false) {
@@ -19528,6 +19525,18 @@ var WMJSAnimate = /*#__PURE__*/function () {
19528
19525
  this._map.rebuildMapDimensions();
19529
19526
  this._callBack.triggerEvent('onstopanimation', this._map);
19530
19527
  }
19528
+ }, {
19529
+ key: "getRequestsForAnimationStep",
19530
+ value: function getRequestsForAnimationStep(animationSteps, index) {
19531
+ // get urls for animation step
19532
+ var animationStep = animationSteps[index];
19533
+ this._map.setDimension(animationStep.name, animationStep.value, false);
19534
+ var requests = this._map.getWMSRequests();
19535
+ // set map back to correct dimension
19536
+ var animationStepShownOnMap = animationSteps[this._map.currentAnimationStep];
19537
+ this._map.setDimension(animationStepShownOnMap.name, animationStepShownOnMap.value, false);
19538
+ return requests;
19539
+ }
19531
19540
  }]);
19532
19541
  return WMJSAnimate;
19533
19542
  }();
@@ -19818,10 +19827,6 @@ var getLegendGraphicURLForLayer = function getLegendGraphicURLForLayer(layer) {
19818
19827
  if (!legendURL) {
19819
19828
  return undefined;
19820
19829
  }
19821
- // For THREDDS WMS we need to add layers=
19822
- if (!legendURL.includes('&layers=')) {
19823
- legendURL += "&layers=".concat(URLEncode(layer.name), "&");
19824
- }
19825
19830
  try {
19826
19831
  if (layer.legendIsDimensionDependent === true) {
19827
19832
  legendURL += "".concat(getMapDimURL(layer), "&");
@@ -25571,14 +25576,14 @@ var moment$1 = {exports: {}};
25571
25576
 
25572
25577
  var moment = moment$1.exports;
25573
25578
 
25574
- function _typeof(obj) {
25579
+ function _typeof(o) {
25575
25580
  "@babel/helpers - typeof";
25576
25581
 
25577
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
25578
- return typeof obj;
25579
- } : function (obj) {
25580
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
25581
- }, _typeof(obj);
25582
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
25583
+ return typeof o;
25584
+ } : function (o) {
25585
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
25586
+ }, _typeof(o);
25582
25587
  }
25583
25588
 
25584
25589
  function requiredArgs(required, args) {
@@ -26973,11 +26978,9 @@ var getBBOXandProjString = function getBBOXandProjString(map, layer) {
26973
26978
  };
26974
26979
  // Build a valid WMS request for a certain layer
26975
26980
  var buildWMSGetMapRequest = function buildWMSGetMapRequest(map, layer) {
26976
- if (!isDefined(layer.name)) {
26977
- return {
26978
- url: undefined,
26979
- headers: null
26980
- };
26981
+ var _a;
26982
+ if (!isDefined(layer.name) || layer.name.length < 1) {
26983
+ return undefined;
26981
26984
  }
26982
26985
  var _map$getProjection2 = map.getProjection(),
26983
26986
  srs = _map$getProjection2.srs;
@@ -26985,15 +26988,7 @@ var buildWMSGetMapRequest = function buildWMSGetMapRequest(map, layer) {
26985
26988
  var _map$getSize = map.getSize(),
26986
26989
  width = _map$getSize.width,
26987
26990
  height = _map$getSize.height;
26988
- if (!layer.format) {
26989
- layer.format = 'image/png';
26990
- }
26991
- if (layer.name.length < 1) {
26992
- return {
26993
- url: undefined,
26994
- headers: null
26995
- };
26996
- }
26991
+ (_a = layer.format) !== null && _a !== void 0 ? _a : layer.format = 'image/png';
26997
26992
  // GetFeatureInfo timeseries in the mapview
26998
26993
  if (srs === 'GFI:TIME_ELEVATION') {
26999
26994
  var x = 707;
@@ -27059,10 +27054,7 @@ var buildWMSGetMapRequest = function buildWMSGetMapRequest(map, layer) {
27059
27054
  try {
27060
27055
  request += getMapDimURL(layer);
27061
27056
  } catch (e) {
27062
- return {
27063
- url: null,
27064
- headers: null
27065
- };
27057
+ return undefined;
27066
27058
  }
27067
27059
  // Handle WMS extensions
27068
27060
  request += layer.wmsextensions.url;
@@ -27377,7 +27369,7 @@ var WMJSMap = /*#__PURE__*/function () {
27377
27369
  this._onResumeSuspendCallbackFunction = this._onResumeSuspendCallbackFunction.bind(this);
27378
27370
  this._animFrameRedraw = this._animFrameRedraw.bind(this);
27379
27371
  this.getWMSRequests = this.getWMSRequests.bind(this);
27380
- this._pdraw = this._pdraw.bind(this);
27372
+ this.addLayersToCanvasAndDisplayThem = this.addLayersToCanvasAndDisplayThem.bind(this);
27381
27373
  this._updateBoundingBox = this._updateBoundingBox.bind(this);
27382
27374
  this.redrawBuffer = this.redrawBuffer.bind(this);
27383
27375
  this.addBaseLayers = this.addBaseLayers.bind(this);
@@ -28451,7 +28443,7 @@ var WMJSMap = /*#__PURE__*/function () {
28451
28443
  debug(DebugType.Log);
28452
28444
  return;
28453
28445
  }
28454
- this._animFrameRedraw();
28446
+ this._draw(this._animationList);
28455
28447
  }
28456
28448
  /**
28457
28449
  * API Function called to draw the layers, fires getmap request and shows the layers on the screen
@@ -28475,46 +28467,41 @@ var WMJSMap = /*#__PURE__*/function () {
28475
28467
  }, {
28476
28468
  key: "_drawAndLoad",
28477
28469
  value: function _drawAndLoad(animationList) {
28470
+ var _this7 = this;
28478
28471
  if (this.width < 4 || this.height < 4) {
28479
28472
  this._drawReady();
28480
28473
  return;
28481
28474
  }
28482
28475
  this.callBack.triggerEvent('beforedraw');
28483
- if (this.isAnimating === false) {
28484
- if (animationList !== undefined) {
28485
- if (_typeof$1(animationList) === 'object') {
28486
- if (animationList.length > 0) {
28487
- // Ensure the time dimension has been loaded for the map before starting animation
28488
- var timeDim = this.getDimension('time');
28489
- if (!timeDim) {
28490
- return;
28491
- }
28492
- var selectedTime = timeDim.currentValue;
28493
- this.isAnimating = true;
28494
- this.callBack.triggerEvent('onstartanimation', this);
28495
- this.currentAnimationStep = this.initialAnimationStep;
28496
- this.animationList = [];
28497
- this.mouseHoverAnimationBox = false;
28498
- for (var j = 0; j < animationList.length; j += 1) {
28499
- if (selectedTime && animationList[j].value === selectedTime) {
28500
- this.currentAnimationStep = j;
28501
- }
28502
- var animationListObject = {
28503
- name: animationList[j].name,
28504
- value: animationList[j].value,
28505
- requests: []
28506
- };
28507
- this.setDimension(animationList[j].name, animationList[j].value, false);
28508
- animationListObject.requests = this.getWMSRequests();
28509
- this.animationList.push(animationListObject);
28510
- }
28511
- this.setDimension(this.animationList[this.currentAnimationStep].name, this.animationList[this.currentAnimationStep].value, false);
28512
- this.wmAnimate.checkAnimation();
28513
- }
28514
- }
28476
+ if (this.isAnimating === false && animationList !== undefined && _typeof$1(animationList) === 'object' && animationList.length > 0) {
28477
+ // Ensure the time dimension has been loaded for the map before starting animation
28478
+ var timeDim = this.getDimension('time');
28479
+ if (!timeDim) {
28480
+ return;
28515
28481
  }
28482
+ var selectedTime = timeDim.currentValue;
28483
+ this.isAnimating = true;
28484
+ this.callBack.triggerEvent('onstartanimation', this);
28485
+ this.currentAnimationStep = this.initialAnimationStep;
28486
+ this.animationList = [];
28487
+ this.mouseHoverAnimationBox = false;
28488
+ animationList.forEach(function (animationStepWithoutRequests, j) {
28489
+ if (selectedTime && animationStepWithoutRequests.value === selectedTime) {
28490
+ _this7.currentAnimationStep = j;
28491
+ }
28492
+ var animationStep = {
28493
+ name: animationStepWithoutRequests.name,
28494
+ value: animationStepWithoutRequests.value,
28495
+ requests: []
28496
+ };
28497
+ _this7.setDimension(animationStepWithoutRequests.name, animationStepWithoutRequests.value, false);
28498
+ animationStep.requests = _this7.getWMSRequests();
28499
+ _this7.animationList.push(animationStep);
28500
+ });
28501
+ this.setDimension(this.animationList[this.currentAnimationStep].name, this.animationList[this.currentAnimationStep].value, false);
28502
+ this.wmAnimate.prefetchImagesForAnimationSteps();
28516
28503
  }
28517
- this._pdraw();
28504
+ this.addLayersToCanvasAndDisplayThem();
28518
28505
  }
28519
28506
  }, {
28520
28507
  key: "_onLayersReadyCallbackFunction",
@@ -28535,70 +28522,65 @@ var WMJSMap = /*#__PURE__*/function () {
28535
28522
  }, {
28536
28523
  key: "getWMSRequests",
28537
28524
  value: function getWMSRequests() {
28525
+ var _this8 = this;
28538
28526
  var requests = [];
28539
- var n = this.getNumLayers();
28540
- for (var j = 0; j < n; j += 1) {
28541
- if (this.layers[j].service && this.layers[j].enabled) {
28542
- var request = buildWMSGetMapRequest(this, this.layers[j]);
28543
- if (request.url) {
28527
+ this.layers.forEach(function (layer) {
28528
+ if (layer.service && layer.enabled) {
28529
+ var request = buildWMSGetMapRequest(_this8, layer);
28530
+ if (request === null || request === void 0 ? void 0 : request.url) {
28544
28531
  requests.push(request);
28545
28532
  }
28546
28533
  }
28547
- }
28534
+ });
28548
28535
  return requests;
28549
28536
  }
28550
28537
  }, {
28551
- key: "_pdraw",
28552
- value: function _pdraw() {
28553
- var _this7 = this;
28554
- var loadLayers = function loadLayers() {
28555
- debug(DebugType.Log);
28556
- _this7.divBuffer.reset();
28557
- var currentLayerIndex = 0;
28558
- _this7.numBaseLayers = 0;
28559
- if (_this7.baseLayers) {
28560
- for (var l = 0; l < _this7.baseLayers.length; l += 1) {
28561
- if (_this7.baseLayers[l].enabled && _this7.baseLayers[l].keepOnTop === false && _this7.baseLayers[l].type && _this7.baseLayers[l].type !== 'twms') {
28562
- _this7.numBaseLayers += 1;
28563
- var requestURL = buildWMSGetMapRequest(_this7, _this7.baseLayers[l]).url;
28564
- if (requestURL) {
28565
- _this7.divBuffer.setSrc(currentLayerIndex, requestURL, {
28566
- layer: _this7.baseLayers[l]
28567
- }, _this7.baseLayers[l].opacity, _this7.getDrawBBOX());
28568
- currentLayerIndex += 1;
28569
- }
28570
- }
28538
+ key: "addLayersToCanvasAndDisplayThem",
28539
+ value: function addLayersToCanvasAndDisplayThem() {
28540
+ var _this9 = this;
28541
+ var _a, _b, _c;
28542
+ debug(DebugType.Log);
28543
+ this.divBuffer.reset();
28544
+ var currentLayerIndex = 0;
28545
+ this.numBaseLayers = 0;
28546
+ (_a = this.baseLayers) === null || _a === void 0 ? void 0 : _a.forEach(function (baseLayer) {
28547
+ var _a;
28548
+ if (baseLayer.enabled && baseLayer.keepOnTop === false && baseLayer.type && baseLayer.type !== 'twms') {
28549
+ _this9.numBaseLayers += 1;
28550
+ var requestURL = (_a = buildWMSGetMapRequest(_this9, baseLayer)) === null || _a === void 0 ? void 0 : _a.url;
28551
+ if (requestURL) {
28552
+ _this9.divBuffer.setSrc(currentLayerIndex, requestURL, {
28553
+ layer: baseLayer
28554
+ }, baseLayer.opacity, _this9.getDrawBBOX());
28555
+ currentLayerIndex += 1;
28571
28556
  }
28572
28557
  }
28573
- /* Loop through all layers */
28574
- for (var j = 0; j < _this7.getNumLayers(); j += 1) {
28575
- if (_this7.layers[j].service && _this7.layers[j].enabled && _this7.layers[j].isConfigured) {
28576
- var _requestURL = buildWMSGetMapRequest(_this7, _this7.layers[j]).url;
28577
- if (_requestURL) {
28578
- _this7.divBuffer.setSrc(currentLayerIndex, _requestURL, {
28579
- layer: _this7.layers[j]
28580
- }, _this7.layers[j].opacity, _this7.getDrawBBOX());
28581
- currentLayerIndex += 1;
28582
- }
28558
+ });
28559
+ /* Loop through all layers */
28560
+ (_b = this.layers) === null || _b === void 0 ? void 0 : _b.forEach(function (layer) {
28561
+ var _a;
28562
+ if (layer.service && layer.enabled && layer.isConfigured) {
28563
+ var requestURL = (_a = buildWMSGetMapRequest(_this9, layer)) === null || _a === void 0 ? void 0 : _a.url;
28564
+ if (requestURL) {
28565
+ _this9.divBuffer.setSrc(currentLayerIndex, requestURL, {
28566
+ layer: layer
28567
+ }, layer.opacity, _this9.getDrawBBOX());
28568
+ currentLayerIndex += 1;
28583
28569
  }
28584
28570
  }
28585
- if (_this7.baseLayers) {
28586
- for (var _l = 0; _l < _this7.baseLayers.length; _l += 1) {
28587
- if (_this7.baseLayers[_l].enabled) {
28588
- if (_this7.baseLayers[_l].keepOnTop === true) {
28589
- var _requestURL2 = buildWMSGetMapRequest(_this7, _this7.baseLayers[_l]).url;
28590
- if (_requestURL2) {
28591
- _this7.divBuffer.setSrc(currentLayerIndex, _requestURL2, {
28592
- layer: _this7.baseLayers[_l]
28593
- }, _this7.baseLayers[_l].opacity, _this7.getDrawBBOX());
28594
- currentLayerIndex += 1;
28595
- }
28596
- }
28597
- }
28571
+ });
28572
+ (_c = this.baseLayers) === null || _c === void 0 ? void 0 : _c.forEach(function (baseLayer) {
28573
+ var _a;
28574
+ if (baseLayer.enabled && baseLayer.keepOnTop === true) {
28575
+ var requestURL = (_a = buildWMSGetMapRequest(_this9, baseLayer)) === null || _a === void 0 ? void 0 : _a.url;
28576
+ if (requestURL) {
28577
+ _this9.divBuffer.setSrc(currentLayerIndex, requestURL, {
28578
+ layer: baseLayer
28579
+ }, baseLayer.opacity, _this9.getDrawBBOX());
28580
+ currentLayerIndex += 1;
28598
28581
  }
28599
28582
  }
28600
- };
28601
- loadLayers();
28583
+ });
28602
28584
  this.divBuffer.display();
28603
28585
  this.callBack.triggerEvent('onmapready', this);
28604
28586
  }
@@ -28788,27 +28770,24 @@ var WMJSMap = /*#__PURE__*/function () {
28788
28770
  }, {
28789
28771
  key: "_buildLayerDims",
28790
28772
  value: function _buildLayerDims() {
28773
+ var _this10 = this;
28791
28774
  if (this.buildLayerDimsBusy === true) {
28792
28775
  return;
28793
28776
  }
28794
- for (var k = 0; k < this.mapdimensions.length; k += 1) {
28795
- var mapDim = this.mapdimensions[k];
28796
- for (var j = 0; j < this.layers.length; j += 1) {
28797
- for (var i = 0; i < this.layers[j].dimensions.length; i += 1) {
28798
- var layerDim = this.layers[j].dimensions[i];
28799
- if (layerDim.linked === true) {
28800
- if (layerDim.name === mapDim.name) {
28801
- if (mapDim.currentValue === 'current' || mapDim.currentValue === 'default' || mapDim.currentValue === '' || mapDim.currentValue === 'earliest' || mapDim.currentValue === 'middle' || mapDim.currentValue === 'latest') {
28802
- mapDim.currentValue = layerDim.getClosestValue(mapDim.currentValue);
28803
- }
28804
- this.buildLayerDimsBusy = true;
28805
- layerDim.setClosestValue(mapDim.currentValue);
28806
- this.buildLayerDimsBusy = false;
28777
+ this.mapdimensions.forEach(function (mapDim) {
28778
+ _this10.layers.forEach(function (layer) {
28779
+ layer.dimensions.forEach(function (layerDim) {
28780
+ if (layerDim.linked === true && layerDim.name === mapDim.name) {
28781
+ if (mapDim.currentValue === 'current' || mapDim.currentValue === 'default' || mapDim.currentValue === '' || mapDim.currentValue === 'earliest' || mapDim.currentValue === 'middle' || mapDim.currentValue === 'latest') {
28782
+ mapDim.currentValue = layerDim.getClosestValue(mapDim.currentValue);
28807
28783
  }
28784
+ _this10.buildLayerDimsBusy = true;
28785
+ layerDim.setClosestValue(mapDim.currentValue);
28786
+ _this10.buildLayerDimsBusy = false;
28808
28787
  }
28809
- }
28810
- }
28811
- }
28788
+ });
28789
+ });
28790
+ });
28812
28791
  }
28813
28792
  }, {
28814
28793
  key: "getMapMode",
@@ -29520,7 +29499,7 @@ var WMJSMap = /*#__PURE__*/function () {
29520
29499
  }, {
29521
29500
  key: "zoomTo",
29522
29501
  value: function zoomTo(_newbbox) {
29523
- var _this8 = this;
29502
+ var _this11 = this;
29524
29503
  debug(DebugType.Log);
29525
29504
  var setOrigBox = false;
29526
29505
  var newbbox = new WMBBOX(_newbbox);
@@ -29561,14 +29540,14 @@ var WMJSMap = /*#__PURE__*/function () {
29561
29540
  this._updateBoundingBox(this.bbox);
29562
29541
  this.drawnBBOX.setBBOX(this.bbox);
29563
29542
  var resetMapPinAndDialogs = function resetMapPinAndDialogs() {
29564
- for (var j = 0; j < _this8.gfiDialogList.length; j += 1) {
29565
- var newpos = _this8.getPixelCoordFromGeoCoord({
29566
- x: _this8.gfiDialogList[j].geoPosX,
29567
- y: _this8.gfiDialogList[j].geoPosY
29543
+ for (var j = 0; j < _this11.gfiDialogList.length; j += 1) {
29544
+ var newpos = _this11.getPixelCoordFromGeoCoord({
29545
+ x: _this11.gfiDialogList[j].geoPosX,
29546
+ y: _this11.gfiDialogList[j].geoPosY
29568
29547
  });
29569
- if (_this8.gfiDialogList[j].hasBeenDragged === false) {
29570
- if (_this8.gfiDialogList[j].moveToMouseCursor === true) {
29571
- _this8.gfiDialogList[j].setXY(_this8.gfiDialogList[j].origX + newpos.x, _this8.gfiDialogList[j].origY + newpos.y);
29548
+ if (_this11.gfiDialogList[j].hasBeenDragged === false) {
29549
+ if (_this11.gfiDialogList[j].moveToMouseCursor === true) {
29550
+ _this11.gfiDialogList[j].setXY(_this11.gfiDialogList[j].origX + newpos.x, _this11.gfiDialogList[j].origY + newpos.y);
29572
29551
  }
29573
29552
  }
29574
29553
  }
@@ -29721,10 +29700,13 @@ var WMJSMap = /*#__PURE__*/function () {
29721
29700
  // listeners:
29722
29701
  }, {
29723
29702
  key: "addListener",
29724
- value: function addListener(name, f) {
29703
+ value: function addListener(name,
29704
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29705
+ f) {
29725
29706
  var keep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
29726
29707
  return this.callBack.addToCallback(name, f, keep);
29727
29708
  }
29709
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29728
29710
  }, {
29729
29711
  key: "removeListener",
29730
29712
  value: function removeListener(name, f) {
@@ -29948,6 +29930,30 @@ var WMJSMap = /*#__PURE__*/function () {
29948
29930
  return WMJSMap;
29949
29931
  }();
29950
29932
 
29933
+ /* *
29934
+ * Licensed under the Apache License, Version 2.0 (the "License");
29935
+ * you may not use this file except in compliance with the License.
29936
+ * You may obtain a copy of the License at
29937
+ *
29938
+ * http://www.apache.org/licenses/LICENSE-2.0
29939
+ *
29940
+ * Unless required by applicable law or agreed to in writing, software
29941
+ * distributed under the License is distributed on an "AS IS" BASIS,
29942
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29943
+ * See the License for the specific language governing permissions and
29944
+ * limitations under the License.
29945
+ *
29946
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
29947
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
29948
+ * */
29949
+ /**
29950
+ * Global service store for re-use of services
29951
+ */
29952
+ var WMServiceStore = [];
29953
+ var WMServiceStoreXML2JSONRequest = {
29954
+ proxy: 'Check WMJSGlobals WMJSServiceStoreXML2JSONRequest'
29955
+ };
29956
+
29951
29957
  /* *
29952
29958
  * Licensed under the Apache License, Version 2.0 (the "License");
29953
29959
  * you may not use this file except in compliance with the License.
@@ -30351,30 +30357,6 @@ var I18n = {
30351
30357
  }
30352
30358
  };
30353
30359
 
30354
- /* *
30355
- * Licensed under the Apache License, Version 2.0 (the "License");
30356
- * you may not use this file except in compliance with the License.
30357
- * You may obtain a copy of the License at
30358
- *
30359
- * http://www.apache.org/licenses/LICENSE-2.0
30360
- *
30361
- * Unless required by applicable law or agreed to in writing, software
30362
- * distributed under the License is distributed on an "AS IS" BASIS,
30363
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30364
- * See the License for the specific language governing permissions and
30365
- * limitations under the License.
30366
- *
30367
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
30368
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
30369
- * */
30370
- /**
30371
- * Global service store for re-use of services
30372
- */
30373
- var WMServiceStore = [];
30374
- var WMServiceStoreXML2JSONRequest = {
30375
- proxy: 'Check WMJSGlobals WMJSServiceStoreXML2JSONRequest'
30376
- };
30377
-
30378
30360
  /* *
30379
30361
  * Licensed under the Apache License, Version 2.0 (the "License");
30380
30362
  * you may not use this file except in compliance with the License.
@@ -30918,6 +30900,7 @@ var LayerType;
30918
30900
  LayerType["mapLayer"] = "mapLayer";
30919
30901
  LayerType["baseLayer"] = "baseLayer";
30920
30902
  LayerType["overLayer"] = "overLayer";
30903
+ LayerType["featureLayer"] = "featureLayer";
30921
30904
  })(LayerType || (LayerType = {}));
30922
30905
  /**
30923
30906
  * Helper function to figure out the dimensions from the WMS layer object (From WMS GetCapabilities). Parses both WMS 1.1.1 and WMS 1.3.0.
@@ -31597,9 +31580,7 @@ var WMLayer = /*#__PURE__*/function () {
31597
31580
  this.legendGraphic = this.styles[0].legendURL;
31598
31581
  }
31599
31582
  /* Check if this legenURL has already a Layer Property set. If so set the Layer to the name of this layer */
31600
- this.legendGraphic = getUriWithParam(this.legendGraphic, {
31601
- layer: this.name
31602
- });
31583
+ this.legendGraphic = getUriWithParam(this.legendGraphic);
31603
31584
  }
31604
31585
  }, {
31605
31586
  key: "getStyles",
@@ -31746,6 +31727,286 @@ var WMLayer = /*#__PURE__*/function () {
31746
31727
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
31747
31728
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
31748
31729
  * */
31730
+ var generatedLayerIds = 0;
31731
+ var generateLayerId = function generateLayerId() {
31732
+ generatedLayerIds += 1;
31733
+ return "layerid_".concat(generatedLayerIds);
31734
+ };
31735
+ var generatedMapIds = 0;
31736
+ var generateMapId = function generateMapId() {
31737
+ generatedMapIds += 1;
31738
+ return "mapid_".concat(generatedMapIds);
31739
+ };
31740
+ var generatedTimesliderIds = 0;
31741
+ var generateTimesliderId = function generateTimesliderId() {
31742
+ generatedTimesliderIds += 1;
31743
+ return "timesliderid_".concat(generatedTimesliderIds);
31744
+ };
31745
+ /**
31746
+ * Map for registering wmlayers with their id's
31747
+ */
31748
+ var registeredWMLayersForReactLayerId = {};
31749
+ /**
31750
+ * Registers a WMJSLayer in a lookuptable with a layerId
31751
+ * @param {WMLayer} wmLayer
31752
+ * @param {string} layerId
31753
+ */
31754
+ var registerWMLayer = function registerWMLayer(wmLayer, layerId) {
31755
+ registeredWMLayersForReactLayerId[layerId] = wmLayer;
31756
+ };
31757
+ /**
31758
+ * Get the WMLayer from the lookuptable with layerId
31759
+ * @param {string} layerId
31760
+ */
31761
+ var getWMLayerById = function getWMLayerById(layerId) {
31762
+ return registeredWMLayersForReactLayerId[layerId];
31763
+ };
31764
+ var unRegisterWMJSLayer = function unRegisterWMJSLayer(layerId) {
31765
+ var layer = registeredWMLayersForReactLayerId[layerId];
31766
+ if (layer) {
31767
+ delete registeredWMLayersForReactLayerId[layerId];
31768
+ }
31769
+ };
31770
+ var unRegisterAllWMJSLayersAndMaps = function unRegisterAllWMJSLayersAndMaps() {
31771
+ var allLayerIds = Object.keys(registeredWMLayersForReactLayerId);
31772
+ allLayerIds.forEach(function (layerId) {
31773
+ unRegisterWMJSLayer(layerId);
31774
+ });
31775
+ var allMapIds = Object.keys(registeredWMMapForReactMapId);
31776
+ allMapIds.forEach(function (mapId) {
31777
+ unRegisterWMJSMap(mapId);
31778
+ });
31779
+ };
31780
+ /**
31781
+ * Map for registering wmlayers with their id's
31782
+ */
31783
+ var registeredWMMapForReactMapId = {};
31784
+ /**
31785
+ * Registers a WMJSMap in a lookuptable with a wmjsMapId
31786
+ * @param {WMJSMap} wmjsMap
31787
+ * @param {string} wmjsMapId
31788
+ */
31789
+ var registerWMJSMap = function registerWMJSMap(wmjsMap, wmjsMapId) {
31790
+ if (registeredWMMapForReactMapId[wmjsMapId]) {
31791
+ console.warn("Map with id ".concat(wmjsMapId, " already made"));
31792
+ }
31793
+ registeredWMMapForReactMapId[wmjsMapId] = wmjsMap;
31794
+ };
31795
+ var unRegisterWMJSMap = function unRegisterWMJSMap(wmjsMapId) {
31796
+ var wmjsMap = registeredWMMapForReactMapId[wmjsMapId];
31797
+ if (wmjsMap) {
31798
+ wmjsMap.getListener().suspendEvents();
31799
+ try {
31800
+ wmjsMap.stopAnimating && wmjsMap.stopAnimating();
31801
+ } catch (e) {
31802
+ console.warn(e);
31803
+ }
31804
+ Object.keys(registeredWMLayersForReactLayerId).forEach(function (layerId) {
31805
+ var wmLayer = getWMLayerById(layerId);
31806
+ if (wmLayer.parentMap === wmjsMap) {
31807
+ unRegisterWMJSLayer(layerId);
31808
+ }
31809
+ });
31810
+ wmjsMap.destroy();
31811
+ delete registeredWMMapForReactMapId[wmjsMapId];
31812
+ }
31813
+ };
31814
+ /**
31815
+ * Get the wmjsMap from the lookuptable with wmjsMapId
31816
+ * @param {string} wmjsMapId
31817
+ */
31818
+ var getWMJSMapById = function getWMJSMapById(wmjsMapId) {
31819
+ return registeredWMMapForReactMapId[wmjsMapId];
31820
+ };
31821
+ /**
31822
+ * Returns the WMJSDimension object for given layerId and dimension name
31823
+ * @param layerId The layerId
31824
+ * @param dimensionName The dimension to lookup
31825
+ */
31826
+ var getWMJSDimensionForLayerAndDimension = function getWMJSDimensionForLayerAndDimension(layerId, dimensionName) {
31827
+ var wmLayer = getWMLayerById(layerId);
31828
+ if (!wmLayer || !dimensionName) {
31829
+ return undefined;
31830
+ }
31831
+ var wmjsDimension = wmLayer.getDimension(dimensionName);
31832
+ if (!wmjsDimension) {
31833
+ return undefined;
31834
+ }
31835
+ return wmjsDimension;
31836
+ };
31837
+ /**
31838
+ * Gets the WMJSTimeDimension for given activeLayerId and dimensions list
31839
+ * @param layerId: The layer id to search the WMJSDimension for
31840
+ * @return: The WMJSDimension if found, otherwise null
31841
+ */
31842
+ var getWMJSTimeDimensionForLayerId = function getWMJSTimeDimensionForLayerId(layerId) {
31843
+ var wmLayer = getWMLayerById(layerId);
31844
+ if (!wmLayer) {
31845
+ return null;
31846
+ }
31847
+ return wmLayer.getDimension('time');
31848
+ };
31849
+
31850
+ var utils = /*#__PURE__*/Object.freeze({
31851
+ __proto__: null,
31852
+ generateLayerId: generateLayerId,
31853
+ generateMapId: generateMapId,
31854
+ generateTimesliderId: generateTimesliderId,
31855
+ registerWMLayer: registerWMLayer,
31856
+ getWMLayerById: getWMLayerById,
31857
+ unRegisterWMJSLayer: unRegisterWMJSLayer,
31858
+ unRegisterAllWMJSLayersAndMaps: unRegisterAllWMJSLayersAndMaps,
31859
+ registerWMJSMap: registerWMJSMap,
31860
+ unRegisterWMJSMap: unRegisterWMJSMap,
31861
+ getWMJSMapById: getWMJSMapById,
31862
+ getWMJSDimensionForLayerAndDimension: getWMJSDimensionForLayerAndDimension,
31863
+ getWMJSTimeDimensionForLayerId: getWMJSTimeDimensionForLayerId
31864
+ });
31865
+
31866
+ /* *
31867
+ * Licensed under the Apache License, Version 2.0 (the "License");
31868
+ * you may not use this file except in compliance with the License.
31869
+ * You may obtain a copy of the License at
31870
+ *
31871
+ * http://www.apache.org/licenses/LICENSE-2.0
31872
+ *
31873
+ * Unless required by applicable law or agreed to in writing, software
31874
+ * distributed under the License is distributed on an "AS IS" BASIS,
31875
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31876
+ * See the License for the specific language governing permissions and
31877
+ * limitations under the License.
31878
+ *
31879
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
31880
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
31881
+ * */
31882
+ var defaultReduxLayerRadarColor = {
31883
+ service: 'https://testservice',
31884
+ name: 'RAD_NL25_PCP_CM',
31885
+ title: 'RAD_NL25_PCP_CM',
31886
+ format: 'image/png',
31887
+ style: 'rainbow/nearest',
31888
+ enabled: true,
31889
+ layerType: LayerType.mapLayer,
31890
+ dimensions: [],
31891
+ styles: [{
31892
+ title: 'rainbow/nearest',
31893
+ name: 'rainbow/nearest',
31894
+ legendURL: 'https://geoservices.knmi.nl/wms?dataset=RADAR&SERVICE=WMS&&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=RAD_NL25_PCP_CM&format=image/png&STYLE=precip-rainbow/nearest',
31895
+ "abstract": 'No abstract available'
31896
+ }],
31897
+ id: 'layerid_1'
31898
+ };
31899
+ var multiDimensionLayer = {
31900
+ service: 'https://testservice',
31901
+ id: 'multiDimensionLayerMock',
31902
+ name: 'MULTI_DIMENSION_LAYER',
31903
+ title: 'MULTI_DIMENSION_LAYER',
31904
+ layerType: LayerType.mapLayer,
31905
+ enabled: true,
31906
+ dimensions: [{
31907
+ name: 'flight level',
31908
+ units: 'hft',
31909
+ currentValue: '625',
31910
+ values: '25,325,625'
31911
+ }, {
31912
+ name: 'elevation',
31913
+ units: 'meters',
31914
+ currentValue: '9000',
31915
+ values: '1000,5000,9000'
31916
+ }, {
31917
+ name: 'time',
31918
+ units: 'ISO8601',
31919
+ currentValue: '2020-03-13T14:40:00Z'
31920
+ }]
31921
+ };
31922
+ var WmdefaultReduxLayerRadarKNMI = new WMLayer({
31923
+ service: 'https://testservice',
31924
+ name: 'RADNL_OPER_R___25PCPRR_L3_KNMI',
31925
+ title: 'RADNL_OPER_R___25PCPRR_L3_KNMI',
31926
+ format: 'image/png',
31927
+ style: 'knmiradar/nearest',
31928
+ enabled: true,
31929
+ layerType: LayerType.mapLayer,
31930
+ dimensions: [{
31931
+ name: 'time',
31932
+ units: 'ISO8601',
31933
+ currentValue: '2020-03-13T13:30:00Z'
31934
+ }],
31935
+ id: 'layerid_3'
31936
+ });
31937
+ var defaultReduxLayerRadarKNMI = {
31938
+ service: 'https://testservice',
31939
+ name: 'RADNL_OPER_R___25PCPRR_L3_KNMI',
31940
+ title: 'RADNL_OPER_R___25PCPRR_L3_KNMI',
31941
+ format: 'image/png',
31942
+ style: 'knmiradar/nearest',
31943
+ enabled: true,
31944
+ layerType: LayerType.mapLayer,
31945
+ dimensions: [{
31946
+ name: 'time',
31947
+ units: 'ISO8601',
31948
+ currentValue: '2020-03-13T13:30:00Z'
31949
+ }],
31950
+ styles: [{
31951
+ title: 'knmiradar/nearest',
31952
+ name: 'knmiradar/nearest',
31953
+ legendURL: 'https://geoservices.knmi.nl/wms?dataset=RADAR&SERVICE=WMS&&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=RADNL_OPER_R___25PCPRR_L3_KNMI&format=image/png&STYLE=knmiradar/nearest',
31954
+ "abstract": 'No abstract available'
31955
+ }, {
31956
+ title: 'precip/nearest',
31957
+ name: 'precip/nearest',
31958
+ legendURL: 'https://geoservices.knmi.nl/wms?dataset=RADAR&SERVICE=WMS&&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=RADNL_OPER_R___25PCPRR_L3_KNMI&format=image/png&STYLE=precip/nearest',
31959
+ "abstract": 'No abstract available'
31960
+ }, {
31961
+ title: 'precip-transparent/nearest',
31962
+ name: 'precip-transparent/nearest',
31963
+ legendURL: 'https://geoservices.knmi.nl/wms?dataset=RADAR&SERVICE=WMS&&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=RADNL_OPER_R___25PCPRR_L3_KNMI&format=image/png&STYLE=precip-transparent/nearest',
31964
+ "abstract": 'No abstract available'
31965
+ }, {
31966
+ title: 'precip-gray/nearest',
31967
+ name: 'precip-gray/nearest',
31968
+ legendURL: 'https://geoservices.knmi.nl/wms?dataset=RADAR&SERVICE=WMS&&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=RADNL_OPER_R___25PCPRR_L3_KNMI&format=image/png&STYLE=precip-gray/nearest',
31969
+ "abstract": 'No abstract available'
31970
+ }, {
31971
+ title: 'precip-rainbow/nearest',
31972
+ name: 'precip-rainbow/nearest',
31973
+ legendURL: 'https://geoservices.knmi.nl/wms?dataset=RADAR&SERVICE=WMS&&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=RADNL_OPER_R___25PCPRR_L3_KNMI&format=image/png&STYLE=precip-rainbow/nearest',
31974
+ "abstract": 'No abstract available'
31975
+ }, {
31976
+ title: 'precip-blue/nearest',
31977
+ name: 'precip-blue/nearest',
31978
+ legendURL: 'https://geoservices.knmi.nl/wms?dataset=RADAR&SERVICE=WMS&&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=RADNL_OPER_R___25PCPRR_L3_KNMI&format=image/png&STYLE=precip-blue/nearest',
31979
+ "abstract": 'No abstract available'
31980
+ }, {
31981
+ title: 'precip-blue-transparent/nearest',
31982
+ name: 'precip-blue-transparent/nearest',
31983
+ legendURL: 'https://geoservices.knmi.nl/wms?dataset=RADAR&SERVICE=WMS&&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=RADNL_OPER_R___25PCPRR_L3_KNMI&format=image/png&STYLE=precip-blue-transparent/nearest',
31984
+ "abstract": 'No abstract available'
31985
+ }, {
31986
+ title: 'pseudoradar/nearest',
31987
+ name: 'pseudoradar/nearest',
31988
+ legendURL: 'https://geoservices.knmi.nl/wms?dataset=RADAR&SERVICE=WMS&&version=1.1.1&service=WMS&request=GetLegendGraphic&layer=RADNL_OPER_R___25PCPRR_L3_KNMI&format=image/png&STYLE=pseudoradar/nearest',
31989
+ "abstract": 'No abstract available'
31990
+ }],
31991
+ id: 'layerid_2'
31992
+ };
31993
+ var makeGeoservicesRadarLayer = function makeGeoservicesRadarLayer(dimensions) {
31994
+ return new WMLayer({
31995
+ service: 'https://geoservices.knmi.nl/wms?dataset=RADAR&',
31996
+ name: 'RAD_NL25_PCP_CM',
31997
+ format: 'image/png',
31998
+ enabled: true,
31999
+ style: 'radar/nearest',
32000
+ id: generateLayerId(),
32001
+ layerType: LayerType.mapLayer,
32002
+ title: 'RAD_NL25_PCP_CM',
32003
+ dimensions: dimensions !== null && dimensions !== void 0 ? dimensions : [{
32004
+ name: 'time',
32005
+ units: 'ISO8601',
32006
+ currentValue: '2021-04-15T00:00:00Z'
32007
+ }]
32008
+ });
32009
+ };
31749
32010
  var WmMultiDimensionLayer = new WMLayer({
31750
32011
  service: 'https://testservice',
31751
32012
  id: 'multiDimensionLayerMock',
@@ -31954,6 +32215,11 @@ var styleListForRADNL25PCPCMLayer = [{
31954
32215
 
31955
32216
  var testSettings = /*#__PURE__*/Object.freeze({
31956
32217
  __proto__: null,
32218
+ defaultReduxLayerRadarColor: defaultReduxLayerRadarColor,
32219
+ multiDimensionLayer: multiDimensionLayer,
32220
+ WmdefaultReduxLayerRadarKNMI: WmdefaultReduxLayerRadarKNMI,
32221
+ defaultReduxLayerRadarKNMI: defaultReduxLayerRadarKNMI,
32222
+ makeGeoservicesRadarLayer: makeGeoservicesRadarLayer,
31957
32223
  WmMultiDimensionLayer: WmMultiDimensionLayer,
31958
32224
  layerWithoutTimeDimension: layerWithoutTimeDimension,
31959
32225
  WmLayerWithoutTimeDimension: WmLayerWithoutTimeDimension,
@@ -31977,6 +32243,19 @@ var testSettings = /*#__PURE__*/Object.freeze({
31977
32243
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
31978
32244
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
31979
32245
  * */
32246
+ var EPSGCode;
32247
+ (function (EPSGCode) {
32248
+ EPSGCode["EPSG3857"] = "EPSG:3857";
32249
+ EPSGCode["EPSG28992"] = "EPSG:28992";
32250
+ EPSGCode["TODO_EPSG4326"] = "TODO__EPSG:4326";
32251
+ EPSGCode["EPSG3411"] = "EPSG:3411";
32252
+ EPSGCode["EPSG32661"] = "EPSG:32661";
32253
+ EPSGCode["EPSG54030"] = "EPSG:54030";
32254
+ EPSGCode["EPSG4326"] = "EPSG:4326";
32255
+ EPSGCode["EPSG4258"] = "EPSG:4258";
32256
+ EPSGCode["EPSG3412"] = "EPSG:3412";
32257
+ EPSGCode["EPSG3575"] = "EPSG:3575";
32258
+ })(EPSGCode || (EPSGCode = {}));
31980
32259
  var tilesettings = {
31981
32260
  WorldMap_Light_Grey_Canvas: {
31982
32261
  'EPSG:3857': {
@@ -32312,158 +32591,6 @@ var tilesettings = {
32312
32591
  }
32313
32592
  };
32314
32593
 
32315
- /* *
32316
- * Licensed under the Apache License, Version 2.0 (the "License");
32317
- * you may not use this file except in compliance with the License.
32318
- * You may obtain a copy of the License at
32319
- *
32320
- * http://www.apache.org/licenses/LICENSE-2.0
32321
- *
32322
- * Unless required by applicable law or agreed to in writing, software
32323
- * distributed under the License is distributed on an "AS IS" BASIS,
32324
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32325
- * See the License for the specific language governing permissions and
32326
- * limitations under the License.
32327
- *
32328
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
32329
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
32330
- * */
32331
- var generatedLayerIds = 0;
32332
- var generateLayerId = function generateLayerId() {
32333
- generatedLayerIds += 1;
32334
- return "layerid_".concat(generatedLayerIds);
32335
- };
32336
- var generatedMapIds = 0;
32337
- var generateMapId = function generateMapId() {
32338
- generatedMapIds += 1;
32339
- return "mapid_".concat(generatedMapIds);
32340
- };
32341
- var generatedTimesliderIds = 0;
32342
- var generateTimesliderId = function generateTimesliderId() {
32343
- generatedTimesliderIds += 1;
32344
- return "timesliderid_".concat(generatedTimesliderIds);
32345
- };
32346
- /**
32347
- * Map for registering wmlayers with their id's
32348
- */
32349
- var registeredWMLayersForReactLayerId = {};
32350
- /**
32351
- * Registers a WMJSLayer in a lookuptable with a layerId
32352
- * @param {WMLayer} wmLayer
32353
- * @param {string} layerId
32354
- */
32355
- var registerWMLayer = function registerWMLayer(wmLayer, layerId) {
32356
- registeredWMLayersForReactLayerId[layerId] = wmLayer;
32357
- };
32358
- /**
32359
- * Get the WMLayer from the lookuptable with layerId
32360
- * @param {string} layerId
32361
- */
32362
- var getWMLayerById = function getWMLayerById(layerId) {
32363
- return registeredWMLayersForReactLayerId[layerId];
32364
- };
32365
- var unRegisterWMJSLayer = function unRegisterWMJSLayer(layerId) {
32366
- var layer = registeredWMLayersForReactLayerId[layerId];
32367
- if (layer) {
32368
- delete registeredWMLayersForReactLayerId[layerId];
32369
- }
32370
- };
32371
- var unRegisterAllWMJSLayersAndMaps = function unRegisterAllWMJSLayersAndMaps() {
32372
- var allLayerIds = Object.keys(registeredWMLayersForReactLayerId);
32373
- allLayerIds.forEach(function (layerId) {
32374
- unRegisterWMJSLayer(layerId);
32375
- });
32376
- var allMapIds = Object.keys(registeredWMMapForReactMapId);
32377
- allMapIds.forEach(function (mapId) {
32378
- unRegisterWMJSMap(mapId);
32379
- });
32380
- };
32381
- /**
32382
- * Map for registering wmlayers with their id's
32383
- */
32384
- var registeredWMMapForReactMapId = {};
32385
- /**
32386
- * Registers a WMJSMap in a lookuptable with a wmjsMapId
32387
- * @param {WMJSMap} wmjsMap
32388
- * @param {string} wmjsMapId
32389
- */
32390
- var registerWMJSMap = function registerWMJSMap(wmjsMap, wmjsMapId) {
32391
- if (registeredWMMapForReactMapId[wmjsMapId]) {
32392
- console.warn("Map with id ".concat(wmjsMapId, " already made"));
32393
- }
32394
- registeredWMMapForReactMapId[wmjsMapId] = wmjsMap;
32395
- };
32396
- var unRegisterWMJSMap = function unRegisterWMJSMap(wmjsMapId) {
32397
- var wmjsMap = registeredWMMapForReactMapId[wmjsMapId];
32398
- if (wmjsMap) {
32399
- wmjsMap.getListener().suspendEvents();
32400
- try {
32401
- wmjsMap.stopAnimating && wmjsMap.stopAnimating();
32402
- } catch (e) {
32403
- console.warn(e);
32404
- }
32405
- Object.keys(registeredWMLayersForReactLayerId).forEach(function (layerId) {
32406
- var wmLayer = getWMLayerById(layerId);
32407
- if (wmLayer.parentMap === wmjsMap) {
32408
- unRegisterWMJSLayer(layerId);
32409
- }
32410
- });
32411
- wmjsMap.destroy();
32412
- delete registeredWMMapForReactMapId[wmjsMapId];
32413
- }
32414
- };
32415
- /**
32416
- * Get the wmjsMap from the lookuptable with wmjsMapId
32417
- * @param {string} wmjsMapId
32418
- */
32419
- var getWMJSMapById = function getWMJSMapById(wmjsMapId) {
32420
- return registeredWMMapForReactMapId[wmjsMapId];
32421
- };
32422
- /**
32423
- * Returns the WMJSDimension object for given layerId and dimension name
32424
- * @param layerId The layerId
32425
- * @param dimensionName The dimension to lookup
32426
- */
32427
- var getWMJSDimensionForLayerAndDimension = function getWMJSDimensionForLayerAndDimension(layerId, dimensionName) {
32428
- var wmLayer = getWMLayerById(layerId);
32429
- if (!wmLayer || !dimensionName) {
32430
- return undefined;
32431
- }
32432
- var wmjsDimension = wmLayer.getDimension(dimensionName);
32433
- if (!wmjsDimension) {
32434
- return undefined;
32435
- }
32436
- return wmjsDimension;
32437
- };
32438
- /**
32439
- * Gets the WMJSTimeDimension for given activeLayerId and dimensions list
32440
- * @param layerId: The layer id to search the WMJSDimension for
32441
- * @return: The WMJSDimension if found, otherwise null
32442
- */
32443
- var getWMJSTimeDimensionForLayerId = function getWMJSTimeDimensionForLayerId(layerId) {
32444
- var wmLayer = getWMLayerById(layerId);
32445
- if (!wmLayer) {
32446
- return null;
32447
- }
32448
- return wmLayer.getDimension('time');
32449
- };
32450
-
32451
- var utils = /*#__PURE__*/Object.freeze({
32452
- __proto__: null,
32453
- generateLayerId: generateLayerId,
32454
- generateMapId: generateMapId,
32455
- generateTimesliderId: generateTimesliderId,
32456
- registerWMLayer: registerWMLayer,
32457
- getWMLayerById: getWMLayerById,
32458
- unRegisterWMJSLayer: unRegisterWMJSLayer,
32459
- unRegisterAllWMJSLayersAndMaps: unRegisterAllWMJSLayersAndMaps,
32460
- registerWMJSMap: registerWMJSMap,
32461
- unRegisterWMJSMap: unRegisterWMJSMap,
32462
- getWMJSMapById: getWMJSMapById,
32463
- getWMJSDimensionForLayerAndDimension: getWMJSDimensionForLayerAndDimension,
32464
- getWMJSTimeDimensionForLayerId: getWMJSTimeDimensionForLayerId
32465
- });
32466
-
32467
32594
  /* *
32468
32595
  * Licensed under the Apache License, Version 2.0 (the "License");
32469
32596
  * you may not use this file except in compliance with the License.
@@ -32804,4 +32931,4 @@ var getCapabilities = /*#__PURE__*/Object.freeze({
32804
32931
  getLayersFlattenedFromService: getLayersFlattenedFromService
32805
32932
  });
32806
32933
 
32807
- export { DateInterval, DebugType, I18n, LayerType, ParseISOTimeRangeDuration, URLDecode, URLEncode, WMBBOX, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle, WMGetServiceFromStore, WMImage, WMImageEventType, WMJSDimension, WMJSMap, WMJSService, WMJScheckURL, WMLayer, WMTimer, clearImageCache, debug, getCapabilities, getLegendGraphicURLForLayer, getMapImageStore, isDefined, legendImageStore, mockGetCapabilities, parseISO8601DateToDate, parseISO8601IntervalToDateInterval, tilesettings, toArray, testSettings as webmapTestSettings, utils as webmapUtils };
32934
+ export { DateInterval, DebugType, EPSGCode, I18n, LayerType, ParseISOTimeRangeDuration, URLDecode, URLEncode, WMBBOX, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle, WMGetServiceFromStore, WMImage, WMImageEventType, WMJSDimension, WMJSMap, WMJSService, WMJScheckURL, WMLayer, WMTimer, clearImageCache, debug, getCapabilities, getLegendGraphicURLForLayer, getMapImageStore, isDefined, legendImageStore, mockGetCapabilities, parseISO8601DateToDate, parseISO8601IntervalToDateInterval, tilesettings, toArray, testSettings as webmapTestSettings, utils as webmapUtils };