@defra/interactive-map 0.0.59-alpha → 0.0.60-alpha
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/assets/templates/add-polygons.njk +2 -2
- package/assets/templates/add-symbols.njk +2 -2
- package/dist/css/index.css +1 -1
- package/dist/esm/im-core.js +1 -1
- package/dist/esm/im-shell.js +1 -1
- package/dist/umd/im-core.js +1 -1
- package/dist/umd/index.js +1 -1
- package/docs/api/panel-definition.md +30 -0
- package/docs/api/symbol-config.md +12 -0
- package/docs/api.md +21 -2
- package/docs/assets/images/slot-map.svg +3 -3
- package/docs/plugins/datasets.md +11 -1
- package/package.json +1 -1
- package/plugins/datasets/dist/esm/index.js +1 -1
- package/plugins/datasets/dist/esm/layerAdapter.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-ml-adapter.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-ol-adapter.js +1 -1
- package/plugins/datasets/dist/umd/im-datasets-plugin.js +1 -1
- package/plugins/datasets/dist/umd/index.js +1 -1
- package/plugins/datasets/src/index.js +0 -1
- package/plugins/datasets/src/index.test.js +2 -8
- package/plugins/datasets/src/registry/dataset.test.js +9 -0
- package/plugins/draw/dist/umd/im-draw-ml-adapter.js +1 -1
- package/plugins/draw/dist/umd/im-draw-ol-adapter.js +1 -1
- package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
- package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
- package/plugins/map-key/dist/esm/im-map-key-plugin.js +1 -1
- package/plugins/map-key/dist/umd/im-map-key-plugin.js +1 -1
- package/plugins/search/dist/css/index.css +1 -1
- package/plugins/search/src/components/Form/Form.module.scss +1 -0
- package/providers/esri/dist/esm/im-esri-provider.js +1 -1
- package/providers/esri/src/esriProvider.js +10 -21
- package/providers/esri/src/utils/coords.js +37 -7
- package/providers/esri/src/utils/coords.test.js +22 -1
- package/providers/esri/src/utils/spatial.js +1 -47
- package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
- package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
- package/providers/maplibre/src/maplibreProvider.js +5 -14
- package/providers/maplibre/src/maplibreProvider.test.js +143 -146
- package/providers/maplibre/src/utils/spatial.js +0 -40
- package/providers/maplibre/src/utils/spatial.test.js +0 -35
- package/providers/openlayers/dist/esm/im-openlayers-provider.js +1 -1
- package/providers/openlayers/dist/umd/im-openlayers-provider.js +1 -1
- package/providers/openlayers/src/openlayersProvider.js +5 -14
- package/providers/openlayers/src/openlayersProvider.test.js +12 -10
- package/providers/openlayers/src/utils/spatial.js +0 -39
- package/providers/openlayers/src/utils/spatial.test.js +1 -26
- package/src/App/components/Hints/Hints.jsx +9 -21
- package/src/App/components/Hints/Hints.test.jsx +20 -33
- package/src/App/components/Panel/Panel.jsx +16 -1
- package/src/App/components/Panel/Panel.test.jsx +44 -0
- package/src/App/hooks/useCrossHairAPI.js +27 -28
- package/src/App/hooks/useCrossHairAPI.test.js +64 -7
- package/src/App/hooks/useLayoutMeasurements.js +175 -131
- package/src/App/hooks/useLayoutMeasurements.test.js +227 -122
- package/src/App/hooks/useMapProviderOverrides.js +114 -35
- package/src/App/hooks/useMapProviderOverrides.test.js +188 -5
- package/src/App/hooks/useModalPanelBehaviour.js +18 -32
- package/src/App/hooks/useModalPanelBehaviour.test.js +45 -33
- package/src/App/hooks/useVisibleGeometry.js +35 -45
- package/src/App/hooks/useVisibleGeometry.test.js +149 -121
- package/src/App/layout/Layout.jsx +4 -4
- package/src/App/layout/layout.module.scss +124 -61
- package/src/App/store/AppProvider.jsx +3 -0
- package/src/App/store/appDispatchMiddleware.js +18 -10
- package/src/App/store/appDispatchMiddleware.test.js +42 -4
- package/src/InteractiveMap/InteractiveMap.js +3 -2
- package/src/InteractiveMap/InteractiveMap.test.js +2 -2
- package/src/config/events.js +1 -1
- package/src/config/mapPanelSlots.js +8 -0
- package/src/config/symbolConfig.js +1 -1
- package/src/services/symbolRegistry.js +1 -1
- package/src/services/symbolRegistry.test.js +19 -0
- package/src/types.js +29 -8
- package/src/utils/getFitMove.js +73 -0
- package/src/utils/getFitMove.test.js +114 -0
- package/src/utils/getSafeZoneInset.js +122 -77
- package/src/utils/getSafeZoneInset.test.js +241 -54
- package/src/utils/getValueForStyle.js +10 -5
- package/src/utils/getValueForStyle.test.js +13 -2
- package/src/utils/renderedBoxes.js +25 -0
- package/src/utils/renderedBoxes.test.js +61 -0
- package/src/utils/screenBox.js +70 -0
- package/src/utils/screenBox.test.js +69 -0
- package/src/utils/symbolUtils.js +9 -9
- package/src/utils/symbolUtils.test.js +21 -0
- package/providers/esri/src/utils/spatial.test.js +0 -58
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see im-datasets-ml-adapter.js.LICENSE.txt */
|
|
2
|
-
"use strict";(Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[]).push([[563],{913:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function u(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof c?n:c,l=Object.create(u.prototype);return s(l,"_invoke",function(r,n,o){var i,u,s,c=0,l=o||[],f=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,s=t,y.n=r,a}};function p(r,n){for(u=r,s=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],p=y.p,h=i[2];r>3?(o=h===n)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,y.n=h,u=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,h),u=l,s=h;(e=u<2?t:s)||!f;){i||(u?u<3?(u>1&&(y.n=-1),p(u,s)):y.n=s:y.v=s);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=y.n<0)?s:r.call(n,y))!==a)break}catch(e){i=t,u=1,s=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),l}var a={};function c(){}function l(){}function f(){}e=Object.getPrototypeOf;var y=[][n]?e(e([][n]())):(s(e={},n,function(){return this}),e),p=f.prototype=c.prototype=Object.create(y);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,o,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=f,s(p,"constructor",f),s(f,"constructor",l),l.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(p),s(p,o,"Generator"),s(p,n,function(){return this}),s(p,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:h}})()}function s(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}s=function(t,e,r,n){function i(e,r){s(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},s(t,e,r,n)}function c(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function f(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(y=function(){return!!t})()}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}r.d(e,{h:function(){return b}});var b=function(t){function e(t,r,n,o){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=function(t,e,r){return e=p(e),function(t,e){if(e&&("object"==a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,y()?Reflect.construct(e,r||[],p(t).constructor):e.apply(t,r))}(this,e))._mapProvider=t,i._map=t.map,i._symbolRegistry=r,i._patternRegistry=n,i._datasetRegistry=o,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(e,t),r=e,n=[{key:"_pixelRatio",get:function(){return this._map.getPixelRatio()}},{key:"addDataset",value:(o=u().m(function t(e){var r;return u().w(function(t){for(;;)switch(t.n){case 0:if(r=this._datasetRegistry.getDataset(e)){t.n=1;break}return t.a(2);case 1:return t.n=2,this._registerPatternsAndSymbols(r);case 2:this._addLayers(r);case 3:return t.a(2)}},t,this)}),i=function(){var t=this,e=arguments;return new Promise(function(r,n){var i=o.apply(t,e);function a(t){c(i,r,n,a,u,"next",t)}function u(t){c(i,r,n,a,u,"throw",t)}a(void 0)})},function(t){return i.apply(this,arguments)})},{key:"applyDatasetOpacity",value:function(t){var e=this._datasetRegistry.getDataset(t);e&&this._applyRegistryDatasetOpacity(e)}},{key:"_applyRegistryDatasetOpacity",value:function(t){var e=this;t.getLayersWithOpacity().forEach(function(t){var r=t.layerIds,n=t.opacity;r.forEach(function(t){return e._setLayerOpacity(t,n)})})}},{key:"applyGlobalOpacity",value:function(){var t=this;this._datasetRegistry.forEachDataset(function(e){return t._applyRegistryDatasetOpacity(e)})}},{key:"applyDatasetVisibility",value:function(t){var e=this._datasetRegistry.getDataset(t);e&&this._applyRegistryDatasetVisibility(e)}},{key:"_applyRegistryDatasetVisibility",value:function(t){var e=this;t.getLayersWithVisibility().forEach(function(t){var r=t.layerIds,n=t.visibility;r.forEach(function(t){return e._setLayerVisibility(t,n)})})}},{key:"applyGlobalVisibility",value:function(){var t=this;this._datasetRegistry.forEachDataset(function(e){return t._applyRegistryDatasetVisibility(e)})}}],n&&l(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i}(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"attachDynamicSources",value:function(t){this._dynamicSources=t}},{key:"dynamicSources",get:function(){return this._dynamicSources}}])&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}())},291:function(t,e,r){r.r(e),r.d(e,{default:function(){return D}});var n=r(247);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function a(t,e,r){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u=function(t,e,r,o,s,c){var l,f=t.map,y=e.sourceId,p=e.source;p&&!f.getSource(y)&&f.addSource(y,p);var h=r.id;return function(t,e,r,n,o){var i=t.map,a=e.hasSymbol,u=e.symbolLayerId;if(a&&n&&u&&!i.getLayer(u)){var s=n.getSymbolDef(e.style);if(s){var c=n.getSymbolImageId(e.style,r,"normal",o);c&&i.addLayer(e.getSymbolSource(c,t.getSymbolIconLayout(s)))}}}(t,e,r,o,c),function(t,e,r,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=e.hasFill,u=e.fillLayerId;if(a&&u&&!t.getLayer(u)){var s=o.getPatternImageId(e.style,r,i),c=s?{"fill-pattern":s,"fill-opacity":e.opacity}:{"fill-color":(0,n.o)(e.style.fill,r),"fill-opacity":e.opacity};t.addLayer(e.getFillSource(c))}}(f,e,h,s,c),function(t,e,r){var o=e.hasStroke,u=e.strokeLayerId;if(o&&!t.getLayer(u)){var s=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){a(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({"line-color":(0,n.o)(e.style.stroke,r),"line-width":e.style.strokeWidth,"line-opacity":e.opacity},e.style.strokeDashArray?{"line-dasharray":e.style.strokeDashArray}:{}),c=e.getStrokeSource(s);t.addLayer(c)}}(f,e,h),null!==(l=e.sublayers)&&void 0!==l&&l.length?(e.sublayers.forEach(function(e){u(t,e,r,o,s,c)}),y):e.isSublayer?void 0:y},s=r(416),c=r(619);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach(function(e){p(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function p(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}function b(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}function d(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(d=function(){return!!t})()}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}var g=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=m(e),function(t,e){if(e&&("object"==l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,d()?Reflect.construct(e,r||[],m(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}(e,t),r=e,(n=[{key:"fillLayerId",get:function(){return this.hasSublayers||this.hasSymbol?null:this.hasFill?this.id:null}},{key:"strokeLayerId",get:function(){return this.hasSublayers||this.hasSymbol?null:this.hasStroke?this.hasFill?"".concat(this.id,"-stroke"):this.id:null}},{key:"symbolLayerId",get:function(){return this.hasSublayers?null:this.hasSymbol?this.id:null}},{key:"leafLayerIds",get:function(){return[this.symbolLayerId,this.fillLayerId,this.strokeLayerId].filter(Boolean)}},{key:"_geojsonIdStrategy",value:function(){var t;return this.idProperty?{promoteId:this.idProperty}:this.generateIds?{generateId:!0}:(null!==(t=this.geojson)&&void 0!==t&&null!==(t=t.features)&&void 0!==t&&t.some(function(t){return"string"==typeof t.id})&&c.v.warn('Dataset "'.concat(this.id,'" has GeoJSON features with string native IDs. MapLibre only surfaces integer native feature IDs through queryRenderedFeatures. Use idProperty to promote a string property instead.')),{})}},{key:"source",get:function(){if(this.hasDynamicGeoJSON)return this.dynamicGeoJSON.source;if(this.tiles){var t={type:"vector",tiles:this.tiles,minzoom:this.minZoom||0,maxzoom:this.maxZoom||22};return this.idProperty&&this.sourceLayer&&(t.promoteId=p({},this.sourceLayer,this.idProperty)),t}return this.geojson?y({type:"geojson",data:this.geojson},this._geojsonIdStrategy()):null}},{key:"getSymbolSource",value:function(t,e){return y({id:this.symbolLayerId,type:"symbol",source:this.sourceId,"source-layer":this.sourceLayer,minzoom:this.minZoom,maxzoom:this.maxZoom,layout:y(y({visibility:this.visibility,"icon-image":t},e),{},{"icon-allow-overlap":!0})},this.filter?{filter:this.filter}:{})}},{key:"getFillSource",value:function(t){return y({id:this.fillLayerId,type:"fill",source:this.sourceId,"source-layer":this.sourceLayer,minzoom:this.minZoom,maxzoom:this.maxZoom,layout:{visibility:this.visibility},paint:t},this.filter?{filter:this.filter}:{})}},{key:"getStrokeSource",value:function(t){return y({id:this.strokeLayerId,type:"line",source:this.sourceId,"source-layer":this.sourceLayer,minzoom:this.minZoom,maxzoom:this.maxZoom,layout:{visibility:this.visibility},paint:t},this.filter?{filter:this.filter}:{})}}])&&h(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(s.f);function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function _(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var s=n&&n.prototype instanceof u?n:u,c=Object.create(s.prototype);return O(c,"_invoke",function(r,n,o){var i,u,s,c=0,l=o||[],f=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,s=t,y.n=r,a}};function p(r,n){for(u=r,s=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],p=y.p,h=i[2];r>3?(o=h===n)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,y.n=h,u=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,h),u=l,s=h;(e=u<2?t:s)||!f;){i||(u?u<3?(u>1&&(y.n=-1),p(u,s)):y.n=s:y.v=s);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=y.n<0)?s:r.call(n,y))!==a)break}catch(e){i=t,u=1,s=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),c}var a={};function u(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(O(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(l);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,O(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return s.prototype=c,O(f,"constructor",c),O(c,"constructor",s),s.displayName="GeneratorFunction",O(c,o,"GeneratorFunction"),O(f),O(f,o,"Generator"),O(f,n,function(){return this}),O(f,"toString",function(){return"[object Generator]"}),(_=function(){return{w:i,m:y}})()}function O(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}O=function(t,e,r,n){function i(e,r){O(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},O(t,e,r,n)}function w(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function j(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){w(i,n,o,a,u,"next",t)}function u(t){w(i,n,o,a,u,"throw",t)}a(void 0)})}}function P(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,L(n.key),n)}}function L(t){var e=function(t){if("object"!=S(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==S(e)?e:e+""}function k(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(k=function(){return!!t})()}function I(t){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},I(t)}function E(t,e){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},E(t,e)}var D=function(t){function e(t,r,n,o){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=function(t,e,r){return e=I(e),function(t,e){if(e&&("object"==S(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,k()?Reflect.construct(e,r||[],I(t).constructor):e.apply(t,r))}(this,e,[t,r,n,o]))._datasetSourceMap=new Map,window._datasetSourceMap=i._datasetSourceMap,i._symbolLayerIds=new Set,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&E(t,e)}(e,t),r=e,n=[{key:"createDataset",value:function(t,e){return new g(t,e)}},{key:"init",value:(c=j(_().m(function t(){var e,r,n,o=this;return _().w(function(t){for(;;)switch(t.n){case 0:return e=this._datasetRegistry.getPatternAndSymbolConfigs(),r=e.patternConfigs,n=e.symbolConfigs,t.n=1,this.addPatternsAndSymbolsToMap(r,n);case 1:return this._symbolLayerIds.clear(),this._datasetRegistry.forEachDataset(function(t){return o._addLayers(t)}),t.n=2,new Promise(function(t){return o._map.once("idle",t)});case 2:return t.a(2)}},t,this)})),function(){return c.apply(this,arguments)})},{key:"removeLayer",value:function(t){this._map.getLayer(t)&&this._map.removeLayer(t),this._symbolLayerIds.delete(t)}},{key:"addPatternsAndSymbolsToMap",value:(s=j(_().m(function t(e,r){var n,o;return _().w(function(t){for(;;)if(0===t.n)return n=this._datasetRegistry.mapStyle,o=n.id,t.a(2,Promise.all([this._mapProvider.addPatternsToMap(e,o,this._patternRegistry),this._mapProvider.addSymbolsToMap(r,n,this._symbolRegistry)]))},t,this)})),function(t,e){return s.apply(this,arguments)})},{key:"destroy",value:function(){var t=this,e=new Set;this._datasetRegistry.forEachDataset(function(r){var n=r.sourceId;t._getLayersUsingSource(n).forEach(function(e){return t.removeLayer(e)}),!e.has(n)&&t._map.getSource(n)&&(t._map.removeSource(n),e.add(n))}),this._datasetSourceMap.clear()}},{key:"onMapStyleChange",value:(a=j(_().m(function t(){var e,r,n,o=this;return _().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,new Promise(function(t){return o._map.once("idle",t)});case 1:return e=this._datasetRegistry.getPatternAndSymbolConfigs(),r=e.patternConfigs,n=e.symbolConfigs,t.n=2,this.addPatternsAndSymbolsToMap(r,n);case 2:this._symbolLayerIds.clear(),this._datasetRegistry.forEachDataset(function(t){o._addLayers(t),o._applyFeatureFilter(t)}),this.dynamicSources.forEach(function(t){return t.reapply()});case 3:return t.a(2)}},t,this)})),function(){return a.apply(this,arguments)})},{key:"onMapSizeChange",value:(i=j(_().m(function t(){var e,r,n,o,i,a=this;return _().w(function(t){for(;;)switch(t.n){case 0:return e=this._datasetRegistry.mapStyle,r=this._pixelRatio,n=this._datasetRegistry.getPatternAndSymbolConfigs(),o=n.patternConfigs,i=n.symbolConfigs,t.n=1,this.addPatternsAndSymbolsToMap(o,i);case 1:if(this._pixelRatio===r){t.n=2;break}return t.a(2);case 2:this._datasetRegistry.forEach(function(t){var n=t.fillLayerId,o=t.symbolLayerId;if(o&&a._symbolLayerIds.has(o)&&a._map.getLayer(o)){var i=a._symbolRegistry.getSymbolImageId(t.style,e,"normal",r);i&&a._map.setLayoutProperty(o,"icon-image",i)}else if(n&&a._map.getLayer(n)){var u=a._patternRegistry.getPatternImageId(t.style,e.id,r);u&&a._map.setPaintProperty(n,"fill-pattern",u)}});case 3:return t.a(2)}},t,this)})),function(){return i.apply(this,arguments)})},{key:"_registerPatternsAndSymbols",value:function(t){return this.addPatternsAndSymbolsToMap(t.patternConfigs,t.symbolConfigs)}},{key:"removeDataset",value:function(t){var e=this,r=this._datasetRegistry.getDataset(t);if(r){var n=r.sourceId;r.layerIds.forEach(function(t){return e.removeLayer(t)}),!this._datasetRegistry.topLevelDatasets().some(function(e){return e.id!==t&&e.sourceId===n})&&this._map.getSource(n)&&this._map.removeSource(n),this._datasetSourceMap.delete(t)}}},{key:"applyFeatureFilter",value:function(t){var e=this._datasetRegistry.getDataset(t);e&&this._applyFeatureFilter(e)}},{key:"applyStyle",value:(o=j(_().m(function t(e){var r,n=this;return _().w(function(t){for(;;)switch(t.n){case 0:return(r=this._datasetRegistry.getDataset(e)).layerIds.forEach(function(t){return n.removeLayer(t)}),t.n=1,this._registerPatternsAndSymbols(r);case 1:this._addLayers(r);case 2:return t.a(2)}},t,this)})),function(t){return o.apply(this,arguments)})},{key:"setData",value:function(t,e){var r=this._datasetSourceMap.get(t);if(r){var n=this._map.getSource(r);n&&"function"==typeof n.setData&&n.setData(e)}}},{key:"_addLayers",value:function(t){var e=this._datasetRegistry.mapStyle,r=u(this._mapProvider,t,e,this._symbolRegistry,this._patternRegistry,this._pixelRatio);this._datasetSourceMap.set(t.id,r),this._maintainSymbolOrdering(t)}},{key:"_getFirstSymbolLayerId",value:function(){var t,e=this,r=this._map.getStyle();if(null==r||!r.layers)return null;var n=r.layers.find(function(t){return e._symbolLayerIds.has(t.id)});return null!==(t=null==n?void 0:n.id)&&void 0!==t?t:null}},{key:"_maintainSymbolOrdering",value:function(t){var e=this,r=(t=t.isSublayer?t.parent:t).layerIds.filter(function(t){return t&&e._map.getLayer(t)});r.forEach(function(t){var r;"symbol"===(null===(r=e._map.getLayer(t))||void 0===r?void 0:r.type)?e._symbolLayerIds.add(t):e._symbolLayerIds.delete(t)});var n=this._getFirstSymbolLayerId();n&&r.forEach(function(t){e._symbolLayerIds.has(t)||e._map.moveLayer(t,n)})}},{key:"_setLayerVisibility",value:function(t,e){this._map.getLayer(t)&&this._map.setLayoutProperty(t,"visibility",e)}},{key:"_applyFeatureFilter",value:function(t){var e=this;t.getLayersWithFilters().forEach(function(t){var r=t.layerIds,n=t.filter;r.forEach(function(t){e._map.getLayer(t)&&e._map.setFilter(t,n)})})}},{key:"_setLayerOpacity",value:function(t,e){var r=this._map.getLayer(t);if(r){var n={line:"line-opacity",symbol:"icon-opacity"}[r.type]||"fill-opacity";this._map.setPaintProperty(t,n,e)}}},{key:"_getLayersUsingSource",value:function(t){var e=this._map.getStyle();return null!=e&&e.layers?e.layers.filter(function(e){return e.source===t}).map(function(t){return t.id}):[]}}],n&&P(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i,a,s,c}(r(913).h)},416:function(t,e,r){r.d(e,{f:function(){return p}});var n=r(428);function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var i=function(t){var e,r=0,n=2166136261,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){s=!0,a=t},f:function(){try{u||null==r.return||r.return()}finally{if(s)throw a}}}}(t);try{for(i.s();!(e=i.n()).done;){var a=e.value.codePointAt(0);r=Math.imul(r,31)+a,n=Math.imul(n^a,16777619)}}catch(t){i.e(t)}finally{i.f()}return(r>>>0).toString(36)+(n>>>0).toString(36)};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function c(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}function l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(l=function(){return!!t})()}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}var p=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=f(e),function(t,e){if(e&&("object"==a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,l()?Reflect.construct(e,r||[],f(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}(e,t),r=e,n=[{key:"_hiddenFeaturesIdExpression",get:function(){return this.hasDynamicGeoJSON?this.dynamicGeoJSON.hiddenFeaturesIdExpression:this.idProperty?["to-string",["get",this.idProperty]]:["to-string",["id"]]}},{key:"_hiddenFeaturesFilter",get:function(){var t,e=null===(t=this.hiddenFeatures)||void 0===t?void 0:t.filter(function(t){return-1!==t});return null!=e&&e.length?["!",["in",this._hiddenFeaturesIdExpression,["literal",e.map(String)]]]:null}},{key:"filter",get:function(){var t,e=["all"];null!==(t=this.parent)&&void 0!==t&&t.filter&&e.push(this.parent.filter),this._datasetDefinition.filter&&e.push(this._datasetDefinition.filter);var r=this._hiddenFeaturesFilter;return r&&e.push(r),1===e.length?null:e.length>2?e:e[1]}},{key:"leafLayerIds",get:function(){return[]}},{key:"layerIds",get:function(){return this.hasSublayers?this.sublayers.flatMap(function(t){return t.layerIds}).filter(Boolean):this.leafLayerIds}},{key:"getLayersWithValue",value:function(t){var e,r,n,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];if(!1===o||this[o]){var a=this.leafLayerIds;if(a.length){var s=this[t];i.push((e={layerIds:a},n=s,(r=c(r=t))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e))}}return this.hasSublayers&&this.sublayers.forEach(function(e){if(!1===o||e[o]){var r=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.getLayersWithValue(t),1)[0];r&&i.push(r)}}),i}},{key:"getLayersWithVisibility",value:function(){return this.getLayersWithValue("visibility")}},{key:"getLayersWithOpacity",value:function(){return this.getLayersWithValue("opacity")}},{key:"getLayersWithFilters",value:function(){return this.getLayersWithValue("filter","hasHiddenFeatures")}},{key:"sourceId",get:function(){if(this.isSublayer)return this.parent.sourceId;if(this.hasDynamicGeoJSON)return this.dynamicGeoJSON.sourceId;if(this.tiles){var t=Array.isArray(this.tiles)?this.tiles.join(","):this.tiles;return"tiles-".concat(i(t))}return this.geojson?"string"==typeof this.geojson?"geojson-".concat(i(this.geojson)):"geojson-".concat(this.id):"source-".concat(this.id)}}],n&&s(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(n.j)},247:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}r.d(e,{o:function(){return o}});var o=function(t,e){if(!t)return null;if("string"==typeof t)return t.trim();if("object"===n(t)){if(e&&t[e])return t[e];var r=Object.values(t)[0];return null!=r?r:null}return null}}}]);
|
|
2
|
+
"use strict";(Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[]).push([[563],{913:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}function i(t){var e=function(t){if("object"!=n(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==n(e)?e:e+""}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function u(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof c?n:c,l=Object.create(u.prototype);return s(l,"_invoke",function(r,n,o){var i,u,s,c=0,l=o||[],f=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,s=t,y.n=r,a}};function p(r,n){for(u=r,s=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],p=y.p,h=i[2];r>3?(o=h===n)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,y.n=h,u=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,h),u=l,s=h;(e=u<2?t:s)||!f;){i||(u?u<3?(u>1&&(y.n=-1),p(u,s)):y.n=s:y.v=s);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=y.n<0)?s:r.call(n,y))!==a)break}catch(e){i=t,u=1,s=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),l}var a={};function c(){}function l(){}function f(){}e=Object.getPrototypeOf;var y=[][n]?e(e([][n]())):(s(e={},n,function(){return this}),e),p=f.prototype=c.prototype=Object.create(y);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,o,"GeneratorFunction")),t.prototype=Object.create(p),t}return l.prototype=f,s(p,"constructor",f),s(f,"constructor",l),l.displayName="GeneratorFunction",s(f,o,"GeneratorFunction"),s(p),s(p,o,"Generator"),s(p,n,function(){return this}),s(p,"toString",function(){return"[object Generator]"}),(u=function(){return{w:i,m:h}})()}function s(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}s=function(t,e,r,n){function i(e,r){s(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},s(t,e,r,n)}function c(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function f(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(y=function(){return!!t})()}function p(t){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},p(t)}function h(t,e){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},h(t,e)}r.d(e,{h:function(){return b}});var b=function(t){function e(t,r,n,o){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=function(t,e,r){return e=p(e),function(t,e){if(e&&("object"==a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,y()?Reflect.construct(e,r||[],p(t).constructor):e.apply(t,r))}(this,e))._mapProvider=t,i._map=t.map,i._symbolRegistry=r,i._patternRegistry=n,i._datasetRegistry=o,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&h(t,e)}(e,t),r=e,n=[{key:"_pixelRatio",get:function(){return this._map.getPixelRatio()}},{key:"addDataset",value:(o=u().m(function t(e){var r;return u().w(function(t){for(;;)switch(t.n){case 0:if(r=this._datasetRegistry.getDataset(e)){t.n=1;break}return t.a(2);case 1:return t.n=2,this._registerPatternsAndSymbols(r);case 2:this._addLayers(r);case 3:return t.a(2)}},t,this)}),i=function(){var t=this,e=arguments;return new Promise(function(r,n){var i=o.apply(t,e);function a(t){c(i,r,n,a,u,"next",t)}function u(t){c(i,r,n,a,u,"throw",t)}a(void 0)})},function(t){return i.apply(this,arguments)})},{key:"applyDatasetOpacity",value:function(t){var e=this._datasetRegistry.getDataset(t);e&&this._applyRegistryDatasetOpacity(e)}},{key:"_applyRegistryDatasetOpacity",value:function(t){var e=this;t.getLayersWithOpacity().forEach(function(t){var r=t.layerIds,n=t.opacity;r.forEach(function(t){return e._setLayerOpacity(t,n)})})}},{key:"applyGlobalOpacity",value:function(){var t=this;this._datasetRegistry.forEachDataset(function(e){return t._applyRegistryDatasetOpacity(e)})}},{key:"applyDatasetVisibility",value:function(t){var e=this._datasetRegistry.getDataset(t);e&&this._applyRegistryDatasetVisibility(e)}},{key:"_applyRegistryDatasetVisibility",value:function(t){var e=this;t.getLayersWithVisibility().forEach(function(t){var r=t.layerIds,n=t.visibility;r.forEach(function(t){return e._setLayerVisibility(t,n)})})}},{key:"applyGlobalVisibility",value:function(){var t=this;this._datasetRegistry.forEachDataset(function(e){return t._applyRegistryDatasetVisibility(e)})}}],n&&l(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i}(function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},(e=[{key:"attachDynamicSources",value:function(t){this._dynamicSources=t}},{key:"dynamicSources",get:function(){return this._dynamicSources}}])&&o(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}())},291:function(t,e,r){r.r(e),r.d(e,{default:function(){return D}});var n=r(247);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function a(t,e,r){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var u=function(t,e,r,o,s,c){var l,f=t.map,y=e.sourceId,p=e.source;p&&!f.getSource(y)&&f.addSource(y,p);var h=r.id;return function(t,e,r,n,o){var i=t.map,a=e.hasSymbol,u=e.symbolLayerId;if(a&&n&&u&&!i.getLayer(u)){var s=n.getSymbolDef(e.style);if(s){var c=n.getSymbolImageId(e.style,r,"normal",o);c&&i.addLayer(e.getSymbolSource(c,t.getSymbolIconLayout(s)))}}}(t,e,r,o,c),function(t,e,r,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=e.hasFill,u=e.fillLayerId;if(a&&u&&!t.getLayer(u)){var s=o.getPatternImageId(e.style,r,i),c=s?{"fill-pattern":s,"fill-opacity":e.opacity}:{"fill-color":(0,n.o)(e.style.fill,r),"fill-opacity":e.opacity};t.addLayer(e.getFillSource(c))}}(f,e,h,s,c),function(t,e,r){var o=e.hasStroke,u=e.strokeLayerId;if(o&&!t.getLayer(u)){var s=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(Object(r),!0).forEach(function(e){a(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({"line-color":(0,n.o)(e.style.stroke,r),"line-width":e.style.strokeWidth,"line-opacity":e.opacity},e.style.strokeDashArray?{"line-dasharray":e.style.strokeDashArray}:{}),c=e.getStrokeSource(s);t.addLayer(c)}}(f,e,h),null!==(l=e.sublayers)&&void 0!==l&&l.length?(e.sublayers.forEach(function(e){u(t,e,r,o,s,c)}),y):e.isSublayer?void 0:y},s=r(416),c=r(619);function l(t){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},l(t)}function f(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?f(Object(r),!0).forEach(function(e){p(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function p(t,e,r){return(e=b(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b(n.key),n)}}function b(t){var e=function(t){if("object"!=l(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=l(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==l(e)?e:e+""}function d(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(d=function(){return!!t})()}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}function v(t,e){return v=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},v(t,e)}var g=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=m(e),function(t,e){if(e&&("object"==l(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,d()?Reflect.construct(e,r||[],m(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v(t,e)}(e,t),r=e,(n=[{key:"fillLayerId",get:function(){return this.hasSublayers||this.hasSymbol?null:this.hasFill?this.id:null}},{key:"strokeLayerId",get:function(){return this.hasSublayers||this.hasSymbol?null:this.hasStroke?this.hasFill?"".concat(this.id,"-stroke"):this.id:null}},{key:"symbolLayerId",get:function(){return this.hasSublayers?null:this.hasSymbol?this.id:null}},{key:"leafLayerIds",get:function(){return[this.symbolLayerId,this.fillLayerId,this.strokeLayerId].filter(Boolean)}},{key:"_geojsonIdStrategy",value:function(){var t;return this.idProperty?{promoteId:this.idProperty}:this.generateIds?{generateId:!0}:(null!==(t=this.geojson)&&void 0!==t&&null!==(t=t.features)&&void 0!==t&&t.some(function(t){return"string"==typeof t.id})&&c.v.warn('Dataset "'.concat(this.id,'" has GeoJSON features with string native IDs. MapLibre only surfaces integer native feature IDs through queryRenderedFeatures. Use idProperty to promote a string property instead.')),{})}},{key:"source",get:function(){if(this.hasDynamicGeoJSON)return this.dynamicGeoJSON.source;if(this.tiles){var t={type:"vector",tiles:this.tiles,minzoom:this.minZoom||0,maxzoom:this.maxZoom||22};return this.idProperty&&this.sourceLayer&&(t.promoteId=p({},this.sourceLayer,this.idProperty)),t}return this.geojson?y({type:"geojson",data:this.geojson},this._geojsonIdStrategy()):null}},{key:"getSymbolSource",value:function(t,e){return y({id:this.symbolLayerId,type:"symbol",source:this.sourceId,"source-layer":this.sourceLayer,minzoom:this.minZoom,maxzoom:this.maxZoom,layout:y(y({visibility:this.visibility,"icon-image":t},e),{},{"icon-allow-overlap":!0})},this.filter?{filter:this.filter}:{})}},{key:"getFillSource",value:function(t){return y({id:this.fillLayerId,type:"fill",source:this.sourceId,"source-layer":this.sourceLayer,minzoom:this.minZoom,maxzoom:this.maxZoom,layout:{visibility:this.visibility},paint:t},this.filter?{filter:this.filter}:{})}},{key:"getStrokeSource",value:function(t){return y({id:this.strokeLayerId,type:"line",source:this.sourceId,"source-layer":this.sourceLayer,minzoom:this.minZoom,maxzoom:this.maxZoom,layout:{visibility:this.visibility},paint:t},this.filter?{filter:this.filter}:{})}}])&&h(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(s.f);function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function _(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var s=n&&n.prototype instanceof u?n:u,c=Object.create(s.prototype);return O(c,"_invoke",function(r,n,o){var i,u,s,c=0,l=o||[],f=!1,y={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,r){return i=e,u=0,s=t,y.n=r,a}};function p(r,n){for(u=r,s=n,e=0;!f&&c&&!o&&e<l.length;e++){var o,i=l[e],p=y.p,h=i[2];r>3?(o=h===n)&&(s=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=r<2&&p<i[1])?(u=0,y.v=n,y.n=i[1]):p<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,y.n=h,u=0))}if(o||r>1)return a;throw f=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&p(l,h),u=l,s=h;(e=u<2?t:s)||!f;){i||(u?u<3?(u>1&&(y.n=-1),p(u,s)):y.n=s:y.v=s);try{if(c=2,i){if(u||(o="next"),e=i[o]){if(!(e=e.call(i,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,u<2&&(u=0)}else 1===u&&(e=i.return)&&e.call(i),u<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=t}else if((e=(f=y.n<0)?s:r.call(n,y))!==a)break}catch(e){i=t,u=1,s=e}finally{c=1}}return{value:e,done:f}}}(r,o,i),!0),c}var a={};function u(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(O(e={},n,function(){return this}),e),f=c.prototype=u.prototype=Object.create(l);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,O(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return s.prototype=c,O(f,"constructor",c),O(c,"constructor",s),s.displayName="GeneratorFunction",O(c,o,"GeneratorFunction"),O(f),O(f,o,"Generator"),O(f,n,function(){return this}),O(f,"toString",function(){return"[object Generator]"}),(_=function(){return{w:i,m:y}})()}function O(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}O=function(t,e,r,n){function i(e,r){O(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},O(t,e,r,n)}function w(t,e,r,n,o,i,a){try{var u=t[i](a),s=u.value}catch(t){return void r(t)}u.done?e(s):Promise.resolve(s).then(n,o)}function j(t){return function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){w(i,n,o,a,u,"next",t)}function u(t){w(i,n,o,a,u,"throw",t)}a(void 0)})}}function P(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,L(n.key),n)}}function L(t){var e=function(t){if("object"!=S(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==S(e)?e:e+""}function k(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(k=function(){return!!t})()}function I(t){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},I(t)}function E(t,e){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},E(t,e)}var D=function(t){function e(t,r,n,o){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(i=function(t,e,r){return e=I(e),function(t,e){if(e&&("object"==S(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,k()?Reflect.construct(e,r||[],I(t).constructor):e.apply(t,r))}(this,e,[t,r,n,o]))._datasetSourceMap=new Map,window._datasetSourceMap=i._datasetSourceMap,i._symbolLayerIds=new Set,i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&E(t,e)}(e,t),r=e,n=[{key:"createDataset",value:function(t,e){return new g(t,e)}},{key:"init",value:(c=j(_().m(function t(){var e,r,n,o=this;return _().w(function(t){for(;;)switch(t.n){case 0:return e=this._datasetRegistry.getPatternAndSymbolConfigs(),r=e.patternConfigs,n=e.symbolConfigs,t.n=1,this.addPatternsAndSymbolsToMap(r,n);case 1:return this._symbolLayerIds.clear(),this._datasetRegistry.forEachDataset(function(t){return o._addLayers(t)}),t.n=2,new Promise(function(t){return o._map.once("idle",t)});case 2:return t.a(2)}},t,this)})),function(){return c.apply(this,arguments)})},{key:"removeLayer",value:function(t){this._map.getLayer(t)&&this._map.removeLayer(t),this._symbolLayerIds.delete(t)}},{key:"addPatternsAndSymbolsToMap",value:(s=j(_().m(function t(e,r){var n,o;return _().w(function(t){for(;;)if(0===t.n)return n=this._datasetRegistry.mapStyle,o=n.id,t.a(2,Promise.all([this._mapProvider.addPatternsToMap(e,o,this._patternRegistry),this._mapProvider.addSymbolsToMap(r,n,this._symbolRegistry)]))},t,this)})),function(t,e){return s.apply(this,arguments)})},{key:"destroy",value:function(){var t=this,e=new Set;this._datasetRegistry.forEachDataset(function(r){var n=r.sourceId;t._getLayersUsingSource(n).forEach(function(e){return t.removeLayer(e)}),!e.has(n)&&t._map.getSource(n)&&(t._map.removeSource(n),e.add(n))}),this._datasetSourceMap.clear()}},{key:"onMapStyleChange",value:(a=j(_().m(function t(){var e,r,n,o=this;return _().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,new Promise(function(t){return o._map.once("idle",t)});case 1:return e=this._datasetRegistry.getPatternAndSymbolConfigs(),r=e.patternConfigs,n=e.symbolConfigs,t.n=2,this.addPatternsAndSymbolsToMap(r,n);case 2:this._symbolLayerIds.clear(),this._datasetRegistry.forEachDataset(function(t){o._addLayers(t),o._applyFeatureFilter(t)}),this.dynamicSources.forEach(function(t){return t.reapply()});case 3:return t.a(2)}},t,this)})),function(){return a.apply(this,arguments)})},{key:"onMapSizeChange",value:(i=j(_().m(function t(){var e,r,n,o,i,a=this;return _().w(function(t){for(;;)switch(t.n){case 0:return e=this._datasetRegistry.mapStyle,r=this._pixelRatio,n=this._datasetRegistry.getPatternAndSymbolConfigs(),o=n.patternConfigs,i=n.symbolConfigs,t.n=1,this.addPatternsAndSymbolsToMap(o,i);case 1:if(this._pixelRatio===r){t.n=2;break}return t.a(2);case 2:this._datasetRegistry.forEach(function(t){var n=t.fillLayerId,o=t.symbolLayerId;if(o&&a._symbolLayerIds.has(o)&&a._map.getLayer(o)){var i=a._symbolRegistry.getSymbolImageId(t.style,e,"normal",r);i&&a._map.setLayoutProperty(o,"icon-image",i)}else if(n&&a._map.getLayer(n)){var u=a._patternRegistry.getPatternImageId(t.style,e.id,r);u&&a._map.setPaintProperty(n,"fill-pattern",u)}});case 3:return t.a(2)}},t,this)})),function(){return i.apply(this,arguments)})},{key:"_registerPatternsAndSymbols",value:function(t){return this.addPatternsAndSymbolsToMap(t.patternConfigs,t.symbolConfigs)}},{key:"removeDataset",value:function(t){var e=this,r=this._datasetRegistry.getDataset(t);if(r){var n=r.sourceId;r.layerIds.forEach(function(t){return e.removeLayer(t)}),!this._datasetRegistry.topLevelDatasets().some(function(e){return e.id!==t&&e.sourceId===n})&&this._map.getSource(n)&&this._map.removeSource(n),this._datasetSourceMap.delete(t)}}},{key:"applyFeatureFilter",value:function(t){var e=this._datasetRegistry.getDataset(t);e&&this._applyFeatureFilter(e)}},{key:"applyStyle",value:(o=j(_().m(function t(e){var r,n=this;return _().w(function(t){for(;;)switch(t.n){case 0:return(r=this._datasetRegistry.getDataset(e)).layerIds.forEach(function(t){return n.removeLayer(t)}),t.n=1,this._registerPatternsAndSymbols(r);case 1:this._addLayers(r);case 2:return t.a(2)}},t,this)})),function(t){return o.apply(this,arguments)})},{key:"setData",value:function(t,e){var r=this._datasetSourceMap.get(t);if(r){var n=this._map.getSource(r);n&&"function"==typeof n.setData&&n.setData(e)}}},{key:"_addLayers",value:function(t){var e=this._datasetRegistry.mapStyle,r=u(this._mapProvider,t,e,this._symbolRegistry,this._patternRegistry,this._pixelRatio);this._datasetSourceMap.set(t.id,r),this._maintainSymbolOrdering(t)}},{key:"_getFirstSymbolLayerId",value:function(){var t,e=this,r=this._map.getStyle();if(null==r||!r.layers)return null;var n=r.layers.find(function(t){return e._symbolLayerIds.has(t.id)});return null!==(t=null==n?void 0:n.id)&&void 0!==t?t:null}},{key:"_maintainSymbolOrdering",value:function(t){var e=this,r=(t=t.isSublayer?t.parent:t).layerIds.filter(function(t){return t&&e._map.getLayer(t)});r.forEach(function(t){var r;"symbol"===(null===(r=e._map.getLayer(t))||void 0===r?void 0:r.type)?e._symbolLayerIds.add(t):e._symbolLayerIds.delete(t)});var n=this._getFirstSymbolLayerId();n&&r.forEach(function(t){e._symbolLayerIds.has(t)||e._map.moveLayer(t,n)})}},{key:"_setLayerVisibility",value:function(t,e){this._map.getLayer(t)&&this._map.setLayoutProperty(t,"visibility",e)}},{key:"_applyFeatureFilter",value:function(t){var e=this;t.getLayersWithFilters().forEach(function(t){var r=t.layerIds,n=t.filter;r.forEach(function(t){e._map.getLayer(t)&&e._map.setFilter(t,n)})})}},{key:"_setLayerOpacity",value:function(t,e){var r=this._map.getLayer(t);if(r){var n={line:"line-opacity",symbol:"icon-opacity"}[r.type]||"fill-opacity";this._map.setPaintProperty(t,n,e)}}},{key:"_getLayersUsingSource",value:function(t){var e=this._map.getStyle();return null!=e&&e.layers?e.layers.filter(function(e){return e.source===t}).map(function(t){return t.id}):[]}}],n&&P(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,o,i,a,s,c}(r(913).h)},416:function(t,e,r){r.d(e,{f:function(){return p}});var n=r(428);function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var i=function(t){var e,r=0,n=2166136261,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return o(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return u=t.done,t},e:function(t){s=!0,a=t},f:function(){try{u||null==r.return||r.return()}finally{if(s)throw a}}}}(t);try{for(i.s();!(e=i.n()).done;){var a=e.value.codePointAt(0);r=Math.imul(r,31)+a,n=Math.imul(n^a,16777619)}}catch(t){i.e(t)}finally{i.f()}return(r>>>0).toString(36)+(n>>>0).toString(36)};function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function c(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}function l(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(l=function(){return!!t})()}function f(t){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},f(t)}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},y(t,e)}var p=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e,r){return e=f(e),function(t,e){if(e&&("object"==a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,l()?Reflect.construct(e,r||[],f(t).constructor):e.apply(t,r))}(this,e,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}(e,t),r=e,n=[{key:"_hiddenFeaturesIdExpression",get:function(){return this.hasDynamicGeoJSON?this.dynamicGeoJSON.hiddenFeaturesIdExpression:this.idProperty?["to-string",["get",this.idProperty]]:["to-string",["id"]]}},{key:"_hiddenFeaturesFilter",get:function(){var t,e=null===(t=this.hiddenFeatures)||void 0===t?void 0:t.filter(function(t){return-1!==t});return null!=e&&e.length?["!",["in",this._hiddenFeaturesIdExpression,["literal",e.map(String)]]]:null}},{key:"filter",get:function(){var t,e=["all"];null!==(t=this.parent)&&void 0!==t&&t.filter&&e.push(this.parent.filter),this._datasetDefinition.filter&&e.push(this._datasetDefinition.filter);var r=this._hiddenFeaturesFilter;return r&&e.push(r),1===e.length?null:e.length>2?e:e[1]}},{key:"leafLayerIds",get:function(){return[]}},{key:"layerIds",get:function(){return this.hasSublayers?this.sublayers.flatMap(function(t){return t.layerIds}).filter(Boolean):this.leafLayerIds}},{key:"getLayersWithValue",value:function(t){var e,r,n,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[];if(!1===o||this[o]){var a=this.leafLayerIds;if(a.length){var s=this[t];i.push((e={layerIds:a},n=s,(r=c(r=t))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e))}}return this.hasSublayers&&this.sublayers.forEach(function(e){if(!1===o||e[o]){var r=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],s=!0,c=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);s=!0);}catch(t){c=!0,o=t}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(t,e)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.getLayersWithValue(t),1)[0];r&&i.push(r)}}),i}},{key:"getLayersWithVisibility",value:function(){return this.getLayersWithValue("visibility")}},{key:"getLayersWithOpacity",value:function(){return this.getLayersWithValue("opacity")}},{key:"getLayersWithFilters",value:function(){return this.getLayersWithValue("filter","hasHiddenFeatures")}},{key:"sourceId",get:function(){if(this.isSublayer)return this.parent.sourceId;if(this.hasDynamicGeoJSON)return this.dynamicGeoJSON.sourceId;if(this.tiles){var t=Array.isArray(this.tiles)?this.tiles.join(","):this.tiles;return"tiles-".concat(i(t))}return this.geojson?"string"==typeof this.geojson?"geojson-".concat(i(this.geojson)):"geojson-".concat(this.id):"source-".concat(this.id)}}],n&&s(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(n.j)},247:function(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}r.d(e,{o:function(){return o}});var o=function(t,e){if("number"==typeof t)return t;if(!t)return null;if("string"==typeof t)return t.trim();if("object"===n(t)){if(e&&null!=t[e])return t[e];var r=Object.values(t)[0];return null!=r?r:null}return null}}}]);
|