mapicgc-gl-js 0.0.5 → 0.0.7

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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Biblioteca de mapes ICGC. Envoltori de MaplibreGL
4
4
 
5
5
  <br>
6
- Versió 0.0.5
6
+ Versió 0.0.7
7
7
 
8
8
  <br>
9
9
  ### Documentació:
@@ -32,7 +32,9 @@ Versió 0.0.5
32
32
  3. En el script del cos del document, declarar el mapa de la següent manera:
33
33
 
34
34
  ```javascript
35
- const map = (window.map = new mapicgcgl.Map({
35
+ import { Map } from 'mapicgc-gl-js';
36
+
37
+ const map = (window.map = new Map({
36
38
  style: "topografic",
37
39
  }));
38
40
  ```
@@ -55,3 +57,8 @@ Versió 0.0.5
55
57
  - Control print
56
58
 
57
59
  - Popups
60
+
61
+ ### Publicar npm
62
+
63
+ npm login (user, password)
64
+ npm publish --access public
@@ -713,6 +713,33 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
713
713
  border-radius: 5px;
714
714
 
715
715
  }
716
+
717
+ .maplibregl-ctrl-bottom-left .maplibregl-ctrl-group {
718
+ border-radius: 50px;
719
+ }
720
+ .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group {
721
+ border-radius: 50px;
722
+ }
723
+
724
+ .maplibregl-ctrl-bottom-left .maplibregl-ctrl-icon-control-pitch {
725
+ border-radius: 50px;
726
+ }
727
+
728
+ .maplibregl-ctrl-bottom-right .maplibregl-ctrl-icon-control-pitch {
729
+ border-radius: 50px;
730
+ }
731
+
732
+ .maplibregl-ctrl-bottom-left
733
+ .maplibregl-ctrl-icon-maplibregl-ctrl-pitchtoggle-3d {
734
+ border-radius: 50px;
735
+ }
736
+ .maplibregl-ctrl-bottom-right
737
+ .maplibregl-ctrl-icon-maplibregl-ctrl-pitchtoggle-3d {
738
+ border-radius: 50px;
739
+ }
740
+
741
+
742
+
716
743
  .filter-group {
717
744
  font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
718
745
  font-weight: 600;
@@ -760,6 +787,108 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
760
787
  content: '✔';
761
788
  margin-right: 5px;
762
789
  }
790
+
791
+
792
+
793
+ .maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon {
794
+ background-size: 70%;
795
+ }
796
+
797
+ .maplibregl-ctrl
798
+ button.maplibregl-ctrl-geolocate:disabled
799
+ .maplibregl-ctrl-icon {
800
+ background-image: url("data:image/svg+xml,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7z'/%3E%3Ccircle id='dot' cx='10' cy='10' r='2'/%3E%3Cpath id='stroke' d='M14 5l1 1-9 9-1-1 9-9z'/%3E%3C/svg%3E");
801
+ fill: #000;
802
+ }
803
+
804
+ .maplibregl-ctrl-compass {
805
+ cursor: pointer !important;
806
+ }
807
+
808
+
809
+
810
+ .maplibregl-ctrl-bottom-left .maplibregl-ctrl-group {
811
+ border-radius: 50px;
812
+ }
813
+ .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group {
814
+ border-radius: 50px;
815
+ }
816
+
817
+ .maplibregl-ctrl-bottom-left .maplibregl-ctrl-icon-control-pitch {
818
+ border-radius: 50px;
819
+ }
820
+
821
+ .maplibregl-ctrl-bottom-right .maplibregl-ctrl-icon-control-pitch {
822
+ border-radius: 50px;
823
+ }
824
+
825
+ .maplibregl-ctrl-bottom-left
826
+ .maplibregl-ctrl-icon-maplibregl-ctrl-pitchtoggle-3d {
827
+ border-radius: 50px;
828
+ }
829
+ .maplibregl-ctrl-bottom-right
830
+ .maplibregl-ctrl-icon-maplibregl-ctrl-pitchtoggle-3d {
831
+ border-radius: 50px;
832
+ }
833
+
834
+ .maplibregl-ctrl-pitchtoggle-3d {
835
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCI+ICAgIDx0ZXh0IHg9IjUwJSIgeT0iNTAlIiBkeT0iLjM1ZW0iIHN0eWxlPSJmb250LXNpemU6IDE0cHg7IGZvbnQtZmFtaWx5OiAnSGVsdmV0aWNhIE5ldWUnLEFyaWFsLEhlbHZldGljYSxzYW5zLXNlcmlmOyBmb250LXdlaWdodDogYm9sZDsgdGV4dC1hbmNob3I6IG1pZGRsZTsiPjNEPC90ZXh0Pjwvc3ZnPg==);
836
+ background-repeat: no-repeat;
837
+ background-size: 70%;
838
+ background-position: center;
839
+ width: 5px;
840
+ height: 5px;
841
+ position: relative;
842
+ }
843
+
844
+ .maplibregl-ctrl-pitchtoggle-2d {
845
+ background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMCIgaGVpZ2h0PSIzMCI+ICAgIDx0ZXh0IHg9IjUwJSIgeT0iNTAlIiBkeT0iLjM1ZW0iIHN0eWxlPSJmb250LXNpemU6IDE0cHg7IGZvbnQtZmFtaWx5OiAnSGVsdmV0aWNhIE5ldWUnLEFyaWFsLEhlbHZldGljYSxzYW5zLXNlcmlmOyBmb250LXdlaWdodDogYm9sZDsgdGV4dC1hbmNob3I6IG1pZGRsZTsiPjJEPC90ZXh0Pjwvc3ZnPg==);
846
+ background-repeat: no-repeat;
847
+ background-size: 70%;
848
+ background-position: center;
849
+ width: 5px;
850
+ height: 5px;
851
+ position: relative;
852
+ }
853
+
854
+ .maplibregl-export-control {
855
+ background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools --%3E%3Csvg width='800px' height='800px' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18 16.75H16C15.8011 16.75 15.6103 16.671 15.4697 16.5303C15.329 16.3897 15.25 16.1989 15.25 16C15.25 15.8011 15.329 15.6103 15.4697 15.4697C15.6103 15.329 15.8011 15.25 16 15.25H18C18.3315 15.25 18.6495 15.1183 18.8839 14.8839C19.1183 14.6495 19.25 14.3315 19.25 14V10C19.25 9.66848 19.1183 9.35054 18.8839 9.11612C18.6495 8.8817 18.3315 8.75 18 8.75H6C5.66848 8.75 5.35054 8.8817 5.11612 9.11612C4.8817 9.35054 4.75 9.66848 4.75 10V14C4.75 14.3315 4.8817 14.6495 5.11612 14.8839C5.35054 15.1183 5.66848 15.25 6 15.25H8C8.19891 15.25 8.38968 15.329 8.53033 15.4697C8.67098 15.6103 8.75 15.8011 8.75 16C8.75 16.1989 8.67098 16.3897 8.53033 16.5303C8.38968 16.671 8.19891 16.75 8 16.75H6C5.27065 16.75 4.57118 16.4603 4.05546 15.9445C3.53973 15.4288 3.25 14.7293 3.25 14V10C3.25 9.27065 3.53973 8.57118 4.05546 8.05546C4.57118 7.53973 5.27065 7.25 6 7.25H18C18.7293 7.25 19.4288 7.53973 19.9445 8.05546C20.4603 8.57118 20.75 9.27065 20.75 10V14C20.75 14.7293 20.4603 15.4288 19.9445 15.9445C19.4288 16.4603 18.7293 16.75 18 16.75Z' fill='%23000000'/%3E%3Cpath d='M16 8.75C15.8019 8.74741 15.6126 8.66756 15.4725 8.52747C15.3324 8.38737 15.2526 8.19811 15.25 8V4.75H8.75V8C8.75 8.19891 8.67098 8.38968 8.53033 8.53033C8.38968 8.67098 8.19891 8.75 8 8.75C7.80109 8.75 7.61032 8.67098 7.46967 8.53033C7.32902 8.38968 7.25 8.19891 7.25 8V4.5C7.25 4.16848 7.3817 3.85054 7.61612 3.61612C7.85054 3.3817 8.16848 3.25 8.5 3.25H15.5C15.8315 3.25 16.1495 3.3817 16.3839 3.61612C16.6183 3.85054 16.75 4.16848 16.75 4.5V8C16.7474 8.19811 16.6676 8.38737 16.5275 8.52747C16.3874 8.66756 16.1981 8.74741 16 8.75Z' fill='%23000000'/%3E%3Cpath d='M15.5 20.75H8.5C8.16848 20.75 7.85054 20.6183 7.61612 20.3839C7.3817 20.1495 7.25 19.8315 7.25 19.5V12.5C7.25 12.1685 7.3817 11.8505 7.61612 11.6161C7.85054 11.3817 8.16848 11.25 8.5 11.25H15.5C15.8315 11.25 16.1495 11.3817 16.3839 11.6161C16.6183 11.8505 16.75 12.1685 16.75 12.5V19.5C16.75 19.8315 16.6183 20.1495 16.3839 20.3839C16.1495 20.6183 15.8315 20.75 15.5 20.75ZM8.75 19.25H15.25V12.75H8.75V19.25Z' fill='%23000000'/%3E%3C/svg%3E") !important;
856
+ background-repeat: no-repeat;
857
+ background-size: 65% !important;
858
+ background-position: center;
859
+ width: 5px;
860
+ height: 5px;
861
+ }
862
+
863
+ .maplibregl-export-list {
864
+ padding: 15px;
865
+ }
866
+ .generate-button {
867
+ border-radius: 5px !important;
868
+ background-color: rgb(0, 0, 0, 2%) !important;
869
+ }
870
+ .maplibregl-ctrl button:not(:disabled):hover {
871
+ background-color: rgb(0, 0, 0, 10%) !important;
872
+ }
873
+
874
+
875
+
876
+
877
+
878
+
879
+
880
+
881
+
882
+
883
+
884
+
885
+
886
+
887
+
888
+
889
+
890
+
891
+
763
892
  #logos{
