From dede3a910cc6a31306d8da4047b1e9d000f84ec4 Mon Sep 17 00:00:00 2001 From: Volodymyr Molchkov Volkogon Date: Tue, 4 Jun 2024 15:15:37 +0200 Subject: [PATCH 1/7] Arreglos de pruebas test/development --- mapea-js/test/development/adivina-municipio.js | 3 +++ mapea-js/test/development/jsts.js | 5 ++--- mapea-js/test/development/maxextent.js | 5 +++-- mapea-js/test/development/printer-layers.js | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mapea-js/test/development/adivina-municipio.js b/mapea-js/test/development/adivina-municipio.js index 7b714818..352899ad 100644 --- a/mapea-js/test/development/adivina-municipio.js +++ b/mapea-js/test/development/adivina-municipio.js @@ -99,6 +99,9 @@ layer.on(SelectFeaturesEvt, (features) => { }); window.resetea = () => { + anteriores.forEach((feat) => { + feat.setStyle(undefined); + }); anteriores = []; layer.setStyle(incognita); layer.redraw(); diff --git a/mapea-js/test/development/jsts.js b/mapea-js/test/development/jsts.js index da593274..6d08cf1c 100644 --- a/mapea-js/test/development/jsts.js +++ b/mapea-js/test/development/jsts.js @@ -4,8 +4,7 @@ import WFS from 'M/layer/WFS'; import GeoJSON from 'M/layer/GeoJSON'; import { SELECT_FEATURES } from 'M/event/eventtype'; import Feature from 'M/feature/Feature'; - -const jsts = require('jsts/dist/jsts.js'); +import { GeoJSONReader } from 'jsts/org/locationtech/jts/io'; const mapajs = map({ container: 'map', @@ -34,7 +33,7 @@ const lyEnvelope = new GeoJSON({ }); lyProvincias.on(SELECT_FEATURES, (features) => { - const parser = new jsts.io.GeoJSONReader(); + const parser = new GeoJSONReader(); const f = parser.read(features[0].getGeoJSON()); const objEnv = f.geometry.getEnvelopeInternal(); diff --git a/mapea-js/test/development/maxextent.js b/mapea-js/test/development/maxextent.js index 2072c9d6..02d7085f 100644 --- a/mapea-js/test/development/maxextent.js +++ b/mapea-js/test/development/maxextent.js @@ -26,8 +26,9 @@ window.mapjs = mapjs; // cargar/quitar wmc const maxExtent = [193104.52926740074, 4119420.5399687593, 287161.9825899291, 4164759.1717656343]; const wmc = new WMC('http://sigc.desarrollo.guadaltel.es/mapea5/files/wmc/wmcprueba.xml*prueba'); -const permeabilidad = new WMS('WMS*permeabilidad*http://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_Permeabilidad_Andalucia?*permeabilidad'); -const redesEnergeticas = new WMS('WMS*Redes*http://www.ideandalucia.es/wms/mta400v_2008?*Redes_energeticas*true'); +// const permeabilidad = new WMS('WMS*permeabilidad*http://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_Permeabilidad_Andalucia?*permeabilidad'); +const permeabilidad = new WMS('WMS*permeabilidad*http://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_zona_peligro_incendios_forestales?*REDIAM'); +const redesEnergeticas = new WMS('WMS*Redes*https://www.ideandalucia.es/wms/mta400v_2008?*Redes_energeticas*true'); const limites = new WMS('WMS*Limites*https://www.ideandalucia.es/wms/mta10v_2007?*Limites*true'); const canarias = new WMS('WMS*canarias*http://idecan2.grafcan.es/ServicioWMS/MOS?*WMS_MOS*true*false'); const toporaster = new WMTS('WMTS*http://www.ideandalucia.es/geowebcache/service/wmts?*toporaster'); diff --git a/mapea-js/test/development/printer-layers.js b/mapea-js/test/development/printer-layers.js index 8357c8aa..35107cc1 100644 --- a/mapea-js/test/development/printer-layers.js +++ b/mapea-js/test/development/printer-layers.js @@ -2,8 +2,8 @@ import Printerdos from 'plugins/printerdos/facade/js/printerdos'; // import WMS from 'M/layer/WMS'; // import GeoJSON from 'M/layer/GeoJSON'; // import LayerGroup from 'M/layer/LayerGroup'; -import WFS from 'M/layer/WFS'; import KML from 'M/layer/KML'; +import WFS from 'M/layer/WFS'; // import WMTS from 'M/layer/WMTS'; // import Point from 'M/style/Point'; // import Cluster from 'M/style/Cluster'; From 81eb27c5d3ab6082c926fdaba1e09addb87b61c6 Mon Sep 17 00:00:00 2001 From: Antonio Manuel Rebollar Marquez Date: Tue, 4 Jun 2024 13:28:48 +0200 Subject: [PATCH 2/7] Printerdos legacy --- .../printerdos/printerdos-4.2.2.min.css | 483 ++++++++++++++++++ .../printerdos/printerdos-4.2.2.ol.min.js | 1 + 2 files changed, 484 insertions(+) create mode 100644 mapea-legacy/plugins/printerdos/printerdos-4.2.2.min.css create mode 100644 mapea-legacy/plugins/printerdos/printerdos-4.2.2.ol.min.js diff --git a/mapea-legacy/plugins/printerdos/printerdos-4.2.2.min.css b/mapea-legacy/plugins/printerdos/printerdos-4.2.2.min.css new file mode 100644 index 00000000..25999fa4 --- /dev/null +++ b/mapea-legacy/plugins/printerdos/printerdos-4.2.2.min.css @@ -0,0 +1,483 @@ +/********************* + GENERAL +*********************/ + +.m-printer-container { + /*min-width: 200px;*/ + color: #404040; + width: 100%; +} + + +/********************* + PRINTER TITLE +*********************/ + +.m-printer-container>div.title { + line-height: 40px; + text-align: center; + height: 39px; + border-bottom: 1px solid rgba(0, 0, 0, 0.08); + font-size: 15px; +} + + +/********************* + PRINTER FORM +*********************/ + +.m-printer-container>div.form {} + +.m-printer-container>div.form>div { + margin-bottom: 10px; +} + + +/* TITLE & DESCRIPTION */ + +.m-printer-container>div.form>div.title, +.m-printer-container>div.form>div.description { + width: 90%; + margin: 10px auto; +} + +.m-printer-container>div.form>div.title>input, +.m-printer-container>div.form>div.description>textarea { + width: calc(100% - 10px); + min-width: 200px; + border: 1px solid #ccc; + border-radius: 4px; + margin: 0px; + padding: 5px; +} + +.m-printer-container>div.form>div.title>input { + height: 20px; +} + +.m-printer-container>div.form>div.description>textarea { + height: 50px; + font-family: 'Muli', 'sans-serif' !important; + font-size: 13px; +} + + +/* LAYOUT */ + +.m-printer-container>div.form>div.layout, +.m-printer-container>div.form>div.format { + width: 45%; + border-radius: 0px; + float: left; + text-align: right; + margin-left: 5%; +} + +.m-printer-container>div.form>div.layout>select, +.m-printer-container>div.form>div.dpi>select, +.m-printer-container>div.form>div.format>select { + height: 25px; + cursor: pointer; + padding-left: 5px; + width: 68%; + background-color: #fff; + border: 1px solid #ccc; + border-radius: 4px; + color: #6c6c6c; + font-family: 'Muli', 'sans-serif'; +} + +@media only screen and (max-width: 380px) { + + .m-printer-container>div.form>div.layout, + .m-printer-container>div.form>div.format, + .m-printer-container>div.form>div.dpi, + .m-printer-container>div.form>div.forcescale { + width: calc(100vw - 10%) !important; + margin-left: 5% !important; + text-align: left !important; + } + + .m-printer-container>div.form>div.layout label, + .m-printer-container>div.form>div.format label, + .m-printer-container>div.form>div.dpi label, + .m-printer-container>div.form>div.forcescale label { + margin-right: 10px; + } +} + + +/* DPI */ + +.m-printer-container>div.form>div.dpi, +.m-printer-container>div.form>div.forcescale { + width: 45%; + float: right; + border-radius: 0px; + text-align: right; + margin-right: 5%; +} + + +/* FORMAT */ + +.m-printer-container>div.form>div.format { + /* + width: 50%; + float: left; + border-radius: 0px; +*/ +} + + +/* FORCE SCALE */ + +.m-printer-container>div.form>div.forcescale { + /* + width: 50%; + float: right; + border-radius: 0px; +*/ +} + +/* TEXT WRAP*/ +.m-printer-container>div.form>div.textwrap { + width: 45%; + float: right; + border-radius: 0px; + text-align: right; + margin-right: 5%; + padding-top: 10px; + padding-bottom: 10px; +} + +.m-printer-container>div.form>div.textwrap>input[type=range] { + -webkit-appearance: none; + width: 30%; + height: 8px; +} + +.m-printer-container>div.form>div.textwrap>input[type=range]:focus { + outline: none; +} + +.m-printer-container>div.form>div.textwrap>input[type=range]::-webkit-slider-runnable-track { + width: 100%; + height: 2px; + cursor: pointer; + background: rgba(0, 0, 0, 0.31); + border-radius: 12px; +} + +.m-printer-container>div.form>div.textwrap>input[type=range]::-webkit-slider-thumb { + height: 10px; + width: 10px; + cursor: pointer; + border-radius: 15px; + background: #FFF; + -webkit-appearance: none; + margin-top: -4px; + background-color: #e7338c; +} + +/**************************** + FIREFOX HACKS +****************************/ +input[type="range"]::-moz-range-track { + width: 100%; + height: 2px; + cursor: pointer; + background: rgba(0, 0, 0, 0.31); + border-radius: 12px; +} + +input[type="range"]::-moz-range-thumb { + height: 10px; + width: 10px; + cursor: pointer; + border: none; + background: #FFF; + -webkit-appearance: none; + margin-top: 20px; + background-color: #e7338c; +} + + +/********************* + BUTTONS +*********************/ + +.m-printer-container>div.button { + width: 100%; + margin: 0 auto; + /* text-align: center; */ + display: table; + background-color: #eaeaea; +} + +.m-printer-container>div.button>button.print, +.m-printer-container>div.button>button.remove, +.m-printer-container>div.button>button.cancel { + border-radius: 4px; + border: 1px solid rgba(0, 0, 0, 0.4); + font-size: 15px; + line-height: 25px; + cursor: pointer; + opacity: 0.75; + -webkit-transition: opacity 0.25s ease 0s; + transition: opacity 0.25s ease 0s; + color: #404040; +} + +.m-printer-container>div.button>button.print:hover, +.m-printer-container>div.button>button.remove:hover, +.m-printer-container>div.button>button.cancel:hover { + opacity: 1; +} + +.m-printer-container>div.button>button.print:focus, +.m-printer-container>div.button>button.remove:focus, +.m-printer-container>div.button>button.cancel:focus { + outline: none; +} + +.m-printer-container>div.button>button.print:before, +.m-printer-container>div.button>button.remove:before, +.m-printer-container>div.button>button.cancel:before { + font-size: 21px; + margin-right: 10px; +} + +.m-printer-container>div.button>button.print { + width: 60%; + margin: 10px 5% 10px 5%; + padding: 5px; + background-color: #fff; + font-family: 'Muli', 'sans-serif' !important; + cursor: pointer; +} + +@-moz-document url-prefix() { + .m-printer-container>div.button>button.print { + margin: 10px 4% 10px 5%; + } +} + +.m-printer-container>div.button>button.remove { + width: 25%; + margin: 10px 5% 10px 0; + padding: 5px; + background-color: #fff; + font-family: 'Muli', 'sans-serif' !important; + cursor: pointer; +} + +.m-printer-container>div.button>button.cancel { + width: 45%; + margin: 10px 5% 10px 50%; + padding: 5px; + background-color: #fff; + font-family: 'Muli', 'sans-serif' !important; + cursor: pointer; +} + +.m-printer-container>div.button>button.print i, +.m-printer-container>div.button>button.remove i, +.m-printer-container>div.button>button.cancel i { + font-size: 20px; + vertical-align: text-bottom; +} + +.m-control>button { + color: #404040; +} + + +/********************* + QUEUE PANEL +*********************/ + +.m-printer-container>div.queue>div.title { + display: none; +} + +.m-printer-container>div.queue>ul.queue-container { + margin: 0px; + padding: 5px; +} + +@media only screen and (min-width: 769px) { + .m-printer-container>div.queue>ul.queue-container { + max-height: 20vh; + overflow: auto; + } +} + + +/********************* + QUEUE ELEM +*********************/ + +.m-printer-container>div.queue>ul.queue-container>li { + position: relative; + padding: 10px; + -webkit-transition: box-shadow 0.3s ease 0s, background 0.3s ease 0s, transform 0.05s ease 0s; + transition: box-shadow 0.3s ease 0s, background 0.3s ease 0s, transform 0.05s ease 0s; + cursor: pointer; + margin: 0px; + border-top: 1px solid rgba(0, 0, 0, 0.13); + box-sizing: border-box; + font-family: 'Muli', 'sans-serif' !important; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.m-printer-container>div.queue>ul.queue-container>li:after, +.m-printer-container>div.queue>ul.queue-container>li.printing:after { + position: absolute; + right: 15px; + font-size: 19px; + color: #e7338c; + font-family: 'g-cartografia' !important; +} + +.m-printer-container>div.queue>ul.queue-container>li:after { + content: "\e90e"; +} + +.m-printer-container>div.queue>ul.queue-container>li.printing:after { + /* border: 1px solid #A914DA;*/ + content: "\e950"; + -webkit-animation: mloading 1s linear infinite; + -moz-animation: mloading 1s linear infinite; + animation: mloading 1s linear infinite; +} + +.m-printer-container>div.queue>ul.queue-container>li:nth-child(1) { + border-top: 0px; +} + +.m-printer-container>div.queue>ul.queue-container>li.printing { + /* border: 1px solid #A914DA;*/ + cursor: inherit; + font-family: 'Muli', 'sans-serif' !important; +} + +.m-printer-container>div.queue>ul.queue-container>li:not(.printing):hover { + background-color: rgba(231, 51, 140, 0.1); + box-sizing: border-box; + border-bottom: 0; +} + + +/*************** + PANEL +***************/ + +.m-areas>div.m-area>div.m-panel.m-printer { + order: 3; + border-top-right-radius: 0px; +} + +.m-areas>div.m-area>div.m-panel.m-printer.opened { + border-top-left-radius: 0px; +} + +.m-areas>div.m-area>div.m-panel.m-printer.collapsed { + order: -98; + border-top-right-radius: 20px; +} + +.m-areas>div.m-area>div.m-panel.m-printer>button.m-panel-btn { + background-color: #e7338c; + position: absolute; + left: initial; + color: #fff; + z-index: 999999; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 -1px 0px rgba(0, 0, 0, 0.02); +} + +.m-areas>div.m-area>div.m-panel.m-printer.opened>button.m-panel-btn { + left: -40px; +} + +@media only screen and (max-width: 768px) { + .m-areas>div.m-area>div.m-panel.m-printer.opened>button.m-panel-btn { + background-color: transparent; + position: absolute; + right: 0; + left: initial; + color: #e7338c; + z-index: 999999; + box-shadow: none; + } +} + +.m-areas>div.m-area>div.m-panel.m-printer.collapsed>button.m-panel-btn { + color: #e7338c; + position: inherit; + right: 0; + box-shadow: none; +} + + +/* ANIMATIONS */ + +.m-areas>div.m-area>div.m-panel.m-printer { + -webkit-transition: max-height .33s ease-in-out 0s; + transition: max-height .33s ease-in-out 0s; + max-height: 100vh; +} + +.m-areas>div.m-area>div.m-panel.m-printer.collapsed { + -webkit-transition: max-height .33s ease-in-out 0s; + transition: max-height .33s ease-in-out 0s; + max-height: 40px; +} + +.m-areas>div.m-area>div.m-panel.m-printer>div.m-panel-controls { + -webkit-transition: max-width .5s ease 0s, opacity .44s ease 0s; + transition: max-width .5s ease 0s, opacity .44s ease 0s; + background: white; +} + +.m-printer-container>.results-panel>div.results { + -webkit-transition: max-height .33s ease-in-out 0s; + transition: max-height .33s ease-in-out 0s; +} + +.m-areas>div.m-area>div.m-panel.m-printer { + order: -98; +} + +.m-areas>div.m-area>div.m-panel.m-printer.opened { + width: 440px; +} + +@media only screen and (max-width: 768px) { + .m-areas>div.m-area>div.m-panel.m-printer.opened { + margin-left: 0; + width: 100vw; + height: 100vh; + position: fixed; + top: 0; + left: 0; + margin: 0; + z-index: 10000; + overflow: auto; + } +} + +.m-printer-container>div.form>div.textwrap>#label { + width: 30%; + float: right; + text-align: center; + font-size: 12px; + margin-top: 3px; +} diff --git a/mapea-legacy/plugins/printerdos/printerdos-4.2.2.ol.min.js b/mapea-legacy/plugins/printerdos/printerdos-4.2.2.ol.min.js new file mode 100644 index 00000000..406cfb83 --- /dev/null +++ b/mapea-legacy/plugins/printerdos/printerdos-4.2.2.ol.min.js @@ -0,0 +1 @@ +(()=>{var t={450:t=>{t.exports='
\n \x3c!-- TITLE --\x3e\n
Impresión del mapa
\n \x3c!-- FORM --\x3e\n
\n \x3c!-- title --\x3e\n
\n \n
\n \x3c!-- description --\x3e\n
\n \n
\n \x3c!-- layout --\x3e\n
\n \n \n
\n \x3c!-- DPI --\x3e\n
\n \n \n
\n \x3c!-- format --\x3e\n
\n \n \n
\n \x3c!-- force scale --\x3e\n
\n \n \n
\n \x3c!-- text wrap --\x3e\n
\n \n \n
{{textWrap}}
\n
\n
\n \x3c!-- buttons --\x3e\n
\n \n \n \n
\n \x3c!-- queue --\x3e\n
\n
Descargar
\n
    \n
    \n \x3c!-- minimize button --\x3e\n
    \n
    '}},e={};function i(l){var s=e[l];if(void 0!==s)return s.exports;var n=e[l]={exports:{}};return t[l](n,n.exports,i),n.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var l in e)i.o(e,l)&&!i.o(t,l)&&Object.defineProperty(t,l,{enumerable:!0,get:e[l]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";class t extends M.impl.Control{constructor(t={}){super(),this.facadeMap_=null,this.additionalOptsLabel_={},this.labeling_=t.labeling,M.utils.isNullOrEmpty(this.labeling_)?(this.additionalOptsLabel_.conflictResolution="false",this.additionalOptsLabel_.goodnessOfFit=.9):(M.utils.isNullOrEmpty(this.labeling_.allowOverruns)||(this.additionalOptsLabel_.allowOverruns=this.labeling_.allowOverruns),M.utils.isNullOrEmpty(this.labeling_.autoWrap)||(this.additionalOptsLabel_.autoWrap=this.labeling_.autoWrap),M.utils.isNullOrEmpty(this.labeling_.conflictResolution)?this.additionalOptsLabel_.conflictResolution="false":this.additionalOptsLabel_.conflictResolution=this.labeling_.conflictResolution,M.utils.isNullOrEmpty(this.labeling_.followLine)||(this.additionalOptsLabel_.followLine=this.labeling_.followLine),M.utils.isNullOrEmpty(this.labeling_.goodnessOfFit)?this.additionalOptsLabel_.goodnessOfFit=.9:this.additionalOptsLabel_.goodnessOfFit=this.labeling_.goodnessOfFit,M.utils.isNullOrEmpty(this.labeling_.group)||(this.additionalOptsLabel_.group=this.labeling_.group),M.utils.isNullOrEmpty(this.labeling_.maxDisplacement)||(this.additionalOptsLabel_.maxDisplacement=this.labeling_.maxDisplacement),M.utils.isNullOrEmpty(this.labeling_.spaceAround)||(this.additionalOptsLabel_.spaceAround=this.labeling_.spaceAround))}addTo(t,e){this.facadeMap_=t,this.element=e,super.addTo(t,e)}encodeLayer(t){return new Promise(((e,i)=>{t.type===M.layer.type.WMC||(t.type===M.layer.type.KML?e(this.encodeKML(t)):t.type===M.layer.type.WMS?e(this.encodeWMS(t)):t.type===M.layer.type.WFS||t.type===M.layer.type.GeoJSON?e(this.encodeWFS(t)):t.type===M.layer.type.WMTS?this.encodeWMTS(t).then((t=>{e(t)})):t instanceof M.layer.MVT?e(this.encodeMVT(t)):t.type===M.layer.type.MBtiles||(t.type===M.layer.type.OSM?e(this.encodeOSM(t)):t.type===M.layer.type.Mapbox?e(this.encodeMapbox(t)):(M.utils.isNullOrEmpty(t.type)&&M.layer.Vector,e(this.encodeWFS(t)))))}))}encodeLegend(t){let e=null;if(t.displayInLayerSwitcher){e={classes:[]};const i=new RegExp(`.*${M.Layer.LEGEND_DEFAULT}$`),l=new RegExp(`.*${M.Layer.LEGEND_ERROR}$`),s=t.getLegendURL();M.utils.isNullOrEmpty(s)||i.test(s)||l.test(s)||(e.classes[0]={name:t.name,icons:[t.getLegendURL()]},t instanceof M.layer.Vector&&delete e.classes[0].icons)}return e}encodeKML(t){let e=null;const i=t.getImpl().getOL3Layer(),l=i.getSource().getFeatures(),s=t.name,n=i.getOpacity(),o=new ol.format.GeoJSON;let a=this.facadeMap_.getBbox();a=[a.x.min,a.y.min,a.x.max,a.y.max];const r=this.facadeMap_.getMapImpl().getView().getResolution(),u=[];let p=1,c=1,g="";const d={},m={};let y,h,O=1;return l.forEach((t=>{const e=t.getGeometry();let i=t.get("styleUrl");M.utils.isNullOrEmpty(i)||(i=i.replace("#",""));const l=t.getStyle();if(!M.utils.isNullOrEmpty(l)){let s;try{s=l(t,r),Array.isArray(s)&&(s=s[0])}catch(e){s=l.call(t,r)[0]}if(!M.utils.isNullOrEmpty(s)){const l=s.getImage();let n,r=l.getImageSize();M.utils.isNullOrEmpty(r)&&(r=[64,64]),n="multipolygon"===t.getGeometry().getType().toLowerCase()?"polygon":"multipoint"===t.getGeometry().getType().toLowerCase()?"point":t.getGeometry().getType().toLowerCase();const f=s.getStroke();let _;const E={type:n,id:i,externalGraphic:l.getSrc(),graphicHeight:r[0],graphicWidth:r[1],graphicOpacity:l.getOpacity(),strokeWidth:f?f.getWidth():1},b=s.getText&&s.getText();if(M.utils.isNullOrEmpty(b)||(_={type:"text",label:M.utils.isNullOrEmpty(b.getText())?t.get("name"):b.getText(),fontColor:M.utils.isNullOrEmpty(b.getFill())?"":M.utils.rgbToHex(M.utils.isArray(b.getFill().getColor())?`rgba(${b.getFill().getColor().toString()})`:b.getFill().getColor()),fontSize:"11px",fontFamily:"Helvetica, sans-serif",fontWeight:"bold",conflictResolution:this.additionalOptsLabel_.conflictResolution,labelAlign:b.getTextAlign(),labelXOffset:b.getOffsetX(),labelYOffset:b.getOffsetY(),labelOutlineColor:M.utils.isNullOrEmpty(b.getStroke())?"":M.utils.rgbToHex(M.utils.isArray(b.getStroke().getColor())?`rgba(${b.getStroke().getColor().toString()})`:b.getStroke().getColor()),labelOutlineWidth:M.utils.isNullOrEmpty(b.getStroke())?"":b.getStroke().getWidth()},_.fontColor=_.fontColor.slice(0,7),_.labelOutlineColor=_.labelOutlineColor.slice(0,7),_=this.addAdditionalLabelOptions(_)),y=`draw${O}`,!M.utils.isNullOrEmpty(e)&&e.intersectsExtent(a)||!M.utils.isNullOrEmpty(b)){const i=JSON.stringify(E),l=JSON.stringify(_);let s=d[i],n=m[l];if(M.utils.isUndefined(s)||M.utils.isUndefined(n)){const t=[];let o=0;if(!M.utils.isNullOrEmpty(e)&&e.intersectsExtent(a)&&M.utils.isUndefined(s)&&(s=c,d[i]=s,o=1,t.push(i),c+=1,O+=1),!M.utils.isNullOrEmpty(b)&&M.utils.isUndefined(n)&&(n=p,m[l]=n,t.push(l),p+=1,0===o&&(O+=1,t.push(i))),void 0===s&&(s=0),void 0===n&&(n=0),h=`"[_gx_style ='${s+n}']"`,!M.utils.isNullOrEmpty(t)){const e=` ${h}:{"symbolizers": [${t}]}`;g+=""!==g?`,${e}`:`{${e},"version":"2"`}}const r=o.writeFeatureObject(t);r.properties={_gx_style:s+n,name:y},u.push(r)}}}}),this),g=""!==g?JSON.parse(g.concat("}")):{"*":{symbolizers:[]},version:"2"},e={type:"Vector",style:g,styleProperty:"_gx_style",geoJson:{type:"FeatureCollection",features:u},name:s,opacity:n},e}encodeWMS(t){let e=null;const i=t.getImpl().getOL3Layer(),l=t.url,s=i.getOpacity(),n=i.getSource().getParams(),o=[n.LAYERS],a=n.FORMAT,r=[n.STYLES];if(e={baseURL:l,opacity:s,type:"WMS",layers:o.join(",").split(","),format:a||"image/jpeg",styles:r.join(",").split(",")},t._updateNoCache){t._updateNoCache();const i=t.getNoCacheName(),l=t.getNoCacheUrl();M.utils.isNullOrEmpty(i)||M.utils.isNullOrEmpty(l)||(e.layers=[i],e.baseURL=l)}else{const i=t.getNoChacheName(),l=t.getNoChacheUrl();M.utils.isNullOrEmpty(i)||M.utils.isNullOrEmpty(l)||(e.layers=[i],e.baseURL=l)}return e.customParams={},Object.keys(n).forEach((t=>{-1!=="iswmc,transparent".indexOf(t.toLowerCase())&&(e.customParams[t]=n[t])})),e}encodeWFS(t){let e=null,i=!0;if((t.getStyle()instanceof M.style.Chart||t.getStyle()instanceof M.style.Cluster&&t.getStyle().getOldStyle()instanceof M.style.Chart)&&(i=!1),i){const i=this.facadeMap_.getProjection(),l=t.getImpl().getOL3Layer();let s=null;s=t.type===M.layer.type.MVT?t.getFeatures():l.getSource().getFeatures();const n=t.name,o=l.getOpacity(),a=l.getStyle(),r=new ol.format.GeoJSON;let u=this.facadeMap_.getBbox();u=[u.x.min,u.y.min,u.x.max,u.y.max];const p=this.facadeMap_.getMapImpl().getView().getResolution(),c=[];let g,d,m=1,y=1,h=1,O="";const f={},_={};s.forEach((e=>{const l=e.getGeometry();let s;const n=e.getStyle();M.utils.isNullOrEmpty(n)?M.utils.isNullOrEmpty(a)||(s=a):s=n,s instanceof Function&&(s=s.call(s,e,p));let o=null;if(s instanceof Array&&(s.length>1?(o=M.utils.isNullOrEmpty(s[1])||M.utils.isNullOrEmpty(s[1].getImage())||!s[1].getImage().getGlyph?null:s[1].getImage(),s=!M.utils.isNullOrEmpty(s[1].getImage())&&s[1].getImage().getSrc?s[1]:s[0]):s=s[0]),!M.utils.isNullOrEmpty(s)){const n=s.getImage(),a=M.utils.isNullOrEmpty(n)?[0,0]:n.getImageSize()||[24,24];let p,E=s.getText();M.utils.isNullOrEmpty(E)&&!M.utils.isNullOrEmpty(s.textPath)&&(E=s.textPath),p="multipolygon"===e.getGeometry().getType().toLowerCase()?"polygon":"multipoint"===e.getGeometry().getType().toLowerCase()?"point":"multilinestring"===e.getGeometry().getType().toLowerCase()?"line":e.getGeometry().getType().toLowerCase();const b=M.utils.isNullOrEmpty(n)?s.getStroke():n.getStroke&&n.getStroke(),x=M.utils.isNullOrEmpty(n)?s.getFill():n.getFill&&n.getFill();let N;const L=M.utils.isNullOrEmpty(n)?"":n.getRadius&&n.getRadius(),S={type:p,fillColor:M.utils.isNullOrEmpty(x)?"#000000":M.utils.rgbaToHex(x.getColor()).slice(0,7),fillOpacity:M.utils.isNullOrEmpty(x)?0:M.utils.getOpacityFromRgba(x.getColor()),strokeColor:M.utils.isNullOrEmpty(b)?"#000000":M.utils.rgbaToHex(b.getColor()),strokeOpacity:M.utils.isNullOrEmpty(b)?0:M.utils.getOpacityFromRgba(b.getColor()),strokeWidth:M.utils.isNullOrEmpty(b)?0:b.getWidth&&b.getWidth(),pointRadius:M.utils.isNullOrEmpty(n)?"":n.getRadius&&n.getRadius(),externalGraphic:M.utils.isNullOrEmpty(n)?"":n.getSrc&&n.getSrc(),graphicHeight:a[0],graphicWidth:a[1]};Number.isNaN(L)&&(S.fillOpacity=0,S.strokeOpacity=0,S.pointRadius=0);const v=!M.utils.isNullOrEmpty(o)&&o.getImage?o.getImage():null;if(M.utils.isNullOrEmpty(v)||(o.getRadius&&o.getRadius()&&(S.pointRadius=o.getRadius&&o.getRadius()),o.getOpacity&&o.getOpacity()&&(S.graphicOpacity=o.getOpacity()),S.externalGraphic=v.toDataURL()),!M.utils.isNullOrEmpty(E)){let t=E.getTextAlign(),e=E.getTextBaseline(),i="";M.utils.isNullOrEmpty(t)||(t=t===M.style.align.LEFT?"l":t===M.style.align.RIGHT?"r":t===M.style.align.CENTER?"c":""),M.utils.isNullOrEmpty(e)||(e=e===M.style.baseline.BOTTOM?"b":e===M.style.baseline.MIDDLE?"m":e===M.style.baseline.TOP?"t":""),M.utils.isNullOrEmpty(t)||M.utils.isNullOrEmpty(e)||(i=t.concat(e));const l=E.getFont(),s=!M.utils.isNullOrEmpty(l)&&l.indexOf("bold")>-1?"bold":"normal";let n="11px";if(!M.utils.isNullOrEmpty(l)){const t=l.substr(0,l.indexOf("px"));if(!M.utils.isNullOrEmpty(t)){const e=t.lastIndexOf(" ");n=e>-1?t.substr(e,t.length).trim().concat("px"):t.concat("px")}}N={type:"text",label:E.getText()||"",fontColor:M.utils.isNullOrEmpty(E.getFill())?"#000000":M.utils.rgbToHex(E.getFill().getColor()),fontSize:n,fontFamily:"Helvetica, sans-serif",fontStyle:"normal",fontWeight:s,conflictResolution:this.additionalOptsLabel_.conflictResolution,labelXOffset:E.getOffsetX(),labelYOffset:E.getOffsetY(),fillColor:S.fillColor||"#FF0000",fillOpacity:S.fillOpacity||1,labelOutlineColor:M.utils.isNullOrEmpty(E.getStroke())?"":M.utils.rgbToHex(E.getStroke().getColor()||"#FF0000"),labelOutlineWidth:M.utils.isNullOrEmpty(E.getStroke())?"":E.getStroke().getWidth(),labelAlign:i},N=this.addAdditionalLabelOptions(N)}if(g=`draw${m}`,!M.utils.isNullOrEmpty(l)&&l.intersectsExtent(u)||!M.utils.isNullOrEmpty(E)){const s=JSON.stringify(S),n=JSON.stringify(N);let o,a=f[s],p=_[n];if(M.utils.isUndefined(a)||M.utils.isUndefined(p)){const i=[];let o=0;if(!M.utils.isNullOrEmpty(l)&&l.intersectsExtent(u)&&M.utils.isUndefined(a)&&(a=h,f[s]=a,o=1,i.push(s),h+=1,m+=1),!M.utils.isNullOrEmpty(E)&&M.utils.isUndefined(p)&&(p=y,_[n]=p,i.push(n),y+=1,0===o&&(m+=1,i.push(s))),void 0===a&&(a=0),void 0===p&&(p=0),d=`"[_gx_style ='${a+p}']"`,!M.utils.isNullOrEmpty(i)){let l=` ${d}:{"symbolizers": [${i}]}`;if(t.getStyle()instanceof M.style.Proportional){const t=e.getGeometry().getType().toLocaleLowerCase();t.indexOf("polygon")>=0?l=l.replace("polygon","point"):t.indexOf("line")>=0&&(l=l.replace("line","point"))}l=l.replace("linestring","line"),O+=""!==O?`,${l}`:`{${l},"version":"2"`}}o="EPSG:3857"!==i.code&&this.facadeMap_.getLayers().some((t=>t.type===M.layer.type.OSM||t.type===M.layer.type.Mapbox))?r.writeFeatureObject(e,{featureProjection:i.code,dataProjection:"EPSG:3857"}):r.writeFeatureObject(e),o.properties={_gx_style:a+p,name:g},c.push(o)}}}),this),O=""!==O?JSON.parse(O.concat("}")):{"*":{symbolizers:[]},version:"2"},e={type:"Vector",style:O,styleProperty:"_gx_style",geoJson:{type:"FeatureCollection",features:c},name:n,opacity:o}}return e}encodeMVT(t){let e=null,i=!0;if((t.getStyle()instanceof M.style.Chart||t.getStyle()instanceof M.style.Cluster&&t.getStyle().getOldStyle()instanceof M.style.Chart)&&(i=!1),i){const i=t.getImpl().getOL3Layer(),l=t.getFeatures(),s=t.name,n=i.getOpacity(),o=i.getStyle();let a=this.facadeMap_.getBbox();a=[a.x.min,a.y.min,a.x.max,a.y.max];const r=this.facadeMap_.getMapImpl().getView().getResolution(),u=[];let p,c,g=1,d=1,m=1,y="";const h={},O={};l.forEach((e=>{const i=e.getImpl().getOLFeature().getGeometry();let l;const s=e.getImpl().getOLFeature().getStyleFunction();M.utils.isNullOrEmpty(s)?M.utils.isNullOrEmpty(o)||(l=o):l=s,l instanceof Function&&(l=l.call(l,e.getImpl().getOLFeature(),r));let n=null;if(l instanceof Array&&(l.length>1?(n=M.utils.isNullOrEmpty(l[1])||M.utils.isNullOrEmpty(l[1].getImage())||!l[1].getImage().getGlyph?null:l[1].getImage(),l=!M.utils.isNullOrEmpty(l[1].getImage())&&l[1].getImage().getSrc?l[1]:l[0]):l=l[0]),!M.utils.isNullOrEmpty(l)){const s=l.getImage(),o=M.utils.isNullOrEmpty(s)?[0,0]:s.getImageSize()||[24,24];let r,f=l.getText();M.utils.isNullOrEmpty(f)&&!M.utils.isNullOrEmpty(l.textPath)&&(f=l.textPath),r="multipolygon"===i.getType().toLowerCase()?"polygon":"multipoint"===i.getType().toLowerCase()?"point":"multilinestring"===i.getType().toLowerCase()?"line":i.getType().toLowerCase();const _=M.utils.isNullOrEmpty(s)?l.getStroke():s.getStroke&&s.getStroke(),E=M.utils.isNullOrEmpty(s)?l.getFill():s.getFill&&s.getFill();let b;const x=M.utils.isNullOrEmpty(s)?"":s.getRadius&&s.getRadius(),N={type:r,fillColor:M.utils.isNullOrEmpty(E)?"#000000":M.utils.rgbaToHex(E.getColor()).slice(0,7),fillOpacity:M.utils.isNullOrEmpty(E)?0:M.utils.getOpacityFromRgba(E.getColor()),strokeColor:M.utils.isNullOrEmpty(_)?"#000000":M.utils.rgbaToHex(_.getColor()),strokeOpacity:M.utils.isNullOrEmpty(_)?0:M.utils.getOpacityFromRgba(_.getColor()),strokeWidth:M.utils.isNullOrEmpty(_)?0:_.getWidth&&_.getWidth(),pointRadius:M.utils.isNullOrEmpty(s)?"":s.getRadius&&s.getRadius(),externalGraphic:M.utils.isNullOrEmpty(s)?"":s.getSrc&&s.getSrc(),graphicHeight:o[0],graphicWidth:o[1]};Number.isNaN(x)&&(N.fillOpacity=0,N.strokeOpacity=0,N.pointRadius=0);const L=!M.utils.isNullOrEmpty(n)&&n.getImage?n.getImage():null;if(M.utils.isNullOrEmpty(L)||(n.getRadius&&n.getRadius()&&(N.pointRadius=n.getRadius&&n.getRadius()),n.getOpacity&&n.getOpacity()&&(N.graphicOpacity=n.getOpacity()),N.externalGraphic=L.toDataURL()),!M.utils.isNullOrEmpty(f)){let t=f.getTextAlign(),e=f.getTextBaseline(),i="";M.utils.isNullOrEmpty(t)||(t=t===M.style.align.LEFT?"l":t===M.style.align.RIGHT?"r":t===M.style.align.CENTER?"c":""),M.utils.isNullOrEmpty(e)||(e=e===M.style.baseline.BOTTOM?"b":e===M.style.baseline.MIDDLE?"m":e===M.style.baseline.TOP?"t":""),M.utils.isNullOrEmpty(t)||M.utils.isNullOrEmpty(e)||(i=t.concat(e));const l=f.getFont(),s=!M.utils.isNullOrEmpty(l)&&l.indexOf("bold")>-1?"bold":"normal";let n="11px";if(!M.utils.isNullOrEmpty(l)){const t=l.substr(0,l.indexOf("px"));if(!M.utils.isNullOrEmpty(t)){const e=t.lastIndexOf(" ");n=e>-1?t.substr(e,t.length).trim().concat("px"):t.concat("px")}}b={type:"text",label:f.getText()||"",fontColor:M.utils.isNullOrEmpty(f.getFill())?"#000000":M.utils.rgbToHex(f.getFill().getColor()),fontSize:n,fontFamily:"Helvetica, sans-serif",fontStyle:"normal",fontWeight:s,conflictResolution:this.additionalOptsLabel_.conflictResolution,labelXOffset:f.getOffsetX(),labelYOffset:f.getOffsetY(),fillColor:N.fillColor||"#FF0000",fillOpacity:N.fillOpacity||1,labelOutlineColor:M.utils.isNullOrEmpty(f.getStroke())?"":M.utils.rgbToHex(f.getStroke().getColor()||"#FF0000"),labelOutlineWidth:M.utils.isNullOrEmpty(f.getStroke())?"":f.getStroke().getWidth(),labelAlign:i},b=this.addAdditionalLabelOptions(b)}p=`draw${g}`;const S=i.getExtent();if(!M.utils.isNullOrEmpty(i)&&ol.extent.intersects(a,S)||!M.utils.isNullOrEmpty(f)){const l=JSON.stringify(N),s=JSON.stringify(b);let n=h[l],o=O[s];if(M.utils.isUndefined(n)||M.utils.isUndefined(o)){const r=[];let u=0;if(!M.utils.isNullOrEmpty(i)&&ol.extent.intersects(a,S)&&M.utils.isUndefined(n)&&(n=m,h[l]=n,u=1,r.push(l),m+=1,g+=1),!M.utils.isNullOrEmpty(f)&&M.utils.isUndefined(o)&&(o=d,O[s]=o,r.push(s),d+=1,0===u&&(g+=1,r.push(l))),void 0===n&&(n=0),void 0===o&&(o=0),c=`"[_gx_style ='${n+o}']"`,!M.utils.isNullOrEmpty(r)){let i=` ${c}:{"symbolizers": [${r}]}`;if(t.getStyle()instanceof M.style.Proportional){const t=e.getGeometry().getType().toLocaleLowerCase();t.indexOf("polygon")>=0?i=i.replace("polygon","point"):t.indexOf("line")>=0&&(i=i.replace("line","point"))}i=i.replace("linestring","line"),y+=""!==y?`,${i}`:`{${i},"version":"2"`}}let _=i.getFlatCoordinates();if(_=this.inflCoordArray(r,_.slice(),0,i.getEnds(),2),_.length>0){const t={id:e.getId(),type:"Feature",geometry:{type:i.getType(),coordinates:_}};t.properties={_gx_style:n+o,name:p},u.push(t)}}}}),this),y=""!==y?JSON.parse(y.concat("}")):{"*":{symbolizers:[]},version:"2"},e={type:"Vector",style:y,styleProperty:"_gx_style",geoJson:{type:"FeatureCollection",features:u},name:s,opacity:n}}return e}inflCoordinates(t,e,i,l,s){const n=void 0!==s?s:[];let o=0;for(let s=e;s=2||"polygon"===t&&u.length>3)&&(o[a++]=u),i=r}return o.length=a,"line"!==t&&"linestring"!==t||1!==o.length||(o=o[0]),o}inflateMultiCoordinatesArray(t,e,i,l,s){const n=void 0!==s?s:[];let o=0;for(let s=0,a=i.length;s{const e=t.Contents.TileMatrixSet.filter((t=>t.Identifier===m))[0];return{baseURL:a,opacity:u,singleTile:!c,type:"WMTS",layer:r,requestEncoding:p,tileSize:y,style:M.utils.isNullOrEmpty(o)?"default":o,rotation:0,imageFormat:"image/png",dimensionParams:{},dimensions:[],params:d,version:"1.0.0",maxExtent:g,matrixSet:m,matrices:e.TileMatrix.map(((t,e)=>({identifier:t.Identifier,matrixSize:[t.MatrixWidth,t.MatrixHeight],scaleDenominator:t.ScaleDenominator,tileSize:[t.TileWidth,t.TileHeight],topLeftCorner:t.TopLeftCorner}))),resolutions:h}}))}encodeOSM(t){let e=null;const i=t.getImpl(),l=i.getOL3Layer(),s=l.getSource().getTileGrid(),n=t.url||"http://tile.openstreetmap.org/",o=t.name,a=l.getOpacity(),r=i.tiled,u=s.getExtent(),p=s.getTileSize();return e={baseURL:n,opacity:a,singleTile:!r,layer:o,maxExtent:u,tileSize:[p,p],resolutions:s.getResolutions(),type:"OSM",imageExtension:"png"},e}encodeMapbox(t){let e=null;const i=t.getImpl().getOL3Layer(),l=i.getSource().getTileGrid(),s=M.utils.concatUrlPaths([M.config.MAPBOX_URL,t.name]),n=i.getOpacity(),o=l.getExtent(),a=l.getTileSize(),r=l.getResolutions(),u={};return u[M.config.MAPBOX_TOKEN_NAME]=M.config.MAPBOX_TOKEN_VALUE,e={opacity:n,baseURL:s,customParams:u,maxExtent:o,tileSize:[a,a],resolutions:r,extension:M.config.MAPBOX_EXTENSION,type:"osm",path_format:"/${z}/${x}/${y}.png"},e}transformExt(t,e,i){return ol.proj.transformExtent(t,e,i)}addAdditionalLabelOptions(t){const e=t;return M.utils.isNullOrEmpty(this.additionalOptsLabel_.allowOverruns)||(e.allowOverruns=this.additionalOptsLabel_.allowOverruns),M.utils.isNullOrEmpty(this.additionalOptsLabel_.autoWrap)||(e.autoWrap=this.additionalOptsLabel_.autoWrap),M.utils.isNullOrEmpty(this.additionalOptsLabel_.followLine)||(e.followLine=this.additionalOptsLabel_.followLine),M.utils.isNullOrEmpty(this.additionalOptsLabel_.goodnessOfFit)||(e.goodnessOfFit=this.additionalOptsLabel_.goodnessOfFit),M.utils.isNullOrEmpty(this.additionalOptsLabel_.group)||(e.group=this.additionalOptsLabel_.group),M.utils.isNullOrEmpty(this.additionalOptsLabel_.maxDisplacement)||(e.maxDisplacement=this.additionalOptsLabel_.maxDisplacement),M.utils.isNullOrEmpty(this.additionalOptsLabel_.spaceAround)||(e.spaceAround=this.additionalOptsLabel_.spaceAround),e}setGoodnessOfFit(t){this.additionalOptsLabel_.goodnessOfFit=t}destroy(){this.facadeMap_.getMapImpl().removeControl(this),this.facadeMap_=null}}var e=i(450),l=i.n(e);const s="Error de conexión",n="No se ha podido conectar con el servicio de impresión";class o extends M.Control{constructor(e,i,l){super(new t(l),o.NAME),M.utils.isUndefined(t)&&M.exception("La implementación usada no puede crear controles Printer"),M.utils.isUndefined(t.prototype.encodeLayer)&&M.exception("La implementación usada no posee el método encodeLayer"),M.utils.isUndefined(t.prototype.encodeLegend)&&M.exception("La implementación usada no posee el método encodeLegend"),this.url_=e,this.ref_=null,this.printing_=!1,this.inputTitle_=null,this.areaDescription_=null,this.layout_=null,this.format_=null,this.dpi_=null,this.forceScale_=null,this.textWrap_=null,this.params_=i||{},this.queueContainer_=null,this.capabilitiesPromise_=null,this.connectionTimeout_=l.connectionTimeout||15,this.loadingService=!0,this.errorService=!1,this.outputFormats_=Array.isArray(l.outputFormats)?l.outputFormats:["pdf","png","jpg"],this.options_=l||{},M.utils.isNullOrEmpty(this.options_.layout)&&(this.options_.layout=M.config.geoprint.TEMPLATE),M.utils.isNullOrEmpty(this.options_.dpi)&&(this.options_.dpi=M.config.geoprint.DPI),M.utils.isNullOrEmpty(this.options_.format)&&(this.options_.format=M.config.geoprint.FORMAT),M.utils.isNullOrEmpty(this.options_.forceScale)&&(this.options_.forceScale=M.config.geoprint.FORCE_SCALE),M.utils.isNullOrEmpty(this.options_.legend)&&(this.options_.legend=M.config.geoprint.LEGEND),M.utils.isNullOrEmpty(this.options_.labeling)?this.options_.labeling={goodnessOfFit:.9}:M.utils.isNullOrEmpty(this.options_.labeling.goodnessOfFit)&&(this.options_.labeling.goodnessOfFit=.9)}getStatus(t,e){M.remote.get(t).then((i=>{const l=JSON.parse(i.text),{status:s}=l;"finished"===s?e():"error"===s?(e(),M.dialog.error("Se ha producido un error en la impresión")):!1===this.printing_?(M.dialog.error("Se ha cancelado la impresión"),this.queueContainer_.lastChild.remove()):setTimeout((()=>this.getStatus(t,e)),1e3)}))}open(){if(this.loadingService)M.dialog.error("El servicio aún no ha cargado","Servicio cargando");else if(this.errorService)M.dialog.error(n,s);else{const t=this.getPanel().getTemplatePanel(),e=this.getPanel().getButtonPanel();t.classList.remove("collapsed"),e.classList.remove("g-cartografia-impresora"),t.classList.add("opened"),e.classList.add("g-cartografia-flecha-derecha"),this.getPanel().setCollapsed(!1),this.getPanel().fire(M.evt.SHOW)}}createView(t){return this.getPanel().open=this.open.bind(this),new Promise(((t,e)=>{this.getCapabilities().then((e=>{const i=e;let s,n,o=0;for(i.layouts=i.layouts.filter((t=>!t.name.endsWith("jpg"))),o=0,s=i.layouts.length;o{const e={name:t};return t===this.options_.format&&(e.default=!0),e})),M.template.compileSync||(M.template.compileSync=(t,e)=>{let i,l,s={};M.utils.isUndefined(e)||(s=M.utils.extends(s,e.vars),l=e.parseToHtml);const n=Handlebars.compile(t)(s);return i=!1!==l?M.utils.stringToHtml(n):n,i}),i.forceScale=this.options_.forceScale,i.textWrap=this.options_.labeling.goodnessOfFit;const a=M.template.compileSync(l(),{jsonp:!0,vars:i});this.addEvents(a),this.loadingService=!1,t(a)})).catch((t=>{this.loadingService=!1,this.errorService=!0,M.dialog.error(n,s)}))}))}addEvents(t){this.element_=t,this.inputTitle_=this.element_.querySelector(".form div.title > input"),this.areaDescription_=this.element_.querySelector(".form div.description > textarea");const e=this.element_.querySelector(".form div.layout > select");e.addEventListener("change",(t=>{const i=e.value;this.setLayout({value:i,name:i})}));const i=e.value;this.setLayout({value:i,name:i});const l=this.element_.querySelector(".form div.dpi > select");l.addEventListener("change",(t=>{const e=l.value;this.setDpi({value:e,name:e})}));const s=l.value;this.setDpi({value:s,name:s});const n=this.element_.querySelector(".form div.format > select");n.addEventListener("change",(t=>{this.setFormat(n.value)})),this.setFormat(n.value);const o=this.element_.querySelector(".form div.forcescale > input");o.addEventListener("click",(t=>{this.setForceScale(!0===o.checked)})),this.setForceScale(!0===o.checked);const a=this.element_.querySelector(".form div.textwrap > input");a.addEventListener("change",(t=>{this.setTextWrap(parseFloat(a.value))})),this.element_.querySelector(".button > button.print").addEventListener("click",this.printClick_.bind(this)),this.element_.querySelector(".button > button.cancel").addEventListener("click",this.cancelClick_.bind(this)),this.element_.querySelector(".button > button.remove").addEventListener("click",(t=>{t.preventDefault(),this.inputTitle_.value="",this.areaDescription_.value="",e.value=this.options_.layout,l.value=this.options_.dpi,n.value=this.options_.format,o.checked=this.options_.forceScale,a.value=this.options_.labeling.textWrap;const i=document.createEvent("HTMLEvents");i.initEvent("change");const s=document.createEvent("HTMLEvents");s.initEvent("click"),e.dispatchEvent(i),l.dispatchEvent(i),n.dispatchEvent(i),o.dispatchEvent(s),a.dispatchEvent(i),Array.prototype.forEach.apply(this.queueContainer_.children,[t=>{t.removeEventListener("click",this.dowloadPrint)},this]),this.queueContainer_.innerHTML=""})),this.queueContainer_=this.element_.querySelector(".queue > ul.queue-container"),M.utils.enableTouchScroll(this.queueContainer_)}setLayout(t){this.layout_=t}setFormat(t){this.format_=t}setDpi(t){this.dpi_=t}setForceScale(t){this.forceScale_=t}setTextWrap(t){this.textwrap_=t,this.getImpl().setGoodnessOfFit(t);const e=this.getPanel().getTemplatePanel(),i=e.querySelector("#label"),l=e.querySelector("#inputRange");i.innerHTML=l.value}printClick_(t){t.preventDefault(),this.getPrintData().then((t=>{let e=M.utils.concatUrlPaths([this.url_,`report.${t.outputFormat}`]);const i=this.createQueueElement();this.queueContainer_.appendChild(i),i.classList.add(o.LOADING_CLASS),e=M.utils.addParameters(e,"mapeaop=geoprint"),M.remote.post(e,t).then((t=>{let e=t;const l=JSON.parse(e.text);this.ref_=l.ref;const s=M.utils.concatUrlPaths([this.params_.urlApplication,"print/status",`${this.ref_}.json`]);if(this.printing_=!0,this.getStatus(s,(()=>i.classList.remove(o.LOADING_CLASS))),200===e.code){let t;try{e=JSON.parse(e.text);const i=e.downloadURL.split("@")[1],l=e.downloadURL.substring(e.downloadURL.indexOf("/print"),e.downloadURL.length);t=M.utils.concatUrlPaths([this.params_.urlApplication,`${l};GEOPRID=.${i}`])}catch(t){M.exception(t)}i.setAttribute(o.DOWNLOAD_ATTR_NAME,t),i.addEventListener("click",this.dowloadPrint)}else M.dialog.error("Se ha producido un error en la impresión")}))}))}cancelClick_(t){t.preventDefault(),this.printing_=!1}getCapabilities(){return M.utils.isNullOrEmpty(this.capabilitiesPromise_)&&(this.capabilitiesPromise_=new Promise(((t,e)=>{setTimeout((()=>{const t=new Error("CONNECTION TIMEOUT");e(t)}),1e3*this.connectionTimeout_);const i=M.utils.concatUrlPaths([this.url_,"capabilities.json"]);M.remote.get(i).then((e=>{let i={};try{i=JSON.parse(e.text)}catch(t){M.exception(t)}t(i)}))}))),this.capabilitiesPromise_}getPrintData(){const t=this.inputTitle_.value,e=this.areaDescription_.value,i=this.map_.getProjection().code;let l=this.layout_.name;const s=this.dpi_.value,n=this.format_,o=this.map_.getCenter(),a=this.params_.parameters,r=this.options_.legend;"jpg"===n&&(l+=" jpg");const u=M.utils.extend({layout:l,outputFormat:n,attributes:{title:t,description:e,epsg:i,map:{useAdjustBounds:!0,projection:i,dpi:s}}},this.params_.layout);return this.encodeLayers().then((t=>{if(u.attributes.map.layers=t,u.attributes=Object.assign(u.attributes,a),r){const t=[],e=this.encodeLegends();for(let i=0,l=e.length;it.type===M.layer.type.OSM||t.type===M.layer.type.Mapbox))&&(u.attributes.map.projection="EPSG:3857"),!1===this.forceScale_){const t=this.map_.getBbox();u.attributes.map.bbox=[t.x.min,t.y.min,t.x.max,t.y.max],"EPSG:3857"!==i&&this.map_.getLayers().some((t=>t.type===M.layer.type.OSM||t.type===M.layer.type.Mapbox))&&(u.attributes.map.bbox=this.getImpl().transformExt(u.attributes.map.bbox,i,"EPSG:3857"))}else!0===this.forceScale_&&(u.attributes.map.center=[o.x,o.y],u.attributes.map.scale=this.map_.getScale());return u}))}encodeLayers(){const t=this.map_.getLayers().filter((t=>!0===t.isVisible()&&!0===t.inRange()&&M.utils.isString(t.name)&&!t.name.startsWith("cluster_cover")));let e=t.length;return new Promise(((i,l)=>{let s=[];const n=[];t.forEach((t=>{this.getImpl().encodeLayer(t).then((l=>{if(M.utils.isNullOrEmpty(l)||"Vector"===l.type){const e=this.map_.getMapImpl().getView().getResolution(),i=t.getImpl().getOL3Layer().getMaxResolution();e>=t.getImpl().getOL3Layer().getMinResolution()&&e<=i&&n.push(l)}else s.push(l);e-=1,0===e&&(s=s.concat(n),i(s.reverse()))}))}))}))}encodeLegends(){const t=[];return this.map_.getLayers().forEach((e=>{if(!0===e.isVisible()&&!0===e.inRange()){const i=this.getImpl().encodeLegend(e);null!==i&&t.push(i)}}),this),t}createQueueElement(){const t=document.createElement("li");let e=this.inputTitle_.value;return M.utils.isNullOrEmpty(e)&&(e=o.NO_TITLE),t.innerHTML=e,t}dowloadPrint(t){t.preventDefault();const e=this.getAttribute(o.DOWNLOAD_ATTR_NAME);M.utils.isNullOrEmpty(e)||window.open(e,"_blank")}equals(t){let e=!1;return t instanceof o&&(e=this.name===t.name),e}}o.NAME="printercontrol",o.TEMPLATE="printer.html",o.LOADING_CLASS="printing",o.DOWNLOAD_ATTR_NAME="data-donwload-url-print",o.NO_TITLE="(Sin título)";const a=JSON.parse('{"Pu":{"uuid_plugin":"","uuid_version_plugin":"","version_ficha_metadatos":"","name":"Printer","description":"Tool for printing maps.","text":"","version":"4.2.2","date":"06/11/2023","author":"Junta de Andalucía","org":"Junta de Andalucía","tags":"mapea,plugin","icon":"./facade/assets/icons/icons.svg","buttons":[{"title":"","description":"","querySelector":""},{"title":"","description":"","querySelector":""}],"dependencies":{"modules":["",""],"plugins":[{"uuid":"","name":""}],"services":[{"name":"","description":""}]},"compatibility":["4","5","6"]}}');class r extends M.Plugin{constructor(t={}){super(null),this.map_=null,this.control_=null,this.panel_=null,this.name=r.NAME,M.utils.isUndefined(M.config.geoprint2)&&M.config("geoprint2",{URL:"https://geoprint-sigc.juntadeandalucia.es/geoprint3/print/SIGC",URL_APPLICATION:"https://geoprint-sigc.juntadeandalucia.es/geoprint3"}),this.url_=M.config.geoprint2.URL,M.utils.isNullOrEmpty(t.url)||(this.url_=t.url),this.params_={urlApplication:M.config.geoprint2.URL_APPLICATION,layout:{outputFilename:"mapea_${yyyy-MM-dd_hhmmss}"}},M.utils.isNullOrEmpty(t.params)||(this.params_=t.params,M.utils.isNullOrEmpty(this.params_.urlApplication)&&(this.params_.urlApplication=M.config.geoprint2.URL_APPLICATION),M.utils.isNullOrEmpty(this.params_.layout)&&(this.params_.layout={outputFilename:"mapea_${yyyy-MM-dd_hhmmss}"})),this.options_={},M.utils.isNullOrEmpty(t.options)||(this.options_=t.options),this.metadata_=a.Pu}addTo(t){this.map_=t,this.control_=new o(this.url_,this.params_,this.options_),this.panel_=new M.ui.Panel("printer",{collapsible:!0,className:"m-printer",collapsedButtonClass:"g-cartografia-impresora",position:M.ui.position.TR,tooltip:"Impresión del mapa"}),this.panel_.on(M.evt.ADDED_TO_MAP,(t=>{M.utils.enableTouchScroll(t)})),this.panel_.addControls(this.control_),this.map_.addPanels(this.panel_),this.control_.on(M.evt.ADDED_TO_MAP,(()=>{this.fire(M.evt.ADDED_TO_MAP)}))}getControls(){const t=[];return t.push(this.control_),t}destroy(){this.map_.removeControls([this.control_]),this.map_=null,this.control_=null,this.panel_=null,this.url_=null,this.params_=null,this.options_=null,this.name=null}equals(t){return t instanceof r}getAPIRest(){return`printer=${this.url_}`}getMetadata(){return this.metadata_}}r.NAME="printer",null==window.M.plugin&&(window.M.plugin={}),window.M.plugin.Printer=r})()})(); \ No newline at end of file From 53adfd721b56a8a612e57241d2f55bf391eb1ca2 Mon Sep 17 00:00:00 2001 From: Antonio Manuel Rebollar Marquez Date: Wed, 5 Jun 2024 10:46:28 +0200 Subject: [PATCH 3/7] #315844 [8] se controlla null en zoomToSelected --- .../facade/js/attributetableControl.js | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/mapea-js/src/plugins/attributetable/facade/js/attributetableControl.js b/mapea-js/src/plugins/attributetable/facade/js/attributetableControl.js index 5fa6dd74..8bceba48 100644 --- a/mapea-js/src/plugins/attributetable/facade/js/attributetableControl.js +++ b/mapea-js/src/plugins/attributetable/facade/js/attributetableControl.js @@ -152,15 +152,20 @@ export default class AttributeTableControl extends M.Control { zoomToSelected(evt) { const zoomTo = []; - this.layer_.getFeatures().forEach((feature) => { - if (this.featuresSeleccionados.includes(feature.getId())) { - zoomTo.push(feature); + if (this.layer_) { + this.layer_.getFeatures().forEach((feature) => { + if (this.featuresSeleccionados.includes(feature.getId())) { + zoomTo.push(feature); + } + }); + const pcode = this.facadeMap_.getProjection().code; + const extent = M.impl.utils.getFeaturesExtent(zoomTo, pcode); + if (!M.utils.isNullOrEmpty(extent)) { + this.facadeMap_.setBbox(extent); } - }); - const pcode = this.facadeMap_.getProjection().code; - const extent = M.impl.utils.getFeaturesExtent(zoomTo, pcode); - if (!M.utils.isNullOrEmpty(extent)) { - this.facadeMap_.setBbox(extent); + } else { + // eslint-disable-next-line no-console + console.error('No hay mapa asociado al control de tabla de atributos.'); } } From 2846922469e97cc8b3b7c733fd60c3cba0b6033c Mon Sep 17 00:00:00 2001 From: Antonio Manuel Rebollar Marquez Date: Wed, 5 Jun 2024 10:47:33 +0200 Subject: [PATCH 4/7] #315844 [7] se controllan valores negativos en acceso a array --- mapea-js/src/facade/js/style/Quantification.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mapea-js/src/facade/js/style/Quantification.js b/mapea-js/src/facade/js/style/Quantification.js index a991641f..361e445b 100644 --- a/mapea-js/src/facade/js/style/Quantification.js +++ b/mapea-js/src/facade/js/style/Quantification.js @@ -149,7 +149,7 @@ const jenksBreaks = (data, lowerClassLimits, nClasses) => { // the lowerClassLimits matrix is used as indexes into itself // here: the `k` variable is reused in each iteration. while (countNum > 1) { - kclass[countNum - 1] = data[lowerClassLimits[k][countNum] - 2]; + kclass[countNum - 1] = data[Math.max(0, lowerClassLimits[k][countNum] - 2)]; k = lowerClassLimits[k][countNum] - 1; countNum -= 1; } @@ -186,6 +186,7 @@ export const JENKS = (numberClassesParam) => { const breaks = jenksBreaks(data, lowerClassLimits, nclasses); // No cogemos el minimo const breakPoints = breaks.slice(1, breaks.length); + console.log(breakPoints); return breakPoints; }; From c1bee6b5f86d81100d0026651c88a49718431f10 Mon Sep 17 00:00:00 2001 From: Antonio Manuel Rebollar Marquez Date: Wed, 5 Jun 2024 11:01:02 +0200 Subject: [PATCH 5/7] #315844 [10] se controla que M.style no exista y se avisa --- mapea-js/src/facade/js/style/Generic.js | 2 +- mapea-js/src/facade/js/style/Line.js | 2 +- mapea-js/src/facade/js/style/Point.js | 2 +- mapea-js/src/facade/js/style/Polygon.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mapea-js/src/facade/js/style/Generic.js b/mapea-js/src/facade/js/style/Generic.js index b6bcdf98..47f17d80 100644 --- a/mapea-js/src/facade/js/style/Generic.js +++ b/mapea-js/src/facade/js/style/Generic.js @@ -45,7 +45,7 @@ class Generic extends Simple { * @private */ getDeserializedMethod_() { - return "((serializedParameters) => M.style.Simple.deserialize(serializedParameters, 'M.style.Generic'))"; + return "((serializedParameters) => M.style ? M.style.Simple.deserialize(serializedParameters, 'M.style.Generic') : console.error('M.style is not defined'))"; } } diff --git a/mapea-js/src/facade/js/style/Line.js b/mapea-js/src/facade/js/style/Line.js index 89f28d1e..fb619a6d 100644 --- a/mapea-js/src/facade/js/style/Line.js +++ b/mapea-js/src/facade/js/style/Line.js @@ -48,7 +48,7 @@ class Line extends Simple { * @private */ getDeserializedMethod_() { - return "((serializedParameters) => M.style.Simple.deserialize(serializedParameters, 'M.style.Line'))"; + return "((serializedParameters) => M.style ? M.style.Simple.deserialize(serializedParameters, 'M.style.Line') : console.error('M.style is not defined'))"; } } diff --git a/mapea-js/src/facade/js/style/Point.js b/mapea-js/src/facade/js/style/Point.js index f3ebf2df..9de16f71 100644 --- a/mapea-js/src/facade/js/style/Point.js +++ b/mapea-js/src/facade/js/style/Point.js @@ -45,7 +45,7 @@ class Point extends Simple { * @private */ getDeserializedMethod_() { - return "((serializedParameters) => M.style.Simple.deserialize(serializedParameters, 'M.style.Point'))"; + return "((serializedParameters) => M.style ? M.style.Simple.deserialize(serializedParameters, 'M.style.Point') : console.error('M.style is not defined'))"; } } diff --git a/mapea-js/src/facade/js/style/Polygon.js b/mapea-js/src/facade/js/style/Polygon.js index c6465897..024d6558 100644 --- a/mapea-js/src/facade/js/style/Polygon.js +++ b/mapea-js/src/facade/js/style/Polygon.js @@ -37,7 +37,7 @@ class Polygon extends Simple { * @private */ getDeserializedMethod_() { - return "((serializedParameters) => M.style.Simple.deserialize(serializedParameters, 'M.style.Polygon'))"; + return "((serializedParameters) => M.style ? M.style.Simple.deserialize(serializedParameters, 'M.style.Polygon') : console.error('M.style is not defined'))"; } } From 7f7e2ac6dacbe05ff9061159dbe60fcfb0771065 Mon Sep 17 00:00:00 2001 From: Antonio Manuel Rebollar Marquez Date: Wed, 5 Jun 2024 13:44:05 +0200 Subject: [PATCH 6/7] #319050 - Reemplazo de URLs caidas --- mapea-js/test/development/attribute.js | 4 ++-- mapea-js/test/development/filters.js | 6 +++--- mapea-js/test/development/geojson.js | 2 +- mapea-js/test/development/layer-vectortile.js | 3 ++- mapea-js/test/development/layer-wms_full.js | 2 +- mapea-js/test/development/layerGroup.js | 14 ++++++++------ mapea-js/test/development/maxextent.js | 4 ++-- mapea-js/test/development/printer-layers.js | 4 ++-- mapea-js/test/development/style-category-point.js | 2 +- .../test/development/style-choropleth-point.js | 2 +- mapea-js/test/development/style-cluster.js | 2 +- mapea-js/test/development/style-composite.js | 2 +- mapea-js/test/development/style-heatmap-panel.js | 2 +- mapea-js/test/development/style-heatmap.js | 2 +- mapea-js/test/development/style-point.js | 2 +- .../test/development/style-proportional-point.js | 2 +- mapea-js/test/development/styles-scale.js | 2 +- mapea-js/test/production/jsfiddle/basic-puntos.js | 2 +- mapea-js/test/production/jsfiddle/composite.js | 2 +- mapea-js/test/production/jsfiddle/eventos.js | 2 +- .../test/production/jsfiddle/generic-puntos.js | 2 +- mapea-js/test/production/jsfiddle/grupocapa.js | 2 +- mapea-js/test/production/jsfiddle/mapacalor.js | 2 +- .../src/main/webapp/test/chap/debug_pnoa_wmts.html | 3 ++- 24 files changed, 38 insertions(+), 34 deletions(-) diff --git a/mapea-js/test/development/attribute.js b/mapea-js/test/development/attribute.js index 75ecaf8f..4cf5ed55 100644 --- a/mapea-js/test/development/attribute.js +++ b/mapea-js/test/development/attribute.js @@ -27,7 +27,7 @@ mapjs.addPlugin(attributetable); const campamentosa = new M.layer.GeoJSON({ name: 'Campamentos', - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sepim:campamentos&outputFormat=application/json&', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sepim:campamentos&outputFormat=application/json&', extract: true, legend: 'Campamentos A', }); @@ -36,7 +36,7 @@ window.campamentosa = campamentosa; /* / Campamento comentado const campamentosB = new M.layer.GeoJSON({ name: 'Campamentos', - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sepim:campamentos&outputFormat=application/json&', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sepim:campamentos&outputFormat=application/json&', extract: true, legend: 'Campamentos b', }); // */ diff --git a/mapea-js/test/development/filters.js b/mapea-js/test/development/filters.js index d193d85f..797dc847 100644 --- a/mapea-js/test/development/filters.js +++ b/mapea-js/test/development/filters.js @@ -11,9 +11,9 @@ const m = Mmap({ controls: ['layerswitcher', 'panzoom', 'navtoolbar'], wmcfiles: ['callejero'], layers: [ - 'WFST*CapaWFS_POL*https://clientes.guadaltel.es/desarrollo/geossigc/wfs?*callejero:mapea_filtros_no_tocar*MPOLYGON', - 'WFST*CapaWFS_POINT*https://clientes.guadaltel.es/desarrollo/geossigc/wfs?*ggis:TEST_Geor_Inventario_cavidades*MPOINT', - 'WFS*Lineas*https://clientes.guadaltel.es/desarrollo/geossigc/wfs?*mapea:hs1_100_simplificada*MLINE', + 'WFST*CapaWFS_POL*https://geostematicos-sigc.juntadeandalucia.es/geoserver/tematicos/ows?*tematicos:Provincias*MPOLYGON', + 'WFST*CapaWFS_POINT*https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows*sepim:campamentos*POINT', + 'WFS*Lineas*https://geostematicos-sigc.juntadeandalucia.es/geoserver/tematicos/ows?*tematicos:Provincias*MLINE', ], }); diff --git a/mapea-js/test/development/geojson.js b/mapea-js/test/development/geojson.js index 3dd241cb..3f447f94 100644 --- a/mapea-js/test/development/geojson.js +++ b/mapea-js/test/development/geojson.js @@ -8,7 +8,7 @@ const mapjs = map({ // GeoJSON local const layer = new GeoJSON({ - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sepim:EstructuraJA&maxFeatures=50&outputFormat=application%2Fjson', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sepim:EstructuraJA&maxFeatures=50&outputFormat=application%2Fjson', name: 'prueba', }); diff --git a/mapea-js/test/development/layer-vectortile.js b/mapea-js/test/development/layer-vectortile.js index 07a3c5c8..2aaf56f0 100644 --- a/mapea-js/test/development/layer-vectortile.js +++ b/mapea-js/test/development/layer-vectortile.js @@ -7,11 +7,12 @@ const mapjs = Mmap({ projection: 'EPSG:3857*m', controls: ['mouse'], layers: ['OSM'], + ticket: 'PWUMZ5MQTPUGAEWTHCXVXSFZLLAKXUNKBQSTBOVVUIDYTPVPUK3Q3UZNNIV3HB6JTIFBCNXB3PJIGPKARGK5HLKV5CXQ4J62FEXTGWHYJG3BHFLETUSVDLRYDVB2SL4WNYTQMGVGFGBMVGM4QJ5H4FFH34WF6SJNEG5FNGY', }); const mvt = new MVT( { - url: 'https://localhost:8080/geoserver/gwc/service/tms/1.0.0/CHG:carmenmarquez_municipios_20200916_16431@EPSG:900913@pbf/{z}/{x}/{-y}.pbf', + url: 'https://hcsigc-geoserver-sigc.desarrollo.guadaltel.es/geoserver/gwc/service/tms/1.0.0/Global:superadministradortest_oficinas_sae_prueba_1717413455725@EPSG%3A3857@pbf/{z}/{x}/{-y}.pbf', name: 'vectortile', projection: 'EPSG:3857', }, diff --git a/mapea-js/test/development/layer-wms_full.js b/mapea-js/test/development/layer-wms_full.js index 85e30186..8443fef9 100644 --- a/mapea-js/test/development/layer-wms_full.js +++ b/mapea-js/test/development/layer-wms_full.js @@ -3,7 +3,7 @@ import { map as Mmap } from 'M/mapea'; const mapjs = Mmap({ container: 'map', wmc: ['callejeroCacheado'], - // layers: ['WMS_FULL*http://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_Permeabilidad_Andalucia?'], // ERROR 404 + // layers: ['WMS_FULL*https://www.ideandalucia.es/wms/mdt_2016?'], // ERROR 404 layers: ['WMS_FULL*https://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_zona_peligro_incendios_forestales?*true'], // layers: ['WMS_FULL*http://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_Edad_Geologica_Andalucia?*true'], // Long wait before shown with colors center: [353200, 4125400], diff --git a/mapea-js/test/development/layerGroup.js b/mapea-js/test/development/layerGroup.js index 53f56dc6..e5cdf29b 100644 --- a/mapea-js/test/development/layerGroup.js +++ b/mapea-js/test/development/layerGroup.js @@ -16,9 +16,10 @@ const mapa = map({ container: 'map', controls: ['layerswitcher'] }); // layers const centrosMedicos = new WFS({ - url: 'https://herramienta-centralizada-sigc.desarrollo.guadaltel.es/geoserver/Global/wfs?*', - name: 'centros_medicos_2da3a991_a621_4a01_b4c0_a9c7f90d1f00', - legend: 'Centros Medicos', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows', + name: 'campamentos', + namespace: 'sepim', + legend: 'sepim:campamentos', tiled: true, }); @@ -30,9 +31,10 @@ const nucleo = new WFS({ }); const provinciasWMS = new WFS({ - url: 'https://herramienta-centralizada-sigc.desarrollo.guadaltel.es/geoserver/guadaltel_prod/wfs?*', - name: 'u2_red_nacional_de_p_1ac4a9b2_dde9_4a83_9569_93ef5cfb1f60', - legend: 'provinciasWMS', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/tematicos/ows?*', + name: 'Provincias', + legend: 'Provincias', + namespace: 'tematicos', tiled: true, }); diff --git a/mapea-js/test/development/maxextent.js b/mapea-js/test/development/maxextent.js index 02d7085f..9a4bbc4a 100644 --- a/mapea-js/test/development/maxextent.js +++ b/mapea-js/test/development/maxextent.js @@ -26,7 +26,7 @@ window.mapjs = mapjs; // cargar/quitar wmc const maxExtent = [193104.52926740074, 4119420.5399687593, 287161.9825899291, 4164759.1717656343]; const wmc = new WMC('http://sigc.desarrollo.guadaltel.es/mapea5/files/wmc/wmcprueba.xml*prueba'); -// const permeabilidad = new WMS('WMS*permeabilidad*http://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_Permeabilidad_Andalucia?*permeabilidad'); +// const permeabilidad = new WMS('WMS*Redes*https://www.ideandalucia.es/wms/mta400v_2008?*Redes_energeticas'); const permeabilidad = new WMS('WMS*permeabilidad*http://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_zona_peligro_incendios_forestales?*REDIAM'); const redesEnergeticas = new WMS('WMS*Redes*https://www.ideandalucia.es/wms/mta400v_2008?*Redes_energeticas*true'); const limites = new WMS('WMS*Limites*https://www.ideandalucia.es/wms/mta10v_2007?*Limites*true'); @@ -42,7 +42,7 @@ window.prioridadCapa = (evt) => { Añadimos una WMS con un maxExtent por parámetro. `); const permeabilidadExtent = new WMS({ - // url: "http://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_Permeabilidad_Andalucia?", name: "permeabilidad", + // url: "https://www.ideandalucia.es/wms/mta400v_2008?", name: "Redes_energeticas", url: 'http://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_zona_peligro_incendios_forestales?', name: 'REDIAM', maxExtent, diff --git a/mapea-js/test/development/printer-layers.js b/mapea-js/test/development/printer-layers.js index 35107cc1..7b4c7217 100644 --- a/mapea-js/test/development/printer-layers.js +++ b/mapea-js/test/development/printer-layers.js @@ -73,7 +73,7 @@ mapjs.addWFS(rios); // */ // Capa con campamentos de andalucía const campamentos = new M.layer.WFS({ - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', name: 'campamentos', legend: 'Campamentos', geometry: 'MPOINT', @@ -122,7 +122,7 @@ mapjs.addWMTS(toporaster); // */ /* / Capa con los menores de 15 años por provincia const estructuraJA = new M.layer.WFS({ - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', namespace: 'sepim', name: 'EstructuraJA', legend: 'Menores de 15 años por provincia', diff --git a/mapea-js/test/development/style-category-point.js b/mapea-js/test/development/style-category-point.js index 0ab7a0dc..0297addb 100644 --- a/mapea-js/test/development/style-category-point.js +++ b/mapea-js/test/development/style-category-point.js @@ -9,7 +9,7 @@ const mapjs = map({ }); const wfs = new WFS({ - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', namespace: 'sepim', name: 'campamentos', legend: 'Campamentos', diff --git a/mapea-js/test/development/style-choropleth-point.js b/mapea-js/test/development/style-choropleth-point.js index f6036d42..afc14cc3 100644 --- a/mapea-js/test/development/style-choropleth-point.js +++ b/mapea-js/test/development/style-choropleth-point.js @@ -9,7 +9,7 @@ const mapjs = map({ }); const wfs = new WFS({ - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', namespace: 'sepim', name: 'campamentos', legend: 'Campamentos', diff --git a/mapea-js/test/development/style-cluster.js b/mapea-js/test/development/style-cluster.js index cc10b071..b9d23ee0 100644 --- a/mapea-js/test/development/style-cluster.js +++ b/mapea-js/test/development/style-cluster.js @@ -8,7 +8,7 @@ window.mapjs = map({ }); const wfs = new WFS({ - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', namespace: 'sepim', name: 'campamentos', legend: 'Campamentos', diff --git a/mapea-js/test/development/style-composite.js b/mapea-js/test/development/style-composite.js index d13dcdfa..8540c805 100644 --- a/mapea-js/test/development/style-composite.js +++ b/mapea-js/test/development/style-composite.js @@ -9,7 +9,7 @@ const mapjs = map({ }); const wfs = new WFS({ - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows', name: 'sepim:campamentos', legend: 'Campamentos', geometry: 'POINT', diff --git a/mapea-js/test/development/style-heatmap-panel.js b/mapea-js/test/development/style-heatmap-panel.js index 2598206b..3d65921c 100644 --- a/mapea-js/test/development/style-heatmap-panel.js +++ b/mapea-js/test/development/style-heatmap-panel.js @@ -9,7 +9,7 @@ const mapjs = Mmap({ }); const wfs = new WFS({ - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', namespace: 'sepim', name: 'campamentos', legend: 'Campamentos', diff --git a/mapea-js/test/development/style-heatmap.js b/mapea-js/test/development/style-heatmap.js index bc752489..d07d6d5f 100644 --- a/mapea-js/test/development/style-heatmap.js +++ b/mapea-js/test/development/style-heatmap.js @@ -8,7 +8,7 @@ const mapjs = map({ }); const wfs = new WFS({ - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', namespace: 'sepim', name: 'campamentos', legend: 'Campamentos', diff --git a/mapea-js/test/development/style-point.js b/mapea-js/test/development/style-point.js index c42b278e..c5618a34 100644 --- a/mapea-js/test/development/style-point.js +++ b/mapea-js/test/development/style-point.js @@ -9,7 +9,7 @@ const mapjs = map({ }); const campamentos = new WFS({ - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows', name: 'sepim:campamentos', legend: 'Campamentos', geometry: 'POINT', diff --git a/mapea-js/test/development/style-proportional-point.js b/mapea-js/test/development/style-proportional-point.js index aa90cb64..b9e0b678 100644 --- a/mapea-js/test/development/style-proportional-point.js +++ b/mapea-js/test/development/style-proportional-point.js @@ -9,7 +9,7 @@ const mapjs = map({ }); const wfs = new WFS({ - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows', name: 'sepim:campamentos', legend: 'Campamentos', geometry: 'POINT', diff --git a/mapea-js/test/development/styles-scale.js b/mapea-js/test/development/styles-scale.js index 06fa8c82..dd196d78 100644 --- a/mapea-js/test/development/styles-scale.js +++ b/mapea-js/test/development/styles-scale.js @@ -25,7 +25,7 @@ window.polygons = new MlayerWFS({ }), }); window.points = new MlayerWFS({ - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows', name: 'sepim:campamentos', legend: 'Campamentos', geometry: 'POINT', diff --git a/mapea-js/test/production/jsfiddle/basic-puntos.js b/mapea-js/test/production/jsfiddle/basic-puntos.js index 271a85e0..c5e0ba3b 100644 --- a/mapea-js/test/production/jsfiddle/basic-puntos.js +++ b/mapea-js/test/production/jsfiddle/basic-puntos.js @@ -6,7 +6,7 @@ var mapajs = M.map({ var campamentos = new M.layer.WFS({ - url: "http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows", + url: "https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows", name: "sepim:campamentos", legend: "Campamentos", geometry: 'POINT', diff --git a/mapea-js/test/production/jsfiddle/composite.js b/mapea-js/test/production/jsfiddle/composite.js index 4776cfd3..7b8ec8a9 100644 --- a/mapea-js/test/production/jsfiddle/composite.js +++ b/mapea-js/test/production/jsfiddle/composite.js @@ -5,7 +5,7 @@ let map = M.map({ // Capa puntual de Campamentos var campamentos = new M.layer.GeoJSON({ name: "Provincias", - url: "http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=campamentos&outputFormat=application/json", + url: "https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=campamentos&outputFormat=application/json", extract: true }); diff --git a/mapea-js/test/production/jsfiddle/eventos.js b/mapea-js/test/production/jsfiddle/eventos.js index 76ac03f3..f082bcb1 100644 --- a/mapea-js/test/production/jsfiddle/eventos.js +++ b/mapea-js/test/production/jsfiddle/eventos.js @@ -16,7 +16,7 @@ mapajs.on(M.evt.ADDED_WMS, function() { }); var wfslayer = new M.layer.WFS({ - url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', + url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?', namespace: 'sepim', name: 'campamentos', geometry: 'POINT' diff --git a/mapea-js/test/production/jsfiddle/generic-puntos.js b/mapea-js/test/production/jsfiddle/generic-puntos.js index ca0abde2..657207b0 100644 --- a/mapea-js/test/production/jsfiddle/generic-puntos.js +++ b/mapea-js/test/production/jsfiddle/generic-puntos.js @@ -6,7 +6,7 @@ var mapajs = M.map({ var campamentos = new M.layer.WFS({ - url: "http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows", + url: "https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows", name: "sepim:campamentos", legend: "Campamentos", geometry: 'POINT', diff --git a/mapea-js/test/production/jsfiddle/grupocapa.js b/mapea-js/test/production/jsfiddle/grupocapa.js index bb743fc9..5943b0a4 100644 --- a/mapea-js/test/production/jsfiddle/grupocapa.js +++ b/mapea-js/test/production/jsfiddle/grupocapa.js @@ -17,7 +17,7 @@ let provincias = new M.layer.GeoJSON({ let campamentos = new M.layer.GeoJSON({ name: "Campamentos", - url: "http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sepim:campamentos&outputFormat=application/json&", + url: "https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=sepim:campamentos&outputFormat=application/json&", extract: true }); diff --git a/mapea-js/test/production/jsfiddle/mapacalor.js b/mapea-js/test/production/jsfiddle/mapacalor.js index fcdf3a97..049aabdc 100644 --- a/mapea-js/test/production/jsfiddle/mapacalor.js +++ b/mapea-js/test/production/jsfiddle/mapacalor.js @@ -10,7 +10,7 @@ url: 'https://www.ideandalucia.es/services/DERA_g9_transport_com/wfs?service=WFS const wfs = new M.layer.GeoJSON({ name: 'Campamentos', -url: 'http://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?service=WFS&version=1.0.0&request=GetFeature&typename=sepim%3Acampamentos&outputFormat=application%2Fjson&srsname=EPSG%3A25830' +url: 'https://geostematicos-sigc.juntadeandalucia.es/geoserver/sepim/ows?service=WFS&version=1.0.0&request=GetFeature&typename=sepim%3Acampamentos&outputFormat=application%2Fjson&srsname=EPSG%3A25830' }); /*const wfs = new M.layer.GeoJSON({ diff --git a/mapea-rest/src/main/webapp/test/chap/debug_pnoa_wmts.html b/mapea-rest/src/main/webapp/test/chap/debug_pnoa_wmts.html index 0fc18efc..a6ff06d2 100644 --- a/mapea-rest/src/main/webapp/test/chap/debug_pnoa_wmts.html +++ b/mapea-rest/src/main/webapp/test/chap/debug_pnoa_wmts.html @@ -60,7 +60,8 @@ }); var wms3 = new M.layer.WMS({ - url: 'http://www.juntadeandalucia.es/medioambiente/mapwms/REDIAM_Permeabilidad_Andalucia?' + url: 'https://www.ideandalucia.es/wms/mta400v_2008?', + name: 'Redes_energeticas', }); var wms4 = new M.layer.WMS('WMS*MTA400*http://www.ideandalucia.es/wms/mta400r_2008?*MTA400*false'); From dce9388830b2a86cec1d00aef79383cb90119cd7 Mon Sep 17 00:00:00 2001 From: Antonio Manuel Rebollar Marquez Date: Thu, 6 Jun 2024 08:27:53 +0200 Subject: [PATCH 7/7] #319050 - Reemplazo de URLs caidas --- mapea-js/test/development/basic-map.js | 2 +- mapea-js/test/development/mbtiles.js | 1 + mapea-js/test/production/jsfiddle/wmts copy.js | 8 ++++---- mapea-js/test/production/jsfiddle/wmts.js | 8 ++++---- mapea-rest/src/main/webapp/test/index.html | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/mapea-js/test/development/basic-map.js b/mapea-js/test/development/basic-map.js index b7c167d1..b2164e0a 100644 --- a/mapea-js/test/development/basic-map.js +++ b/mapea-js/test/development/basic-map.js @@ -6,6 +6,6 @@ import { map as Mmap } from 'M/mapea'; const mapa = Mmap({ container: 'map', // controls: ['layerswitcher'], - layers: ['WMTS*https://www.ideandalucia.es/geowebcache/service/wmts?*orto_2010-11*false'], + layers: ['WMTS*http://www.ign.es/wmts/pnoa-ma?*OI.OrthoimageCoverage*false'], }); window.map = mapa; diff --git a/mapea-js/test/development/mbtiles.js b/mapea-js/test/development/mbtiles.js index 11493c95..2f868f0c 100644 --- a/mapea-js/test/development/mbtiles.js +++ b/mapea-js/test/development/mbtiles.js @@ -9,6 +9,7 @@ const mapjs = Mmap({ // bbox: [-734643.6701675085, 4803884.403272196, -576286.1226744428, 4882155.920236216] }); +// En esta url se pueden descargar ficheros mbtiles: https://centrodedescargas.cnig.es/CentroDescargas/loadMapMovExt fetch('./monfrague.mbtiles').then((response) => { const mbtile = new MBTiles({ name: 'mbtile', diff --git a/mapea-js/test/production/jsfiddle/wmts copy.js b/mapea-js/test/production/jsfiddle/wmts copy.js index ec1e7e20..54876417 100644 --- a/mapea-js/test/production/jsfiddle/wmts copy.js +++ b/mapea-js/test/production/jsfiddle/wmts copy.js @@ -9,10 +9,10 @@ // OPCION 2: Con el metodo addLayers /*var layer = new M.layer.WMTS({ - url: "https://www.ideandalucia.es/geowebcache/service/wmts", - name: "toporaster", - matrixSet: "EPSG:25830", - legend: "Toporaster" + url: 'http://www.ign.es/wmts/pnoa-ma?', + name: 'OI.OrthoimageCoverage', + legend: 'Imagen (PNOA)', + matrixSet: 'GoogleMapsCompatible', }); mapajs.addWMTS(layer);*/ diff --git a/mapea-js/test/production/jsfiddle/wmts.js b/mapea-js/test/production/jsfiddle/wmts.js index ec1e7e20..54876417 100644 --- a/mapea-js/test/production/jsfiddle/wmts.js +++ b/mapea-js/test/production/jsfiddle/wmts.js @@ -9,10 +9,10 @@ // OPCION 2: Con el metodo addLayers /*var layer = new M.layer.WMTS({ - url: "https://www.ideandalucia.es/geowebcache/service/wmts", - name: "toporaster", - matrixSet: "EPSG:25830", - legend: "Toporaster" + url: 'http://www.ign.es/wmts/pnoa-ma?', + name: 'OI.OrthoimageCoverage', + legend: 'Imagen (PNOA)', + matrixSet: 'GoogleMapsCompatible', }); mapajs.addWMTS(layer);*/ diff --git a/mapea-rest/src/main/webapp/test/index.html b/mapea-rest/src/main/webapp/test/index.html index 3e78dbc5..ae6df250 100644 --- a/mapea-rest/src/main/webapp/test/index.html +++ b/mapea-rest/src/main/webapp/test/index.html @@ -157,7 +157,7 @@

    PLAN DE PRUEBAS FUNCIONALES

    - +