"use strict";(self.webpackChunkpyams_app_msc=self.webpackChunkpyams_app_msc||[]).push([[742],{7742:(e,t,r)=>{r.r(t),r.d(t,{default:()=>f});var n=r(3830),o=r(4692);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var i=function(e,t,r,i){return new Promise((function(f,u){var p=e.data(),s={preferCanvas:p.mapLeafletPreferCanvas||!1,attributionControl:void 0===p.mapLeafletAttributionControl?t.attributionControl:p.mapLeafletAttributionControl,zoomControl:void 0===p.mapLeafletZoomControl?t.zoomControl:p.mapLeafletZoomControl,crs:p.mapLeafletCrs||n.A.getObject(t.crs)||L.CRS.EPSG3857,center:p.mapLeafletCenter||t.center,zoom:p.mapLeafletZoom||t.zoom,gestureHandling:void 0===p.mapLeafletWheelZoom?!t.scrollWheelZoom:p.mapLeafletWheelZoom,keyboard:void 0===p.mapLeafletKeyboard?t.keyboard&&!L.Browser.mobile:p.amsLeafletKeyboard};s=o.extend({},s,r),e.trigger("map.init",[e,s,t]);var c=L.map(e.attr("id"),s),m=[];if(t.layers){var d,g=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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 i,l=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return l=e.done,e},e:function(e){f=!0,i=e},f:function(){try{l||null==r.return||r.return()}finally{if(f)throw i}}}}(t.layers);try{for(g.s();!(d=g.n()).done;){var y=d.value;e.trigger("map.layer.init",[e,y]),m.push(l.getLayer(e,c,y))}}catch(e){g.e(e)}finally{g.f()}}else m.push(L.tileLayer("http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,id:"osm",attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}));o.when.apply(o,m).then((function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];for(var a in n)n[a].addTo(c);if(t.zoomControl&&!0!==p.mapLeafletHideZoomControl&&L.control.scale().addTo(c),t.center?c.setView(new L.LatLng(t.center.lat,t.center.lon),t.zoom||13):t.bounds&&c.fitBounds(t.bounds),t.marker){var l=L.icon({iconUrl:"/--static--/pyams_gis/img/marker-icon.png",iconSize:[25,41],iconAnchor:[12,39]}),u=L.marker();u.setIcon(l),u.setLatLng({lon:t.marker.lon,lat:t.marker.lat}),u.addTo(c)}e.data("leafmap",c),e.data("leafmap.config",t),e.trigger("map.finishing",[e,c,t]),i&&i(c,t),e.trigger("map.finished",[e,c,t]),f(c)}))}))},l={init:function(e,t,n){window.PyAMS_GIS=l,Promise.all([r.e(481).then(r.t.bind(r,3481,23)),r.e(882).then(r.t.bind(r,3882,23)),r.e(274).then(r.bind(r,9893)),r.e(860).then(r.bind(r,479))]).then((function(){var r=o.map(e,(function(e){return new Promise((function(r,a){var l=o(e),f=l.data(),u=f.mapConfiguration;u?r(i(l,u,t,n)):o.get(f.mapConfigurationUrl||"get-map-configuration.json",(function(e){r(i(l,e,t,n))}))}))}));o.when.apply(o,r).then()}))},getLayer:function(e,t,r){var a=n.A.getObject(r.factory);if(void 0!==a){delete r.factory;var i=[];if(r.dependsOn){for(var l in r.dependsOn)r.dependsOn.hasOwnProperty(l)&&void 0===n.A.getObject(l)&&i.push(n.A.getScript(r.dependsOn[l]));delete r.dependsOn}return i.length>0&&o.when.apply(o,i),a(e,t,r)}},factory:{GeoJSON:function(e,t,r){var n=r.url;delete r.url;var a=L.geoJSON(null,r);return e.on("map.finished",(function(e,t,i,l){o.get(n,(function(e){a.addData(e.geometry,{style:r.style}),l.fitLayer===r.name&&i.fitBounds(a.getBounds())}))})),a},TileLayer:function(e,t,r){var n=r.url;return delete r.url,L.tileLayer(n,r)},WMS:function(e,t,r){var n=r.url;return delete r.url,L.tileLayer.wms(n,r)},Geoportal:{WMS:function(e,t,r){return n.A.getCSS("/--static--/pyams_gis/css/leaflet-gp-3.0.2.min.css","geoportal"),L.geoportalLayer.WMS(r)}},ESRI:{Feature:function(e,t,r){return L.esri.featureLayer(r)}},Google:function(e,t,r){var a=r.apiKey;if(delete r.apiKey,void 0===n.A.getObject("window.google.maps")){var i=n.A.getScript("https://maps.googleapis.com/maps/api/js?key="+a);o.when.apply(o,[i])}return L.gridLayer.googleMutant(r)}}};const f=l}}]);