764
893
  display: flex;
765
894
  flex-direction: row;
@@ -51,10 +51,12 @@ return maplibregl$1;
51
51
  },{}],2:[function(_dereq_,module,exports){
52
52
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var urlImages="https://visors.icgc.cat/contextmaps/imatges_estil/",urlStyles="https://geoserveis.icgc.cat/contextmaps/",defaultOptions={mapOptions:{container:"map",center:[1.537786,41.837539],zoom:7.5,bearing:0,pitch:0,hash:!1,style:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_estandard_general.json",maxZoom:18,maxPitch:85},baseStyles:[{name:"topografic",url:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_estandard_general.json"},{name:"ortofoto",url:"https://geoserveis.icgc.cat/contextmaps/icgc_orto_estandard.json"},{name:"limits",url:"https://geoserveis.icgc.cat/contextmaps/icgc_delimitacio_limits_administratius.json"},{name:"fosc",url:"https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_fosc.json"},{name:"ombra",url:"https://geoserveis.icgc.cat/contextmaps/icgc_ombra.json"},{name:"hipsometria",url:"https://geoserveis.icgc.cat/contextmaps/icgc_ombra_hipsometria.json"},{name:"protegits",url:"https://geoserveis.icgc.cat/contextmaps/icgc_espais_protegits_hidrografia.json"},{name:"geologia",url:"https://geoserveis.icgc.cat/contextmaps/icgc_geologic_informacio.json"}],urlTerrainICGC:[{name:"5m",url:"https://geoserveis.icgc.cat/servei/catalunya/contextmaps-terreny-5m-rgb/wmts/{z}/{x}/{y}.png"},{name:"2m",url:"https://tilemaps.icgc.cat/tileserver/tileserver.php/terreny_icgc_2m_rgb/{z}/{x}/{y}.png"}],ortoLayersICGC:[{key:"ortoICGC2003",text:"2000-2003",value:0},{key:"ortoICGC2005",text:"2004-2005",value:1},{key:"ortoICGC2007",text:"2006-2007",value:2},{key:"ortoICGC2008",text:"2008",value:3},{key:"ortoICGC2009",text:"2009",value:4},{key:"ortoICGC2010",text:"2010",value:5},{key:"ortoICGC2011",text:"2011",value:6},{key:"ortoICGC2012",text:"2012",value:7},{key:"ortoICGC2013",text:"2013",value:8},{key:"ortoICGC2014",text:"2014",value:9},{key:"ortoICGC2015",text:"2015",value:10},{key:"ortoICGC2016",text:"2016",value:11},{key:"ortoICGC2017",text:"2017",value:12},{key:"ortoICGC2018",text:"2018",value:13},{key:"ortoICGC2019",text:"2019",value:14},{key:"ortoICGC2020",text:"2020",value:15},{key:"ortoICGC2021",text:"2021",value:16},{key:"ortoICGC2022",text:"2022",value:17}],vectorLayersICGC:[{name:"agrupacionsCensalsVigent",key:"agrupacions-censals-vigent",url:"https://betaserver2.icgc.cat/fgb/agrupacions-censals-vigent.fgb"},{name:"areesBasiquesSalutVigent",key:"arees-basiques-salut-vigent",url:"https://betaserver2.icgc.cat/fgb/arees-basiques-salut-vigent.fgb"},{name:"areesHidrogeologiquesAquifersVigent",key:"arees-hidrogeologiques-aquifers-vigent",url:"https://betaserver2.icgc.cat/fgb/arees-hidrogeologiques-aquifers-vigent.fgb"},{name:"cobertesSolVigent",key:"cobertes-sol-vigent",url:"https://betaserver2.icgc.cat/fgb/cobertes-sol-vigent.fgb"},{name:"comarquesVigent",key:"comarques-vigent",url:"https://betaserver2.icgc.cat/fgb/comarques-vigent.fgb"},{name:"municipisVigent",key:"municipis-vigent",url:"https://betaserver2.icgc.cat/fgb/municipis-vigent.fgb"},{name:"provinciesVigent",key:"provincies-vigent",url:"https://betaserver2.icgc.cat/fgb/provincies-vigent.fgb"},{name:"quadriculaUTM1kmSocVigent",key:"quadricula-utm-1km-soc-vigent",url:"https://betaserver2.icgc.cat/fgb/quadricula-utm-1km-soc-vigent.fgb"},{name:"regionsSanitariesVigent",key:"regions-sanitaries-vigent",url:"https://betaserver2.icgc.cat/fgb/regions-sanitaries-vigent.fgb"},{name:"seccionsCensalsVigent",key:"seccions-censals-vigent",url:"https://betaserver2.icgc.cat/fgb/seccions-censals-vigent.fgb"},{name:"tall5mEtrs89Vigent",key:"tall-5m-etrs89-vigent",url:"https://betaserver2.icgc.cat/fgb/tall-5m-etrs89-vigent.fgb"},{name:"unitatsGeologiques50mVigent",key:"unitats-geologiques-50m-vigent",url:"https://betaserver2.icgc.cat/fgb/unitats-geologiques-50m-vigent.fgb"},{name:"vegueriesVigent",key:"vegueries-vigent",url:"https://betaserver2.icgc.cat/fgb/vegueries-vigent.fgb"}]},_default=exports.default=defaultOptions;
53
53
  },{}],3:[function(_dereq_,module,exports){
54
+ "use strict";function _typeof(t){"@babel/helpers - typeof";return(_typeof="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})(t)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,_toPropertyKey(r.key),r)}}function _createClass(t,e,i){return e&&_defineProperties(t.prototype,e),i&&_defineProperties(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"===_typeof(e)?e:String(e)}function _toPrimitive(t,e){if("object"!==_typeof(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,e||"default");if("object"!==_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var Pitch3DToggle=exports.default=function(){function t(){_classCallCheck(this,t),this._bearing=0,this._pitch=60,this._minpitchzoom=null}return _createClass(t,[{key:"onAdd",value:function(t){this._map=t;var e=this;return this._btn=document.createElement("button"),this._btn.className="maplibregl-ctrl-icon maplibregl-ctrl-pitchtoggle-3d",this._btn.id="bt3D",this._btn.type="button",this._btn["aria-label"]="Vista 3D",this._btn.onclick=function(){if(-1!=e._btn.className.indexOf("3d")){var i={pitch:e._pitch,bearing:e._bearing};e._minpitchzoom&&t.getZoom()>e._minpitchzoom&&(i.zoom=e._minpitchzoom);var r=t.getCenter(),n=r.longitude,o=r.latitude;t.getZoom()<10?t.setTerrain({source:"terrainMapZen",exaggeration:1.5}):n>=0&&n<=6&&o>=38.5&&o<=62.33?t.setTerrain({source:"terrainICGC",exaggeration:1.2}):t.setTerrain({source:"terrainMapZen",exaggeration:1.5}),t.easeTo(i),e._btn.className="maplibregl-ctrl-icon maplibregl-ctrl-pitchtoggle-2d"}else t.setTerrain(null),t.easeTo({pitch:0,bearing:0}),e._btn.className="maplibregl-ctrl-icon maplibregl-ctrl-pitchtoggle-3d"},this._container=document.createElement("div"),this._container.className="maplibregl-ctrl maplibregl-ctrl-group",this._container.title="Vista 3D",this._container.appendChild(this._btn),this._container}},{key:"onRemove",value:function(){this._container.parentNode.removeChild(this._container),this._map=void 0}}]),t}();
55
+ },{}],4:[function(_dereq_,module,exports){
54
56
  "use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Map",{enumerable:!0,get:function(){return _Map.default}});var _Map=_interopRequireDefault(_dereq_("./map/Map"));
55
- },{"./map/Map":4}],4:[function(_dereq_,module,exports){
56
- "use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){function e(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}function t(e,t,r,n){var a=t&&t.prototype instanceof o?t:o,i=Object.create(a.prototype),c=new d(n||[]);return v(i,"_invoke",{value:l(e,r,c)}),i}function r(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function o(){}function n(){}function a(){}function i(t){["next","throw","return"].forEach(function(r){e(t,r,function(e){return this._invoke(r,e)})})}function c(e,t){function o(n,a,i,c){var l=r(e[n],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==_typeof(u)&&g.call(u,"__await")?t.resolve(u.__await).then(function(e){o("next",e,i,c)},function(e){o("throw",e,i,c)}):t.resolve(u).then(function(e){s.value=e,i(s)},function(e){return o("throw",e,i,c)})}c(l.arg)}var n;v(this,"_invoke",{value:function(e,r){function a(){return new t(function(t,n){o(e,r,t,n)})}return n=n?n.then(a,a):a()}})}function l(e,t,o){var n=E;return function(a,i){if(n===x)throw new Error("Generator is already running");if(n===k){if("throw"===a)throw i;return{value:y,done:!0}}for(o.method=a,o.arg=i;;){var c=o.delegate;if(c){var l=s(c,o);if(l){if(l===S)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(n===E)throw n=k,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);n=x;var u=r(e,t,o);if("normal"===u.type){if(n=o.done?k:L,u.arg===S)continue;return{value:u.arg,done:o.done}}"throw"===u.type&&(n=k,o.method="throw",o.arg=u.arg)}}}function s(e,t){var o=t.method,n=e.iterator[o];if(n===y)return t.delegate=null,"throw"===o&&e.iterator.return&&(t.method="return",t.arg=y,s(e,t),"throw"===t.method)||"return"!==o&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+o+"' method")),S;var a=r(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,S;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=y),t.delegate=null,S):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,S)}function u(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function f(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function d(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(u,this),this.reset(!0)}function p(e){if(e||""===e){var t=e[w];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(g.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=y,t.done=!0,t};return o.next=o}}throw new TypeError(_typeof(e)+" is not iterable")}_regeneratorRuntime=function(){return h};var y,h={},m=Object.prototype,g=m.hasOwnProperty,v=Object.defineProperty||function(e,t,r){e[t]=r.value},b="function"==typeof Symbol?Symbol:{},w=b.iterator||"@@iterator",_=b.asyncIterator||"@@asyncIterator",C=b.toStringTag||"@@toStringTag";try{e({},"")}catch(t){e=function(e,t,r){return e[t]=r}}h.wrap=t;var E="suspendedStart",L="suspendedYield",x="executing",k="completed",S={},G={};e(G,w,function(){return this});var I=Object.getPrototypeOf,P=I&&I(I(p([])));P&&P!==m&&g.call(P,w)&&(G=P);var T=a.prototype=o.prototype=Object.create(G);return n.prototype=a,v(T,"constructor",{value:a,configurable:!0}),v(a,"constructor",{value:n,configurable:!0}),n.displayName=e(a,C,"GeneratorFunction"),h.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===n||"GeneratorFunction"===(t.displayName||t.name))},h.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,e(t,C,"GeneratorFunction")),t.prototype=Object.create(T),t},h.awrap=function(e){return{__await:e}},i(c.prototype),e(c.prototype,_,function(){return this}),h.AsyncIterator=c,h.async=function(e,r,o,n,a){void 0===a&&(a=Promise);var i=new c(t(e,r,o,n),a);return h.isGeneratorFunction(r)?i:i.next().then(function(e){return e.done?e.value:i.next()})},i(T),e(T,C,"Generator"),e(T,w,function(){return this}),e(T,"toString",function(){return"[object Generator]"}),h.keys=function(e){var t=Object(e),r=[];for(var o in t)r.push(o);return r.reverse(),function e(){for(;r.length;){var o=r.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},h.values=p,d.prototype={constructor:d,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=y,this.done=!1,this.delegate=null,this.method="next",this.arg=y,this.tryEntries.forEach(f),!e)for(var t in this)"t"===t.charAt(0)&&g.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=y)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){function t(t,o){return a.type="throw",a.arg=e,r.next=t,o&&(r.method="next",r.arg=y),!!o}if(this.done)throw e;for(var r=this,o=this.tryEntries.length-1;o>=0;--o){var n=this.tryEntries[o],a=n.completion;if("root"===n.tryLoc)return t("end");if(n.tryLoc<=this.prev){var i=g.call(n,"catchLoc"),c=g.call(n,"finallyLoc");if(i&&c){if(this.prev<n.catchLoc)return t(n.catchLoc,!0);if(this.prev<n.finallyLoc)return t(n.finallyLoc)}else if(i){if(this.prev<n.catchLoc)return t(n.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return t(n.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&g.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var n=o;break}}n&&("break"===e||"continue"===e)&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var a=n?n.completion:{};return a.type=e,a.arg=t,n?(this.method="next",this.next=n.finallyLoc,S):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),S},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),f(r),S}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var n=o.arg;f(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:p(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=y),S}},h}function asyncGeneratorStep(e,t,r,o,n,a,i){try{var c=e[a](i),l=c.value}catch(e){return void r(e)}c.done?t(l):Promise.resolve(l).then(o,n)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise(function(o,n){function a(e){asyncGeneratorStep(c,o,n,a,i,"next",e)}function i(e){asyncGeneratorStep(c,o,n,a,i,"throw",e)}var c=e.apply(t,r);a(void 0)})}}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,n=function(){};return{s:n,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:n}}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,i=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.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)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _asyncIterator(e){var t,r,o,n=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,o=Symbol.iterator);n--;){if(r&&null!=(t=e[r]))return t.call(e);if(o&&null!=(t=e[o]))return new AsyncFromSyncIterator(t.call(e));r="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")}function AsyncFromSyncIterator(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return AsyncFromSyncIterator=function(e){this.s=e,this.n=e.next},AsyncFromSyncIterator.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return;return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new AsyncFromSyncIterator(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _maplibreGl=_interopRequireDefault(_dereq_("maplibre-gl")),_config=_interopRequireDefault(_dereq_("../config.js")),Map=exports.default=function(){function e(t){var r=this;_classCallCheck(this,e);var o=Object.getOwnPropertyNames(t);if(o&&o.forEach(function(e){t[e]="style"===e?r._dealStyleMaps(t[e]):t[e]}),t)for(var n in _config.default.mapOptions)t.hasOwnProperty(n)||(t[n]=_config.default.mapOptions[n]);else t=_config.default.mapOptions;t.maxZoom=18,t.maxPitch=85,t.maplibreLogo=!1,t.attributionControl=!1,this.map=new _maplibreGl.default.Map(t)}return _createClass(e,[{key:"on",value:function(e,t){try{this.map.on(e,t)}catch(e){console.error("Error adding event listener: ".concat(e.message))}}},{key:"getSource",value:function(e){try{this.map.getSource(e)}catch(e){console.error("Error getting source: ".concat(e.message))}}},{key:"addSource",value:function(e){try{this.map.addSource(e)}catch(e){console.error("Error adding source: ".concat(e.message))}}},{key:"getLayer",value:function(e){try{this.map.getLayer(e)}catch(e){console.error("Error getting layer: ".concat(e.message))}}},{key:"jumpTo",value:function(e){try{this.map.jumpTo(e)}catch(t){console.error("Error jumping to ".concat(e,": ").concat(t.message))}}},{key:"setLayoutProperty",value:function(e){try{this.map.setLayoutProperty(e)}catch(e){console.error("Error setting layout property: ".concat(e.message))}}},{key:"addControl",value:function(e){try{this.map.addControl(e)}catch(e){console.error("Error adding control: ".concat(e.message))}}},{key:"getZoom",value:function(){try{return this.map.getZoom()}catch(e){console.error("Error getting zoom level: ".concat(e.message))}}},{key:"addMouseCoordControl",value:function(){try{this.map.on("mousemove",function(e){var t=e.lngLat.lat,r=e.lngLat.lng,o="Lon/Lat (WGS 84) Lon: "+r.toFixed(6)+" Lat: "+t.toFixed(6),n=document.getElementById("divInfo"),a=document.createElement("div");a.className="coordControl",a.innerHTML=o+" - ZL: "+map.getZoom().toFixed(1),n.appendChild(a)})}catch(e){console.error("Error adding mouse coordinate control: ".concat(e.message))}}},{key:"addGeolocateControl",value:function(e){try{void 0===e?this.map.addControl(new _maplibreGl.default.GeolocateControl({positionOptions:{enableHighAccuracy:!0},trackUserLocation:!0})):this.map.addControl(new _maplibreGl.default.GeolocateControl(e))}catch(e){console.error("Error adding geolocate control: ".concat(e.message))}}},{key:"getBounds",value:function(){try{return this.map.getBounds()}catch(e){console.error("Error getting bounds: ".concat(e.message))}}},{key:"getCanvas",value:function(){try{return this.map.getCanvas()}catch(e){console.error("Error getting canvas: ".concat(e.message))}}},{key:"setCenter",value:function(e){try{return this.map.setCenter(e)}catch(e){console.error("Error setting center: ".concat(e.message))}}},{key:"addLayer",value:function(e){try{this.map.addLayer(e)}catch(e){console.error("Error adding layer: ".concat(e.message))}}},{key:"addLayerGeoJSON",value:function(e){var t=this;try{this.map.on("load",function(){t.map.addSource("".concat(e.id,"-sourceIcgcMap"),{type:"geojson",data:e.data}),t.map.addLayer({id:"".concat(e.id,"-layerIcgcMap"),type:e.layerType,source:"".concat(e.id,"-sourceIcgcMap"),layout:e.layout,paint:e.paint})})}catch(e){console.error("Error adding GeoJSON layer: ".concat(e.message))}}},{key:"addLayerWMS",value:function(e){var t=this;try{this.map.on("load",function(){t.map.addSource("".concat(e.id,"-sourceIcgcMap"),{type:"raster",tiles:[e.tiles],tileSize:256}),t.map.addLayer({id:"".concat(e.id,"-layerIcgcMap"),type:"raster",source:"".concat(e.id,"-sourceIcgcMap"),paint:{}})})}catch(e){console.error("Error adding WMS layer: ".concat(e.message))}}},{key:"removeLayer",value:function(e){try{this.map.removeLayer(e)}catch(e){console.error("Error removing layer: ".concat(e.message))}}},{key:"removeSource",value:function(e){try{this.map.removeSource(e)}catch(e){console.error("Error removing source: ".concat(e.message))}}},{key:"addLogo",value:function(e){try{var t=document.createElement("img");t.src=e.url,t.style.height="62px";var r=document.getElementById("logos"),o=document.createElement("a");o.id=e.id,o.href=e.href,o.target="_blank",o.style.position="relative",o.style.bottom="1px",o.appendChild(t),r.appendChild(o)}catch(e){console.error("Error adding logo: ".concat(e.message))}}},{key:"addBasemaps",value:function(e){var t=this;try{var r=function(e){t.map.setStyle(e.url)},o=document.getElementById("basemap-group");this.map.on("load",function(){e.forEach(function(e){var t=document.createElement("div");t.className="basemap-item",t.title=e.label,t.style.backgroundImage="url('".concat(e.image,"')"),o.appendChild(t),t.addEventListener("click",function(){return r(e)})})})}catch(e){console.error("Error adding basemaps: ".concat(e.message))}}},{key:"addExportControl",value:function(){try{this.map.addControl(new MaplibreExportControl.MaplibreExportControl({PageSize:MaplibreExportControl.Size.A4,PageOrientation:MaplibreExportControl.PageOrientation.Landscape,Format:MaplibreExportControl.Format.PNG,DPI:MaplibreExportControl.DPI[300],Crosshair:!0,PrintableArea:!0,Local:"en"}),"top-right")}catch(e){console.error("Error adding export control: ".concat(e.message))}}},{key:"addMarker",value:function(e){try{var t,r;return void 0===e.text?t=new _maplibreGl.default.Marker(e.options).setLngLat(e.coord).addTo(this.map):(r=new _maplibreGl.default.Popup({offset:e.textOffset}).setText(e.text),t=(new _maplibreGl.default.Marker).setLngLat(e.coord).setPopup(r).addTo(this.map)),t}catch(e){return console.error("Error adding marker: ".concat(e.message)),null}}},{key:"addPopup",value:function(e){try{return(new _maplibreGl.default.Popup).setLngLat(e.coord).setHTML(e.text).addTo(this.map)}catch(e){return console.error("Error adding popup: ".concat(e.message)),null}}},{key:"addFullScreen",value:function(){try{this.map.addControl(new _maplibreGl.default.FullscreenControl)}catch(e){console.error("Error adding fullscreen control: ".concat(e.message))}}},{key:"addLayerTree",value:function(e){var t=this;try{var r=e.features,o=document.getElementById("filter-group");this.map.on("load",function(){for(var n,a=t.map.getStyle().layers,i=0;i<a.length;i++)if("symbol"===a[i].type){n=a[i].id;break}t.map.addSource("".concat(e.id,"-source"),{type:e.type,data:r}),r.features.forEach(function(r){var a=r.properties.icon,i="poi-".concat(a);if(!t.map.getLayer(i)){t.map.addLayer({id:i,type:"circle",source:"".concat(e.id,"-source"),paint:{"circle-radius":6,"circle-color":"#B42222"},filter:["==","icon",a]},n);var c=document.createElement("input");c.type="checkbox",c.id=i,c.checked=!0,o.appendChild(c);var l=document.createElement("label");l.setAttribute("for",i),l.textContent=a,o.appendChild(l),c.addEventListener("change",function(e){t.map.setLayoutProperty(i,"visibility",e.target.checked?"visible":"none")})}})})}catch(e){console.error("Error adding layer tree: ".concat(e.message))}}},{key:"createNavigationControl",value:function(e){try{return new _maplibreGl.default.NavigationControl(e)}catch(e){return console.error("Error creating navigation control: ".concat(e.message)),null}}},{key:"addNavigationControl",value:function(e){try{var t=this.createNavigationControl(e);t&&this.map.addControl(t)}catch(e){console.error("Error adding navigation control: ".concat(e.message))}}},{key:"addAttributionControl",value:function(e){try{this.map.addControl(new _maplibreGl.default.AttributionControl(e.options),e.position)}catch(e){console.error("Error adding attribution control: ".concat(e.message))}}},{key:"_dealStyleMaps",value:function(e){try{var t,r=_createForOfIteratorHelper(_config.default.baseStyles);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o.name===e)return o.url}}catch(e){r.e(e)}finally{r.f()}return _config.default.baseStyles[0].url}catch(e){return console.error("Error dealing with map styles: ".concat(e.message)),null}}},{key:"addImageLayerICGC",value:function(e,t){try{var r,o,n;if(e.includes("orto")||e.includes("geol")||e.includes("relleu")){if(e.includes("orto"))if(void 0!==t){r=e+t;var a=_config.default.ortoLayersICGC.find(function(e){return e.key===r});a||console.log("❌ %c The layer: %c%s%c does not exist in the ICGC DB. Consult the documentation.","font-weight: bold; font-style: italic;","font-weight: normal; font-style: normal; color: red;",r,"font-weight: bold; font-style: italic;"),o=a.text,n="ortofoto_color_"+o;var i={id:r,tiles:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=".concat(n)};this.addLayerWMS(i)}else{var c={id:e+"Actual",tiles:"https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.png"};this.addLayerWMS(c)}if(e.includes("relleu")){var l={id:e+"Actual",tiles:"https://tilemaps.icgc.cat/mapfactory/wmts/relleu/CAT3857/{z}/{x}/{y}.png"};this.addLayerWMS(l)}if(e.includes("geol")){var s={id:e+"Actual",tiles:"https://tilemaps.icgc.cat/mapfactory/wmts/geologia/MON3857NW/{z}/{x}/{y}.png"};this.addLayerWMS(s)}}else console.log("❌ %c The layer: %c%s%c does not exist in the ICGC DB. Consult the documentation.","font-weight: bold; font-style: italic;","font-weight: normal; font-style: normal; color: red;",e,"font-weight: bold; font-style: italic;")}catch(e){console.error("Error adding ICGC image layer: ".concat(e.message))}}},{key:"addFGBLayerICGC",value:function(){function e(e,r){return t.apply(this,arguments)}var t=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,r){var o,n,a,i=this;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o=_config.default.vectorLayersICGC.find(function(e){return e.key.includes(t)}),o||console.log("❌ %c The layer: %c%s%c does not exist in the ICGC DB. Consult the documentation.","font-weight: bold; font-style: italic;","font-weight: normal; font-style: normal; color: red;",t,"font-weight: bold; font-style: italic;"),n=o.url,e.next=6,fetch(n);case 6:a=e.sent,this.map.on("load",_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,r,n,c,l,s,u,f;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t={type:"FeatureCollection",features:[]},r=!1,n=!1,e.prev=3,l=_asyncIterator(flatgeobuf.deserialize(a.body));case 5:return e.next=7,l.next();case 7:if(!(r=!(s=e.sent).done)){e.next=13;break}u=s.value,t.features.push(u);case 10:r=!1,e.next=5;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(3),n=!0,c=e.t0;case 19:if(e.prev=19,e.prev=20,!r||null==l.return){e.next=24;break}return e.next=24,l.return();case 24:if(e.prev=24,!n){e.next=27;break}throw c;case 27:return e.finish(24);case 28:return e.finish(19);case 29:f=o.name+"-source",i.map.addSource(f,{type:"geojson",data:t}),i.map.addLayer({id:o.name+"-fill",type:"fill",source:f,paint:{"fill-color":"#0000FF","fill-opacity":0}}),i.map.addLayer({id:o.name+"-line",type:"line",source:f,paint:{"line-color":"#FFFFFF","line-opacity":.49,"line-width":1}});case 33:case"end":return e.stop()}},e,null,[[3,15,19,29],[20,,24,28]])}))),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.error("Error adding ICGC vector layer: ".concat(e.t0.message));case 13:case"end":return e.stop()}},e,this,[[0,10]])}));return e}()},{key:"addTerrainICGC",value:function(e){var t=this;this.map.on("load",function(){try{var r=_config.default.urlTerrainICGC.find(function(t){return t.name===e}),o=r.url;t.map.addSource("terrainICGC-src",{type:"raster-dem",tiles:[o],tileSize:512,maxzoom:16}),t.map.setTerrain({source:"terrainMapZen",exaggeration:1.5}),t.map.setTerrain({source:"terrainICGC-src",exaggeration:1.5}),t.map.addControl(new _maplibreGl.default.TerrainControl({source:"terrainICGC-src",exaggeration:1.5}))}catch(e){console.error("Error adding 3D terrain: ".concat(e.message))}})}}]),e}();
57
- },{"../config.js":2,"maplibre-gl":1}]},{},[3])(3)
57
+ },{"./map/Map":5}],5:[function(_dereq_,module,exports){
58
+ "use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){"@babel/helpers - typeof";return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){function e(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}function t(e,t,r,n){var a=t&&t.prototype instanceof o?t:o,i=Object.create(a.prototype),c=new f(n||[]);return v(i,"_invoke",{value:l(e,r,c)}),i}function r(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function o(){}function n(){}function a(){}function i(t){["next","throw","return"].forEach(function(r){e(t,r,function(e){return this._invoke(r,e)})})}function c(e,t){function o(n,a,i,c){var l=r(e[n],e,a);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==_typeof(u)&&g.call(u,"__await")?t.resolve(u.__await).then(function(e){o("next",e,i,c)},function(e){o("throw",e,i,c)}):t.resolve(u).then(function(e){s.value=e,i(s)},function(e){return o("throw",e,i,c)})}c(l.arg)}var n;v(this,"_invoke",{value:function(e,r){function a(){return new t(function(t,n){o(e,r,t,n)})}return n=n?n.then(a,a):a()}})}function l(e,t,o){var n=E;return function(a,i){if(n===x)throw new Error("Generator is already running");if(n===k){if("throw"===a)throw i;return{value:y,done:!0}}for(o.method=a,o.arg=i;;){var c=o.delegate;if(c){var l=s(c,o);if(l){if(l===S)continue;return l}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(n===E)throw n=k,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);n=x;var u=r(e,t,o);if("normal"===u.type){if(n=o.done?k:L,u.arg===S)continue;return{value:u.arg,done:o.done}}"throw"===u.type&&(n=k,o.method="throw",o.arg=u.arg)}}}function s(e,t){var o=t.method,n=e.iterator[o];if(n===y)return t.delegate=null,"throw"===o&&e.iterator.return&&(t.method="return",t.arg=y,s(e,t),"throw"===t.method)||"return"!==o&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+o+"' method")),S;var a=r(n,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,S;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=y),t.delegate=null,S):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,S)}function u(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function d(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function f(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(u,this),this.reset(!0)}function p(e){if(e||""===e){var t=e[w];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(g.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=y,t.done=!0,t};return o.next=o}}throw new TypeError(_typeof(e)+" is not iterable")}_regeneratorRuntime=function(){return h};var y,h={},m=Object.prototype,g=m.hasOwnProperty,v=Object.defineProperty||function(e,t,r){e[t]=r.value},b="function"==typeof Symbol?Symbol:{},w=b.iterator||"@@iterator",_=b.asyncIterator||"@@asyncIterator",C=b.toStringTag||"@@toStringTag";try{e({},"")}catch(t){e=function(e,t,r){return e[t]=r}}h.wrap=t;var E="suspendedStart",L="suspendedYield",x="executing",k="completed",S={},G={};e(G,w,function(){return this});var I=Object.getPrototypeOf,P=I&&I(I(p([])));P&&P!==m&&g.call(P,w)&&(G=P);var T=a.prototype=o.prototype=Object.create(G);return n.prototype=a,v(T,"constructor",{value:a,configurable:!0}),v(a,"constructor",{value:n,configurable:!0}),n.displayName=e(a,C,"GeneratorFunction"),h.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===n||"GeneratorFunction"===(t.displayName||t.name))},h.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,a):(t.__proto__=a,e(t,C,"GeneratorFunction")),t.prototype=Object.create(T),t},h.awrap=function(e){return{__await:e}},i(c.prototype),e(c.prototype,_,function(){return this}),h.AsyncIterator=c,h.async=function(e,r,o,n,a){void 0===a&&(a=Promise);var i=new c(t(e,r,o,n),a);return h.isGeneratorFunction(r)?i:i.next().then(function(e){return e.done?e.value:i.next()})},i(T),e(T,C,"Generator"),e(T,w,function(){return this}),e(T,"toString",function(){return"[object Generator]"}),h.keys=function(e){var t=Object(e),r=[];for(var o in t)r.push(o);return r.reverse(),function e(){for(;r.length;){var o=r.pop();if(o in t)return e.value=o,e.done=!1,e}return e.done=!0,e}},h.values=p,f.prototype={constructor:f,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=y,this.done=!1,this.delegate=null,this.method="next",this.arg=y,this.tryEntries.forEach(d),!e)for(var t in this)"t"===t.charAt(0)&&g.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=y)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){function t(t,o){return a.type="throw",a.arg=e,r.next=t,o&&(r.method="next",r.arg=y),!!o}if(this.done)throw e;for(var r=this,o=this.tryEntries.length-1;o>=0;--o){var n=this.tryEntries[o],a=n.completion;if("root"===n.tryLoc)return t("end");if(n.tryLoc<=this.prev){var i=g.call(n,"catchLoc"),c=g.call(n,"finallyLoc");if(i&&c){if(this.prev<n.catchLoc)return t(n.catchLoc,!0);if(this.prev<n.finallyLoc)return t(n.finallyLoc)}else if(i){if(this.prev<n.catchLoc)return t(n.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return t(n.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&g.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var n=o;break}}n&&("break"===e||"continue"===e)&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var a=n?n.completion:{};return a.type=e,a.arg=t,n?(this.method="next",this.next=n.finallyLoc,S):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),S},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),d(r),S}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var o=r.completion;if("throw"===o.type){var n=o.arg;d(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:p(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=y),S}},h}function asyncGeneratorStep(e,t,r,o,n,a,i){try{var c=e[a](i),l=c.value}catch(e){return void r(e)}c.done?t(l):Promise.resolve(l).then(o,n)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise(function(o,n){function a(e){asyncGeneratorStep(c,o,n,a,i,"next",e)}function i(e){asyncGeneratorStep(c,o,n,a,i,"throw",e)}var c=e.apply(t,r);a(void 0)})}}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,n=function(){};return{s:n,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:n}}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,i=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.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)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"===_typeof(t)?t:String(t)}function _toPrimitive(e,t){if("object"!==_typeof(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _asyncIterator(e){var t,r,o,n=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,o=Symbol.iterator);n--;){if(r&&null!=(t=e[r]))return t.call(e);if(o&&null!=(t=e[o]))return new AsyncFromSyncIterator(t.call(e));r="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")}function AsyncFromSyncIterator(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return AsyncFromSyncIterator=function(e){this.s=e,this.n=e.next},AsyncFromSyncIterator.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return;return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new AsyncFromSyncIterator(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _maplibreGl=_interopRequireDefault(_dereq_("maplibre-gl")),_Toggle3DControl=_interopRequireDefault(_dereq_("../controls/Toggle3DControl.js")),_config=_interopRequireDefault(_dereq_("../config.js")),Map=exports.default=function(){function e(t){var r=this;_classCallCheck(this,e);var o=Object.getOwnPropertyNames(t);if(o&&o.forEach(function(e){t[e]="style"===e?r._dealStyleMaps(t[e]):t[e]}),t)for(var n in _config.default.mapOptions)t.hasOwnProperty(n)||(t[n]=_config.default.mapOptions[n]);else t=_config.default.mapOptions;t.maxZoom=18,t.maxPitch=85,t.maplibreLogo=!1,t.attributionControl=!1,this.map=new _maplibreGl.default.Map(t)}return _createClass(e,[{key:"on",value:function(e,t){try{this.map.on(e,t)}catch(e){console.error("Error adding event listener: ".concat(e.message))}}},{key:"getSource",value:function(e){try{this.map.getSource(e)}catch(e){console.error("Error getting source: ".concat(e.message))}}},{key:"addSource",value:function(e){try{this.map.addSource(e)}catch(e){console.error("Error adding source: ".concat(e.message))}}},{key:"setStyle",value:function(e,t){try{void 0!==t?this.map.setStyle(e,t):this.map.setStyle(e)}catch(e){console.error("Error setting style: ".concat(e.message))}}},{key:"getLayer",value:function(e){try{this.map.getLayer(e)}catch(e){console.error("Error getting layer: ".concat(e.message))}}},{key:"jumpTo",value:function(e){try{this.map.jumpTo(e)}catch(t){console.error("Error jumping to ".concat(e,": ").concat(t.message))}}},{key:"setLayoutProperty",value:function(e){try{this.map.setLayoutProperty(e)}catch(e){console.error("Error setting layout property: ".concat(e.message))}}},{key:"addControl",value:function(e,t){try{void 0===t&&(t="top-right"),this.map.addControl(e,t)}catch(e){console.error("Error adding control: ".concat(e.message))}}},{key:"getZoom",value:function(){try{return this.map.getZoom()}catch(e){console.error("Error getting zoom level: ".concat(e.message))}}},{key:"addMouseCoordControl",value:function(){try{this.map.on("mousemove",function(e){var t=e.lngLat.lat,r=e.lngLat.lng,o="Lon/Lat (WGS 84) Lon: "+r.toFixed(6)+" Lat: "+t.toFixed(6),n=document.getElementById("divInfo"),a=document.createElement("div");a.className="coordControl",a.innerHTML=o+" - ZL: "+map.getZoom().toFixed(1),n.appendChild(a)})}catch(e){console.error("Error adding mouse coordinate control: ".concat(e.message))}}},{key:"addGeolocateControl",value:function(e,t){try{void 0===t&&(t="top-right"),void 0===e?this.map.addControl(new _maplibreGl.default.GeolocateControl({positionOptions:{enableHighAccuracy:!0},trackUserLocation:!0}),t):this.map.addControl(new _maplibreGl.default.GeolocateControl(e),t)}catch(e){console.error("Error adding geolocate control: ".concat(e.message))}}},{key:"getBounds",value:function(){try{return this.map.getBounds()}catch(e){console.error("Error getting bounds: ".concat(e.message))}}},{key:"getCanvas",value:function(){try{return this.map.getCanvas()}catch(e){console.error("Error getting canvas: ".concat(e.message))}}},{key:"setCenter",value:function(e){try{return this.map.setCenter(e)}catch(e){console.error("Error setting center: ".concat(e.message))}}},{key:"addLayer",value:function(e){try{this.map.addLayer(e)}catch(e){console.error("Error adding layer: ".concat(e.message))}}},{key:"addLayerGeoJSON",value:function(e){var t=this;try{this.map.on("load",function(){t.map.addSource("".concat(e.id,"-sourceIcgcMap"),{type:"geojson",data:e.data}),t.map.addLayer({id:"".concat(e.id,"-layerIcgcMap"),type:e.layerType,source:"".concat(e.id,"-sourceIcgcMap"),layout:e.layout,paint:e.paint})})}catch(e){console.error("Error adding GeoJSON layer: ".concat(e.message))}}},{key:"addLayerWMS",value:function(e){var t=this;try{this.map.on("load",function(){t.map.addSource("".concat(e.id,"-sourceIcgcMap"),{type:"raster",tiles:[e.tiles],tileSize:256}),t.map.addLayer({id:"".concat(e.id,"-layerIcgcMap"),type:"raster",source:"".concat(e.id,"-sourceIcgcMap"),paint:{}})})}catch(e){console.error("Error adding WMS layer: ".concat(e.message))}}},{key:"removeControl",value:function(e){try{this.map.removeControl(e)}catch(e){console.error("Error removing control: ".concat(e.message))}}},{key:"removeLayer",value:function(e){try{this.map.removeLayer(e)}catch(e){console.error("Error removing layer: ".concat(e.message))}}},{key:"removeSource",value:function(e){try{this.map.removeSource(e)}catch(e){console.error("Error removing source: ".concat(e.message))}}},{key:"addLogo",value:function(e){try{var t=document.createElement("img");t.src=e.url,t.style.height="62px";var r=document.getElementById("logos"),o=document.createElement("a");o.id=e.id,o.href=e.href,o.target="_blank",o.style.position="relative",o.style.bottom="1px",o.appendChild(t),r.appendChild(o)}catch(e){console.error("Error adding logo: ".concat(e.message))}}},{key:"addBasemaps",value:function(e){var t=this;try{var r=function(e){t.map.setStyle(e.url)},o=document.getElementById("basemap-group");this.map.on("load",function(){e.forEach(function(e){var t=document.createElement("div");t.className="basemap-item",t.title=e.label,t.style.backgroundImage="url('".concat(e.image,"')"),o.appendChild(t),t.addEventListener("click",function(){return r(e)})})})}catch(e){console.error("Error adding basemaps: ".concat(e.message))}}},{key:"addExportControl",value:function(e,t){try{"string"==typeof e&&(t=e,e=void 0),void 0===e&&(e={PageSize:MaplibreExportControl.Size.A4,PageOrientation:MaplibreExportControl.PageOrientation.Landscape,Format:MaplibreExportControl.Format.PNG,DPI:MaplibreExportControl.DPI[300],Crosshair:!0,PrintableArea:!0},t="top-right"),this.map.addControl(new MaplibreExportControl.MaplibreExportControl(e),t)}catch(e){console.error("Error adding export control: ".concat(e.message))}}},{key:"addMarker",value:function(e){try{var t,r;return void 0===e.text?t=new _maplibreGl.default.Marker(e.options).setLngLat(e.coord).addTo(this.map):(r=new _maplibreGl.default.Popup({offset:e.textOffset}).setText(e.text),t=(new _maplibreGl.default.Marker).setLngLat(e.coord).setPopup(r).addTo(this.map)),t}catch(e){return console.error("Error adding marker: ".concat(e.message)),null}}},{key:"addPopup",value:function(e){try{return(new _maplibreGl.default.Popup).setLngLat(e.coord).setHTML(e.text).addTo(this.map)}catch(e){return console.error("Error adding popup: ".concat(e.message)),null}}},{key:"addFullScreen",value:function(e){try{void 0===e&&(e="top-right"),this.map.addControl(new _maplibreGl.default.FullscreenControl,e)}catch(e){console.error("Error adding fullscreen control: ".concat(e.message))}}},{key:"addLayerTree",value:function(e){var t=this;try{var r=e.features,o=document.getElementById("filter-group");this.map.on("load",function(){for(var n,a=t.map.getStyle().layers,i=0;i<a.length;i++)if("symbol"===a[i].type){n=a[i].id;break}t.map.addSource("".concat(e.id,"-source"),{type:e.type,data:r}),r.features.forEach(function(r){var a=r.properties.icon,i="poi-".concat(a);if(!t.map.getLayer(i)){t.map.addLayer({id:i,type:"circle",source:"".concat(e.id,"-source"),paint:{"circle-radius":6,"circle-color":"#B42222"},filter:["==","icon",a]},n);var c=document.createElement("input");c.type="checkbox",c.id=i,c.checked=!0,o.appendChild(c);var l=document.createElement("label");l.setAttribute("for",i),l.textContent=a,o.appendChild(l),c.addEventListener("change",function(e){t.map.setLayoutProperty(i,"visibility",e.target.checked?"visible":"none")})}})})}catch(e){console.error("Error adding layer tree: ".concat(e.message))}}},{key:"createNavigationControl",value:function(e,t){try{void 0===t&&(t="top-right"),this.map.addControl(new _maplibreGl.default.NavigationControl(e),t)}catch(e){return console.error("Error creating navigation control: ".concat(e.message)),null}}},{key:"addNavigationControl",value:function(e,t){try{void 0===t&&(t="top-right"),this.map.addControl(new _maplibreGl.default.NavigationControl(e),t)}catch(e){console.error("Error adding navigation control: ".concat(e.message))}}},{key:"addAttributionControl",value:function(e){try{this.map.addControl(new _maplibreGl.default.AttributionControl(e.options),e.position)}catch(e){console.error("Error adding attribution control: ".concat(e.message))}}},{key:"_dealStyleMaps",value:function(e){try{var t,r=_createForOfIteratorHelper(_config.default.baseStyles);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(o.name===e)return o.url}}catch(e){r.e(e)}finally{r.f()}return _config.default.baseStyles[0].url}catch(e){return console.error("Error dealing with map styles: ".concat(e.message)),null}}},{key:"addImageLayerICGC",value:function(e,t){try{var r,o,n;if(e.includes("orto")||e.includes("geol")||e.includes("relleu")){if(e.includes("orto"))if(void 0!==t){r=e+t;var a=_config.default.ortoLayersICGC.find(function(e){return e.key===r});a||console.log("❌ %c The layer: %c%s%c does not exist in the ICGC DB. Consult the documentation.","font-weight: bold; font-style: italic;","font-weight: normal; font-style: normal; color: red;",r,"font-weight: bold; font-style: italic;"),o=a.text,n="ortofoto_color_"+o;var i={id:r,tiles:"https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=".concat(n)};this.addLayerWMS(i)}else{var c={id:e+"Actual",tiles:"https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.png"};this.addLayerWMS(c)}if(e.includes("relleu")){var l={id:e+"Actual",tiles:"https://tilemaps.icgc.cat/mapfactory/wmts/relleu/CAT3857/{z}/{x}/{y}.png"};this.addLayerWMS(l)}if(e.includes("geol")){var s={id:e+"Actual",tiles:"https://tilemaps.icgc.cat/mapfactory/wmts/geologia/MON3857NW/{z}/{x}/{y}.png"};this.addLayerWMS(s)}}else console.log("❌ %c The layer: %c%s%c does not exist in the ICGC DB. Consult the documentation.","font-weight: bold; font-style: italic;","font-weight: normal; font-style: normal; color: red;",e,"font-weight: bold; font-style: italic;")}catch(e){console.error("Error adding ICGC image layer: ".concat(e.message))}}},{key:"addFGBLayerICGC",value:function(){function e(e,r){return t.apply(this,arguments)}var t=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,r){var o,n,a,i=this;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o=_config.default.vectorLayersICGC.find(function(e){return e.key.includes(t)}),o||console.log("❌ %c The layer: %c%s%c does not exist in the ICGC DB. Consult the documentation.","font-weight: bold; font-style: italic;","font-weight: normal; font-style: normal; color: red;",t,"font-weight: bold; font-style: italic;"),n=o.url,e.next=6,fetch(n);case 6:a=e.sent,this.map.on("load",_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,r,n,c,l,s,u,d;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t={type:"FeatureCollection",features:[]},r=!1,n=!1,e.prev=3,l=_asyncIterator(flatgeobuf.deserialize(a.body));case 5:return e.next=7,l.next();case 7:if(!(r=!(s=e.sent).done)){e.next=13;break}u=s.value,t.features.push(u);case 10:r=!1,e.next=5;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(3),n=!0,c=e.t0;case 19:if(e.prev=19,e.prev=20,!r||null==l.return){e.next=24;break}return e.next=24,l.return();case 24:if(e.prev=24,!n){e.next=27;break}throw c;case 27:return e.finish(24);case 28:return e.finish(19);case 29:d=o.name+"-source",i.map.addSource(d,{type:"geojson",data:t}),i.map.addLayer({id:o.name+"-fill",type:"fill",source:d,paint:{"fill-color":"#0000FF","fill-opacity":0}}),i.map.addLayer({id:o.name+"-line",type:"line",source:d,paint:{"line-color":"#FFFFFF","line-opacity":.49,"line-width":1}});case 33:case"end":return e.stop()}},e,null,[[3,15,19,29],[20,,24,28]])}))),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),console.error("Error adding ICGC vector layer: ".concat(e.t0.message));case 13:case"end":return e.stop()}},e,this,[[0,10]])}));return e}()},{key:"addTerrainICGC",value:function(e,t){var r=this;this.map.on("load",function(){try{var o=_config.default.urlTerrainICGC.find(function(t){return t.name===e}),n=o.url;r.map.addSource("terrainICGC-src",{type:"raster-dem",tiles:[n],tileSize:512,maxzoom:16}),r.map.setTerrain({source:"terrainMapZen",exaggeration:1.5}),r.map.setTerrain({source:"terrainICGC-src",exaggeration:1.5}),void 0===t&&(t="top-right"),map.addControl(new _Toggle3DControl.default({pitch:90,bearing:null,minpitchzoom:null}),t)}catch(e){console.error("Error adding 3D terrain: ".concat(e.message))}})}}]),e}();
59
+ },{"../config.js":2,"../controls/Toggle3DControl.js":3,"maplibre-gl":1}]},{},[4])(4)
58
60
  });
59
61
 
60
62