Skip to content

Commit

Permalink
styles raster i transparencia logo
Browse files Browse the repository at this point in the history
  • Loading branch information
lstiz committed Dec 16, 2024
1 parent e9e04a1 commit 4214443
Show file tree
Hide file tree
Showing 17 changed files with 8,323 additions and 7,105 deletions.
10,665 changes: 5,368 additions & 5,297 deletions dist/index-RUEGHg-j.mjs → dist/index-DQri_Q_4.mjs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { p as Ui } from "./index-RUEGHg-j.mjs";
import { p as Ui } from "./index-DQri_Q_4.mjs";
var Zt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function No(i) {
return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
Expand Down
2,649 changes: 2,649 additions & 0 deletions dist/mapicgc-gl.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mapicgc-gl.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { C as p, a as s, M as r } from "./index-RUEGHg-j.mjs";
import { C as p, a as s, M as r } from "./index-DQri_Q_4.mjs";
export {
p as CompareMaps,
s as Config,
Expand Down
86 changes: 43 additions & 43 deletions dist/mapicgc-gl.umd.js

Large diffs are not rendered by default.

84 changes: 64 additions & 20 deletions nodeSetConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,44 @@ async function getVectorLimitsLayers() {
{ key: "DARK", url: "https://geoserveis.icgc.cat/styles/icgc_mapa_base_fosc.json" , image: "https://visors.icgc.cat/contextmaps/imatges_estil/icgc_mapa_base_fosc.png"},
{ key: "LIGHT", url: "https://geoserveis.icgc.cat/styles/icgc_mapa_base_gris.json", image: "https://visors.icgc.cat/contextmaps/imatges_estil/icgc_mapa_base_gris.png" },
{ key: "GEOLOGY", url: "https://geoserveis.icgc.cat/styles/icgc_geologic_informacio.json", image: "https://visors.icgc.cat/contextmaps/imatges_estil/icgc_geologic_informacio.png" },

{
key: "RASTER",
substyles: {
TOPO: {
url: "https://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/topografic/MON3857NW/{z}/{x}/{y}.png",
image: "https://icgc-web-pro.s3.eu-central-1.amazonaws.com/produccio/s3fs-public/2024-10/mapabase_topo.jpg"
},
ADMIN: {
url: "https://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/administratiu/MON3857NW/{z}/{x}/{y}.png",
image: "https://icgc-web-pro.s3.eu-central-1.amazonaws.com/produccio/s3fs-public/2024-10/mapabase_administratiu.jpg"
},
LIGHT: {
url: "https://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/topografic-gris/MON3857NW/{z}/{x}/{y}.png",
image: "https://icgc-web-pro.s3.eu-central-1.amazonaws.com/produccio/s3fs-public/2024-10/mapabase_topo_gris.jpg"
},
STANDARD: {
url: "https://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/estandard/MON3857NW/{z}/{x}/{y}.png",
image: "https://icgc-web-pro.s3.eu-central-1.amazonaws.com/produccio/s3fs-public/2024-10/mapabase_estandard_0.jpg"
},
SIMPLIFIED: {
url: "https://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/simplificat/MON3857NW/{z}/{x}/{y}.png",
image: "https://icgc-web-pro.s3.eu-central-1.amazonaws.com/produccio/s3fs-public/2024-10/mapabase_simplificat.jpg"
},
ORTO: {
url: "https://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/orto/MON3857NW/{z}/{x}/{y}.png",
image: "https://icgc-web-pro.s3.eu-central-1.amazonaws.com/produccio/s3fs-public/2024-10/mapabase_orto.jpg"
},
ORTOGREY: {
url: "https://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/orto-gris/MON3857NW/{z}/{x}/{y}.png",
image: "https://icgc-web-pro.s3.eu-central-1.amazonaws.com/produccio/s3fs-public/2024-10/mapabase_orto_gris.jpg"
},
ORTOHYBRID: {
url: "https://geoserveis.icgc.cat/servei/catalunya/mapa-base/wmts/orto-hibrida/MON3857NW/{z}/{x}/{y}.png",
image: "https://icgc-web-pro.s3.eu-central-1.amazonaws.com/produccio/s3fs-public/2024-10/mapabase_orto_hibida.jpg"
}
}

}
]
stylesOptions = test
console.info('Dades styles actualitzats' );
Expand Down Expand Up @@ -240,19 +277,19 @@ function replace(){
defaultOptions.fgbLayers = fgbLayersOptions
defaultOptions.ortoLayersICGC = ortoLayersOptions
defaultOptions.wmsLayers = wmsLayersOptions
defaultOptions.baseStyles = stylesOptions
defaultOptions.baseStyles = stylesOptions
defaultOptions.urlTerrainICGC = terrainOptions

function stringifyWithoutQuotes(obj, indent = 0) {
const padding = ' '.repeat(indent);
let result = '';
for (let key in obj) {
const value = obj[key];
key = camelize(key)
const formattedValue = typeof value === 'object'
const formattedKey = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key) ? key : `"${key}"`; // Asegura claves válidas
const formattedValue = typeof value === 'object' && !Array.isArray(value)
? stringifyWithoutQuotes(value, indent + 2)
: JSON.stringify(value);
result += `${padding}${key}: ${formattedValue},\n`;
result += `${padding}${formattedKey}: ${formattedValue},\n`;
}
return `{\n${result}${' '.repeat(Math.max(indent - 2, 0))}}`;
}
Expand Down Expand Up @@ -287,37 +324,44 @@ console.log('Variables actualitzades correctament a config.js');

function replaceConstants(){
// console.log('replaceeee')

function stringifyWithoutQuotes(obj, indent = 0) {
const padding = ' '.repeat(indent);
let result = '';
for (let key in obj) {
let value = obj[key];
//start camelize
key = camelize(key)
// console.log('v', key)
//end camelize
const formattedValue = typeof value === 'object'
? stringifyWithoutQuotes(value, indent + 2)
: JSON.stringify(value);
result += `${padding}${key}: ${formattedValue},\n`;
const value = obj[key];
const formattedKey = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(key) ? key : `"${key}"`; // Asegura claves válidas
const formattedValue =
typeof value === 'object' && !Array.isArray(value) && value !== null
? stringifyWithoutQuotes(value, indent + 2)
: JSON.stringify(value ?? null); // Convierte undefined a null explícitamente
result += `${padding}${formattedKey}: ${formattedValue},\n`;
}
return `{\n${result}${' '.repeat(Math.max(indent - 2, 0))}}`;
}
//baseStyles

// Conversión del objeto baseStyles
const convertedObject = {};
let originalObject = defaultOptions.baseStyles
let originalObject = defaultOptions.baseStyles;

for (const key in originalObject) {
if (originalObject.hasOwnProperty(key)) {
const item = originalObject[key];
convertedObject[item.key] = item.url;
// Si el item tiene una propiedad substyles (como RASTER), las añadimos a la conversión
if (item.key === 'RASTER' && item.substyles) {
// No agregar con índice, sino directamente a la propiedad RASTER
convertedObject.RASTER = item.substyles;
} else {
// Usa null si item.url no existe
convertedObject[item.key] = item.url || null;
}
}
}

// Genera el archivo de estilos con valores consistentes
const stylesConfig = `
const Styles = ${stringifyWithoutQuotes(convertedObject, null, 2)};
const Styles = ${stringifyWithoutQuotes(convertedObject, 2)};
\nexport default Styles;
`;

// Escribe el contenido actualizado en el archivo config.js
fs.writeFileSync(stylePath, stylesConfig);

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mapicgc-gl-js",
"homepage": "https://openicgc.github.io/mapicgc-doc/",
"version": "0.0.92",
"version": "0.0.93",
"description": "mapicgc-gl-js library",
"author": "Institut Cartogràfic i Geològic de Catalunya",
"license": "BSD-3-Clause",
Expand Down
4 changes: 3 additions & 1 deletion src/config-out.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,23 @@ logoIcgcOptions: {
logoLink: "https://www.icgc.cat",
logoTitle: "Institut Cartogràfic i Geològic de Catalunya",
logoWidth: 100,
logoOpacity: 0.6
},
logoGencatOptions: {
logoUrlColor: "https://eines.icgc.cat/recursos/logos/gencat_logo_color.png",
logoUrlWhite: "https://eines.icgc.cat/recursos/logos/gencat_logo_blanc.png",
logoLink: "https://web.gencat.cat/",
logoTitle: "Generalitat de Catalunya",
logoWidth: 100,
logoOpacity: 0.6
},
map3dOptions: {
spaceErrorFactor: 2,
exaggeration: 1,
zfactor: 48,
minZoomRange: 15.5,
maxZoomRange: 22,
urlTilesetCities: "https://tilemaps.icgc.cat/vector/3dtiles/ciutats/v1/tilesetV1.0.json",
urlTilesetCities: "https://geoserveis.icgc.cat/servei/catalunya/ciutats/3dtiles/v1/tilesetV1.0.json",
layerIdOrder: "place-isolated",
sourceLayerFilterId: "place",
minZoomFilter: 14,
Expand Down
Loading

0 comments on commit 4214443

Please sign in to comment.