@opengeoweb/store 6.0.4 → 6.1.0

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
@@ -1,4 +1,4 @@
1
- import { webmapUtils, webmapTestSettings, WMLayer, getCapabilities } from '@opengeoweb/webmap';
1
+ import { webmapUtils, LayerType, 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"];
@@ -478,7 +478,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
478
478
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
479
479
  };
480
480
 
481
- function n$1(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[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$1(n){return !!n&&!!n[Q]}function t$3(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}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function i$1(n,r,t){void 0===t&&(t=!1),0===o$1(n)?(t?Object.keys:nn)(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$1(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u$1(n,r){return 2===o$1(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a$1(n,r){return 2===o$1(n)?n.get(r):n[r]}function f(n,r,t){var e=o$1(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t;}function c$1(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(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(n,e){return void 0===e&&(e=!1),y(n)||r$1(n)||!t$3(n)||(o$1(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i$1(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n$1(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n$1(18,r),t}function m(n,r){tn[n]||(tn[n]=r);}function _(){return "production"===process.env.NODE_ENV||U||n$1(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function g(n){O(n),n.p.forEach(S),n.p=null;}function O(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b("ES5").S(e,r,o),o?(i[Q].P&&(g(e),n$1(4)),t$3(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i$1(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(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(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i$1(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b("Patches").N(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s,v){if("production"!==process.env.NODE_ENV&&c===o&&n$1(5),r$1(c)){var p=M(e,c,s&&i&&3!==i.i&&!u$1(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r$1(p))return;e.m=!1;}else v&&o.add(c);if(t$3(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(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(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function N(n,r,t){var e=s(r)?b("MapSet").F(r,t):v(r)?b("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function R(e){return r$1(e)||n$1(22,e),function n(r){if(!t$3(r))return r;var e,u=r[Q],c=o$1(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1;}else e=D(r,c);return i$1(e,(function(r,t){u&&a$1(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function F(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return "production"!==process.env.NODE_ENV&&f(r),en.get(r,n)},set:function(r){var t=this[Q];"production"!==process.env.NODE_ENV&&f(t),en.set(t,n,r);}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t);}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u$1(r,o))return !0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c$1(f,a))return !0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return !0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return !0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return !0;return !1}function f(r){r.g&&n$1(3,JSON.stringify(p(r)));}var s={};m("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable);}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r$1(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i$1(o,(function(r){r!==Q&&(void 0!==e[r]||u$1(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)));})),i$1(e,(function(n){void 0!==o[n]||u$1(o,n)||(f[n]=!1,k(t));}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l]);}}}}(n.p[0]),e(n.p));},K:function(n){return 4===n.i?o(n):a(n)}});}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={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=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u$1(e,r))return function(n,r,t){var e,i=I(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$3(i)?i:i===z(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c$1(t,i)&&(void 0!==t||u$1(n.t,r)))return !0;E(n),k(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(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(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$1(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n$1(12);}},on={};i$1(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n$1(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n$1(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,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$1(6),void 0!==o&&"function"!=typeof o&&n$1(7),t$3(r)){var c=w(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?g(c):O(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l);}return f}n$1(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$3(e)||n$1(8),r$1(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n$1(9),e.I&&n$1(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n;},i.setUseProxies=function(r){r&&!B&&n$1(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("Patches").$;return r$1(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);var createNextState3 = fn;
481
+ function n$1(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[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$1(n){return !!n&&!!n[Q]}function t$3(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}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function i$1(n,r,t){void 0===t&&(t=!1),0===o$1(n)?(t?Object.keys:nn)(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$1(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u$1(n,r){return 2===o$1(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a$1(n,r){return 2===o$1(n)?n.get(r):n[r]}function f(n,r,t){var e=o$1(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t;}function c$1(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(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(n,e){return void 0===e&&(e=!1),y(n)||r$1(n)||!t$3(n)||(o$1(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i$1(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n$1(2);}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n$1(18,r),t}function m(n,r){tn[n]||(tn[n]=r);}function _(){return "production"===process.env.NODE_ENV||U||n$1(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function g(n){O(n),n.p.forEach(S),n.p=null;}function O(n){n===U&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0;}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b("ES5").S(e,r,o),o?(i[Q].P&&(g(e),n$1(4)),t$3(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i$1(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(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(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i$1(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b("Patches").N(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s,v){if("production"!==process.env.NODE_ENV&&c===o&&n$1(5),r$1(c)){var p=M(e,c,s&&i&&3!==i.i&&!u$1(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r$1(p))return;e.m=!1;}else v&&o.add(c);if(t$3(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(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(n){n.P||(n.P=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function N(n,r,t){var e=s(r)?b("MapSet").F(r,t):v(r)?b("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function R(e){return r$1(e)||n$1(22,e),function n(r){if(!t$3(r))return r;var e,u=r[Q],c=o$1(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1;}else e=D(r,c);return i$1(e,(function(r,t){u&&a$1(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function F(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return "production"!==process.env.NODE_ENV&&f(r),en.get(r,n)},set:function(r){var t=this[Q];"production"!==process.env.NODE_ENV&&f(t),en.set(t,n,r);}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t);}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u$1(r,o))return !0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c$1(f,a))return !0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return !0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return !0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return !0;return !1}function f(r){r.g&&n$1(3,JSON.stringify(p(r)));}var s={};m("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable);}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r$1(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i$1(o,(function(r){r!==Q&&(void 0!==e[r]||u$1(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)));})),i$1(e,(function(n){void 0!==o[n]||u$1(o,n)||(f[n]=!1,k(t));}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l]);}}}}(n.p[0]),e(n.p));},K:function(n){return 4===n.i?o(n):a(n)}});}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",Y={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=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u$1(e,r))return function(n,r,t){var e,i=I(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$3(i)?i:i===z(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c$1(t,i)&&(void 0!==t||u$1(n.t,r)))return !0;E(n),k(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(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(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$1(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n$1(12);}},on={};i$1(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n$1(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n$1(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,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$1(6),void 0!==o&&"function"!=typeof o&&n$1(7),t$3(r)){var c=w(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1;}finally{v?g(c):O(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l);}return f}n$1(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$3(e)||n$1(8),r$1(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n$1(9),e.I&&n$1(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n;},i.setUseProxies=function(r){r&&!B&&n$1(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("Patches").$;return r$1(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);var produce = fn;
482
482
 
483
483
  function _typeof(obj) {
484
484
  "@babel/helpers - typeof";
@@ -1665,7 +1665,7 @@ var EnhancerArray = /** @class */ (function (_super) {
1665
1665
  return EnhancerArray;
1666
1666
  }(Array));
1667
1667
  function freezeDraftable(val) {
1668
- return t$3(val) ? createNextState3(val, function () {
1668
+ return t$3(val) ? produce(val, function () {
1669
1669
  }) : val;
1670
1670
  }
1671
1671
  // src/immutableStateInvariantMiddleware.ts
@@ -2131,7 +2131,7 @@ function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defau
2131
2131
  return result;
2132
2132
  }
2133
2133
  else {
2134
- return createNextState3(previousState, function (draft) {
2134
+ return produce(previousState, function (draft) {
2135
2135
  return caseReducer(draft, action);
2136
2136
  });
2137
2137
  }
@@ -2287,7 +2287,7 @@ function createStateOperator(mutator) {
2287
2287
  return state;
2288
2288
  }
2289
2289
  else {
2290
- return createNextState3(state, runMutator);
2290
+ return produce(state, runMutator);
2291
2291
  }
2292
2292
  };
2293
2293
  }
@@ -2792,12 +2792,6 @@ F();
2792
2792
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2793
2793
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
2794
2794
  * */
2795
- var LayerType;
2796
- (function (LayerType) {
2797
- LayerType["mapLayer"] = "mapLayer";
2798
- LayerType["baseLayer"] = "baseLayer";
2799
- LayerType["overLayer"] = "overLayer";
2800
- })(LayerType || (LayerType = {}));
2801
2795
  var LayerStatus;
2802
2796
  (function (LayerStatus) {
2803
2797
  LayerStatus["default"] = "default";
@@ -2815,7 +2809,6 @@ var LayerActionOrigin;
2815
2809
 
2816
2810
  var types$8 = /*#__PURE__*/Object.freeze({
2817
2811
  __proto__: null,
2818
- get LayerType () { return LayerType; },
2819
2812
  get LayerStatus () { return LayerStatus; },
2820
2813
  get LayerActionOrigin () { return LayerActionOrigin; }
2821
2814
  });
@@ -8685,7 +8678,7 @@ var createMap = function createMap(_ref) {
8685
8678
  };
8686
8679
  var checkValidLayersPayload = function checkValidLayersPayload(layers, mapId) {
8687
8680
  /* Check for duplicate ids */
8688
- var layerIds = [];
8681
+ var layerIds = {};
8689
8682
  for (var i = 0; i < layers.length; i += 1) {
8690
8683
  if (layers[i].id) {
8691
8684
  /* Check if layer is already added to a different map */
@@ -9036,13 +9029,32 @@ var filterNonTimeDimensions = function filterNonTimeDimensions(dimensions) {
9036
9029
  return dim.name !== 'time';
9037
9030
  }) : [];
9038
9031
  };
9032
+ /**
9033
+ * Returns geoJSON based on type and multipleShapes
9034
+ * @param geoJSON: GeoJSON.FeatureCollection
9035
+ * @param shouldAllowMultipleshapes: boolean
9036
+ */
9037
+ var getGeoJson = function getGeoJson(geojson, shouldAllowMultipleshapes) {
9038
+ if (shouldAllowMultipleshapes || !geojson.features.length) {
9039
+ return geojson;
9040
+ }
9041
+ var geometry = geojson.features[0].geometry;
9042
+ if (geometry.type === 'Point' || geometry.type === 'LineString') {
9043
+ return geojson;
9044
+ }
9045
+ return geometry.coordinates.length > 1 ? produce(geojson, function (draft) {
9046
+ var draftFeature = draft.features[0];
9047
+ draftFeature.geometry.coordinates = [draftFeature.geometry.coordinates[1]];
9048
+ }) : geojson;
9049
+ };
9039
9050
 
9040
9051
  var utils$2 = /*#__PURE__*/Object.freeze({
9041
9052
  __proto__: null,
9042
9053
  isActionLayerSynced: isActionLayerSynced,
9043
9054
  produceDimensionActionForMapLayer: produceDimensionActionForMapLayer,
9044
9055
  produceDraftStateForAllLayersForDimensionWithinMap: produceDraftStateForAllLayersForDimensionWithinMap,
9045
- filterNonTimeDimensions: filterNonTimeDimensions
9056
+ filterNonTimeDimensions: filterNonTimeDimensions,
9057
+ getGeoJson: getGeoJson
9046
9058
  });
9047
9059
 
9048
9060
  /* *
@@ -9195,7 +9207,7 @@ var createLayer = function createLayer(_a) {
9195
9207
  status: status
9196
9208
  });
9197
9209
  };
9198
- var initialState$9 = {
9210
+ var initialState$a = {
9199
9211
  byId: {},
9200
9212
  allIds: [],
9201
9213
  availableBaseLayers: {
@@ -9203,8 +9215,8 @@ var initialState$9 = {
9203
9215
  allIds: []
9204
9216
  }
9205
9217
  };
9206
- var slice$9 = createSlice({
9207
- initialState: initialState$9,
9218
+ var slice$a = createSlice({
9219
+ initialState: initialState$a,
9208
9220
  name: 'layerReducer',
9209
9221
  reducers: {
9210
9222
  addLayer: function addLayer(draft, action) {
@@ -9510,6 +9522,7 @@ var slice$9 = createSlice({
9510
9522
  });
9511
9523
  }
9512
9524
  },
9525
+ // feature layer actions
9513
9526
  setSelectedFeature: function setSelectedFeature(draft, action) {
9514
9527
  var _action$payload14 = action.payload,
9515
9528
  layerId = _action$payload14.layerId,
@@ -9518,13 +9531,64 @@ var slice$9 = createSlice({
9518
9531
  return;
9519
9532
  }
9520
9533
  draft.byId[layerId].selectedFeatureIndex = selectedFeatureIndex;
9534
+ },
9535
+ updateFeature: function updateFeature(draft, action) {
9536
+ var _action$payload15 = action.payload,
9537
+ layerId = _action$payload15.layerId,
9538
+ geojson = _action$payload15.geojson,
9539
+ _action$payload15$sho = _action$payload15.shouldAllowMultipleShapes,
9540
+ shouldAllowMultipleShapes = _action$payload15$sho === void 0 ? false : _action$payload15$sho;
9541
+ if (!draft.byId[layerId]) {
9542
+ return;
9543
+ }
9544
+ var geoJSON = getGeoJson(geojson, shouldAllowMultipleShapes);
9545
+ draft.byId[layerId].geojson = geoJSON;
9546
+ },
9547
+ updateFeatureProperties: function updateFeatureProperties(draft, action) {
9548
+ var _action$payload16 = action.payload,
9549
+ layerId = _action$payload16.layerId,
9550
+ properties = _action$payload16.properties;
9551
+ var currentLayer = draft.byId[layerId];
9552
+ if (!currentLayer) {
9553
+ return;
9554
+ }
9555
+ if (currentLayer.geojson && currentLayer.geojson.features.length) {
9556
+ currentLayer.geojson.features.forEach(function (_, index) {
9557
+ Object.keys(properties).forEach(function (key) {
9558
+ draft.byId[layerId].geojson.features[index].properties[key] = properties[key];
9559
+ });
9560
+ });
9561
+ }
9562
+ },
9563
+ toggleFeatureMode: function toggleFeatureMode(draft, action) {
9564
+ var _action$payload17 = action.payload,
9565
+ layerId = _action$payload17.layerId,
9566
+ isInEditMode = _action$payload17.isInEditMode,
9567
+ drawMode = _action$payload17.drawMode;
9568
+ if (!draft.byId[layerId]) {
9569
+ return;
9570
+ }
9571
+ if (isInEditMode !== undefined) {
9572
+ draft.byId[layerId].isInEditMode = isInEditMode;
9573
+ }
9574
+ if (drawMode !== undefined) {
9575
+ draft.byId[layerId].drawMode = drawMode;
9576
+ }
9577
+ },
9578
+ exitFeatureDrawMode: function exitFeatureDrawMode(draft, action) {
9579
+ var layerId = action.payload.layerId;
9580
+ if (!draft.byId[layerId]) {
9581
+ return;
9582
+ }
9583
+ draft.byId[layerId].isInEditMode = false;
9584
+ draft.byId[layerId].drawMode = '';
9521
9585
  }
9522
9586
  },
9523
9587
  extraReducers: function extraReducers(builder) {
9524
9588
  builder.addCase(setTimeSync, function (draft, action) {
9525
- var _action$payload15 = action.payload,
9526
- targetsFromAction = _action$payload15.targets,
9527
- source = _action$payload15.source;
9589
+ var _action$payload18 = action.payload,
9590
+ targetsFromAction = _action$payload18.targets,
9591
+ source = _action$payload18.source;
9528
9592
  /* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
9529
9593
  var targets = [{
9530
9594
  targetId: source.payload.sourceId,
@@ -9548,9 +9612,9 @@ var slice$9 = createSlice({
9548
9612
  * These targets can be used as payloads in new Layer actions.
9549
9613
  * These actions are here handled via the layer reducer, as it is the same logic
9550
9614
  */
9551
- var _action$payload16 = action.payload,
9552
- targets = _action$payload16.targets,
9553
- source = _action$payload16.source;
9615
+ var _action$payload19 = action.payload,
9616
+ targets = _action$payload19.targets,
9617
+ source = _action$payload19.source;
9554
9618
  var state = R(draft);
9555
9619
  return targets.reduce(function (prevState, target) {
9556
9620
  var action = {
@@ -9558,7 +9622,7 @@ var slice$9 = createSlice({
9558
9622
  type: source.type
9559
9623
  };
9560
9624
  /* Handle the Layer action with the same logic, using the same reducer */
9561
- return reducer$9(prevState, action);
9625
+ return reducer$a(prevState, action);
9562
9626
  }, state);
9563
9627
  }).addCase(setMapPreset, function (draft, action) {
9564
9628
  var mapId = action.payload.mapId;
@@ -9578,8 +9642,8 @@ var slice$9 = createSlice({
9578
9642
  });
9579
9643
  }
9580
9644
  });
9581
- var reducer$9 = slice$9.reducer;
9582
- var layerActions = slice$9.actions;
9645
+ var reducer$a = slice$a.reducer;
9646
+ var layerActions = slice$a.actions;
9583
9647
 
9584
9648
  var lodash = {exports: {}};
9585
9649
 
@@ -26932,6 +26996,18 @@ var getOverLayers = createSelector(getAllLayers, function (layers) {
26932
26996
  return layer.layerType === LayerType.overLayer;
26933
26997
  });
26934
26998
  }, selectorMemoizationOptions);
26999
+ /**
27000
+ * Retrieves all featureLayers
27001
+ *
27002
+ * Example: layers = getFeatureLayers(store)
27003
+ * @param {object} store store: object - object from which the layers state will be extracted
27004
+ * @returns {array} returnType: array - an array of all featureLayers
27005
+ */
27006
+ var getFeatureLayers = createSelector(getAllLayers, function (layers) {
27007
+ return layers.filter(function (layer) {
27008
+ return layer.layerType === LayerType.featureLayer;
27009
+ });
27010
+ }, selectorMemoizationOptions);
26935
27011
  /**
26936
27012
  * Gets dimensions of the passed layer
26937
27013
  *
@@ -27086,6 +27162,24 @@ var getAvailableBaseLayersForMap = createSelector(layerStore, function (_store,
27086
27162
  var getSelectedFeatureIndex = createSelector(getLayerById, function (layer) {
27087
27163
  return layer === null || layer === void 0 ? void 0 : layer.selectedFeatureIndex;
27088
27164
  });
27165
+ /**
27166
+ * Returns the layer is in edit mode
27167
+ *
27168
+ * Example const isLayerInEditMode = getIsLayerInEditMode(store, 'layerId1')
27169
+ * @param {object} store store: object - store object
27170
+ * @param {string} mapId layerId: string - Id of the layer
27171
+ * @returns {number} isLayerInEditMode: boolean - isInEditMode
27172
+ */
27173
+ var getIsLayerInEditMode = createSelector(getLayerById, function (layer) {
27174
+ return (layer === null || layer === void 0 ? void 0 : layer.isInEditMode) || false;
27175
+ });
27176
+ var getFeatureLayerGeoJSON = createSelector(getLayerById, function (layer) {
27177
+ return (layer === null || layer === void 0 ? void 0 : layer.geojson) || undefined;
27178
+ });
27179
+ var getFeatureLayerGeoJSONProperties = createSelector(getLayerById, function (layer) {
27180
+ var _a, _b;
27181
+ return ((_b = (_a = layer === null || layer === void 0 ? void 0 : layer.geojson) === null || _a === void 0 ? void 0 : _a.features[0]) === null || _b === void 0 ? void 0 : _b.properties) || {};
27182
+ });
27089
27183
  /**
27090
27184
  * Gets layerIds that contain passed dimension
27091
27185
  *
@@ -27133,7 +27227,7 @@ var getLayerIsInsideAcceptanceTime = createSelector(getAcceptanceTimeInMinutes,
27133
27227
  return 'inside';
27134
27228
  });
27135
27229
 
27136
- var selectors$8 = /*#__PURE__*/Object.freeze({
27230
+ var selectors$9 = /*#__PURE__*/Object.freeze({
27137
27231
  __proto__: null,
27138
27232
  getLayerById: getLayerById,
27139
27233
  getLayersById: getLayersById,
@@ -27143,6 +27237,7 @@ var selectors$8 = /*#__PURE__*/Object.freeze({
27143
27237
  getLayers: getLayers,
27144
27238
  getBaseLayers: getBaseLayers,
27145
27239
  getOverLayers: getOverLayers,
27240
+ getFeatureLayers: getFeatureLayers,
27146
27241
  getLayerDimensions: getLayerDimensions,
27147
27242
  getLayerNonTimeDimensions: getLayerNonTimeDimensions,
27148
27243
  getLayerTimeDimension: getLayerTimeDimension,
@@ -27156,6 +27251,9 @@ var selectors$8 = /*#__PURE__*/Object.freeze({
27156
27251
  getLayerStatus: getLayerStatus,
27157
27252
  getAvailableBaseLayersForMap: getAvailableBaseLayersForMap,
27158
27253
  getSelectedFeatureIndex: getSelectedFeatureIndex,
27254
+ getIsLayerInEditMode: getIsLayerInEditMode,
27255
+ getFeatureLayerGeoJSON: getFeatureLayerGeoJSON,
27256
+ getFeatureLayerGeoJSONProperties: getFeatureLayerGeoJSONProperties,
27159
27257
  getDimensionLayerIds: getDimensionLayerIds,
27160
27258
  getAcceptanceTimeInMinutes: getAcceptanceTimeInMinutes,
27161
27259
  getLayerIsInsideAcceptanceTime: getLayerIsInsideAcceptanceTime
@@ -27294,27 +27392,6 @@ function replaceLayerIds(layers, autoLayerIdOld, autoLayerIdNew) {
27294
27392
  return layersWithNewIds;
27295
27393
  }
27296
27394
 
27297
- /* *
27298
- * Licensed under the Apache License, Version 2.0 (the "License");
27299
- * you may not use this file except in compliance with the License.
27300
- * You may obtain a copy of the License at
27301
- *
27302
- * http://www.apache.org/licenses/LICENSE-2.0
27303
- *
27304
- * Unless required by applicable law or agreed to in writing, software
27305
- * distributed under the License is distributed on an "AS IS" BASIS,
27306
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27307
- * See the License for the specific language governing permissions and
27308
- * limitations under the License.
27309
- *
27310
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27311
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
27312
- * */
27313
-
27314
- var types$6 = /*#__PURE__*/Object.freeze({
27315
- __proto__: null
27316
- });
27317
-
27318
27395
  var moveToTop = function moveToTop(list, element) {
27319
27396
  var filteredList = list.filter(function (item) {
27320
27397
  return item !== element;
@@ -27338,13 +27415,13 @@ var createUIDialogElement = function createUIDialogElement(_ref) {
27338
27415
  focused: false
27339
27416
  };
27340
27417
  };
27341
- var initialState$8 = {
27418
+ var initialState$9 = {
27342
27419
  order: [],
27343
27420
  dialogs: {},
27344
27421
  activeWindowId: undefined
27345
27422
  };
27346
- var slice$8 = createSlice({
27347
- initialState: initialState$8,
27423
+ var slice$9 = createSlice({
27424
+ initialState: initialState$9,
27348
27425
  name: 'uiReducer',
27349
27426
  reducers: {
27350
27427
  registerDialog: function registerDialog(draft, action) {
@@ -27436,8 +27513,8 @@ var slice$8 = createSlice({
27436
27513
  }
27437
27514
  }
27438
27515
  });
27439
- var reducer$8 = slice$8.reducer;
27440
- var uiActions = slice$8.actions;
27516
+ var reducer$9 = slice$9.reducer;
27517
+ var uiActions = slice$9.actions;
27441
27518
 
27442
27519
  var addBaseLayer = layerActions.addBaseLayer,
27443
27520
  addLayer$1 = layerActions.addLayer,
@@ -27484,12 +27561,12 @@ var createLayersWithIds = function createLayersWithIds(state, layers) {
27484
27561
  }
27485
27562
  });
27486
27563
  };
27487
- var initialState$7 = {
27564
+ var initialState$8 = {
27488
27565
  byId: {},
27489
27566
  allIds: []
27490
27567
  };
27491
- var slice$7 = createSlice({
27492
- initialState: initialState$7,
27568
+ var slice$8 = createSlice({
27569
+ initialState: initialState$8,
27493
27570
  name: 'mapReducer',
27494
27571
  reducers: {
27495
27572
  registerMap: function registerMap(draft, action) {
@@ -27793,7 +27870,8 @@ var slice$7 = createSlice({
27793
27870
  builder.addCase(addLayer$1, function (draft, action) {
27794
27871
  var _action$payload27 = action.payload,
27795
27872
  layerId = _action$payload27.layerId,
27796
- mapId = _action$payload27.mapId;
27873
+ mapId = _action$payload27.mapId,
27874
+ layer = _action$payload27.layer;
27797
27875
  if (!draft.byId[mapId]) {
27798
27876
  return;
27799
27877
  }
@@ -27805,7 +27883,12 @@ var slice$7 = createSlice({
27805
27883
  draft.byId[mapId].autoUpdateLayerId = layerId;
27806
27884
  draft.byId[mapId].autoTimeStepLayerId = layerId;
27807
27885
  }
27808
- draft.byId[mapId].mapLayers.unshift(layerId);
27886
+ var isFeatureLayer = layer && layer.layerType === LayerType.featureLayer;
27887
+ if (isFeatureLayer) {
27888
+ draft.byId[mapId].featureLayers.unshift(layerId);
27889
+ } else {
27890
+ draft.byId[mapId].mapLayers.unshift(layerId);
27891
+ }
27809
27892
  }).addCase(addBaseLayer, function (draft, action) {
27810
27893
  var _action$payload28 = action.payload,
27811
27894
  layer = _action$payload28.layer,
@@ -27922,6 +28005,9 @@ var slice$7 = createSlice({
27922
28005
  if (map.autoTimeStepLayerId === layerId) {
27923
28006
  map.autoTimeStepLayerId = activeLayerId;
27924
28007
  }
28008
+ map.featureLayers = map.featureLayers.filter(function (id) {
28009
+ return id !== layerId;
28010
+ });
27925
28011
  }).addCase(baseLayerDelete, function (draft, action) {
27926
28012
  var _action$payload31 = action.payload,
27927
28013
  mapId = _action$payload31.mapId,
@@ -28004,7 +28090,7 @@ var slice$7 = createSlice({
28004
28090
  type: source.type
28005
28091
  };
28006
28092
  /* Handle the Layer action with the same logic, using the same reducer */
28007
- return reducer$7(prevState, action);
28093
+ return reducer$8(prevState, action);
28008
28094
  }, draft);
28009
28095
  }).addCase(onUpdateLayerInformation, function (draft, action) {
28010
28096
  var mapDimensions = action.payload.mapDimensions;
@@ -28050,11 +28136,11 @@ var slice$7 = createSlice({
28050
28136
  });
28051
28137
  }
28052
28138
  });
28053
- var mapActions = Object.assign(Object.assign({}, slice$7.actions), {
28139
+ var mapActions = Object.assign(Object.assign({}, slice$8.actions), {
28054
28140
  setMapPreset: setMapPreset,
28055
28141
  mapChangeDimension: mapChangeDimension
28056
28142
  });
28057
- var reducer$7 = slice$7.reducer;
28143
+ var reducer$8 = slice$8.reducer;
28058
28144
 
28059
28145
  /* *
28060
28146
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -28181,7 +28267,7 @@ var getDialogError = createSelector(getDialogDetailsByType, function (details) {
28181
28267
  return details && details.error || '';
28182
28268
  });
28183
28269
 
28184
- var selectors$7 = /*#__PURE__*/Object.freeze({
28270
+ var selectors$8 = /*#__PURE__*/Object.freeze({
28185
28271
  __proto__: null,
28186
28272
  getUiStore: getUiStore,
28187
28273
  getDialogDetailsByType: getDialogDetailsByType,
@@ -28228,7 +28314,7 @@ var DialogTypes;
28228
28314
  DialogTypes["AreaManager"] = "areaManager";
28229
28315
  })(DialogTypes || (DialogTypes = {}));
28230
28316
 
28231
- var types$5 = /*#__PURE__*/Object.freeze({
28317
+ var types$6 = /*#__PURE__*/Object.freeze({
28232
28318
  __proto__: null,
28233
28319
  get DialogTypes () { return DialogTypes; }
28234
28320
  });
@@ -28318,7 +28404,7 @@ var removeInPlace = function removeInPlace(inDraftArray, condition) {
28318
28404
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
28319
28405
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
28320
28406
  * */
28321
- var initialState$6 = {
28407
+ var initialState$7 = {
28322
28408
  sources: {
28323
28409
  byId: {},
28324
28410
  allIds: []
@@ -28342,8 +28428,8 @@ var initialState$6 = {
28342
28428
  }
28343
28429
  }
28344
28430
  };
28345
- var slice$6 = createSlice({
28346
- initialState: initialState$6,
28431
+ var slice$7 = createSlice({
28432
+ initialState: initialState$7,
28347
28433
  name: 'synchronizationGroupsReducer',
28348
28434
  reducers: {
28349
28435
  syncGroupAddSource: function syncGroupAddSource(draft, action) {
@@ -28472,7 +28558,7 @@ var slice$6 = createSlice({
28472
28558
  });
28473
28559
  },
28474
28560
  syncGroupClear: function syncGroupClear() {
28475
- return initialState$6;
28561
+ return initialState$7;
28476
28562
  },
28477
28563
  syncGroupSetViewState: function syncGroupSetViewState(draft, action) {
28478
28564
  var viewState = action.payload.viewState;
@@ -28531,7 +28617,7 @@ var setBboxOrTimeSync = function setBboxOrTimeSync(state, action) {
28531
28617
  });
28532
28618
  });
28533
28619
  };
28534
- var _slice$actions = slice$6.actions,
28620
+ var _slice$actions = slice$7.actions,
28535
28621
  syncGroupAddGroup = _slice$actions.syncGroupAddGroup,
28536
28622
  syncGroupAddSource = _slice$actions.syncGroupAddSource,
28537
28623
  syncGroupAddTarget = _slice$actions.syncGroupAddTarget;
@@ -28541,8 +28627,8 @@ var _slice$actions = slice$6.actions,
28541
28627
  syncGroupRemoveSource = _slice$actions.syncGroupRemoveSource,
28542
28628
  syncGroupRemoveTarget = _slice$actions.syncGroupRemoveTarget,
28543
28629
  syncGroupSetViewState = _slice$actions.syncGroupSetViewState;
28544
- var actions = slice$6.actions,
28545
- reducer$6 = slice$6.reducer;
28630
+ var actions = slice$7.actions,
28631
+ reducer$7 = slice$7.reducer;
28546
28632
 
28547
28633
  /* *
28548
28634
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -28570,7 +28656,7 @@ var SyncGroupActionOrigin;
28570
28656
  SyncGroupActionOrigin["activateLayerId"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_ACTIVELAYERIDACTION";
28571
28657
  })(SyncGroupActionOrigin || (SyncGroupActionOrigin = {}));
28572
28658
 
28573
- var types$4 = /*#__PURE__*/Object.freeze({
28659
+ var types$5 = /*#__PURE__*/Object.freeze({
28574
28660
  __proto__: null,
28575
28661
  SyncGroupTypeList: SyncGroupTypeList,
28576
28662
  get SyncGroupActionOrigin () { return SyncGroupActionOrigin; }
@@ -28672,8 +28758,8 @@ var getTargetGroups = function getTargetGroups(state, payload, actionType) {
28672
28758
  }, []);
28673
28759
  return groups;
28674
28760
  };
28675
- var getSourceId = function getSourceId(_, sourceId) {
28676
- return sourceId;
28761
+ var getSourceId = function getSourceId(_state, sourceId) {
28762
+ return typeof sourceId === 'string' ? sourceId : sourceId.sourceId;
28677
28763
  };
28678
28764
  var getAllTargetGroupsForSource = createSelector([syncGroupStore, getSourceId], function (syncGroupStore, sourceId) {
28679
28765
  if (syncGroupStore === null || syncGroupStore === void 0 ? void 0 : syncGroupStore.groups) {
@@ -28711,7 +28797,7 @@ var getSyncGroupTargets = createSelector(syncGroupStore, function (store) {
28711
28797
  }, []);
28712
28798
  });
28713
28799
 
28714
- var selectors$6 = /*#__PURE__*/Object.freeze({
28800
+ var selectors$7 = /*#__PURE__*/Object.freeze({
28715
28801
  __proto__: null,
28716
28802
  syncGroupStore: syncGroupStore,
28717
28803
  getSynchronizationGroupState: getSynchronizationGroupState,
@@ -28863,7 +28949,7 @@ var getTime = createSelector(getSyncSourceBySourceId, function (store) {
28863
28949
  return store && store.payloadByType && store.payloadByType[SYNCGROUPS_TYPE_SETTIME] ? store.payloadByType[SYNCGROUPS_TYPE_SETTIME].value : null;
28864
28950
  });
28865
28951
 
28866
- var selectors$5 = /*#__PURE__*/Object.freeze({
28952
+ var selectors$6 = /*#__PURE__*/Object.freeze({
28867
28953
  __proto__: null,
28868
28954
  getSynchronizationGroupStore: getSynchronizationGroupStore,
28869
28955
  getTime: getTime
@@ -28886,7 +28972,7 @@ var selectors$5 = /*#__PURE__*/Object.freeze({
28886
28972
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
28887
28973
  * */
28888
28974
 
28889
- var types$3 = /*#__PURE__*/Object.freeze({
28975
+ var types$4 = /*#__PURE__*/Object.freeze({
28890
28976
  __proto__: null
28891
28977
  });
28892
28978
 
@@ -29035,6 +29121,12 @@ var getMapBaseLayers = createSelector(getMapBaseLayersIds, getLayersById, functi
29035
29121
  var getMapOverLayersIds = createSelector(getMapById, function (store) {
29036
29122
  return store ? store.overLayers : [];
29037
29123
  }, selectorMemoizationOptions);
29124
+ var getMapFeatureLayers = createSelector(getMapById, getFeatureLayers, function (store, featureLayers) {
29125
+ var featureLayersOnMap = (store === null || store === void 0 ? void 0 : store.featureLayers) || [];
29126
+ return featureLayers.filter(function (layer) {
29127
+ return featureLayersOnMap.indexOf(layer.id) !== -1;
29128
+ });
29129
+ }, selectorMemoizationOptions);
29038
29130
  /**
29039
29131
  * Gets all overLayers for a map
29040
29132
  *
@@ -29137,7 +29229,7 @@ var linkedMapAnimationInfo = createSelector(function (store, mapId) {
29137
29229
  return animationInfo;
29138
29230
  }, function (animationInfo) {
29139
29231
  return animationInfo;
29140
- });
29232
+ }, selectorMemoizationOptions);
29141
29233
  /**
29142
29234
  * Gets start time of animation
29143
29235
  *
@@ -29590,7 +29682,7 @@ var getDockedLayerManagerSize = createSelector(getMapById, function (store) {
29590
29682
  return store ? store.dockedLayerManagerSize : 'sizeSmall';
29591
29683
  });
29592
29684
 
29593
- var selectors$4 = /*#__PURE__*/Object.freeze({
29685
+ var selectors$5 = /*#__PURE__*/Object.freeze({
29594
29686
  __proto__: null,
29595
29687
  getMapById: getMapById,
29596
29688
  getAllMapIds: getAllMapIds,
@@ -29602,6 +29694,7 @@ var selectors$4 = /*#__PURE__*/Object.freeze({
29602
29694
  getMapBaseLayersIds: getMapBaseLayersIds,
29603
29695
  getMapBaseLayers: getMapBaseLayers,
29604
29696
  getMapOverLayersIds: getMapOverLayersIds,
29697
+ getMapFeatureLayers: getMapFeatureLayers,
29605
29698
  getMapOverLayers: getMapOverLayers,
29606
29699
  getMapDimensions: getMapDimensions,
29607
29700
  getMapDimension: getMapDimension,
@@ -29800,12 +29893,12 @@ var mapUtils = Object.assign(Object.assign({}, utils$3), {
29800
29893
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
29801
29894
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
29802
29895
  * */
29803
- var initialState$5 = {
29896
+ var initialState$6 = {
29804
29897
  byId: {},
29805
29898
  allIds: []
29806
29899
  };
29807
- var slice$5 = createSlice({
29808
- initialState: initialState$5,
29900
+ var slice$6 = createSlice({
29901
+ initialState: initialState$6,
29809
29902
  name: 'serviceReducer',
29810
29903
  reducers: {
29811
29904
  serviceSetLayers: function serviceSetLayers(draft, action) {
@@ -29834,8 +29927,8 @@ var slice$5 = createSlice({
29834
29927
  action) {}
29835
29928
  }
29836
29929
  });
29837
- var reducer$5 = slice$5.reducer;
29838
- var serviceActions = slice$5.actions;
29930
+ var reducer$6 = slice$6.reducer;
29931
+ var serviceActions = slice$6.actions;
29839
29932
 
29840
29933
  /* *
29841
29934
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -29947,7 +30040,7 @@ var getLayerStyles = createSelector(getLayerFromService, function (layer) {
29947
30040
  return layer && layer.styles ? layer.styles : [];
29948
30041
  }, selectorMemoizationOptions);
29949
30042
 
29950
- var selectors$3 = /*#__PURE__*/Object.freeze({
30043
+ var selectors$4 = /*#__PURE__*/Object.freeze({
29951
30044
  __proto__: null,
29952
30045
  getServiceIds: getServiceIds,
29953
30046
  getServices: getServices,
@@ -29957,6 +30050,27 @@ var selectors$3 = /*#__PURE__*/Object.freeze({
29957
30050
  getLayerStyles: getLayerStyles
29958
30051
  });
29959
30052
 
30053
+ /* *
30054
+ * Licensed under the Apache License, Version 2.0 (the "License");
30055
+ * you may not use this file except in compliance with the License.
30056
+ * You may obtain a copy of the License at
30057
+ *
30058
+ * http://www.apache.org/licenses/LICENSE-2.0
30059
+ *
30060
+ * Unless required by applicable law or agreed to in writing, software
30061
+ * distributed under the License is distributed on an "AS IS" BASIS,
30062
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30063
+ * See the License for the specific language governing permissions and
30064
+ * limitations under the License.
30065
+ *
30066
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
30067
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
30068
+ * */
30069
+
30070
+ var types$3 = /*#__PURE__*/Object.freeze({
30071
+ __proto__: null
30072
+ });
30073
+
29960
30074
  /* *
29961
30075
  * Licensed under the Apache License, Version 2.0 (the "License");
29962
30076
  * you may not use this file except in compliance with the License.
@@ -32326,7 +32440,7 @@ function takeLatest$1(patternOrChannel, worker) {
32326
32440
  return fork.apply(void 0, [takeLatest, patternOrChannel, worker].concat(args));
32327
32441
  }
32328
32442
 
32329
- var _marked$7 = /*#__PURE__*/_regeneratorRuntime().mark(updateAnimation),
32443
+ var _marked$8 = /*#__PURE__*/_regeneratorRuntime().mark(updateAnimation),
32330
32444
  _marked2$6 = /*#__PURE__*/_regeneratorRuntime().mark(handleBaseLayersSaga),
32331
32445
  _marked3$2 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$7);
32332
32446
  // Expects start, end time as moment object and interval in minutes
@@ -32497,7 +32611,7 @@ function updateAnimation(mapId, maxValue) {
32497
32611
  case "end":
32498
32612
  return _context4.stop();
32499
32613
  }
32500
- }, _marked$7);
32614
+ }, _marked$8);
32501
32615
  }
32502
32616
  function setLayerDimensionsSaga(_ref4) {
32503
32617
  var payload = _ref4.payload;
@@ -33130,7 +33244,7 @@ function rootSaga$7() {
33130
33244
  }, _marked3$2);
33131
33245
  }
33132
33246
 
33133
- var _marked$6 = /*#__PURE__*/_regeneratorRuntime().mark(fetchServiceSaga),
33247
+ var _marked$7 = /*#__PURE__*/_regeneratorRuntime().mark(fetchServiceSaga),
33134
33248
  _marked2$5 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$6);
33135
33249
  function fetchServiceSaga(service) {
33136
33250
  var layers;
@@ -33156,7 +33270,7 @@ function fetchServiceSaga(service) {
33156
33270
  case "end":
33157
33271
  return _context.stop();
33158
33272
  }
33159
- }, _marked$6, null, [[0, 8]]);
33273
+ }, _marked$7, null, [[0, 8]]);
33160
33274
  }
33161
33275
  function fetchInitialServicesSaga(_ref) {
33162
33276
  var payload = _ref.payload;
@@ -33197,9 +33311,9 @@ i({
33197
33311
  var mapStoreModuleConfig = {
33198
33312
  id: 'webmap-module',
33199
33313
  reducersMap: {
33200
- webmap: reducer$7,
33201
- services: reducer$5,
33202
- layers: reducer$9
33314
+ webmap: reducer$8,
33315
+ services: reducer$6,
33316
+ layers: reducer$a
33203
33317
  },
33204
33318
  sagas: [rootSaga$7, rootSaga$6]
33205
33319
  };
@@ -33334,7 +33448,7 @@ var initialServicePopupState = {
33334
33448
  serviceId: '',
33335
33449
  variant: 'add'
33336
33450
  };
33337
- var initialState$4 = {
33451
+ var initialState$5 = {
33338
33452
  filters: {
33339
33453
  searchFilter: '',
33340
33454
  activeServices: layerSelectActiveServicesAdapter.getInitialState(),
@@ -33350,8 +33464,8 @@ var initialState$4 = {
33350
33464
  },
33351
33465
  servicePopup: initialServicePopupState
33352
33466
  };
33353
- var slice$4 = createSlice({
33354
- initialState: initialState$4,
33467
+ var slice$5 = createSlice({
33468
+ initialState: initialState$5,
33355
33469
  name: DialogTypes.LayerSelect,
33356
33470
  reducers: {
33357
33471
  setSearchFilter: function setSearchFilter(draft, action) {
@@ -33525,8 +33639,8 @@ var slice$4 = createSlice({
33525
33639
  });
33526
33640
  }
33527
33641
  });
33528
- var reducer$4 = slice$4.reducer;
33529
- var layerSelectActions = slice$4.actions;
33642
+ var reducer$5 = slice$5.reducer;
33643
+ var layerSelectActions = slice$5.actions;
33530
33644
 
33531
33645
  /* *
33532
33646
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -33691,7 +33805,7 @@ var getServicePopupDetails = function getServicePopupDetails(store) {
33691
33805
  return ((_a = store === null || store === void 0 ? void 0 : store.layerSelect) === null || _a === void 0 ? void 0 : _a.servicePopup) || initialServicePopupState;
33692
33806
  };
33693
33807
 
33694
- var selectors$2 = /*#__PURE__*/Object.freeze({
33808
+ var selectors$3 = /*#__PURE__*/Object.freeze({
33695
33809
  __proto__: null,
33696
33810
  getSearchFilter: getSearchFilter,
33697
33811
  getActiveServices: getActiveServices,
@@ -33772,9 +33886,9 @@ var isNoIdService = function isNoIdService(param) {
33772
33886
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
33773
33887
  * */
33774
33888
  var snackbarAdapter = createEntityAdapter();
33775
- var initialState$3 = snackbarAdapter.getInitialState();
33776
- var slice$3 = createSlice({
33777
- initialState: initialState$3,
33889
+ var initialState$4 = snackbarAdapter.getInitialState();
33890
+ var slice$4 = createSlice({
33891
+ initialState: initialState$4,
33778
33892
  name: 'snackbar',
33779
33893
  reducers: {
33780
33894
  // To open the snackbar call this action
@@ -33798,8 +33912,8 @@ var slice$3 = createSlice({
33798
33912
  }
33799
33913
  }
33800
33914
  });
33801
- var reducer$3 = slice$3.reducer;
33802
- var snackbarActions = slice$3.actions;
33915
+ var reducer$4 = slice$4.reducer;
33916
+ var snackbarActions = slice$4.actions;
33803
33917
 
33804
33918
  /* *
33805
33919
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -33835,7 +33949,7 @@ var getFirstSnackbarMessage = createSelector(getCurrentSnackbarMessages, functio
33835
33949
  return currentMessages.length > 0 ? currentMessages[0] : undefined;
33836
33950
  });
33837
33951
 
33838
- var selectors$1 = /*#__PURE__*/Object.freeze({
33952
+ var selectors$2 = /*#__PURE__*/Object.freeze({
33839
33953
  __proto__: null,
33840
33954
  getSnackbarStore: getSnackbarStore,
33841
33955
  getCurrentSnackbarMessages: getCurrentSnackbarMessages,
@@ -33863,7 +33977,7 @@ var types$1 = /*#__PURE__*/Object.freeze({
33863
33977
  __proto__: null
33864
33978
  });
33865
33979
 
33866
- var _marked$5 = /*#__PURE__*/_regeneratorRuntime().mark(openSnackbarSaga),
33980
+ var _marked$6 = /*#__PURE__*/_regeneratorRuntime().mark(openSnackbarSaga),
33867
33981
  _marked2$4 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$5);
33868
33982
  var hideTime = 4000;
33869
33983
  function openSnackbarSaga(capturedAction) {
@@ -33910,7 +34024,7 @@ function openSnackbarSaga(capturedAction) {
33910
34024
  case "end":
33911
34025
  return _context.stop();
33912
34026
  }
33913
- }, _marked$5);
34027
+ }, _marked$6);
33914
34028
  }
33915
34029
  function rootSaga$5() {
33916
34030
  return _regeneratorRuntime().wrap(function rootSaga$(_context2) {
@@ -33944,7 +34058,7 @@ function rootSaga$5() {
33944
34058
  var snackbarModuleConfig = {
33945
34059
  id: 'snackbar-module',
33946
34060
  reducersMap: {
33947
- snackbar: reducer$3
34061
+ snackbar: reducer$4
33948
34062
  },
33949
34063
  sagas: [rootSaga$5]
33950
34064
  };
@@ -33965,9 +34079,9 @@ var snackbarModuleConfig = {
33965
34079
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
33966
34080
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
33967
34081
  * */
33968
- var initialState$2 = {};
33969
- var slice$2 = createSlice({
33970
- initialState: initialState$2,
34082
+ var initialState$3 = {};
34083
+ var slice$3 = createSlice({
34084
+ initialState: initialState$3,
33971
34085
  name: 'router',
33972
34086
  reducers: {
33973
34087
  navigateToUrl: function navigateToUrl(
@@ -33977,8 +34091,8 @@ var slice$2 = createSlice({
33977
34091
  action) {}
33978
34092
  }
33979
34093
  });
33980
- var reducer$2 = slice$2.reducer;
33981
- var routerActions = slice$2.actions;
34094
+ var reducer$3 = slice$3.reducer;
34095
+ var routerActions = slice$3.actions;
33982
34096
 
33983
34097
  /* *
33984
34098
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -34007,7 +34121,7 @@ var utils = /*#__PURE__*/Object.freeze({
34007
34121
  historyDict: historyDict
34008
34122
  });
34009
34123
 
34010
- var _marked$4 = /*#__PURE__*/_regeneratorRuntime().mark(navigateToUrlSaga),
34124
+ var _marked$5 = /*#__PURE__*/_regeneratorRuntime().mark(navigateToUrlSaga),
34011
34125
  _marked2$3 = /*#__PURE__*/_regeneratorRuntime().mark(rootSaga$4);
34012
34126
  function navigateToUrlSaga(action) {
34013
34127
  var payload;
@@ -34021,7 +34135,7 @@ function navigateToUrlSaga(action) {
34021
34135
  case "end":
34022
34136
  return _context.stop();
34023
34137
  }
34024
- }, _marked$4);
34138
+ }, _marked$5);
34025
34139
  }
34026
34140
  function rootSaga$4() {
34027
34141
  return _regeneratorRuntime().wrap(function rootSaga$(_context2) {
@@ -34055,7 +34169,7 @@ function rootSaga$4() {
34055
34169
  var routerModuleConfig = {
34056
34170
  id: 'router',
34057
34171
  reducersMap: {
34058
- router: reducer$2
34172
+ router: reducer$3
34059
34173
  },
34060
34174
  sagas: [rootSaga$4]
34061
34175
  };
@@ -34076,11 +34190,11 @@ var routerModuleConfig = {
34076
34190
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
34077
34191
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
34078
34192
  * */
34079
- var initialState$1 = {
34193
+ var initialState$2 = {
34080
34194
  isInitialised: false
34081
34195
  };
34082
- var slice$1 = createSlice({
34083
- initialState: initialState$1,
34196
+ var slice$2 = createSlice({
34197
+ initialState: initialState$2,
34084
34198
  name: 'app',
34085
34199
  reducers: {
34086
34200
  initialiseApp: function initialiseApp(draft) {
@@ -34088,8 +34202,8 @@ var slice$1 = createSlice({
34088
34202
  }
34089
34203
  }
34090
34204
  });
34091
- var reducer$1 = slice$1.reducer;
34092
- var appActions = slice$1.actions;
34205
+ var reducer$2 = slice$2.reducer;
34206
+ var appActions = slice$2.actions;
34093
34207
 
34094
34208
  /* *
34095
34209
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -34110,7 +34224,7 @@ var appActions = slice$1.actions;
34110
34224
  var appModuleConfig = {
34111
34225
  id: 'app-module',
34112
34226
  reducersMap: {
34113
- app: reducer$1
34227
+ app: reducer$2
34114
34228
  }
34115
34229
  };
34116
34230
 
@@ -34130,19 +34244,19 @@ var appModuleConfig = {
34130
34244
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
34131
34245
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
34132
34246
  * */
34133
- var drawAdapter = createEntityAdapter({
34247
+ var drawAdapter$1 = createEntityAdapter({
34134
34248
  selectId: function selectId(draw) {
34135
34249
  return draw.mapId;
34136
34250
  }
34137
34251
  });
34138
- var initialState = drawAdapter.getInitialState();
34139
- var slice = createSlice({
34140
- initialState: initialState,
34252
+ var initialState$1 = drawAdapter$1.getInitialState();
34253
+ var slice$1 = createSlice({
34254
+ initialState: initialState$1,
34141
34255
  name: 'draw',
34142
34256
  reducers: {
34143
34257
  setDrawValues: function setDrawValues(draft, action) {
34144
34258
  if (draft.entities[action.payload.mapId]) {
34145
- drawAdapter.setOne(draft, action.payload);
34259
+ drawAdapter$1.setOne(draft, action.payload);
34146
34260
  }
34147
34261
  },
34148
34262
  // action caught in drawings/saga
@@ -34154,19 +34268,19 @@ var slice = createSlice({
34154
34268
  },
34155
34269
  extraReducers: function extraReducers(builder) {
34156
34270
  builder.addCase(mapActions.registerMap, function (draft, action) {
34157
- drawAdapter.addOne(draft, {
34271
+ drawAdapter$1.addOne(draft, {
34158
34272
  mapId: action.payload.mapId,
34159
34273
  area: undefined,
34160
34274
  areaName: '',
34161
34275
  id: ''
34162
34276
  });
34163
34277
  }).addCase(mapActions.unregisterMap, function (draft, action) {
34164
- drawAdapter.removeOne(draft, action.payload.mapId);
34278
+ drawAdapter$1.removeOne(draft, action.payload.mapId);
34165
34279
  });
34166
34280
  }
34167
34281
  });
34168
- var reducer = slice.reducer;
34169
- var drawActions = slice.actions;
34282
+ var reducer$1 = slice$1.reducer;
34283
+ var drawActions = slice$1.actions;
34170
34284
 
34171
34285
  /* *
34172
34286
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -34190,16 +34304,16 @@ var getDrawStore = function getDrawStore(store) {
34190
34304
  }
34191
34305
  return null;
34192
34306
  };
34193
- var _drawAdapter$getSelec = drawAdapter.getSelectors(function (state) {
34307
+ var _drawAdapter$getSelec$1 = drawAdapter$1.getSelectors(function (state) {
34194
34308
  var _a;
34195
34309
  return (_a = state === null || state === void 0 ? void 0 : state.drawings) !== null && _a !== void 0 ? _a : {
34196
34310
  entities: {},
34197
34311
  ids: []
34198
34312
  };
34199
34313
  }),
34200
- selectDrawByMapId = _drawAdapter$getSelec.selectById;
34314
+ selectDrawByMapId = _drawAdapter$getSelec$1.selectById;
34201
34315
 
34202
- var selectors = /*#__PURE__*/Object.freeze({
34316
+ var selectors$1 = /*#__PURE__*/Object.freeze({
34203
34317
  __proto__: null,
34204
34318
  getDrawStore: getDrawStore,
34205
34319
  selectDrawByMapId: selectDrawByMapId
@@ -34245,11 +34359,331 @@ var types = /*#__PURE__*/Object.freeze({
34245
34359
  var drawModuleConfig = {
34246
34360
  id: 'draw-module',
34247
34361
  reducersMap: {
34248
- drawings: reducer
34362
+ drawings: reducer$1
34249
34363
  },
34250
34364
  sagas: []
34251
34365
  };
34252
34366
 
34367
+ /* *
34368
+ * Licensed under the Apache License, Version 2.0 (the "License");
34369
+ * you may not use this file except in compliance with the License.
34370
+ * You may obtain a copy of the License at
34371
+ *
34372
+ * http://www.apache.org/licenses/LICENSE-2.0
34373
+ *
34374
+ * Unless required by applicable law or agreed to in writing, software
34375
+ * distributed under the License is distributed on an "AS IS" BASIS,
34376
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34377
+ * See the License for the specific language governing permissions and
34378
+ * limitations under the License.
34379
+ *
34380
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
34381
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
34382
+ * */
34383
+ // reducer utils
34384
+ var drawAdapter = createEntityAdapter({
34385
+ selectId: function selectId(draw) {
34386
+ return draw.drawToolId;
34387
+ }
34388
+ });
34389
+ var getDrawLayerId = function getDrawLayerId(drawToolId) {
34390
+ return "drawlayer-".concat(drawToolId);
34391
+ };
34392
+ var getDrawToolByLayerId = function getDrawToolByLayerId(draft, layerId) {
34393
+ var state = R(draft);
34394
+ var drawTool = state.ids.map(function (id) {
34395
+ return state.entities[id];
34396
+ }).find(function (tool) {
34397
+ return (tool === null || tool === void 0 ? void 0 : tool.geoJSONLayerId) === layerId;
34398
+ });
34399
+ return (drawTool === null || drawTool === void 0 ? void 0 : drawTool.drawToolId) || undefined;
34400
+ };
34401
+ var initialState = drawAdapter.getInitialState();
34402
+ var slice = createSlice({
34403
+ initialState: initialState,
34404
+ name: 'draw',
34405
+ reducers: {
34406
+ registerDrawTool: function registerDrawTool(draft, action) {
34407
+ var _action$payload = action.payload,
34408
+ drawToolId = _action$payload.drawToolId,
34409
+ drawModes = _action$payload.drawModes;
34410
+ drawAdapter.addOne(draft, {
34411
+ drawToolId: drawToolId,
34412
+ geoJSONLayerId: getDrawLayerId(drawToolId),
34413
+ activeDrawModeId: '',
34414
+ drawModes: drawModes
34415
+ });
34416
+ },
34417
+ changeDrawToolMode: function changeDrawToolMode(draft, action) {
34418
+ var _action$payload2 = action.payload,
34419
+ drawModeId = _action$payload2.drawModeId,
34420
+ drawToolId = _action$payload2.drawToolId;
34421
+ var drawTool = draft.entities[drawToolId];
34422
+ if (!drawTool) {
34423
+ return;
34424
+ }
34425
+ var tool = drawTool.drawModes.find(function (drawMode) {
34426
+ return drawMode.drawModeId === drawModeId;
34427
+ });
34428
+ if ((tool === null || tool === void 0 ? void 0 : tool.isSelectable) === false) {
34429
+ drawTool.activeDrawModeId = '';
34430
+ return;
34431
+ }
34432
+ if ((drawTool === null || drawTool === void 0 ? void 0 : drawTool.activeDrawModeId) !== drawModeId) {
34433
+ drawTool.activeDrawModeId = drawModeId;
34434
+ } else {
34435
+ drawTool.activeDrawModeId = '';
34436
+ }
34437
+ }
34438
+ },
34439
+ extraReducers: function extraReducers(builder) {
34440
+ builder.addCase(layerActions.exitFeatureDrawMode, function (draft, action) {
34441
+ var layerId = action.payload.layerId;
34442
+ var drawToolId = getDrawToolByLayerId(draft, layerId);
34443
+ if (drawToolId && draft.entities[drawToolId] !== undefined) {
34444
+ draft.entities[drawToolId].activeDrawModeId = '';
34445
+ }
34446
+ }).addCase(layerActions.updateFeatureProperties, function (draft, action) {
34447
+ var _a;
34448
+ var _action$payload3 = action.payload,
34449
+ properties = _action$payload3.properties,
34450
+ layerId = _action$payload3.layerId;
34451
+ var drawToolId = getDrawToolByLayerId(draft, layerId);
34452
+ var entity = draft.entities[drawToolId];
34453
+ if (drawToolId && entity !== undefined) {
34454
+ var newDrawModes = (_a = entity === null || entity === void 0 ? void 0 : entity.drawModes) === null || _a === void 0 ? void 0 : _a.map(function (mode) {
34455
+ if (mode.shape.type === 'Feature') {
34456
+ return Object.assign(Object.assign({}, mode), {
34457
+ shape: Object.assign(Object.assign({}, mode.shape), {
34458
+ properties: Object.assign(Object.assign({}, mode.shape.properties), properties)
34459
+ })
34460
+ });
34461
+ }
34462
+ return mode;
34463
+ });
34464
+ entity.drawModes = newDrawModes;
34465
+ drawAdapter.setOne(draft, entity);
34466
+ }
34467
+ });
34468
+ // TODO: https://gitlab.com/opengeoweb/opengeoweb/-/issues/4065 enable auto registering again in
34469
+ // .addCase(mapActions.registerMap, (draft: Draft<DrawState>, action) => {
34470
+ // // drawAdapter.addOne(draft, {
34471
+ // // mapId: action.payload.mapId,
34472
+ // // area: undefined!,
34473
+ // // areaName: '',
34474
+ // // id: '',
34475
+ // // });
34476
+ // })
34477
+ // .addCase(mapActions.unregisterMap, (draft: Draft<DrawState>, action) => {
34478
+ // // drawAdapter.removeOne(draft, action.payload.mapId);
34479
+ // });
34480
+ }
34481
+ });
34482
+
34483
+ var reducer = slice.reducer;
34484
+ var drawtoolActions = slice.actions;
34485
+
34486
+ /* *
34487
+ * Licensed under the Apache License, Version 2.0 (the "License");
34488
+ * you may not use this file except in compliance with the License.
34489
+ * You may obtain a copy of the License at
34490
+ *
34491
+ * http://www.apache.org/licenses/LICENSE-2.0
34492
+ *
34493
+ * Unless required by applicable law or agreed to in writing, software
34494
+ * distributed under the License is distributed on an "AS IS" BASIS,
34495
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34496
+ * See the License for the specific language governing permissions and
34497
+ * limitations under the License.
34498
+ *
34499
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
34500
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
34501
+ * */
34502
+ var getDrawingtoolStore = function getDrawingtoolStore(store) {
34503
+ if (store && store.drawingtools) {
34504
+ return store.drawingtools;
34505
+ }
34506
+ return null;
34507
+ };
34508
+ var _drawAdapter$getSelec = drawAdapter.getSelectors(function (state) {
34509
+ var _a;
34510
+ return (_a = state === null || state === void 0 ? void 0 : state.drawingtools) !== null && _a !== void 0 ? _a : {
34511
+ entities: {},
34512
+ ids: []
34513
+ };
34514
+ }),
34515
+ selectDrawingToolByMapId = _drawAdapter$getSelec.selectById;
34516
+ var getDrawModeById = createSelector(selectDrawingToolByMapId, function (_store, _drawToolId, drawModeId) {
34517
+ return drawModeId;
34518
+ }, function (draw, drawModeId) {
34519
+ return draw === null || draw === void 0 ? void 0 : draw.drawModes.find(function (tool) {
34520
+ return tool.drawModeId === drawModeId;
34521
+ });
34522
+ });
34523
+
34524
+ var selectors = /*#__PURE__*/Object.freeze({
34525
+ __proto__: null,
34526
+ getDrawingtoolStore: getDrawingtoolStore,
34527
+ selectDrawingToolByMapId: selectDrawingToolByMapId,
34528
+ getDrawModeById: getDrawModeById
34529
+ });
34530
+
34531
+ var _marked$4 = /*#__PURE__*/_regeneratorRuntime().mark(drawingSaga);
34532
+ function registerDrawToolSaga(_ref) {
34533
+ var payload = _ref.payload;
34534
+ return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
34535
+ var drawToolId, mapId, drawLayerId;
34536
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
34537
+ while (1) switch (_context.prev = _context.next) {
34538
+ case 0:
34539
+ drawToolId = payload.drawToolId, mapId = payload.mapId;
34540
+ drawLayerId = getDrawLayerId(drawToolId); // create for every drawTool a draw layer
34541
+ _context.next = 4;
34542
+ return put(mapStoreActions.addLayer({
34543
+ mapId: mapId,
34544
+ layer: {
34545
+ // empty geoJSON
34546
+ geojson: {
34547
+ type: 'FeatureCollection',
34548
+ features: []
34549
+ },
34550
+ layerType: LayerType.featureLayer
34551
+ },
34552
+ layerId: drawLayerId,
34553
+ origin: 'drawings saga:registerDrawToolSaga'
34554
+ }));
34555
+ case 4:
34556
+ case "end":
34557
+ return _context.stop();
34558
+ }
34559
+ }, _callee);
34560
+ })();
34561
+ }
34562
+ function changeDrawToolSaga(_ref2) {
34563
+ var payload = _ref2.payload;
34564
+ return /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
34565
+ var _a, _b, _c, _d, drawModeId, drawToolId, drawingTool, newDrawMode, currentGeoJSONLayer, currentSelectionType, newSelectionType;
34566
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
34567
+ while (1) switch (_context2.prev = _context2.next) {
34568
+ case 0:
34569
+ _context2.prev = 0;
34570
+ drawModeId = payload.drawModeId, drawToolId = payload.drawToolId;
34571
+ _context2.next = 4;
34572
+ return select(selectDrawingToolByMapId, drawToolId);
34573
+ case 4:
34574
+ drawingTool = _context2.sent;
34575
+ _context2.next = 7;
34576
+ return select(getDrawModeById, drawToolId, drawModeId);
34577
+ case 7:
34578
+ newDrawMode = _context2.sent;
34579
+ if (!(newDrawMode.value === 'DELETE')) {
34580
+ _context2.next = 12;
34581
+ break;
34582
+ }
34583
+ _context2.next = 11;
34584
+ return put(layerActions.layerChangeGeojson({
34585
+ layerId: drawingTool.geoJSONLayerId,
34586
+ geojson: {
34587
+ type: 'FeatureCollection',
34588
+ features: []
34589
+ }
34590
+ }));
34591
+ case 11:
34592
+ return _context2.abrupt("return");
34593
+ case 12:
34594
+ if (drawingTool.activeDrawModeId) {
34595
+ _context2.next = 16;
34596
+ break;
34597
+ }
34598
+ _context2.next = 15;
34599
+ return put(layerActions.toggleFeatureMode({
34600
+ layerId: drawingTool.geoJSONLayerId,
34601
+ isInEditMode: false,
34602
+ drawMode: ''
34603
+ }));
34604
+ case 15:
34605
+ return _context2.abrupt("return");
34606
+ case 16:
34607
+ _context2.next = 18;
34608
+ return select(getLayerById, drawingTool.geoJSONLayerId);
34609
+ case 18:
34610
+ currentGeoJSONLayer = _context2.sent;
34611
+ currentSelectionType = (_c = (_b = (_a = currentGeoJSONLayer === null || currentGeoJSONLayer === void 0 ? void 0 : currentGeoJSONLayer.geojson) === null || _a === void 0 ? void 0 : _a.features[0]) === null || _b === void 0 ? void 0 : _b.properties) === null || _c === void 0 ? void 0 : _c.selectionType;
34612
+ newSelectionType = (_d = newDrawMode.shape.properties) === null || _d === void 0 ? void 0 : _d.selectionType; // don't change anything if same tool is selected again
34613
+ if (!(currentSelectionType !== newSelectionType)) {
34614
+ _context2.next = 24;
34615
+ break;
34616
+ }
34617
+ _context2.next = 24;
34618
+ return put(mapStoreActions.layerChangeGeojson({
34619
+ layerId: drawingTool.geoJSONLayerId,
34620
+ geojson: {
34621
+ type: 'FeatureCollection',
34622
+ features: [newDrawMode.shape]
34623
+ }
34624
+ }));
34625
+ case 24:
34626
+ _context2.next = 26;
34627
+ return put(layerActions.toggleFeatureMode({
34628
+ layerId: drawingTool.geoJSONLayerId,
34629
+ isInEditMode: true,
34630
+ drawMode: newDrawMode.value
34631
+ }));
34632
+ case 26:
34633
+ _context2.next = 31;
34634
+ break;
34635
+ case 28:
34636
+ _context2.prev = 28;
34637
+ _context2.t0 = _context2["catch"](0);
34638
+ // eslint-disable-next-line no-console
34639
+ console.log('error changeDrawToolSaga', _context2.t0);
34640
+ case 31:
34641
+ case "end":
34642
+ return _context2.stop();
34643
+ }
34644
+ }, _callee2, null, [[0, 28]]);
34645
+ })();
34646
+ }
34647
+ function drawingSaga() {
34648
+ return _regeneratorRuntime().wrap(function drawingSaga$(_context3) {
34649
+ while (1) switch (_context3.prev = _context3.next) {
34650
+ case 0:
34651
+ _context3.next = 2;
34652
+ return takeLatest$1(drawtoolActions.registerDrawTool, registerDrawToolSaga);
34653
+ case 2:
34654
+ _context3.next = 4;
34655
+ return takeLatest$1(drawtoolActions.changeDrawToolMode, changeDrawToolSaga);
34656
+ case 4:
34657
+ case "end":
34658
+ return _context3.stop();
34659
+ }
34660
+ }, _marked$4);
34661
+ }
34662
+
34663
+ /* *
34664
+ * Licensed under the Apache License, Version 2.0 (the "License");
34665
+ * you may not use this file except in compliance with the License.
34666
+ * You may obtain a copy of the License at
34667
+ *
34668
+ * http://www.apache.org/licenses/LICENSE-2.0
34669
+ *
34670
+ * Unless required by applicable law or agreed to in writing, software
34671
+ * distributed under the License is distributed on an "AS IS" BASIS,
34672
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
34673
+ * See the License for the specific language governing permissions and
34674
+ * limitations under the License.
34675
+ *
34676
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
34677
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
34678
+ * */
34679
+ var drawtoolModuleConfig = {
34680
+ id: 'drawtool-module',
34681
+ reducersMap: {
34682
+ drawingtools: reducer
34683
+ },
34684
+ sagas: [drawingSaga]
34685
+ };
34686
+
34253
34687
  var createLayersState = function createLayersState(layerId) {
34254
34688
  var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
34255
34689
  return {
@@ -34403,6 +34837,9 @@ var webmapStateWithMultipleLayers = function webmapStateWithMultipleLayers(layer
34403
34837
  case LayerType.overLayer:
34404
34838
  webmap.byId[mapId].overLayers.push(layer.id);
34405
34839
  break;
34840
+ case LayerType.featureLayer:
34841
+ webmap.byId[mapId].featureLayers.push(layer.id);
34842
+ break;
34406
34843
  }
34407
34844
  });
34408
34845
  // first layer is active layer
@@ -34449,6 +34886,23 @@ var mockStateMapWithMultipleLayers = function mockStateMapWithMultipleLayers(lay
34449
34886
  }
34450
34887
  };
34451
34888
  };
34889
+ var testGeoJSON = {
34890
+ type: 'FeatureCollection',
34891
+ features: [{
34892
+ type: 'Feature',
34893
+ geometry: {
34894
+ type: 'Polygon',
34895
+ coordinates: [[[5.0, 55.0], [4.331914, 55.332644], [3.368817, 55.764314], [2.761908, 54.379261], [3.15576, 52.913554], [2.000002, 51.500002], [3.370001, 51.369722], [3.370527, 51.36867], [3.362223, 51.320002], [3.36389, 51.313608], [3.373613, 51.309999], [3.952501, 51.214441], [4.397501, 51.452776], [5.078611, 51.391665], [5.848333, 51.139444], [5.651667, 50.824717], [6.011797, 50.757273], [5.934168, 51.036386], [6.222223, 51.361666], [5.94639, 51.811663], [6.405001, 51.830828], [7.053095, 52.237764], [7.031389, 52.268885], [7.063612, 52.346109], [7.065557, 52.385828], [7.133055, 52.888887], [7.14218, 52.898244], [7.191667, 53.3], [6.5, 53.666667], [6.500002, 55.000002], [5.0, 55.0]]]
34896
+ },
34897
+ properties: {
34898
+ fill: '#ff7800',
34899
+ 'fill-opacity': 0.2,
34900
+ stroke: '#ff7800',
34901
+ 'stroke-width': 2,
34902
+ 'stroke-opacity': 1
34903
+ }
34904
+ }]
34905
+ };
34452
34906
 
34453
34907
  var storeTestUtils = /*#__PURE__*/Object.freeze({
34454
34908
  __proto__: null,
@@ -34458,7 +34912,8 @@ var storeTestUtils = /*#__PURE__*/Object.freeze({
34458
34912
  createMapDimensionsState: createMapDimensionsState,
34459
34913
  webmapStateWithAddedLayer: webmapStateWithAddedLayer,
34460
34914
  mockStateMapWithLayer: mockStateMapWithLayer,
34461
- mockStateMapWithMultipleLayers: mockStateMapWithMultipleLayers
34915
+ mockStateMapWithMultipleLayers: mockStateMapWithMultipleLayers,
34916
+ testGeoJSON: testGeoJSON
34462
34917
  });
34463
34918
 
34464
34919
  /* *
@@ -35108,7 +35563,7 @@ function rootSaga$2() {
35108
35563
  var synchronizationGroupConfig = {
35109
35564
  id: 'syncronizationGroupStore-module',
35110
35565
  reducersMap: {
35111
- syncronizationGroupStore: reducer$6
35566
+ syncronizationGroupStore: reducer$7
35112
35567
  },
35113
35568
  sagas: [rootSaga$3, rootSaga$2]
35114
35569
  };
@@ -35288,7 +35743,7 @@ function rootSaga$1() {
35288
35743
  var layerSelectConfig = {
35289
35744
  id: 'layerSelect-module',
35290
35745
  reducersMap: {
35291
- layerSelect: reducer$4
35746
+ layerSelect: reducer$5
35292
35747
  },
35293
35748
  sagas: [rootSaga$1]
35294
35749
  };
@@ -35403,7 +35858,7 @@ function rootSaga() {
35403
35858
  var uiModuleConfig = {
35404
35859
  id: 'ui-module',
35405
35860
  reducersMap: {
35406
- ui: reducer$8
35861
+ ui: reducer$9
35407
35862
  },
35408
35863
  sagas: [rootSaga]
35409
35864
  };
@@ -35424,6 +35879,6 @@ var uiModuleConfig = {
35424
35879
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
35425
35880
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
35426
35881
  * */
35427
- var coreModuleConfig = [mapStoreModuleConfig, synchronizationGroupConfig, uiModuleConfig, layerSelectConfig, snackbarModuleConfig, drawModuleConfig];
35882
+ var coreModuleConfig = [mapStoreModuleConfig, synchronizationGroupConfig, uiModuleConfig, layerSelectConfig, snackbarModuleConfig, drawModuleConfig, drawtoolModuleConfig];
35428
35883
 
35429
- export { appActions, appModuleConfig, coreModuleConfig, defaultLayers, drawActions, drawModuleConfig, selectors as drawSelectors, types as drawTypes, filterLayers$1 as filterLayers, genericActions, selectors$5 as genericSelectors, types$3 as genericTypes, getUserAddedServices, initialState$6 as initialState, layerActions, reducer$9 as layerReducer, layerSelectActions, initialState$4 as layerSelectInitialState, selectors$2 as layerSelectSelectors, types$2 as layerSelectTypes, selectors$8 as layerSelectors, types$8 as layerTypes, utils$2 as layerUtils, mapActions, constants$1 as mapConstants, enums as mapEnums, selectors$4 as mapSelectors, mapStoreActions, mapStoreModuleConfig, types$7 as mapTypes, mapUtils, routerActions, routerModuleConfig, utils as routerUtils, serviceActions, selectors$3 as serviceSelectors, types$6 as serviceTypes, setUserAddedServices, snackbarActions, snackbarModuleConfig, selectors$1 as snackbarSelectors, types$1 as snackbarTypes, storeTestSettings, storeTestUtils, utils$1 as storeUtils, constants as syncConstants, actions as syncGroupsActions, selector as syncGroupsSelector, selectors$6 as syncGroupsSelectors, types$4 as syncGroupsTypes, types$4 as types, uiActions, uiModuleConfig, reducer$8 as uiReducer, selectors$7 as uiSelectors, types$5 as uiTypes, reducer$7 as webmapReducer };
35884
+ export { appActions, appModuleConfig, coreModuleConfig, defaultLayers, drawActions, drawModuleConfig, selectors$1 as drawSelectors, types as drawTypes, drawtoolActions, drawtoolModuleConfig, selectors as drawtoolSelectors, filterLayers$1 as filterLayers, genericActions, selectors$6 as genericSelectors, types$4 as genericTypes, getUserAddedServices, initialState$7 as initialState, layerActions, reducer$a as layerReducer, layerSelectActions, initialState$5 as layerSelectInitialState, selectors$3 as layerSelectSelectors, types$2 as layerSelectTypes, selectors$9 as layerSelectors, types$8 as layerTypes, utils$2 as layerUtils, mapActions, constants$1 as mapConstants, enums as mapEnums, selectors$5 as mapSelectors, mapStoreActions, mapStoreModuleConfig, types$7 as mapTypes, mapUtils, routerActions, routerModuleConfig, utils as routerUtils, serviceActions, selectors$4 as serviceSelectors, types$3 as serviceTypes, setUserAddedServices, snackbarActions, snackbarModuleConfig, selectors$2 as snackbarSelectors, types$1 as snackbarTypes, storeTestSettings, storeTestUtils, utils$1 as storeUtils, constants as syncConstants, actions as syncGroupsActions, selector as syncGroupsSelector, selectors$7 as syncGroupsSelectors, types$5 as syncGroupsTypes, types$5 as types, uiActions, uiModuleConfig, reducer$9 as uiReducer, selectors$8 as uiSelectors, types$6 as uiTypes, reducer$8 as webmapReducer };