@opengeoweb/store 6.0.0 → 6.0.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.js CHANGED
@@ -1,4 +1,4 @@
1
- import { WMLayer, WMGetServiceFromStore } from '@opengeoweb/webmap';
1
+ import { webmapUtils, webmapTestSettings, WMLayer, getCapabilities } from '@opengeoweb/webmap';
2
2
 
3
3
  function _iterableToArrayLimit(arr, i) {
4
4
  var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
@@ -133,7 +133,10 @@ function _regeneratorRuntime() {
133
133
  if ("executing" === state) throw new Error("Generator is already running");
134
134
  if ("completed" === state) {
135
135
  if ("throw" === method) throw arg;
136
- return doneResult();
136
+ return {
137
+ value: void 0,
138
+ done: !0
139
+ };
137
140
  }
138
141
  for (context.method = method, context.arg = arg;;) {
139
142
  var delegate = context.delegate;
@@ -186,7 +189,7 @@ function _regeneratorRuntime() {
186
189
  }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
187
190
  }
188
191
  function values(iterable) {
189
- if (iterable) {
192
+ if (iterable || "" === iterable) {
190
193
  var iteratorMethod = iterable[iteratorSymbol];
191
194
  if (iteratorMethod) return iteratorMethod.call(iterable);
192
195
  if ("function" == typeof iterable.next) return iterable;
@@ -199,15 +202,7 @@ function _regeneratorRuntime() {
199
202
  return next.next = next;
200
203
  }
201
204
  }
202
- return {
203
- next: doneResult
204
- };
205
- }
206
- function doneResult() {
207
- return {
208
- value: undefined,
209
- done: !0
210
- };
205
+ throw new TypeError(typeof iterable + " is not iterable");
211
206
  }
212
207
  return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
213
208
  value: GeneratorFunctionPrototype,
@@ -476,16 +471,6 @@ function __rest(s, e) {
476
471
  t[p[i]] = s[p[i]];
477
472
  }
478
473
  return t;
479
- }
480
-
481
- function __awaiter(thisArg, _arguments, P, generator) {
482
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
483
- return new (P || (P = Promise))(function (resolve, reject) {
484
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
485
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
486
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
487
- step((generator = generator.apply(thisArg, _arguments || [])).next());
488
- });
489
474
  }
490
475
 
491
476
  function n$2(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y$1[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return "'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r$2(n){return !!n&&!!n[Q$1]}function t$4(n){var r;return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z$1}(n)||Array.isArray(n)||!!n[L$1]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L$1])||s$1(n)||v$1(n))}function i$2(n,r,t){void 0===t&&(t=!1),0===o$2(n)?(t?Object.keys:nn$1)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o$2(n){var r=n[Q$1];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s$1(n)?2:v$1(n)?3:0}function u$2(n,r){return 2===o$2(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a$2(n,r){return 2===o$2(n)?n.get(r):n[r]}function f$1(n,r,t){var e=o$2(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t;}function c$2(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s$1(n){return X$1&&n instanceof Map}function v$1(n){return q$1&&n instanceof Set}function p$1(n){return n.o||n.t}function l$1(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn$1(n);delete r[Q$1];for(var t=nn$1(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d$1(n,e){return void 0===e&&(e=!1),y$1(n)||r$2(n)||!t$4(n)||(o$2(n)>1&&(n.set=n.add=n.clear=n.delete=h$1),Object.freeze(n),e&&i$2(n,(function(n,r){return d$1(r,!0)}),!0)),n}function h$1(){n$2(2);}function y$1(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b$1(r){var t=tn$1[r];return t||n$2(18,r),t}function _$1(){return "production"===process.env.NODE_ENV||U$1||n$2(0),U$1}function j$1(n,r){r&&(b$1("Patches"),n.u=[],n.s=[],n.v=r);}function g$1(n){O$1(n),n.p.forEach(S$1),n.p=null;}function O$1(n){n===U$1&&(U$1=n.l);}function w$1(n){return U$1={p:[],l:U$1,h:n,m:!0,_:0}}function S$1(n){var r=n[Q$1];0===r.i||1===r.i?r.j():r.g=!0;}function P$1(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b$1("ES5").S(e,r,o),o?(i[Q$1].P&&(g$1(e),n$2(4)),t$4(r)&&(r=M$1(e,r),e.l||x$1(e,r)),e.u&&b$1("Patches").M(i[Q$1].t,r,e.u,e.s)):r=M$1(e,i,[]),g$1(e),e.u&&e.v(e.u,e.s),r!==H$1?r:void 0}function M$1(n,r,t){if(y$1(r))return r;var e=r[Q$1];if(!e)return i$2(r,(function(i,o){return A$1(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x$1(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l$1(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i$2(u,(function(r,i){return A$1(n,e,o,r,i,t,a)})),x$1(n,o,!1),t&&n.u&&b$1("Patches").N(e,t,n.u,n.s);}return e.o}function A$1(e,i,o,a,c,s,v){if("production"!==process.env.NODE_ENV&&c===o&&n$2(5),r$2(c)){var p=M$1(e,c,s&&i&&3!==i.i&&!u$2(i.R,a)?s.concat(a):void 0);if(f$1(o,a,p),!r$2(p))return;e.m=!1;}else v&&o.add(c);if(t$4(c)&&!y$1(c)){if(!e.h.D&&e._<1)return;M$1(e,c),i&&i.A.l||x$1(e,c);}}function x$1(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d$1(r,t);}function z$1(n,r){var t=n[Q$1];return (t?p$1(t):n)[r]}function I$1(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k$1(n){n.P||(n.P=!0,n.l&&k$1(n.l));}function E$1(n){n.o||(n.o=l$1(n.t));}function N$1(n,r,t){var e=s$1(r)?b$1("MapSet").F(r,t):v$1(r)?b$1("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_$1(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en$1;t&&(i=[e],o=on$1);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b$1("ES5").J(r,t);return (t?t.A:_$1()).p.push(e),e}function R$1(e){return r$2(e)||n$2(22,e),function n(r){if(!t$4(r))return r;var e,u=r[Q$1],c=o$2(r);if(u){if(!u.P&&(u.i<4||!b$1("ES5").K(u)))return u.t;u.I=!0,e=D$1(r,c),u.I=!1;}else e=D$1(r,c);return i$2(e,(function(r,t){u&&a$2(u.t,r)===t||f$1(e,r,n(t));})),3===c?new Set(e):e}(e)}function D$1(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l$1(n)}var G$1,U$1,W$1="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X$1="undefined"!=typeof Map,q$1="undefined"!=typeof Set,B$1="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H$1=W$1?Symbol.for("immer-nothing"):((G$1={})["immer-nothing"]=!0,G$1),L$1=W$1?Symbol.for("immer-draftable"):"__$immer_draftable",Q$1=W$1?Symbol.for("immer-state"):"__$immer_state",Y$1={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z$1=""+Object.prototype.constructor,nn$1="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn$1=Object.getOwnPropertyDescriptors||function(n){var r={};return nn$1(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn$1={},en$1={get:function(n,r){if(r===Q$1)return n;var e=p$1(n);if(!u$2(e,r))return function(n,r,t){var e,i=I$1(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t$4(i)?i:i===z$1(n.t,r)?(E$1(n),n.o[r]=N$1(n.A.h,i,n)):i},has:function(n,r){return r in p$1(n)},ownKeys:function(n){return Reflect.ownKeys(p$1(n))},set:function(n,r,t){var e=I$1(p$1(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z$1(p$1(n),r),o=null==i?void 0:i[Q$1];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c$2(t,i)&&(void 0!==t||u$2(n.t,r)))return !0;E$1(n),k$1(n);}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z$1(n.t,r)||r in n.t?(n.R[r]=!1,E$1(n),k$1(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p$1(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n$2(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n$2(12);}},on$1={};i$2(en$1,(function(n,r){on$1[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on$1.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n$2(13),on$1.set.call(this,r,t,void 0)},on$1.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n$2(14),en$1.set.call(this,r[0],t,e,r[0])};var un$1=function(){function e(r){var e=this;this.O=B$1,this.D=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n$2(6),void 0!==o&&"function"!=typeof o&&n$2(7),t$4(r)){var c=w$1(e),s=N$1(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?g$1(c):O$1(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j$1(c,o),P$1(n,c)}),(function(n){throw g$1(c),n})):(j$1(c,o),P$1(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H$1&&(f=void 0),e.D&&d$1(f,!0),o){var p=[],l=[];b$1("Patches").M(r,f,p,l),o(p,l);}return f}n$2(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t$4(e)||n$2(8),r$2(e)&&(e=R$1(e));var i=w$1(this),o=N$1(this,e,void 0);return o[Q$1].C=!0,O$1(i),o},i.finishDraft=function(r,t){var e=r&&r[Q$1];"production"!==process.env.NODE_ENV&&(e&&e.C||n$2(9),e.I&&n$2(10));var i=e.A;return j$1(i,t),P$1(void 0,i)},i.setAutoFreeze=function(n){this.D=n;},i.setUseProxies=function(r){r&&!B$1&&n$2(20),this.O=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b$1("Patches").$;return r$2(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an$1=new un$1,fn$1=an$1.produce;an$1.produceWithPatches.bind(an$1);an$1.setAutoFreeze.bind(an$1);an$1.setUseProxies.bind(an$1);an$1.applyPatches.bind(an$1);an$1.createDraft.bind(an$1);an$1.finishDraft.bind(an$1);
@@ -8571,226 +8556,6 @@ var enums = /*#__PURE__*/Object.freeze({
8571
8556
  get MapActionOrigin () { return MapActionOrigin; }
8572
8557
  });
8573
8558
 
8574
- /* *
8575
- * Licensed under the Apache License, Version 2.0 (the "License");
8576
- * you may not use this file except in compliance with the License.
8577
- * You may obtain a copy of the License at
8578
- *
8579
- * http://www.apache.org/licenses/LICENSE-2.0
8580
- *
8581
- * Unless required by applicable law or agreed to in writing, software
8582
- * distributed under the License is distributed on an "AS IS" BASIS,
8583
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8584
- * See the License for the specific language governing permissions and
8585
- * limitations under the License.
8586
- *
8587
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8588
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
8589
- * */
8590
- var dateFormat = 'YYYY-MM-DDTHH:mm:ss[Z]';
8591
- var generatedLayerIds = 0;
8592
- var generateLayerId = function generateLayerId() {
8593
- generatedLayerIds += 1;
8594
- return "layerid_".concat(generatedLayerIds);
8595
- };
8596
- var generatedMapIds = 0;
8597
- var generateMapId = function generateMapId() {
8598
- generatedMapIds += 1;
8599
- return "mapid_".concat(generatedMapIds);
8600
- };
8601
- var generatedTimesliderIds = 0;
8602
- var generateTimesliderId = function generateTimesliderId() {
8603
- generatedTimesliderIds += 1;
8604
- return "timesliderid_".concat(generatedTimesliderIds);
8605
- };
8606
- /**
8607
- * Map for registering wmlayers with their id's
8608
- */
8609
- var registeredWMLayersForReactLayerId = {};
8610
- /**
8611
- * Registers a WMJSLayer in a lookuptable with a layerId
8612
- * @param {WMLayer} wmLayer
8613
- * @param {string} layerId
8614
- */
8615
- var registerWMLayer = function registerWMLayer(wmLayer, layerId) {
8616
- registeredWMLayersForReactLayerId[layerId] = wmLayer;
8617
- };
8618
- /**
8619
- * Get the WMLayer from the lookuptable with layerId
8620
- * @param {string} layerId
8621
- */
8622
- var getWMLayerById = function getWMLayerById(layerId) {
8623
- return registeredWMLayersForReactLayerId[layerId];
8624
- };
8625
- var unRegisterWMJSLayer = function unRegisterWMJSLayer(layerId) {
8626
- var layer = registeredWMLayersForReactLayerId[layerId];
8627
- if (layer) {
8628
- delete registeredWMLayersForReactLayerId[layerId];
8629
- }
8630
- };
8631
- var unRegisterAllWMJSLayersAndMaps = function unRegisterAllWMJSLayersAndMaps() {
8632
- var allLayerIds = Object.values(registeredWMLayersForReactLayerId);
8633
- allLayerIds.forEach(function (layerId) {
8634
- unRegisterWMJSLayer(layerId);
8635
- });
8636
- var allMapIds = Object.values(registeredWMMapForReactMapId);
8637
- allMapIds.forEach(function (mapId) {
8638
- unRegisterWMJSMap(mapId);
8639
- });
8640
- };
8641
- /**
8642
- * Map for registering wmlayers with their id's
8643
- */
8644
- var registeredWMMapForReactMapId = {};
8645
- /**
8646
- * Registers a WMJSMap in a lookuptable with a wmjsMapId
8647
- * @param {WMJSMap} wmjsMap
8648
- * @param {string} wmjsMapId
8649
- */
8650
- var registerWMJSMap = function registerWMJSMap(wmjsMap, wmjsMapId) {
8651
- if (registeredWMMapForReactMapId[wmjsMapId]) {
8652
- console.warn("Map with id ".concat(wmjsMapId, " already made"));
8653
- }
8654
- registeredWMMapForReactMapId[wmjsMapId] = wmjsMap;
8655
- };
8656
- var unRegisterWMJSMap = function unRegisterWMJSMap(wmjsMapId) {
8657
- var wmjsMap = registeredWMMapForReactMapId[wmjsMapId];
8658
- if (wmjsMap) {
8659
- wmjsMap.getListener().suspendEvents();
8660
- try {
8661
- wmjsMap.stopAnimating && wmjsMap.stopAnimating();
8662
- } catch (e) {
8663
- console.warn(e);
8664
- }
8665
- Object.keys(registeredWMLayersForReactLayerId).forEach(function (layerId) {
8666
- var wmLayer = getWMLayerById(layerId);
8667
- if (wmLayer.parentMap === wmjsMap) {
8668
- unRegisterWMJSLayer(layerId);
8669
- }
8670
- });
8671
- wmjsMap.destroy();
8672
- delete registeredWMMapForReactMapId[wmjsMapId];
8673
- }
8674
- };
8675
- /**
8676
- * Get the wmjsMap from the lookuptable with wmjsMapId
8677
- * @param {string} wmjsMapId
8678
- */
8679
- var getWMJSMapById = function getWMJSMapById(wmjsMapId) {
8680
- return registeredWMMapForReactMapId[wmjsMapId];
8681
- };
8682
- /**
8683
- * Returns the WMJSDimension object for given layerId and dimension name
8684
- * @param layerId The layerId
8685
- * @param dimensionName The dimension to lookup
8686
- */
8687
- var getWMJSDimensionForLayerAndDimension = function getWMJSDimensionForLayerAndDimension(layerId, dimensionName) {
8688
- var wmLayer = getWMLayerById(layerId);
8689
- if (!wmLayer || !dimensionName) {
8690
- return undefined;
8691
- }
8692
- var wmjsDimension = wmLayer.getDimension(dimensionName);
8693
- if (!wmjsDimension) {
8694
- return undefined;
8695
- }
8696
- return wmjsDimension;
8697
- };
8698
- /**
8699
- * Returns the list of dimensions without the time dimension
8700
- * @param dimensions Dimension[]
8701
- */
8702
- var filterNonTimeDimensions = function filterNonTimeDimensions(dimensions) {
8703
- return dimensions && dimensions.length ? dimensions.filter(function (dim) {
8704
- return dim.name !== 'time';
8705
- }) : [];
8706
- };
8707
- /**
8708
- * Gets the WMJSTimeDimension for given activeLayerId and dimensions list
8709
- * @param layerId: The layer id to search the WMJSDimension for
8710
- * @return: The WMJSDimension if found, otherwise null
8711
- */
8712
- var getWMJSTimeDimensionForLayerId = function getWMJSTimeDimensionForLayerId(layerId) {
8713
- var wmLayer = getWMLayerById(layerId);
8714
- if (!wmLayer) {
8715
- return null;
8716
- }
8717
- return wmLayer.getDimension('time');
8718
- };
8719
- /**
8720
- * Get the previous step for this layerid
8721
- * @param layerId The layerId to get the previous timestep for
8722
- */
8723
- var getPreviousTimeStepForLayerId = function getPreviousTimeStepForLayerId(layerId) {
8724
- var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
8725
- if (!wmjsTimeDim) {
8726
- return null;
8727
- }
8728
- var currentIndex = wmjsTimeDim.getIndexForValue(wmjsTimeDim.currentValue, false);
8729
- if (currentIndex < 0 || currentIndex - 1 < 0) {
8730
- return wmjsTimeDim.getClosestValue(wmjsTimeDim.currentValue, true);
8731
- }
8732
- return wmjsTimeDim.getValueForIndex(currentIndex - 1);
8733
- };
8734
- /**
8735
- * Get the next step for this layerid
8736
- * @param layerId The layerId to get the next timestep for
8737
- */
8738
- var getNextTimeStepForLayerId = function getNextTimeStepForLayerId(layerId) {
8739
- var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
8740
- if (!wmjsTimeDim) {
8741
- return null;
8742
- }
8743
- var currentIndex = wmjsTimeDim.getIndexForValue(wmjsTimeDim.currentValue, false);
8744
- if (currentIndex < 0 || currentIndex + 1 >= wmjsTimeDim.size()) {
8745
- return wmjsTimeDim.getClosestValue(wmjsTimeDim.currentValue, true);
8746
- }
8747
- return wmjsTimeDim.getValueForIndex(currentIndex + 1);
8748
- };
8749
- /**
8750
- * Get the first time step for this layerid
8751
- * @param layerId The layerId to get the first timestep for
8752
- */
8753
- var getFirstTimeStepForLayerId = function getFirstTimeStepForLayerId(layerId) {
8754
- var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
8755
- if (!wmjsTimeDim) {
8756
- return null;
8757
- }
8758
- return wmjsTimeDim.getFirstValue();
8759
- };
8760
- /**
8761
- * Get the last time step for this layerid
8762
- * @param layerId The layerId to get the last timestep for
8763
- */
8764
- var getLastTimeStepForLayerId = function getLastTimeStepForLayerId(layerId) {
8765
- var wmjsTimeDim = getWMJSTimeDimensionForLayerId(layerId);
8766
- if (!wmjsTimeDim) {
8767
- return null;
8768
- }
8769
- return wmjsTimeDim.getLastValue();
8770
- };
8771
-
8772
- var helpers = /*#__PURE__*/Object.freeze({
8773
- __proto__: null,
8774
- dateFormat: dateFormat,
8775
- generateLayerId: generateLayerId,
8776
- generateMapId: generateMapId,
8777
- generateTimesliderId: generateTimesliderId,
8778
- registerWMLayer: registerWMLayer,
8779
- getWMLayerById: getWMLayerById,
8780
- unRegisterWMJSLayer: unRegisterWMJSLayer,
8781
- unRegisterAllWMJSLayersAndMaps: unRegisterAllWMJSLayersAndMaps,
8782
- registerWMJSMap: registerWMJSMap,
8783
- unRegisterWMJSMap: unRegisterWMJSMap,
8784
- getWMJSMapById: getWMJSMapById,
8785
- getWMJSDimensionForLayerAndDimension: getWMJSDimensionForLayerAndDimension,
8786
- filterNonTimeDimensions: filterNonTimeDimensions,
8787
- getWMJSTimeDimensionForLayerId: getWMJSTimeDimensionForLayerId,
8788
- getPreviousTimeStepForLayerId: getPreviousTimeStepForLayerId,
8789
- getNextTimeStepForLayerId: getNextTimeStepForLayerId,
8790
- getFirstTimeStepForLayerId: getFirstTimeStepForLayerId,
8791
- getLastTimeStepForLayerId: getLastTimeStepForLayerId
8792
- });
8793
-
8794
8559
  /* *
8795
8560
  * Licensed under the Apache License, Version 2.0 (the "License");
8796
8561
  * you may not use this file except in compliance with the License.
@@ -8824,6 +8589,7 @@ var constants$1 = /*#__PURE__*/Object.freeze({
8824
8589
  IS_LEGEND_OPEN_BY_DEFAULT: IS_LEGEND_OPEN_BY_DEFAULT
8825
8590
  });
8826
8591
 
8592
+ var dateFormat = 'YYYY-MM-DDTHH:mm:ss[Z]';
8827
8593
  var createMap = function createMap(_ref) {
8828
8594
  var id = _ref.id,
8829
8595
  _ref$isAnimating = _ref.isAnimating,
@@ -9009,7 +8775,7 @@ var findMapIdFromLayerId = function findMapIdFromLayerId(draft, layerId) {
9009
8775
  We need to find out from the layerId to which map it is coupled, and then adjust the map dimension
9010
8776
  */
9011
8777
  var produceDraftStateSetMapDimensionFromLayerChangeDimension = function produceDraftStateSetMapDimensionFromLayerChangeDimension(draft, layerId, dimension) {
9012
- var wmjsDimension = getWMJSDimensionForLayerAndDimension(layerId, dimension.name);
8778
+ var wmjsDimension = webmapUtils.getWMJSDimensionForLayerAndDimension(layerId, dimension.name);
9013
8779
  if (!wmjsDimension) {
9014
8780
  return;
9015
8781
  }
@@ -9096,22 +8862,22 @@ var roundWithTimeStep = function roundWithTimeStep(unixTime, timeStep, type) {
9096
8862
  */
9097
8863
  var secondsPerPxToScale = new Map([[2.5, Scale.Minutes5], [30, Scale.Hour], [3 * 30, Scale.Hours3], [6 * 30, Scale.Hours6], [24 * 30, Scale.Day], [7 * 24 * 30, Scale.Week], [30 * 24 * 30, Scale.Month], [365 * 24 * 30, Scale.Year]]);
9098
8864
  /**
9099
- * Here secondsPerPxToScale is converted to an iterator object and
9100
- * then keys are turned to values and values turned to keys
9101
- * to make it easier in some parts GeoWeb to fetch a secondsPerpx for
8865
+ * Creates a reverse mapping of scales to their corresponding secondsPerPx
8866
+ * values to make it easier in some parts GeoWeb to fetch a secondsPerpx for
9102
8867
  * a certain fundamental scale (Scale.Minutes5 ... Scale.year)
9103
8868
  * @returns an Object, where names are fundamental scale values (0 - 7) and
9104
8869
  * values are their corresponding secondsPerPx numbers.
9105
8870
  */
9106
- var scaleToSecondsPerPx = _toConsumableArray(secondsPerPxToScale.entries()).reduce(function (acc, _ref2) {
8871
+ var scaleToSecondsPerPx = Object.fromEntries(Array.from(secondsPerPxToScale.entries()).map(function (_ref2) {
9107
8872
  var _ref3 = _slicedToArray(_ref2, 2),
9108
8873
  k = _ref3[0],
9109
8874
  v = _ref3[1];
9110
- return Object.assign(Object.assign({}, acc), _defineProperty$1({}, v, Number(k)));
9111
- }, {});
8875
+ return [v, k];
8876
+ }));
9112
8877
 
9113
- var utils$2 = /*#__PURE__*/Object.freeze({
8878
+ var utils$3 = /*#__PURE__*/Object.freeze({
9114
8879
  __proto__: null,
8880
+ dateFormat: dateFormat,
9115
8881
  createMap: createMap,
9116
8882
  checkValidLayersPayload: checkValidLayersPayload,
9117
8883
  getDraftMapById: getDraftMapById,
@@ -9223,7 +8989,7 @@ var produceDraftStateForAllLayersForDimensionWithinMap = function produceDraftSt
9223
8989
  if (!layer || layer.mapId !== mapId) {
9224
8990
  return;
9225
8991
  }
9226
- var wmjsDimension = getWMJSDimensionForLayerAndDimension(layerId, dimension.name);
8992
+ var wmjsDimension = webmapUtils.getWMJSDimensionForLayerAndDimension(layerId, dimension.name);
9227
8993
  if ((wmjsDimension === null || wmjsDimension === void 0 ? void 0 : wmjsDimension.linked) && wmjsDimension.name === 'reference_time') {
9228
8994
  wmjsDimension.linked = false;
9229
8995
  }
@@ -9258,6 +9024,23 @@ var produceDraftStateForAllLayersForDimensionWithinMap = function produceDraftSt
9258
9024
  }
9259
9025
  });
9260
9026
  };
9027
+ /**
9028
+ * Returns the list of dimensions without the time dimension
9029
+ * @param dimensions Dimension[]
9030
+ */
9031
+ var filterNonTimeDimensions = function filterNonTimeDimensions(dimensions) {
9032
+ return dimensions && dimensions.length ? dimensions.filter(function (dim) {
9033
+ return dim.name !== 'time';
9034
+ }) : [];
9035
+ };
9036
+
9037
+ var utils$2 = /*#__PURE__*/Object.freeze({
9038
+ __proto__: null,
9039
+ isActionLayerSynced: isActionLayerSynced,
9040
+ produceDimensionActionForMapLayer: produceDimensionActionForMapLayer,
9041
+ produceDraftStateForAllLayersForDimensionWithinMap: produceDraftStateForAllLayersForDimensionWithinMap,
9042
+ filterNonTimeDimensions: filterNonTimeDimensions
9043
+ });
9261
9044
 
9262
9045
  /* *
9263
9046
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -9391,7 +9174,7 @@ var createLayer = function createLayer(_a) {
9391
9174
  _a$status = _a.status,
9392
9175
  status = _a$status === void 0 ? 'default' : _a$status,
9393
9176
  props = __rest(_a, ["id", "opacity", "acceptanceTimeInMinutes", "enabled", "layerType", "status"]);
9394
- var wmjsLayer = getWMLayerById(id);
9177
+ var wmjsLayer = webmapUtils.getWMLayerById(id);
9395
9178
  var dimensions = props.dimensions || (wmjsLayer ? wmjsLayer.getDimensions() : []).map(function (dim) {
9396
9179
  return {
9397
9180
  name: dim.name,
@@ -9688,7 +9471,7 @@ var slice$8 = createSlice({
9688
9471
  /* Now update the dimension for each layer */
9689
9472
  layerDimensions.dimensions.forEach(function (newLayerDimension) {
9690
9473
  /* Find the wmLayer */
9691
- var wmLayer = getWMLayerById(layerId);
9474
+ var wmLayer = webmapUtils.getWMLayerById(layerId);
9692
9475
  /* Find the wmDimension */
9693
9476
  var wmDimension = wmLayer && wmLayer.getDimension(newLayerDimension.name);
9694
9477
  /* This will set the new range of start/stop values for this dimension, making getClosestValue work properly */
@@ -9702,6 +9485,9 @@ var slice$8 = createSlice({
9702
9485
  draftLayerDimension.maxValue = newLayerDimension.maxValue;
9703
9486
  draftLayerDimension.minValue = newLayerDimension.minValue;
9704
9487
  draftLayerDimension.values = newLayerDimension.values;
9488
+ if (!draftLayerDimension.units) {
9489
+ draftLayerDimension.units = newLayerDimension.units;
9490
+ }
9705
9491
  } else if (layerId === layerDimensions.layerId) {
9706
9492
  /* Otherwise add a new one, but only for this layer. */
9707
9493
  draftLayerDimensions.push({
@@ -27405,357 +27191,6 @@ var types$6 = /*#__PURE__*/Object.freeze({
27405
27191
  get AnimationLength () { return AnimationLength; }
27406
27192
  });
27407
27193
 
27408
- /* *
27409
- * Licensed under the Apache License, Version 2.0 (the "License");
27410
- * you may not use this file except in compliance with the License.
27411
- * You may obtain a copy of the License at
27412
- *
27413
- * http://www.apache.org/licenses/LICENSE-2.0
27414
- *
27415
- * Unless required by applicable law or agreed to in writing, software
27416
- * distributed under the License is distributed on an "AS IS" BASIS,
27417
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27418
- * See the License for the specific language governing permissions and
27419
- * limitations under the License.
27420
- *
27421
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27422
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
27423
- * */
27424
- var tilesettings = {
27425
- WorldMap_Light_Grey_Canvas: {
27426
- 'EPSG:3857': {
27427
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap_Light_Grey_Canvas/EPSG3857/',
27428
- minLevel: 0,
27429
- maxLevel: 9,
27430
- tileServerType: 'osm',
27431
- copyRight: 'Natural Earth II | Ingmapping'
27432
- }
27433
- },
27434
- OpenStreetMap_NL: {
27435
- 'EPSG:3857': {
27436
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreetMap_NL/EPSG3857/',
27437
- minLevel: 0,
27438
- maxLevel: 16,
27439
- tileServerType: 'osm',
27440
- copyRight: 'OpenStreetMap - contributors | Ingmapping'
27441
- }
27442
- },
27443
- OpenStreets_NL: {
27444
- 'EPSG:3857': {
27445
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreets_NL/EPSG3857/',
27446
- minLevel: 0,
27447
- maxLevel: 16,
27448
- tileServerType: 'osm',
27449
- copyRight: 'OpenStreetMap - contributors | Ingmapping'
27450
- },
27451
- 'EPSG:28992': {
27452
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreets_NL/EPSG28992/',
27453
- minLevel: 0,
27454
- maxLevel: 16,
27455
- tileServerType: 'osm',
27456
- copyRight: 'Natural Earth II | Ingmapping'
27457
- }
27458
- },
27459
- Positron_NL: {
27460
- 'EPSG:3857': {
27461
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Positron_NL/EPSG3857/',
27462
- minLevel: 0,
27463
- maxLevel: 16,
27464
- tileServerType: 'osm',
27465
- copyRight: 'OpenStreetMap - contributors | OpenMapTiles | Ingmapping'
27466
- }
27467
- },
27468
- Positron_NL_NoLabels: {
27469
- 'EPSG:3857': {
27470
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Positron_NL_NoLabels/EPSG3857/',
27471
- minLevel: 0,
27472
- maxLevel: 16,
27473
- tileServerType: 'osm',
27474
- copyRight: 'OpenStreetMap - contributors | OpenMapTiles | Ingmapping'
27475
- }
27476
- },
27477
- Klokantech_Basic_NL: {
27478
- 'EPSG:3857': {
27479
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Klokantech_Basic_NL/EPSG3857/',
27480
- minLevel: 0,
27481
- maxLevel: 16,
27482
- tileServerType: 'osm',
27483
- copyRight: 'OpenStreetMap - contributors | OpenMapTiles | Ingmapping'
27484
- }
27485
- },
27486
- Klokantech_Basic_NL_NoLabels: {
27487
- 'EPSG:3857': {
27488
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Klokantech_Basic_NL_NoLabels/EPSG3857/',
27489
- minLevel: 0,
27490
- maxLevel: 16,
27491
- tileServerType: 'osm',
27492
- copyRight: 'OpenStreetMap - contributors | OpenMapTiles | Ingmapping'
27493
- }
27494
- },
27495
- OSM_Blossom_NL: {
27496
- 'EPSG:3857': {
27497
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OSM_Blossom_NL/EPSG3857/',
27498
- minLevel: 0,
27499
- maxLevel: 16,
27500
- tileServerType: 'osm',
27501
- copyRight: 'OpenStreetMap - contributors | Ingmapping'
27502
- }
27503
- },
27504
- WorldMap: {
27505
- 'EPSG:3857': {
27506
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3857/',
27507
- minLevel: 0,
27508
- maxLevel: 9,
27509
- tileServerType: 'osm',
27510
- copyRight: 'Natural Earth II | Ingmapping'
27511
- },
27512
- 'TODO__EPSG:4326': {
27513
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG4326/',
27514
- minLevel: 0,
27515
- maxLevel: 9,
27516
- origX: -180,
27517
- origY: 90,
27518
- resolution: 1.422222,
27519
- tileServerType: 'osm',
27520
- copyRight: 'Natural Earth II | Ingmapping'
27521
- },
27522
- 'EPSG:3411': {
27523
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3411/',
27524
- minLevel: 3,
27525
- maxLevel: 9,
27526
- tileServerType: 'osm',
27527
- copyRight: 'Natural Earth II | Ingmapping'
27528
- },
27529
- 'EPSG:28992': {
27530
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG28992/',
27531
- minLevel: 5,
27532
- maxLevel: 9,
27533
- tileServerType: 'osm',
27534
- copyRight: 'Natural Earth II | Ingmapping'
27535
- },
27536
- 'EPSG:3412': {
27537
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3412/',
27538
- minLevel: 3,
27539
- maxLevel: 9,
27540
- tileServerType: 'osm',
27541
- copyRight: 'Natural Earth II | Ingmapping'
27542
- },
27543
- 'EPSG:32661': {
27544
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG32661/',
27545
- minLevel: 4,
27546
- maxLevel: 9,
27547
- tileServerType: 'osm',
27548
- copyRight: 'Natural Earth II | Ingmapping'
27549
- },
27550
- 'EPSG:54030': {
27551
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG54030/',
27552
- minLevel: 3,
27553
- maxLevel: 9,
27554
- tileServerType: 'osm',
27555
- copyRight: 'Natural Earth II | Ingmapping'
27556
- },
27557
- 'EPSG:3575': {
27558
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3575/',
27559
- minLevel: 5,
27560
- maxLevel: 9,
27561
- tileServerType: 'osm',
27562
- copyRight: 'Natural Earth II | Ingmapping'
27563
- }
27564
- },
27565
- OSM_Antarctica: {
27566
- 'EPSG:3412': {
27567
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OSM_Antarctica/EPSG3412/',
27568
- minLevel: 1,
27569
- maxLevel: 7,
27570
- origX: -3000000,
27571
- origY: 3000000,
27572
- resolution: 23437.5,
27573
- tileServerType: 'osm',
27574
- copyRight: 'OpenStreetMap - contributors | Ingmapping'
27575
- }
27576
- },
27577
- arcGisCanvas: {
27578
- title: 'ArcGIS canvas map',
27579
- 'EPSG:3857': {
27580
- home: 'https://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/',
27581
- minLevel: 1,
27582
- maxLevel: 16,
27583
- tileServerType: 'arcgisonline',
27584
- copyRight: 'Basemap copyright: 2013 ESRI, DeLorme, NAVTEQ'
27585
- },
27586
- 'EPSG:28992': {
27587
- home: 'https://services.arcgisonline.com/arcgis/rest/services/Basiskaarten/Canvas/MapServer/tile/',
27588
- minLevel: 1,
27589
- maxLevel: 12,
27590
- origX: -285401.92,
27591
- origY: 903401.92,
27592
- resolution: 3440.64,
27593
- tileServerType: 'arcgisonline',
27594
- copyRight: 'Basiskaart bronnen: ESRI Nederland, ESRI, Kadaster, CBS en Rijkswaterstaat'
27595
- }
27596
- },
27597
- arcGisTopo: {
27598
- title: 'ArcGIS topo map',
27599
- 'EPSG:3857': {
27600
- home: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/',
27601
- minLevel: 1,
27602
- maxLevel: 19,
27603
- tileServerType: 'arcgisonline',
27604
- copyRight: 'Basemap sources: ESRI, DeLorme, NAVTEQ, TomTom, Intermap, increment P Corp., GEBCO, USGS, FAO, NPS, NRCAN, GeoBase, IGN, Kadaster NL, Ordnance Survey, ESRI Japan, METI, ESRI China (Hong Kong), and the GIS User Community'
27605
- },
27606
- 'EPSG:28992': {
27607
- home: 'https://services.arcgisonline.com/arcgis/rest/services/Basiskaarten/Topo/MapServer/tile/',
27608
- minLevel: 1,
27609
- maxLevel: 12,
27610
- origX: -285401.92,
27611
- origY: 903401.92,
27612
- resolution: 3440.64,
27613
- tileServerType: 'arcgisonline',
27614
- copyRight: 'Basiskaart bronnen: ESRI Nederland, ESRI, Kadaster, CBS, Min VROM, Rijkswaterstaat en gemeenten: Rotterdam, Breda, Tilburg'
27615
- }
27616
- },
27617
- arcGisOceanBaseMap: {
27618
- 'EPSG:3857': {
27619
- title: 'ArcGIS ocean map',
27620
- home: 'https://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/tile/',
27621
- minLevel: 1,
27622
- maxLevel: 19,
27623
- tileServerType: 'arcgisonline',
27624
- copyRight: 'Basemap sources: ESRI, GEBCO, NOAA, National Geographic, DeLorme, NAVTEQ, Geonames.org, and other contributors'
27625
- }
27626
- },
27627
- arcGisSat: {
27628
- title: 'ArcGIS satellite map',
27629
- 'EPSG:4326': {
27630
- home: 'https://services.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/tile/',
27631
- minLevel: 1,
27632
- maxLevel: 15,
27633
- tileServerType: 'arcgisonline',
27634
- origX: -180,
27635
- origY: 90,
27636
- resolution: 0.3515625,
27637
- tileSize: 512,
27638
- copyRight: 'ESRI'
27639
- },
27640
- 'EPSG:3857': {
27641
- home: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/',
27642
- minLevel: 1,
27643
- maxLevel: 18,
27644
- tileServerType: 'arcgisonline',
27645
- copyRight: 'ESRI'
27646
- }
27647
- },
27648
- OpenStreetMap_Service: {
27649
- title: 'OpenStreetMap Service',
27650
- 'EPSG:3857': {
27651
- home: 'https://b.tile.openstreetmap.org/',
27652
- minLevel: 1,
27653
- maxLevel: 16,
27654
- tileServerType: 'osm',
27655
- copyRight: 'OpenStreetMap - contributors'
27656
- },
27657
- 'EPSG:28992': {
27658
- home: 'https://services.arcgisonline.com/ArcGIS/rest/services/Basiskaarten/PDOK_BRT/MapServer/tile/',
27659
- minLevel: 1,
27660
- maxLevel: 12,
27661
- origX: -285401.92,
27662
- origY: 903401.92,
27663
- resolution: 3440.64,
27664
- tileServerType: 'arcgisonline',
27665
- copyRight: 'Basiskaart bronnen: PDOK, Kadaster, OpenStreetMap'
27666
- }
27667
- },
27668
- NaturalEarth2: {
27669
- 'EPSG:3411': {
27670
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3411/',
27671
- minLevel: 1,
27672
- maxLevel: 6,
27673
- origX: -12400000,
27674
- origY: 12400000,
27675
- resolution: 96875,
27676
- tileServerType: 'wmst',
27677
- copyRight: 'NPS - Natural Earth II'
27678
- },
27679
- 'EPSG:3412': {
27680
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3412/',
27681
- minLevel: 1,
27682
- maxLevel: 6,
27683
- origX: -12400000,
27684
- origY: 12400000,
27685
- resolution: 96875,
27686
- tileServerType: 'wmst',
27687
- copyRight: 'NPS - Natural Earth II'
27688
- },
27689
- 'EPSG:3575': {
27690
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3575/',
27691
- minLevel: 1,
27692
- maxLevel: 6,
27693
- origX: -13000000,
27694
- origY: 13000000,
27695
- resolution: 101562.5,
27696
- tileServerType: 'wmst',
27697
- copyRight: 'NPS - Natural Earth II'
27698
- },
27699
- 'EPSG:3857': {
27700
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3857/',
27701
- minLevel: 1,
27702
- maxLevel: 7,
27703
- tileServerType: 'wmst',
27704
- copyRight: 'NPS - Natural Earth II'
27705
- },
27706
- 'EPSG:4258': {
27707
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG4326/',
27708
- minLevel: 1,
27709
- maxLevel: 6,
27710
- origX: -180,
27711
- origY: 90,
27712
- resolution: 0.703125,
27713
- tileServerType: 'wmst',
27714
- copyRight: 'NPS - Natural Earth II'
27715
- },
27716
- 'EPSG:4326': {
27717
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG4326/',
27718
- minLevel: 1,
27719
- maxLevel: 6,
27720
- origX: -180,
27721
- origY: 90,
27722
- resolution: 0.703125,
27723
- tileServerType: 'wmst',
27724
- copyRight: 'NPS - Natural Earth II'
27725
- },
27726
- 'EPSG:28992': {
27727
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG28992/',
27728
- minLevel: 1,
27729
- maxLevel: 5,
27730
- origX: -2999000,
27731
- origY: 2995500,
27732
- resolution: 23437,
27733
- tileServerType: 'wmst',
27734
- copyRight: 'NPS - Natural Earth II'
27735
- },
27736
- 'EPSG:32661': {
27737
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG32661/',
27738
- minLevel: 1,
27739
- maxLevel: 7,
27740
- origX: -5000000,
27741
- origY: 4000000,
27742
- resolution: 58593.75,
27743
- tileServerType: 'wmst',
27744
- copyRight: 'NPS - Natural Earth II'
27745
- },
27746
- 'EPSG:54030': {
27747
- home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG54030/',
27748
- minLevel: 1,
27749
- maxLevel: 7,
27750
- origX: -17000000,
27751
- origY: 8625830,
27752
- resolution: 132812.5,
27753
- tileServerType: 'wmst',
27754
- copyRight: 'NPS - Natural Earth II'
27755
- }
27756
- }
27757
- };
27758
-
27759
27194
  /* *
27760
27195
  * Licensed under the Apache License, Version 2.0 (the "License");
27761
27196
  * you may not use this file except in compliance with the License.
@@ -27778,15 +27213,15 @@ var replaceLayerIdsToEnsureUniqueLayerIdsInStore = function replaceLayerIdsToEns
27778
27213
  autoUpdateLayerId = layerIds.autoUpdateLayerId;
27779
27214
  var layerIdIsSameForTimestepAndUpdate = autoTimeStepLayerId && autoTimeStepLayerId === autoUpdateLayerId;
27780
27215
  if (layerIdIsSameForTimestepAndUpdate) {
27781
- var newAutoLayerId = generateLayerId();
27216
+ var newAutoLayerId = webmapUtils.generateLayerId();
27782
27217
  return {
27783
27218
  layers: replaceLayerIds(layers, autoTimeStepLayerId, newAutoLayerId),
27784
27219
  autoTimeStepLayerId: newAutoLayerId,
27785
27220
  autoUpdateLayerId: newAutoLayerId
27786
27221
  };
27787
27222
  }
27788
- var autoTimeStepLayerIdNew = autoTimeStepLayerId && generateLayerId();
27789
- var autoUpdateLayerIdNew = autoUpdateLayerId && generateLayerId();
27223
+ var autoTimeStepLayerIdNew = autoTimeStepLayerId && webmapUtils.generateLayerId();
27224
+ var autoUpdateLayerIdNew = autoUpdateLayerId && webmapUtils.generateLayerId();
27790
27225
  var timestepAndUpdateLayerIdsAreProvided = autoTimeStepLayerId && autoUpdateLayerId;
27791
27226
  if (timestepAndUpdateLayerIdsAreProvided) {
27792
27227
  var autoTimeStepLayerIndex = layers.findIndex(function (layer) {
@@ -27807,7 +27242,7 @@ var replaceLayerIdsToEnsureUniqueLayerIdsInStore = function replaceLayerIdsToEns
27807
27242
  });
27808
27243
  }
27809
27244
  return Object.assign(Object.assign({}, layer), {
27810
- id: generateLayerId()
27245
+ id: webmapUtils.generateLayerId()
27811
27246
  });
27812
27247
  });
27813
27248
  return {
@@ -27832,7 +27267,7 @@ var replaceLayerIdsToEnsureUniqueLayerIdsInStore = function replaceLayerIdsToEns
27832
27267
  // nor auto update layer id was provided
27833
27268
  var layersWithNewIds = layers.map(function (layer) {
27834
27269
  return Object.assign(Object.assign({}, layer), {
27835
- id: generateLayerId()
27270
+ id: webmapUtils.generateLayerId()
27836
27271
  });
27837
27272
  });
27838
27273
  return {
@@ -27850,7 +27285,7 @@ function replaceLayerIds(layers, autoLayerIdOld, autoLayerIdNew) {
27850
27285
  });
27851
27286
  }
27852
27287
  return Object.assign(Object.assign({}, layer), {
27853
- id: generateLayerId()
27288
+ id: webmapUtils.generateLayerId()
27854
27289
  });
27855
27290
  });
27856
27291
  return layersWithNewIds;
@@ -28038,10 +27473,10 @@ var createLayersWithIds = function createLayersWithIds(state, layers) {
28038
27473
  for (var j = 0; j < draft.length; j += 1) {
28039
27474
  var layer = draft[j];
28040
27475
  if (!layer.id) {
28041
- layer.id = generateLayerId();
27476
+ layer.id = webmapUtils.generateLayerId();
28042
27477
  } else if (checkIfMapLayerIdIsAlreadyTaken(state, layer.id)) {
28043
27478
  console.warn("Warning: Layer id ".concat(layer.id, " was already taken: Generating new one."));
28044
- layer.id = generateLayerId();
27479
+ layer.id = webmapUtils.generateLayerId();
28045
27480
  }
28046
27481
  }
28047
27482
  });
@@ -28400,7 +27835,7 @@ var slice$6 = createSlice({
28400
27835
  draft.byId[mapId].mapLayers = layerIds;
28401
27836
  draft.byId[mapId].autoUpdateLayerId = activeLayerId;
28402
27837
  draft.byId[mapId].autoTimeStepLayerId = activeLayerId;
28403
- var webmapInstance = getWMJSMapById(mapId);
27838
+ var webmapInstance = webmapUtils.getWMJSMapById(mapId);
28404
27839
  if (webmapInstance) {
28405
27840
  var mapDims = webmapInstance.getDimensionList();
28406
27841
  if (!draft.byId[mapId].dimensions) {
@@ -30228,7 +29663,7 @@ var selectors$3 = /*#__PURE__*/Object.freeze({
30228
29663
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
30229
29664
  * */
30230
29665
  var baseLayerGrey = {
30231
- id: generateLayerId(),
29666
+ id: webmapUtils.generateLayerId(),
30232
29667
  name: 'WorldMap_Light_Grey_Canvas',
30233
29668
  type: 'twms',
30234
29669
  layerType: LayerType.baseLayer
@@ -30244,7 +29679,7 @@ var overLayer = {
30244
29679
  name: 'countryborders',
30245
29680
  format: 'image/png',
30246
29681
  enabled: true,
30247
- id: generateLayerId(),
29682
+ id: webmapUtils.generateLayerId(),
30248
29683
  layerType: LayerType.overLayer
30249
29684
  };
30250
29685
 
@@ -30316,7 +29751,7 @@ var parseBoolean = function parseBoolean(value) {
30316
29751
  };
30317
29752
  var parseLayer = function parseLayer(layer) {
30318
29753
  return Object.assign(Object.assign(Object.assign({}, layer), !layer.id && {
30319
- id: generateLayerId()
29754
+ id: webmapUtils.generateLayerId()
30320
29755
  }), layer.enabled && {
30321
29756
  enabled: parseBoolean(layer.enabled)
30322
29757
  });
@@ -30346,7 +29781,7 @@ var filterLayers$1 = /*#__PURE__*/Object.freeze({
30346
29781
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
30347
29782
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
30348
29783
  * */
30349
- var mapUtils = Object.assign(Object.assign({}, utils$2), {
29784
+ var mapUtils = Object.assign(Object.assign({}, utils$3), {
30350
29785
  replaceLayerIdsToEnsureUniqueLayerIdsInStore: replaceLayerIdsToEnsureUniqueLayerIdsInStore
30351
29786
  });
30352
29787
 
@@ -30539,43 +29974,9 @@ var selectors$2 = /*#__PURE__*/Object.freeze({
30539
29974
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
30540
29975
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
30541
29976
  * */
30542
- var WmMultiDimensionLayer = new WMLayer({
30543
- service: 'https://testservice',
30544
- id: 'multiDimensionLayerMock',
30545
- name: 'MULTI_DIMENSION_LAYER',
30546
- title: 'MULTI_DIMENSION_LAYER',
30547
- layerType: LayerType.mapLayer,
30548
- enabled: true,
30549
- dimensions: [{
30550
- name: 'flight level',
30551
- units: 'hft',
30552
- currentValue: '625',
30553
- values: '25,325,625'
30554
- }, {
30555
- name: 'elevation',
30556
- units: 'meters',
30557
- currentValue: '9000',
30558
- values: '1000,5000,9000'
30559
- }, {
30560
- name: 'time',
30561
- units: 'ISO8601',
30562
- currentValue: '2020-03-13T14:40:00Z',
30563
- values: '2020-03-13T10:40:00Z/2020-03-13T14:40:00Z/PT5M'
30564
- }]
30565
- });
30566
- var layerWithoutTimeDimension = {
30567
- service: 'https://testservice',
30568
- id: 'layerWithoutTime',
30569
- name: 'LAYER_WITHOUT_TIME',
30570
- layerType: LayerType.mapLayer,
30571
- dimensions: [{
30572
- name: 'flight level',
30573
- units: 'hft',
30574
- currentValue: '625',
30575
- values: '25,325,625'
30576
- }]
30577
- };
30578
- var WmLayerWithoutTimeDimension = new WMLayer(layerWithoutTimeDimension);
29977
+ var WmLayerWithoutTimeDimension = webmapTestSettings.WmLayerWithoutTimeDimension,
29978
+ WmMultiDimensionLayer = webmapTestSettings.WmMultiDimensionLayer,
29979
+ layerWithoutTimeDimension = webmapTestSettings.layerWithoutTimeDimension;
30579
29980
  var styleListForRADNLOPERR25PCPRRL3KNMILayer = [{
30580
29981
  title: 'knmiradar/nearest',
30581
29982
  name: 'knmiradar/nearest',
@@ -30692,185 +30093,15 @@ var WmMultiDimensionLayer2 = new WMLayer({
30692
30093
  currentValue: '2017-01-01T00:25:00Z'
30693
30094
  }]
30694
30095
  });
30695
- var styleListForRADNL25PCPCMLayer = [{
30696
- title: 'radar/nearest',
30697
- name: 'radar/nearest',
30698
- 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=radar/nearest',
30699
- "abstract": 'No abstract available'
30700
- }, {
30701
- title: 'precip-rainbow/nearest',
30702
- name: 'precip-rainbow/nearest',
30703
- 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',
30704
- "abstract": 'No abstract available'
30705
- }, {
30706
- title: 'precip-gray/nearest',
30707
- name: 'precip-gray/nearest',
30708
- 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-gray/nearest',
30709
- "abstract": 'No abstract available'
30710
- }, {
30711
- title: 'precip-blue/nearest',
30712
- name: 'precip-blue/nearest',
30713
- 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-blue/nearest',
30714
- "abstract": 'No abstract available'
30715
- }, {
30716
- title: 'precip-blue-transparent/nearest',
30717
- name: 'precip-blue-transparent/nearest',
30718
- 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-blue-transparent/nearest',
30719
- "abstract": 'No abstract available'
30720
- }, {
30721
- title: 'precip-with-range/nearest',
30722
- name: 'precip-with-range/nearest',
30723
- 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-with-range/nearest',
30724
- "abstract": 'No abstract available'
30725
- }];
30726
- var crsListForRADNL25PCPCMLayer = [{
30727
- name: 'EPSG:3411',
30728
- bbox: {
30729
- left: 2682754.74362,
30730
- right: 3759536.917562,
30731
- bottom: -3245034.014141,
30732
- top: -2168251.989038
30733
- }
30734
- }, {
30735
- name: 'EPSG:3412',
30736
- bbox: {
30737
- left: 0,
30738
- right: 7413041.166015,
30739
- bottom: 32318824.826266,
30740
- top: 40075258.815074
30741
- }
30742
- }, {
30743
- name: 'EPSG:3575',
30744
- bbox: {
30745
- left: -770622.801471,
30746
- right: 56845.766135,
30747
- bottom: -4485814.811314,
30748
- top: -3684039.44362
30749
- }
30750
- }, {
30751
- name: 'EPSG:3857',
30752
- bbox: {
30753
- left: 0,
30754
- right: 1208534.698398,
30755
- bottom: 6257115.219364,
30756
- top: 7553161.958695
30757
- }
30758
- }, {
30759
- name: 'EPSG:4258',
30760
- bbox: {
30761
- left: 0,
30762
- right: 10.856452,
30763
- bottom: 48.895303,
30764
- top: 55.9736
30765
- }
30766
- }, {
30767
- name: 'EPSG:4326',
30768
- bbox: {
30769
- left: 0,
30770
- right: 10.856452,
30771
- bottom: 48.895303,
30772
- top: 55.9736
30773
- }
30774
- }, {
30775
- name: 'CRS:84',
30776
- bbox: {
30777
- left: 0,
30778
- right: 10.856452,
30779
- bottom: 48.895303,
30780
- top: 55.9736
30781
- }
30782
- }, {
30783
- name: 'EPSG:25831',
30784
- bbox: {
30785
- left: 282182.345905,
30786
- right: 997135.658653,
30787
- bottom: 5433247.394267,
30788
- top: 6207204.592736
30789
- }
30790
- }, {
30791
- name: 'EPSG:25832',
30792
- bbox: {
30793
- left: -153083.019482,
30794
- right: 617595.626092,
30795
- bottom: 5415817.312927,
30796
- top: 6239769.309937
30797
- }
30798
- }, {
30799
- name: 'EPSG:28992',
30800
- bbox: {
30801
- left: -236275.338083,
30802
- right: 501527.918656,
30803
- bottom: 106727.731651,
30804
- top: 900797.079725
30805
- }
30806
- }, {
30807
- name: 'EPSG:7399',
30808
- bbox: {
30809
- left: 0,
30810
- right: 763611.971696,
30811
- bottom: 5757301.056717,
30812
- top: 6483919.801602
30813
- }
30814
- }, {
30815
- name: 'EPSG:50001',
30816
- bbox: {
30817
- left: -2000000,
30818
- right: 10000000,
30819
- bottom: -2000000,
30820
- top: 8500000
30821
- }
30822
- }, {
30823
- name: 'EPSG:54030',
30824
- bbox: {
30825
- left: 0,
30826
- right: 853649.695106,
30827
- bottom: 5211855.054125,
30828
- top: 5936394.291427
30829
- }
30830
- }, {
30831
- name: 'EPSG:32661',
30832
- bbox: {
30833
- left: 2000000,
30834
- right: 2745713.040381,
30835
- bottom: -2703305.597319,
30836
- top: -1888346.21671
30837
- }
30838
- }, {
30839
- name: 'EPSG:40000',
30840
- bbox: {
30841
- left: 0,
30842
- right: 750214.326339,
30843
- bottom: -4731695.771951,
30844
- top: -3911817.119426
30845
- }
30846
- }, {
30847
- name: 'EPSG:900913',
30848
- bbox: {
30849
- left: 0,
30850
- right: 1208534.698398,
30851
- bottom: 6257115.219364,
30852
- top: 7553161.958695
30853
- }
30854
- }, {
30855
- name: 'PROJ4:%2Bproj%3Dstere%20%2Blat_0%3D90%20%2Blon_0%3D0%20%2Blat_ts%3D60%20%2Ba%3D6378%2E14%20%2Bb%3D6356%2E75%20%2Bx_0%3D0%20y_0%3D0',
30856
- bbox: {
30857
- left: 0,
30858
- right: 700.00242,
30859
- bottom: -3649.999338,
30860
- top: -4415.002986
30861
- }
30862
- }];
30863
30096
 
30864
30097
  var storeTestSettings = /*#__PURE__*/Object.freeze({
30865
30098
  __proto__: null,
30099
+ WmLayerWithoutTimeDimension: WmLayerWithoutTimeDimension,
30866
30100
  WmMultiDimensionLayer: WmMultiDimensionLayer,
30867
30101
  layerWithoutTimeDimension: layerWithoutTimeDimension,
30868
- WmLayerWithoutTimeDimension: WmLayerWithoutTimeDimension,
30869
30102
  styleListForRADNLOPERR25PCPRRL3KNMILayer: styleListForRADNLOPERR25PCPRRL3KNMILayer,
30870
30103
  defaultReduxServices: defaultReduxServices,
30871
- WmMultiDimensionLayer2: WmMultiDimensionLayer2,
30872
- styleListForRADNL25PCPCMLayer: styleListForRADNL25PCPCMLayer,
30873
- crsListForRADNL25PCPCMLayer: crsListForRADNL25PCPCMLayer
30104
+ WmMultiDimensionLayer2: WmMultiDimensionLayer2
30874
30105
  });
30875
30106
 
30876
30107
  function n(n,e,r){if(r||2===arguments.length)for(var t,u=0,o=e.length;o>u;u++)!t&&u in e||(t||(t=[].slice.call(e,0,u)),t[u]=e[u]);return n.concat(t||[].slice.call(e))}var e$1=function(n,e){return n===e},r=function(){return !1},t$2=function(t,u){void 0===t&&(t=e$1),void 0===u&&(u=r);var o=[],c=function(n){var e=o.findIndex((function(e){return t(e.value,n)}));return [o[e],e]};return {getCount:function(n){var e=c(n)[0];return (null==e?void 0:e.count)||0},getItems:function(){return n([],o,!0)},add:function(n){var e=c(n)[0];e&&!u(e.value)?e.count+=1:e||o.push({value:n,count:u(n)?1/0:1});},remove:function(n){var e=c(n),r=e[0],t=e[1];r&&!u(r.value)&&(r.count>1?r.count-=1:o.splice(t,1));}}},u=Array.isArray,o=function(n){var e=[],r=function(n){n.forEach((function(n){u(n)?r(n):e.push(n);}));};return u(n)&&r(n),e},c=["enhancers","middlewares","beforeAdd","afterAdd","beforeRemove","afterRemove"],a=function(e,r,u,i){void 0===i&&(i=[]);var a,f=i.reduce((function(n,e){return c.forEach((function(r){var t,u=e[r];(null==u?void 0:u.length)&&(t=n[r]).push.apply(t,u);})),n}),c.reduce((function(n,e){return n[e]=[],n}),{})),d={getItems:(a=t$2((function(n,e){return n.id===e.id}),(function(n){return !!n.keep}))).getItems,getCount:a.getCount,add:function(n){n.forEach((function(n){return a.add(n)}));},remove:function(n){n.forEach((function(n){return a.remove(n)}));}},v=function(n){var e,r=t$2(),u=[];return {mid:function(r){return e=r,function(e){return function(r){return n.apply(void 0,u.map((function(n){return n.act})))(e)(r)}}},add:function(n){n.forEach((function(n){r.getCount(n)||u.push({mid:n,act:n(e)}),r.add(n);}));},remove:function(n){n.forEach((function(n){1===r.getCount(n)&&(u=u.filter((function(e){return n!==e.mid}))),r.remove(n);}));}}}(u),l=function(e){var r,u=t$2(),o={},c=[];return {reducer:function(n,e){void 0===n&&(n={});var t=n;return c.length&&(t=Object.assign({},n),c.forEach((function(n){return delete t[n]})),c=[]),(Object.keys(o).length?r:function(){return {}})(t,e)},add:function(n){var t=[];return n.forEach((function(n){var e=n[0],r=n[1];u.getCount(e)||(o[e]=r,t.push(e)),u.add(e);})),t.length&&(r=e(o)),t},remove:function(t){return t.forEach((function(n){var e=n[0];1===u.getCount(e)&&(delete o[e],c.push(e)),u.remove(e);})),c.length&&(r=e(o)),n([],c,!0)}}}(r),g=e(l.reducer,v.mid,f.enhancers,f.middlewares),s=function(n,e,r,t){var u=n.filter((function(n){return n.id}));if(u.length){var o=[],c=[],i=[],a="add"===e;u.forEach((function(n){var e,r=d.getCount(n);(a&&!r||!a&&1===r)&&(o.push(n),(null===(e=n.middlewares)||void 0===e?void 0:e.length)&&c.push.apply(c,n.middlewares),n.reducersMap&&i.push.apply(i,Object.entries(n.reducersMap)));}));var s=o.length;s&&(f[r].forEach((function(n){return n(o,g)})),o.forEach((function(n){var e;return null===(e=n[r])||void 0===e?void 0:e.call(n,g)})),l[e](i).length&&g.dispatch({type:"@@eggs/reduce"}),v[e](c)),d[e](u),s&&(f[t].forEach((function(n){return n(o,g)})),o.forEach((function(n){var e;return null===(e=n[t])||void 0===e?void 0:e.call(n,g)})));}},h=function(n){return s(n,"remove","beforeRemove","afterRemove")};return Object.assign(g,{getEggs:d.getItems,getEggCount:d.getCount,addEggs:function(e){var r=o(e);return s(r,"add","beforeAdd","afterAdd"),function(){return h(n([],r,!0).reverse())}},removeEggs:function(n){h(o(n));}})};
@@ -33130,7 +32361,7 @@ var validInitialAnimationStep = function validInitialAnimationStep(initialAnimat
33130
32361
  return !!initialAnimationStep && !!(draw === null || draw === void 0 ? void 0 : draw.length) && initialAnimationStep >= 0 && draw.length > initialAnimationStep;
33131
32362
  };
33132
32363
  function updateMapDraw(mapId, draw, initialAnimationStep) {
33133
- var webMap = getWMJSMapById(mapId);
32364
+ var webMap = webmapUtils.getWMJSMapById(mapId);
33134
32365
  if (webMap) {
33135
32366
  webMap.getListener().suspendEvents();
33136
32367
  webMap.stopAnimating();
@@ -33319,7 +32550,7 @@ function setLayerDimensionsSaga(_ref4) {
33319
32550
  return select(isAnimating, mapId);
33320
32551
  case 26:
33321
32552
  isAnimating$1 = _context5.sent;
33322
- webmapInstance = getWMJSMapById(mapId);
32553
+ webmapInstance = webmapUtils.getWMJSMapById(mapId);
33323
32554
  isAutoUpdateLayer = layerId === autoUpdateLayerId;
33324
32555
  if (!(isAutoUpdateLayer &&
33325
32556
  // only update the active layer
@@ -33489,7 +32720,7 @@ function handleBaseLayersSaga(mapId, baseLayers) {
33489
32720
  activeAvailableBaseLayer = currentAvailableBaseLayers.find(function (availableBaseLayer) {
33490
32721
  return availableBaseLayer.name === baseLayer.name;
33491
32722
  });
33492
- activeBaseLayerId = activeAvailableBaseLayer ? activeAvailableBaseLayer.id : generateLayerId(); // if the baseLayer can't be found in a visible available baseLayer list, add it
32723
+ activeBaseLayerId = activeAvailableBaseLayer ? activeAvailableBaseLayer.id : webmapUtils.generateLayerId(); // if the baseLayer can't be found in a visible available baseLayer list, add it
33493
32724
  if (!(!activeAvailableBaseLayer && currentAvailableBaseLayers.length)) {
33494
32725
  _context7.next = 9;
33495
32726
  break;
@@ -33576,7 +32807,7 @@ function setMapPresetSaga(_ref6) {
33576
32807
  overLayersWithDefaultLayer = overLayers.length ? overLayers : [overLayer];
33577
32808
  allBaseLayers = [].concat(_toConsumableArray(baseLayersWithDefaultLayer), _toConsumableArray(overLayersWithDefaultLayer)).map(function (layer) {
33578
32809
  return Object.assign(Object.assign({}, layer), {
33579
- id: generateLayerId()
32810
+ id: webmapUtils.generateLayerId()
33580
32811
  });
33581
32812
  });
33582
32813
  _context8.next = 24;
@@ -33900,88 +33131,6 @@ function rootSaga$7() {
33900
33131
  }, _marked3$2);
33901
33132
  }
33902
33133
 
33903
- /* *
33904
- * Licensed under the Apache License, Version 2.0 (the "License");
33905
- * you may not use this file except in compliance with the License.
33906
- * You may obtain a copy of the License at
33907
- *
33908
- * http://www.apache.org/licenses/LICENSE-2.0
33909
- *
33910
- * Unless required by applicable law or agreed to in writing, software
33911
- * distributed under the License is distributed on an "AS IS" BASIS,
33912
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33913
- * See the License for the specific language governing permissions and
33914
- * limitations under the License.
33915
- *
33916
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
33917
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
33918
- * */
33919
- /**
33920
- * Converts webmapjs node structure to LayerTree
33921
- * @param nodesToRecur THe WebMapJS node structure from service.getNodes();
33922
- */
33923
- var recurseNodes = function recurseNodes(nodesToRecur) {
33924
- var newLayerTreeObj = {
33925
- leaf: nodesToRecur.leaf,
33926
- name: nodesToRecur.name,
33927
- title: nodesToRecur.title,
33928
- path: nodesToRecur.path || [],
33929
- children: [],
33930
- keywords: nodesToRecur.keywords || [],
33931
- "abstract": nodesToRecur["abstract"] || '',
33932
- styles: nodesToRecur.styles || [],
33933
- dimensions: nodesToRecur.dimensions || [],
33934
- geographicBoundingBox: nodesToRecur.geographicBoundingBox || null
33935
- };
33936
- if (nodesToRecur.children) {
33937
- for (var j = 0; j < nodesToRecur.children.length; j += 1) {
33938
- newLayerTreeObj.children.push(recurseNodes(nodesToRecur.children[j]));
33939
- }
33940
- }
33941
- return newLayerTreeObj;
33942
- };
33943
- /**
33944
- * Returns a promise with a hierarchical tree of layers from the WMS GetCapabilities document.
33945
- * @param serviceUrl The URL of the WMS service
33946
- * @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
33947
- */
33948
- var getLayersFromService = function getLayersFromService(serviceUrl) {
33949
- var forceReload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
33950
- return new Promise(function (resolve, reject) {
33951
- var serviceObject = WMGetServiceFromStore(serviceUrl);
33952
- serviceObject.getNodes(function (nodes) {
33953
- // TODO: Maarten Plieger, 2022-11-02: Harmonize types and use correct types: https://gitlab.com/opengeoweb/opengeoweb/-/issues/2817
33954
- var layerTree = recurseNodes(nodes);
33955
- resolve(layerTree);
33956
- }, function (error) {
33957
- reject(new Error(error));
33958
- }, forceReload);
33959
- });
33960
- };
33961
- /**
33962
- * Returns a promise with an array of flattened layerobjects from the WMS GetCapabilities document.
33963
- * @param serviceUrl The URL of the WMS service
33964
- * @param {boolean} forceReload **optional** forceReload: boolean, true will force the layers to be reloaded from the service, defaults to false
33965
- */
33966
- var getLayersFlattenedFromService = function getLayersFlattenedFromService(serviceUrl) {
33967
- var forceReload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
33968
- return new Promise(function (resolve, reject) {
33969
- var serviceObject = WMGetServiceFromStore(serviceUrl);
33970
- serviceObject.getLayerObjectsFlat(function (layers) {
33971
- resolve(layers);
33972
- }, function (error) {
33973
- reject(new Error(error));
33974
- }, forceReload);
33975
- });
33976
- };
33977
-
33978
- var getCapabilities$1 = /*#__PURE__*/Object.freeze({
33979
- __proto__: null,
33980
- recurseNodes: recurseNodes,
33981
- getLayersFromService: getLayersFromService,
33982
- getLayersFlattenedFromService: getLayersFlattenedFromService
33983
- });
33984
-
33985
33134
  var _marked$6 = /*#__PURE__*/_regeneratorRuntime().mark(fetchServiceSaga),
33986
33135
  _marked2$5 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$6);
33987
33136
  function fetchServiceSaga(service) {
@@ -33991,7 +33140,7 @@ function fetchServiceSaga(service) {
33991
33140
  case 0:
33992
33141
  _context.prev = 0;
33993
33142
  _context.next = 3;
33994
- return call(getLayersFlattenedFromService, service.serviceUrl);
33143
+ return call(getCapabilities.getLayersFlattenedFromService, service.serviceUrl);
33995
33144
  case 3:
33996
33145
  layers = _context.sent;
33997
33146
  _context.next = 6;
@@ -35177,264 +34326,6 @@ var storeTestUtils = /*#__PURE__*/Object.freeze({
35177
34326
  mockStateMapWithMultipleLayers: mockStateMapWithMultipleLayers
35178
34327
  });
35179
34328
 
35180
- /* *
35181
- * Licensed under the Apache License, Version 2.0 (the "License");
35182
- * you may not use this file except in compliance with the License.
35183
- * You may obtain a copy of the License at
35184
- *
35185
- * http://www.apache.org/licenses/LICENSE-2.0
35186
- *
35187
- * Unless required by applicable law or agreed to in writing, software
35188
- * distributed under the License is distributed on an "AS IS" BASIS,
35189
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35190
- * See the License for the specific language governing permissions and
35191
- * limitations under the License.
35192
- *
35193
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
35194
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
35195
- * */
35196
- var WMS111GetCapabilitiesGeoServicesRADAR = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE WMT_MS_Capabilities SYSTEM \"http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd\" [\n <!ELEMENT VendorSpecificCapabilities EMPTY>\n]>\n<!-- end of DOCTYPE declaration -->\n<WMT_MS_Capabilities version=\"1.1.1\">\n <Service>\n <Name>OGC:WMS</Name>\n <Title>RADAR</Title>\n <Abstract>This service demonstrates how the ADAGUC server can be used to create OGC services.</Abstract>\n <ServerInfo>ADAGUCServer version 2.5.8, of Apr 13 2021 07:55:43</ServerInfo>\n <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"https://geoservices.knmi.nl/wms?DATASET=RADAR&amp;SERVICE=WMS&amp;\" />\n <ContactInformation />\n </Service>\n <Capability>\n <Request>\n <GetCapabilities>\n <Format>application/vnd.ogc.wms_xml</Format>\n <DCPType>\n <HTTP>\n <Get>\n <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"https://geoservices.knmi.nl/wms?DATASET=RADAR&amp;SERVICE=WMS&amp;\" />\n </Get>\n </HTTP>\n </DCPType>\n </GetCapabilities>\n <GetMap>\n <Format>image/png</Format>\n <Format>image/gif</Format>\n <Format>image/png32</Format>\n <DCPType>\n <HTTP>\n <Get>\n <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"https://geoservices.knmi.nl/wms?DATASET=RADAR&amp;SERVICE=WMS&amp;\" />\n </Get>\n </HTTP>\n </DCPType>\n </GetMap>\n <GetFeatureInfo>\n <Format>text/plain</Format>\n <Format>text/html</Format>\n <Format>text/xml</Format>\n <Format>application/vnd.ogc.gml</Format>\n <DCPType>\n <HTTP>\n <Get>\n <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"https://geoservices.knmi.nl/wms?DATASET=RADAR&amp;SERVICE=WMS&amp;\" />\n </Get>\n </HTTP>\n </DCPType>\n </GetFeatureInfo>\n <DescribeLayer>\n <Format>text/xml</Format>\n <DCPType>\n <HTTP>\n <Get>\n <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"https://geoservices.knmi.nl/wms?DATASET=RADAR&amp;SERVICE=WMS&amp;\" />\n </Get>\n </HTTP>\n </DCPType>\n </DescribeLayer>\n <GetLegendGraphic>\n <Format>image/png</Format>\n <Format>image/gif</Format>\n <Format>image/png32</Format>\n <DCPType>\n <HTTP>\n <Get>\n <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"https://geoservices.knmi.nl/wms?DATASET=RADAR&amp;SERVICE=WMS&amp;\" />\n </Get>\n </HTTP>\n </DCPType>\n </GetLegendGraphic>\n <GetStyles>\n <Format>text/xml</Format>\n <DCPType>\n <HTTP>\n <Get>\n <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:href=\"https://geoservices.knmi.nl/wms?DATASET=RADAR&amp;SERVICE=WMS&amp;\" />\n </Get>\n </HTTP>\n </DCPType>\n </GetStyles>\n </Request>\n <Exception>\n <Format>application/vnd.ogc.se_xml</Format>\n <Format>application/vnd.ogc.se_inimage</Format>\n <Format>application/vnd.ogc.se_blank</Format>\n </Exception>\n <VendorSpecificCapabilities />\n <UserDefinedSymbolization SupportSLD=\"1\" UserLayer=\"0\" UserStyle=\"1\" RemoteWFS=\"0\" />\n <Layer>\n <Title>WMS of RADAR</Title>\n <SRS>EPSG:3411</SRS>\n <SRS>EPSG:3412</SRS>\n <SRS>EPSG:3575</SRS>\n <SRS>EPSG:3857</SRS>\n <SRS>EPSG:4258</SRS>\n <SRS>EPSG:4326</SRS>\n <SRS>CRS:84</SRS>\n <SRS>EPSG:25831</SRS>\n <SRS>EPSG:25832</SRS>\n <SRS>EPSG:28992</SRS>\n <SRS>EPSG:7399</SRS>\n <SRS>EPSG:50001</SRS>\n <SRS>EPSG:54030</SRS>\n <SRS>EPSG:32661</SRS>\n <SRS>EPSG:40000</SRS>\n <SRS>EPSG:900913</SRS>\n <SRS>PROJ4:%2Bproj%3Dstere%20%2Blat_0%3D90%20%2Blon_0%3D0%20%2Blat_ts%3D60%20%2Ba%3D6378%2E14%20%2Bb%3D6356%2E75%20%2Bx_0%3D0%20y_0%3D0</SRS>\n <Layer queryable=\"1\" opaque=\"1\" cascaded=\"0\">\n <Name>RAD_NL25_PCP_CM</Name>\n <Title>Precipitation Radar NL</Title>\n <Abstract>Radar NL</Abstract>\n <KeywordList>\n <Keyword>Radar</Keyword>\n </KeywordList>\n <SRS>EPSG:3411</SRS>\n <BoundingBox SRS=\"EPSG:3411\" minx=\"2682754.743620\" miny=\"-3245034.014141\" maxx=\"3759536.917562\" maxy=\"-2168251.989038\" />\n <SRS>EPSG:3412</SRS>\n <BoundingBox SRS=\"EPSG:3412\" minx=\"0.000000\" miny=\"32318824.826266\" maxx=\"7413041.166015\" maxy=\"40075258.815074\" />\n <SRS>EPSG:3575</SRS>\n <BoundingBox SRS=\"EPSG:3575\" minx=\"-770622.801471\" miny=\"-4485814.811314\" maxx=\"56845.766135\" maxy=\"-3684039.443620\" />\n <SRS>EPSG:3857</SRS>\n <BoundingBox SRS=\"EPSG:3857\" minx=\"0.000000\" miny=\"6257115.219364\" maxx=\"1208534.698398\" maxy=\"7553161.958695\" />\n <SRS>EPSG:4258</SRS>\n <BoundingBox SRS=\"EPSG:4258\" minx=\"0.000000\" miny=\"48.895303\" maxx=\"10.856452\" maxy=\"55.973600\" />\n <SRS>EPSG:4326</SRS>\n <BoundingBox SRS=\"EPSG:4326\" minx=\"0.000000\" miny=\"48.895303\" maxx=\"10.856452\" maxy=\"55.973600\" />\n <SRS>CRS:84</SRS>\n <BoundingBox SRS=\"CRS:84\" minx=\"0.000000\" miny=\"48.895303\" maxx=\"10.856452\" maxy=\"55.973600\" />\n <SRS>EPSG:25831</SRS>\n <BoundingBox SRS=\"EPSG:25831\" minx=\"282182.345905\" miny=\"5433247.394267\" maxx=\"997135.658653\" maxy=\"6207204.592736\" />\n <SRS>EPSG:25832</SRS>\n <BoundingBox SRS=\"EPSG:25832\" minx=\"-153083.019482\" miny=\"5415817.312927\" maxx=\"617595.626092\" maxy=\"6239769.309937\" />\n <SRS>EPSG:28992</SRS>\n <BoundingBox SRS=\"EPSG:28992\" minx=\"-236275.338083\" miny=\"106727.731651\" maxx=\"501527.918656\" maxy=\"900797.079725\" />\n <SRS>EPSG:7399</SRS>\n <BoundingBox SRS=\"EPSG:7399\" minx=\"0.000000\" miny=\"5757301.056717\" maxx=\"763611.971696\" maxy=\"6483919.801602\" />\n <SRS>EPSG:50001</SRS>\n <BoundingBox SRS=\"EPSG:50001\" minx=\"-2000000.000000\" miny=\"-2000000.000000\" maxx=\"10000000.000000\" maxy=\"8500000.000000\" />\n <SRS>EPSG:54030</SRS>\n <BoundingBox SRS=\"EPSG:54030\" minx=\"0.000000\" miny=\"5211855.054125\" maxx=\"853649.695106\" maxy=\"5936394.291427\" />\n <SRS>EPSG:32661</SRS>\n <BoundingBox SRS=\"EPSG:32661\" minx=\"2000000.000000\" miny=\"-2703305.597319\" maxx=\"2745713.040381\" maxy=\"-1888346.216710\" />\n <SRS>EPSG:40000</SRS>\n <BoundingBox SRS=\"EPSG:40000\" minx=\"0.000000\" miny=\"-4731695.771951\" maxx=\"750214.326339\" maxy=\"-3911817.119426\" />\n <SRS>EPSG:900913</SRS>\n <BoundingBox SRS=\"EPSG:900913\" minx=\"0.000000\" miny=\"6257115.219364\" maxx=\"1208534.698398\" maxy=\"7553161.958695\" />\n <SRS>PROJ4:%2Bproj%3Dstere%20%2Blat_0%3D90%20%2Blon_0%3D0%20%2Blat_ts%3D60%20%2Ba%3D6378%2E14%20%2Bb%3D6356%2E75%20%2Bx_0%3D0%20y_0%3D0</SRS>\n <BoundingBox SRS=\"PROJ4:%2Bproj%3Dstere%20%2Blat_0%3D90%20%2Blon_0%3D0%20%2Blat_ts%3D60%20%2Ba%3D6378%2E14%20%2Bb%3D6356%2E75%20%2Bx_0%3D0%20y_0%3D0\" minx=\"0.000000\" miny=\"-3649.999338\" maxx=\"700.002420\" maxy=\"-4415.002986\" />\n <LatLonBoundingBox minx=\"0.000000\" miny=\"48.895303\" maxx=\"10.856452\" maxy=\"55.973600\" />\n <Dimension name=\"time\" units=\"ISO8601\" />\n <Extent name=\"time\" default=\"2021-05-17T00:00:00Z\" multipleValues=\"1\" nearestValue=\"0\">2021-03-31T09:25:00Z/2021-05-18T07:45:00Z/PT5M</Extent>\n <Style>\n <Name>radar/nearest</Name>\n <Title>radar/nearest</Title>\n <LegendURL width=\"300\" height=\"400\">\n <Format>image/png</Format>\n <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type=\"simple\" xlink:href=\"https://geoservices.knmi.nl/wms?DATASET=RADAR&amp;SERVICE=WMS&amp;&amp;version=1.1.1&amp;service=WMS&amp;request=GetLegendGraphic&amp;layer=RAD_NL25_PCP_CM&amp;format=image/png&amp;STYLE=radar/nearest\" />\n </LegendURL>\n </Style>\n <Style>\n <Name>precip-rainbow/nearest</Name>\n <Title>precip-rainbow/nearest</Title>\n <LegendURL width=\"300\" height=\"400\">\n <Format>image/png</Format>\n <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type=\"simple\" xlink:href=\"https://geoservices.knmi.nl/wms?DATASET=RADAR&amp;SERVICE=WMS&amp;&amp;version=1.1.1&amp;service=WMS&amp;request=GetLegendGraphic&amp;layer=RAD_NL25_PCP_CM&amp;format=image/png&amp;STYLE=precip-rainbow/nearest\" />\n </LegendURL>\n </Style>\n <Style>\n <Name>precip-gray/nearest</Name>\n <Title>precip-gray/nearest</Title>\n <LegendURL width=\"300\" height=\"400\">\n <Format>image/png</Format>\n <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type=\"simple\" xlink:href=\"https://geoservices.knmi.nl/wms?DATASET=RADAR&amp;SERVICE=WMS&amp;&amp;version=1.1.1&amp;service=WMS&amp;request=GetLegendGraphic&amp;layer=RAD_NL25_PCP_CM&amp;format=image/png&amp;STYLE=precip-gray/nearest\" />\n </LegendURL>\n </Style>\n <Style>\n <Name>precip-blue/nearest</Name>\n <Title>precip-blue/nearest</Title>\n <LegendURL width=\"300\" height=\"400\">\n <Format>image/png</Format>\n <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type=\"simple\" xlink:href=\"https://geoservices.knmi.nl/wms?DATASET=RADAR&amp;SERVICE=WMS&amp;&amp;version=1.1.1&amp;service=WMS&amp;request=GetLegendGraphic&amp;layer=RAD_NL25_PCP_CM&amp;format=image/png&amp;STYLE=precip-blue/nearest\" />\n </LegendURL>\n </Style>\n <Style>\n <Name>precip-blue-transparent/nearest</Name>\n <Title>precip-blue-transparent/nearest</Title>\n <LegendURL width=\"300\" height=\"400\">\n <Format>image/png</Format>\n <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type=\"simple\" xlink:href=\"https://geoservices.knmi.nl/wms?DATASET=RADAR&amp;SERVICE=WMS&amp;&amp;version=1.1.1&amp;service=WMS&amp;request=GetLegendGraphic&amp;layer=RAD_NL25_PCP_CM&amp;format=image/png&amp;STYLE=precip-blue-transparent/nearest\" />\n </LegendURL>\n </Style>\n <Style>\n <Name>precip-with-range/nearest</Name>\n <Title>precip-with-range/nearest</Title>\n <LegendURL width=\"300\" height=\"400\">\n <Format>image/png</Format>\n <OnlineResource xmlns:xlink=\"http://www.w3.org/1999/xlink\" xlink:type=\"simple\" xlink:href=\"https://geoservices.knmi.nl/wms?DATASET=RADAR&amp;SERVICE=WMS&amp;&amp;version=1.1.1&amp;service=WMS&amp;request=GetLegendGraphic&amp;layer=RAD_NL25_PCP_CM&amp;format=image/png&amp;STYLE=precip-with-range/nearest\" />\n </LegendURL>\n </Style>\n <ScaleHint min=\"0\" max=\"10000\" />\n </Layer>\n </Layer>\n </Capability>\n</WMT_MS_Capabilities>";
35197
-
35198
- var MOCK_URL_WITH_CHILDREN = 'https://mockUrlWithChildren.nl';
35199
- var MOCK_URL_NO_CHILDREN = 'https://mockUrlNoChildren.nl';
35200
- var MOCK_URL_WITH_NO_TITLE = 'https://mockUrlWithNoTitle.nl';
35201
- var MOCK_URL_WITH_NO_TITLE_OR_NAME = 'https://mockUrlWithNoTitleOrName.nl/wms?';
35202
- var MOCK_URL_WITH_SUBCATEGORY = 'https://mockUrlWithSubcategory.nl';
35203
- var MOCK_URL_INVALID = 'https://notawmsservice.nl';
35204
- var MOCK_URL_SLOW = 'https://slowresolve.nl';
35205
- var MOCK_URL_SLOW_FAILS = 'https://slowreject.nl';
35206
- var MOCK_URL_DEFAULT = 'https://defaultservice.nl';
35207
- var MOCK_URL_DEFAULT2 = 'https://defaultservice2.nl';
35208
- var MOCK_URL_HTTP = 'http://wmsservice.nl';
35209
- var mockLayersNoChildren = {
35210
- leaf: false,
35211
- name: null,
35212
- title: 'RADNL_OPER_R___25PCPRR_L3_WMS',
35213
- path: [],
35214
- children: []
35215
- };
35216
- var mockLayersWithChildren = {
35217
- leaf: false,
35218
- name: null,
35219
- title: 'RADNL_OPER_R___25PCPRR_L3_WMS',
35220
- path: [],
35221
- children: [{
35222
- leaf: true,
35223
- name: 'RAD_NL25_PCP_CM',
35224
- title: 'RAD_NL25_PCP_CM',
35225
- path: [],
35226
- children: []
35227
- }, {
35228
- leaf: true,
35229
- name: 'RADNL_OPER_R___25PCPRR_L3_KNMI',
35230
- title: 'RADNL_OPER_R___25PCPRR_L3_KNMI',
35231
- path: [],
35232
- children: []
35233
- }]
35234
- };
35235
- var mockLayersWithNoTitle = {
35236
- leaf: false,
35237
- name: 'UNTITLED_WMS',
35238
- title: null,
35239
- path: [],
35240
- children: []
35241
- };
35242
- var mockLayersWithNoTitleOrName = {
35243
- leaf: false,
35244
- name: null,
35245
- title: null,
35246
- path: [],
35247
- children: []
35248
- };
35249
- var mockLayersWithSubcategory = {
35250
- leaf: false,
35251
- name: null,
35252
- title: 'Service with subcategory',
35253
- path: [],
35254
- children: [{
35255
- leaf: true,
35256
- name: 'cloud_area_fraction',
35257
- title: 'Cloud cover (flag)',
35258
- path: [],
35259
- children: []
35260
- }, {
35261
- leaf: false,
35262
- name: null,
35263
- title: 'Subcategory',
35264
- path: [],
35265
- children: [{
35266
- leaf: true,
35267
- name: 'baselayer',
35268
- title: 'Baselayer (-)',
35269
- path: ['Subcategory'],
35270
- children: []
35271
- }, {
35272
- leaf: false,
35273
- name: null,
35274
- title: 'Klima',
35275
- path: ['Subcategory'],
35276
- children: [{
35277
- leaf: true,
35278
- name: 'haic_airports',
35279
- title: 'HAIC Airports',
35280
- path: ['SubcategoryKlima'],
35281
- children: []
35282
- }]
35283
- }]
35284
- }]
35285
- };
35286
- var mockLayersDefault = {
35287
- leaf: false,
35288
- name: null,
35289
- title: 'Default title for default layer',
35290
- path: [],
35291
- children: []
35292
- };
35293
- var mockLayersDefault2 = {
35294
- leaf: false,
35295
- name: null,
35296
- title: 'Default title for default 2 layer',
35297
- path: [],
35298
- children: []
35299
- };
35300
- var mockGetLayersFromService = function mockGetLayersFromService(url) {
35301
- switch (url) {
35302
- case MOCK_URL_WITH_CHILDREN:
35303
- return new Promise(function (resolve) {
35304
- resolve(mockLayersWithChildren);
35305
- });
35306
- case MOCK_URL_NO_CHILDREN:
35307
- return new Promise(function (resolve) {
35308
- resolve(mockLayersNoChildren);
35309
- });
35310
- case MOCK_URL_WITH_NO_TITLE:
35311
- return new Promise(function (resolve) {
35312
- resolve(mockLayersWithNoTitle);
35313
- });
35314
- case MOCK_URL_WITH_NO_TITLE_OR_NAME:
35315
- return new Promise(function (resolve) {
35316
- resolve(mockLayersWithNoTitleOrName);
35317
- });
35318
- case MOCK_URL_WITH_SUBCATEGORY:
35319
- return new Promise(function (resolve) {
35320
- resolve(mockLayersWithSubcategory);
35321
- });
35322
- case MOCK_URL_SLOW:
35323
- return new Promise(function (resolve) {
35324
- setTimeout(function () {
35325
- return resolve(mockLayersWithChildren);
35326
- }, 300);
35327
- });
35328
- case MOCK_URL_SLOW_FAILS:
35329
- return new Promise(function (resolve, reject) {
35330
- setTimeout(function () {
35331
- return reject(new Error("Mock url '".concat(url, "' service returned an error.")));
35332
- }, 300);
35333
- });
35334
- case MOCK_URL_INVALID:
35335
- return Promise.reject(new Error("Url '".concat(url, "' is not a wms service.")));
35336
- case MOCK_URL_HTTP:
35337
- return Promise.reject(new Error("Url '".concat(url, "' is not https.")));
35338
- case MOCK_URL_DEFAULT:
35339
- return new Promise(function (resolve) {
35340
- resolve(mockLayersDefault);
35341
- });
35342
- case MOCK_URL_DEFAULT2:
35343
- return new Promise(function (resolve) {
35344
- resolve(mockLayersDefault2);
35345
- });
35346
- default:
35347
- {
35348
- var message = "Url '".concat(url, "' is not a mock-url.");
35349
- return Promise.reject(new Error(message));
35350
- }
35351
- }
35352
- };
35353
- var mockGetLayersFlattenedFromService = function mockGetLayersFlattenedFromService(url) {
35354
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
35355
- var layers, serviceLayers, _iterator, _step, object;
35356
- return _regeneratorRuntime().wrap(function _callee$(_context) {
35357
- while (1) switch (_context.prev = _context.next) {
35358
- case 0:
35359
- _context.next = 2;
35360
- return mockGetLayersFromService(url);
35361
- case 2:
35362
- layers = _context.sent;
35363
- serviceLayers = []; // TODO: Maarten Plieger, 2022-11-02: Harmonize types and use correct types: https://gitlab.com/opengeoweb/opengeoweb/-/issues/2817
35364
- _iterator = _createForOfIteratorHelper(layers.children);
35365
- try {
35366
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
35367
- object = _step.value;
35368
- serviceLayers.push({
35369
- name: object.name,
35370
- title: object.title,
35371
- leaf: object.leaf,
35372
- path: object.path,
35373
- keywords: object.keywords ? object.keywords : [],
35374
- "abstract": object["abstract"] ? object["abstract"] : '',
35375
- styles: object.styles ? object.styles : [],
35376
- dimensions: object.dimensions || [],
35377
- geographicBoundingBox: object.geographicBoundingBox || undefined
35378
- });
35379
- }
35380
- } catch (err) {
35381
- _iterator.e(err);
35382
- } finally {
35383
- _iterator.f();
35384
- }
35385
- return _context.abrupt("return", serviceLayers);
35386
- case 7:
35387
- case "end":
35388
- return _context.stop();
35389
- }
35390
- }, _callee);
35391
- }));
35392
- };
35393
-
35394
- var getCapabilities = /*#__PURE__*/Object.freeze({
35395
- __proto__: null,
35396
- MOCK_URL_WITH_CHILDREN: MOCK_URL_WITH_CHILDREN,
35397
- MOCK_URL_NO_CHILDREN: MOCK_URL_NO_CHILDREN,
35398
- MOCK_URL_WITH_NO_TITLE: MOCK_URL_WITH_NO_TITLE,
35399
- MOCK_URL_WITH_NO_TITLE_OR_NAME: MOCK_URL_WITH_NO_TITLE_OR_NAME,
35400
- MOCK_URL_WITH_SUBCATEGORY: MOCK_URL_WITH_SUBCATEGORY,
35401
- MOCK_URL_INVALID: MOCK_URL_INVALID,
35402
- MOCK_URL_SLOW: MOCK_URL_SLOW,
35403
- MOCK_URL_SLOW_FAILS: MOCK_URL_SLOW_FAILS,
35404
- MOCK_URL_DEFAULT: MOCK_URL_DEFAULT,
35405
- MOCK_URL_DEFAULT2: MOCK_URL_DEFAULT2,
35406
- MOCK_URL_HTTP: MOCK_URL_HTTP,
35407
- mockLayersNoChildren: mockLayersNoChildren,
35408
- mockLayersWithChildren: mockLayersWithChildren,
35409
- mockLayersWithNoTitle: mockLayersWithNoTitle,
35410
- mockLayersWithNoTitleOrName: mockLayersWithNoTitleOrName,
35411
- mockLayersWithSubcategory: mockLayersWithSubcategory,
35412
- mockLayersDefault: mockLayersDefault,
35413
- mockLayersDefault2: mockLayersDefault2,
35414
- mockGetLayersFromService: mockGetLayersFromService,
35415
- mockGetLayersFlattenedFromService: mockGetLayersFlattenedFromService
35416
- });
35417
-
35418
- /* *
35419
- * Licensed under the Apache License, Version 2.0 (the "License");
35420
- * you may not use this file except in compliance with the License.
35421
- * You may obtain a copy of the License at
35422
- *
35423
- * http://www.apache.org/licenses/LICENSE-2.0
35424
- *
35425
- * Unless required by applicable law or agreed to in writing, software
35426
- * distributed under the License is distributed on an "AS IS" BASIS,
35427
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35428
- * See the License for the specific language governing permissions and
35429
- * limitations under the License.
35430
- *
35431
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
35432
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
35433
- * */
35434
- var mockGetCapabilities = Object.assign(Object.assign({}, getCapabilities), {
35435
- WMS111GetCapabilitiesGeoServicesRADAR: WMS111GetCapabilitiesGeoServicesRADAR
35436
- });
35437
-
35438
34329
  /* *
35439
34330
  * Licensed under the Apache License, Version 2.0 (the "License");
35440
34331
  * you may not use this file except in compliance with the License.
@@ -35549,7 +34440,7 @@ var getAddLayerActionsTargets = function getAddLayerActionsTargets(state, payloa
35549
34440
  var layer = payload.layer;
35550
34441
  layer.id;
35551
34442
  var layerWithoutId = __rest(layer, ["id"]);
35552
- var layerId = generateLayerId();
34443
+ var layerId = webmapUtils.generateLayerId();
35553
34444
  return Object.assign(Object.assign({}, payload), {
35554
34445
  layer: layerWithoutId,
35555
34446
  layerId: layerId,
@@ -35622,7 +34513,7 @@ var getMapBaseLayerActionsTargets = function getMapBaseLayerActionsTargets(state
35622
34513
  return {
35623
34514
  layers: payload.layers.map(function (layer) {
35624
34515
  return Object.assign(Object.assign({}, layer), {
35625
- id: generateLayerId()
34516
+ id: webmapUtils.generateLayerId()
35626
34517
  });
35627
34518
  }),
35628
34519
  mapId: target.targetId,
@@ -36400,4 +35291,4 @@ var uiModuleConfig = {
36400
35291
  * */
36401
35292
  var coreModuleConfig = [mapStoreModuleConfig, synchronizationGroupConfig, uiModuleConfig, layerSelectConfig, snackbarModuleConfig];
36402
35293
 
36403
- export { appActions, appModuleConfig, coreModuleConfig, defaultLayers, filterLayers$1 as filterLayers, genericActions, selectors$4 as genericSelectors, types$2 as genericTypes, getCapabilities$1 as getCapabilities, getUserAddedServices, initialState$5 as initialState, layerActions, reducer$8 as layerReducer, layerSelectActions, initialState$3 as layerSelectInitialState, selectors$1 as layerSelectSelectors, types$1 as layerSelectTypes, selectors$7 as layerSelectors, types$7 as layerTypes, mapActions, constants$1 as mapConstants, enums as mapEnums, selectors$3 as mapSelectors, mapStoreActions, mapStoreModuleConfig, helpers as mapStoreUtils, types$6 as mapTypes, mapUtils, mockGetCapabilities, routerActions, routerModuleConfig, utils as routerUtils, serviceActions, selectors$2 as serviceSelectors, types$5 as serviceTypes, setUserAddedServices, snackbarActions, snackbarModuleConfig, selectors as snackbarSelectors, types as snackbarTypes, storeTestSettings, storeTestUtils, utils$1 as storeUtils, constants as syncConstants, actions as syncGroupsActions, selector as syncGroupsSelector, selectors$5 as syncGroupsSelectors, types$3 as syncGroupsTypes, tilesettings, types$3 as types, uiActions, uiModuleConfig, reducer$7 as uiReducer, selectors$6 as uiSelectors, types$4 as uiTypes, reducer$6 as webmapReducer };
35294
+ export { appActions, appModuleConfig, coreModuleConfig, defaultLayers, filterLayers$1 as filterLayers, genericActions, selectors$4 as genericSelectors, types$2 as genericTypes, getUserAddedServices, initialState$5 as initialState, layerActions, reducer$8 as layerReducer, layerSelectActions, initialState$3 as layerSelectInitialState, selectors$1 as layerSelectSelectors, types$1 as layerSelectTypes, selectors$7 as layerSelectors, types$7 as layerTypes, utils$2 as layerUtils, mapActions, constants$1 as mapConstants, enums as mapEnums, selectors$3 as mapSelectors, mapStoreActions, mapStoreModuleConfig, types$6 as mapTypes, mapUtils, routerActions, routerModuleConfig, utils as routerUtils, serviceActions, selectors$2 as serviceSelectors, types$5 as serviceTypes, setUserAddedServices, snackbarActions, snackbarModuleConfig, selectors as snackbarSelectors, types as snackbarTypes, storeTestSettings, storeTestUtils, utils$1 as storeUtils, constants as syncConstants, actions as syncGroupsActions, selector as syncGroupsSelector, selectors$5 as syncGroupsSelectors, types$3 as syncGroupsTypes, types$3 as types, uiActions, uiModuleConfig, reducer$7 as uiReducer, selectors$6 as uiSelectors, types$4 as uiTypes, reducer$6 as webmapReducer };