diff --git a/api-idee-js/src/facade/assets/images/girar-vista.svg b/api-idee-js/src/facade/assets/images/girar-vista.svg
deleted file mode 100644
index 0484e6e7a..000000000
--- a/api-idee-js/src/facade/assets/images/girar-vista.svg
+++ /dev/null
@@ -1,106 +0,0 @@
-
\ No newline at end of file
diff --git a/api-idee-js/src/facade/assets/images/inclinar-vista.svg b/api-idee-js/src/facade/assets/images/inclinar-vista.svg
deleted file mode 100644
index e5c7988f4..000000000
--- a/api-idee-js/src/facade/assets/images/inclinar-vista.svg
+++ /dev/null
@@ -1,106 +0,0 @@
-
\ No newline at end of file
diff --git a/api-idee-js/src/facade/js/i18n/en.json b/api-idee-js/src/facade/js/i18n/en.json
index bd137cf0b..5035f996c 100644
--- a/api-idee-js/src/facade/js/i18n/en.json
+++ b/api-idee-js/src/facade/js/i18n/en.json
@@ -290,6 +290,7 @@
"getprojection_method": "The implementation used does not have the getProjection method.",
"no_projection": "You have not specified any projection.",
"setprojection_method": "The used implementation does not have the setProjection method.",
+ "no_valid_projection": "The following EPSG code is incorrect or does not exist",
"no_plugins": "You have not specified any plugins.",
"no_add_plugin_to_map": "The plugin can not be added to the map.",
"plugin_already_added": "The plugin is already added to the map.",
diff --git a/api-idee-js/src/facade/js/i18n/es.json b/api-idee-js/src/facade/js/i18n/es.json
index c1cc5d8c1..66aa29605 100644
--- a/api-idee-js/src/facade/js/i18n/es.json
+++ b/api-idee-js/src/facade/js/i18n/es.json
@@ -291,6 +291,7 @@
"getprojection_method": "La implementación usada no posee el método getProjection.",
"no_projection": "No ha especificado ninguna proyección.",
"setprojection_method": "La implementación usada no posee el método setProjection.",
+ "no_valid_projection": "El siguiente código EPSG es erróneo o no existe",
"no_plugins": "No ha especificado ningún plugin.",
"no_add_plugin_to_map": "El plugin no puede añadirse al mapa.",
"plugin_already_added": "El plugin ya está añadido al mapa.",
diff --git a/api-idee-js/src/impl/ol/js/projections.js b/api-idee-js/src/impl/ol/js/projections.js
index e3c3f9175..3268e45f0 100644
--- a/api-idee-js/src/impl/ol/js/projections.js
+++ b/api-idee-js/src/impl/ol/js/projections.js
@@ -6,6 +6,8 @@ import proj4 from 'proj4';
import OLProjection from 'ol/proj/Projection';
import { register } from 'ol/proj/proj4';
import { addEquivalentProjections, get as getProj } from 'ol/proj';
+import { getValue } from 'IDEE/i18n/language';
+import Exception from 'IDEE/exception/exception';
import { parseCRSWKTtoJSON } from '../../../facade/js/util/Utils';
/**
@@ -665,7 +667,7 @@ const refactorUnits = (units) => {
const getDefProjection = async (code) => {
const response = await fetch(`https://epsg.io/${code}.proj4`);
if (!response.ok) {
- throw new Error(`EPSG code ${code} not found`);
+ Exception(`${getValue('exception').no_valid_projection}: ${code}`);
}
return response.text();
};
@@ -691,7 +693,7 @@ const setNewProjection = async (projection) => {
const response = await fetch(url);
if (!response.ok) {
- throw new Error(`No se pudo obtener la definición WKT de EPSG:${code}`);
+ Exception(`${getValue('exception').no_valid_projection}: ${code}`);
}
const wktResponse = await response.text();
@@ -740,8 +742,6 @@ addProjections(projections, false);
* @api stable
*/
export default {
- addProjections,
getSupportedProjs,
- setNewProjection,
ensureProjection,
};
diff --git a/api-idee-js/src/plugins/infocoordinates/README.md b/api-idee-js/src/plugins/infocoordinates/README.md
index fb1f36e53..1268205f8 100644
--- a/api-idee-js/src/plugins/infocoordinates/README.md
+++ b/api-idee-js/src/plugins/infocoordinates/README.md
@@ -54,11 +54,12 @@ El constructor se inicializa con un JSON con los siguientes atributos:
- **decimalUTMcoord**: Indica el número de decimales de las coordenadas proyectadas en UTM. Por defecto: 2
- **helpUrl**: URL a la ayuda para el icono. Por defecto: 'https://www.ign.es/'
- **outputDownloadFormat**: Indica el formato de salida del documento que se va a descargar. Se puede elegir entre 'txt' o 'csv'. Por defecto: txt.
+- **epsgResults**: Códigos EPSG para mostrar simultáneamente las coordenadas, pero ocultará el selector CRS. Si es nulo se utilizará solamente la proyección usada en el mapa en ese momento y se habilitará el selector CRS.
# API-REST
```javascript
-URL_API?infocoordinates=position*collapsed*collapsible*tooltip*decimalGEOcoord*decimalUTMcoord*helpUrl*outputDownloadFormat
+URL_API?infocoordinates=position*collapsed*collapsible*tooltip*decimalGEOcoord*decimalUTMcoord*helpUrl*outputDownloadFormat*epsgResults
```
diff --git a/api-idee-js/src/plugins/printviewmanagement/src/facade/assets/css/printviewmanagement.css b/api-idee-js/src/plugins/printviewmanagement/src/facade/assets/css/printviewmanagement.css
index b9df10a45..075cb3233 100644
--- a/api-idee-js/src/plugins/printviewmanagement/src/facade/assets/css/printviewmanagement.css
+++ b/api-idee-js/src/plugins/printviewmanagement/src/facade/assets/css/printviewmanagement.css
@@ -25,7 +25,6 @@
justify-content: flex-start;
}
-
#plugin-panel-printviewmanagement .button-container {
width: 100%;
display: flex;
@@ -214,8 +213,6 @@
position: relative;
overflow: auto;
min-height: 300px;
- /* display: flex; */
- /* flex-grow: 1; */
}
.m-templateCustomizer-map-preview {
diff --git a/api-idee-js/src/plugins/printviewmanagement/src/facade/js/i18n/en.json b/api-idee-js/src/plugins/printviewmanagement/src/facade/js/i18n/en.json
index fb9de953a..ab40a418b 100644
--- a/api-idee-js/src/plugins/printviewmanagement/src/facade/js/i18n/en.json
+++ b/api-idee-js/src/plugins/printviewmanagement/src/facade/js/i18n/en.json
@@ -92,6 +92,7 @@
"vertical": "Vertical",
"horizontal": "Horizontal",
"scale": "Scale",
+ "scaleLine": "Scale Line",
"dpi": "DPI (dots per inches)",
"defaultText": "Enter text",
"select_srs": "Select a reference system",
diff --git a/api-idee-js/src/plugins/printviewmanagement/src/facade/js/i18n/es.json b/api-idee-js/src/plugins/printviewmanagement/src/facade/js/i18n/es.json
index 1aadbb5ce..c131f5b97 100644
--- a/api-idee-js/src/plugins/printviewmanagement/src/facade/js/i18n/es.json
+++ b/api-idee-js/src/plugins/printviewmanagement/src/facade/js/i18n/es.json
@@ -92,6 +92,7 @@
"vertical": "Vertical",
"horizontal": "Horizontal",
"scale": "Escala",
+ "scaleLine": "Línea de escala",
"dpi": "DPI (puntos por pulgadas)",
"defaultText": "Introduzca texto",
"select_srs": "Seleccione un sistema de referencia",
diff --git a/api-idee-js/src/plugins/printviewmanagement/src/facade/js/templateCustomizer.js b/api-idee-js/src/plugins/printviewmanagement/src/facade/js/templateCustomizer.js
index 4786fde49..128418868 100644
--- a/api-idee-js/src/plugins/printviewmanagement/src/facade/js/templateCustomizer.js
+++ b/api-idee-js/src/plugins/printviewmanagement/src/facade/js/templateCustomizer.js
@@ -8,6 +8,8 @@ import { PREVIEW_MAP_ORIENTATION } from '../../constants';
const ID_TEMPLATE_ORIENTATION = 'input[name="map-orientation"]';
const ID_TEMPLATE_LAYOUT = '#template-layout';
const ID_TEMPLATE_SCALE = '#template-scale';
+const SCALE_LINE_CONTROL_NAME = 'scaleline';
+const ID_TEMPLATE_SCALE_LINE = '#template-scale-line';
const ID_TEMPLATE_DPI = '#template-dpi';
const ID_TEMPLATE_INPUT_SRS = '#epsg-selected';
const ID_TEMPLATE_SRS_SELECTOR = '#m-customize-template-srs-selector';
@@ -155,9 +157,16 @@ export default class TemplateCustomizer extends IDEE.Control {
* Escala inicial del mapa de previsualización
* @private
* @type {number|null}
- */
+ */
this.scale = null;
+ /**
+ * DPI seleccionado por defecto
+ * @private
+ * @type {number}
+ */
+ this.dpi = this.dpiOptions_[0];
+
/**
* Conjunto de elementos principales que tiene la plantilla
* @private
@@ -222,6 +231,7 @@ export default class TemplateCustomizer extends IDEE.Control {
horizontal: getValue('horizontal'),
layout: getValue('layout'),
scale: getValue('scale'),
+ scaleLine: getValue('scaleLine'),
epsg: getValue('projection'),
select_srs: getValue('select_srs'),
choose_create_epsg: getValue('choose_create_epsg'),
@@ -294,6 +304,7 @@ export default class TemplateCustomizer extends IDEE.Control {
this.setupMapOrientationControl(ID_TEMPLATE_ORIENTATION);
this.setupLayoutControl(ID_TEMPLATE_LAYOUT);
this.setupScaleControl(ID_TEMPLATE_SCALE);
+ this.setupScaleLineControl(ID_TEMPLATE_SCALE_LINE);
this.setupDpiControl(ID_TEMPLATE_DPI);
this.setupInputSelectorControl(ID_TEMPLATE_INPUT_SRS, ID_TEMPLATE_SRS_SELECTOR);
}
@@ -327,6 +338,7 @@ export default class TemplateCustomizer extends IDEE.Control {
this.templateElementsContainer_ = previewContainer;
this.stylesApplied_ = false;
this.setupViewScaleListener();
+ this.setupScaleLineInput();
this.setupMapChangeListener();
this.applyTemplateStyles();
this.applyTemplateScripts();
@@ -354,6 +366,11 @@ export default class TemplateCustomizer extends IDEE.Control {
}
}
+ setupScaleLineInput() {
+ const { checked } = document.querySelector(ID_TEMPLATE_SCALE_LINE);
+ if (checked) this.previewMap.addControls(SCALE_LINE_CONTROL_NAME);
+ }
+
/**
* Configura un listener para detectar cambios en el mapa (movimiento, zoom, EPSG, layout, etc.)
*/
@@ -702,6 +719,22 @@ export default class TemplateCustomizer extends IDEE.Control {
});
}
+ /**
+ * Configura el control de escala lineal
+ * @param {string} scaleLineElementId - ID del elemento de entrada de escala lineal
+ */
+ setupScaleLineControl(scaleLineElementId) {
+ /**
+ * @type {HTMLInputElement}
+ */
+ const scaleElement = document.querySelector(scaleLineElementId);
+ scaleElement.addEventListener('click', (e) => {
+ const { checked } = e.target;
+ if (checked) this.previewMap.addControls(SCALE_LINE_CONTROL_NAME);
+ else this.previewMap.removeControls(SCALE_LINE_CONTROL_NAME);
+ });
+ }
+
/**
* Maneja el evento de cambio de escala al escribir en el campo de entrada
* @param {Event} e - Evento de cambio en el campo de entrada de escala
diff --git a/api-idee-js/src/plugins/printviewmanagement/src/templates/templateCustomizer.html b/api-idee-js/src/plugins/printviewmanagement/src/templates/templateCustomizer.html
index 09d3ed549..42d09c118 100644
--- a/api-idee-js/src/plugins/printviewmanagement/src/templates/templateCustomizer.html
+++ b/api-idee-js/src/plugins/printviewmanagement/src/templates/templateCustomizer.html
@@ -4,10 +4,10 @@
@@ -27,7 +27,7 @@
@@ -35,27 +35,24 @@
-
+
@@ -75,4 +72,4 @@
-
+
\ No newline at end of file
diff --git a/api-idee-js/src/plugins/printviewmanagement/test/dev.html b/api-idee-js/src/plugins/printviewmanagement/test/dev.html
index aeb00eafb..b9bc724c7 100644
--- a/api-idee-js/src/plugins/printviewmanagement/test/dev.html
+++ b/api-idee-js/src/plugins/printviewmanagement/test/dev.html
@@ -38,8 +38,7 @@
-
Modo por defecto "defaultOpenControl"
+ title="Índice del modo de impresión que aparecerá abierto al inicio: 0=ninguno, 1=printermap, 2=georefImage, 3=georefImageEpsg. Por defecto: 0">Modo
+ por defecto "defaultOpenControl"