From 17453629299c253bf6eca6e2d3f966be2ceb819b Mon Sep 17 00:00:00 2001 From: alvaroCodes Date: Tue, 3 Dec 2024 08:17:35 +0100 Subject: [PATCH] Refactor: Se refactoriza layerGroup configuracion hibrido backgroundlayers --- api-ign-js/src/configuration.js | 2 +- api-ign-js/src/facade/js/layer/LayerGroup.js | 10 +++------- api-ign-js/src/facade/js/mapea.js | 5 ++--- api-ign-js/test/configuration_filtered.js | 2 +- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/api-ign-js/src/configuration.js b/api-ign-js/src/configuration.js index 4ddc09a58..413c8a08c 100644 --- a/api-ign-js/src/configuration.js +++ b/api-ign-js/src/configuration.js @@ -22,7 +22,7 @@ const backgroundlayersOpts = [{ id: 'hibrido', title: 'Híbrido', layers: [ - 'QUICK*HIBRIDO', + 'QUICK*BASE_HIBRIDO_LayerGroup', ], }, ]; diff --git a/api-ign-js/src/facade/js/layer/LayerGroup.js b/api-ign-js/src/facade/js/layer/LayerGroup.js index ebee81122..ab226170e 100644 --- a/api-ign-js/src/facade/js/layer/LayerGroup.js +++ b/api-ign-js/src/facade/js/layer/LayerGroup.js @@ -12,14 +12,10 @@ import * as LayerType from './Type'; * @classdesc * Representa un grupo de capas. * - * @property {Array} layers - * @property {boolean} display + * @property {Array} layers Capas del grupo. + * @property {boolean} display Indica si el grupo se muestra en el árbol de contenidos. * - * - * @constructor * @extends {M.facade.Base} - * @param {string|Mx.parameters.Layer} userParameters parameters - * provided by the user * @api */ class LayerGroup extends LayerBase { @@ -28,7 +24,7 @@ class LayerGroup extends LayerBase { * con parámetros especificados por el usuario. * * @constructor - * @param {String|Mx.parameters.GeoJSON} parameters Parámetros para la construcción de la capa, + * @param {String|Mx.parameters.LayerGroup} parameters Parámetros para la construcción de la capa, * estos parámetros los proporciona el usuario. * - name: Nombre de la capa en la leyenda. * - layers: Capas que forman el grupo. diff --git a/api-ign-js/src/facade/js/mapea.js b/api-ign-js/src/facade/js/mapea.js index efd4058a8..31629b8c8 100644 --- a/api-ign-js/src/facade/js/mapea.js +++ b/api-ign-js/src/facade/js/mapea.js @@ -205,15 +205,15 @@ let quickLayers = () => { }, { disableBackgroundColor: false, }), - HIBRIDO: new LayerGroup({ + BASE_HIBRIDO_LayerGroup: new LayerGroup({ name: 'Híbrido', + isBase: true, layers: [ new TMS({ url: 'https://tms-pnoa-ma.idee.es/1.0.0/pnoa-ma/{z}/{x}/{-y}.jpeg', legend: 'PNOA_MA', name: 'PNOA_MA', visible: true, - transparent: false, tileGridMaxZoom: 19, attribution: { name: 'PNOA-MA', @@ -231,7 +231,6 @@ let quickLayers = () => { legend: 'IGNBaseOrto', name: 'IGNBaseOrto', visible: true, - transparent: false, tileGridMaxZoom: 17, attribution: '

IDEE: SCNE

', }, { diff --git a/api-ign-js/test/configuration_filtered.js b/api-ign-js/test/configuration_filtered.js index cc7a9dc9d..069d7b7a7 100644 --- a/api-ign-js/test/configuration_filtered.js +++ b/api-ign-js/test/configuration_filtered.js @@ -1,6 +1,6 @@ const backgroundlayersIds = 'mapa,imagen,hibrido'.split(','); const backgroundlayersTitles = 'Mapa,Imagen,Hibrido'.split(','); -const backgroundlayersLayers = 'QUICK*Base_IGNBaseTodo_TMS,QUICK*BASE_PNOA_MA_TMS,QUICK*BASE_PNOA_MA_TMS+QUICK*BASE_IGNBaseOrto_TMS'.split(','); +const backgroundlayersLayers = 'QUICK*Base_IGNBaseTodo_TMS,QUICK*BASE_PNOA_MA_TMS,QUICK*BASE_HIBRIDO_LayerGroup'.split(','); const backgroundlayersOpts = backgroundlayersIds.map((id, index) => { return { id,