Skip to content

Commit

Permalink
add map.SetSky() when ORTO3D
Browse files Browse the repository at this point in the history
  • Loading branch information
lstiz committed Jul 8, 2024
1 parent 32e3d27 commit e6de1da
Show file tree
Hide file tree
Showing 12 changed files with 2,775 additions and 21 deletions.
22 changes: 16 additions & 6 deletions dist/index-BFMDzCuG.mjs → dist/index-DScdZFZm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -58966,7 +58966,7 @@ function(n) {
*/
function(n) {
function e() {
return (Rn.canvg ? Promise.resolve(Rn.canvg) : import("./index.es-BWyxJuJN-C4muY-Eb.mjs")).catch(function(t) {
return (Rn.canvg ? Promise.resolve(Rn.canvg) : import("./index.es-BWyxJuJN-B8aWB3kW.mjs")).catch(function(t) {
return Promise.reject(new Error("Could not load canvg: " + t));
}).then(function(t) {
return t.default ? t.default : t;
Expand Down Expand Up @@ -62308,6 +62308,7 @@ const xq = /* @__PURE__ */ Ap(bq), wq = {
TOPO: "https://geoserveis.icgc.cat/contextmaps/icgc_mapa_estandard_general.json",
ORTO: "https://geoserveis.icgc.cat/contextmaps/icgc_orto_estandard.json",
ORTO3D: "https://tilemaps.icgc.cat/cdn/styles/icgc_orto_3d.json",
ORTOHYBRID: "https://geoserveis.icgc.cat/contextmaps/icgc_orto_hibrida.json",
ADMIN: "https://geoserveis.icgc.cat/contextmaps/icgc_delimitacio_limits_administratius.json",
DARK: "https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_fosc.json",
LIGHT: "https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_gris.json",
Expand All @@ -62318,6 +62319,7 @@ const xq = /* @__PURE__ */ Ap(bq), wq = {
}, Sq = {
Orto: {
ortofotoColorProvisional: "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_provisional",
ortofotoColor2023: "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2023",
ortofotoColor2022: "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2022",
ortofotoColor2021: "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2021",
ortofotoColor2020: "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2020",
Expand Down Expand Up @@ -62345,6 +62347,7 @@ const xq = /* @__PURE__ */ Ap(bq), wq = {
ortofotoBlancINegre1945: "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1945",
ortofotoColorSerieAnual: "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_serie_anual",
ortofotoInfraroigProvisional: "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_provisional",
ortofotoInfraroig2023: "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2023",
ortofotoInfraroig2022: "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2022",
ortofotoInfraroig2021: "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2021",
ortofotoInfraroig2020: "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2020",
Expand Down Expand Up @@ -64778,11 +64781,11 @@ let Ah, $f, Sr, gi, oW = class {
setSky(e) {
try {
e === void 0 && (this.map.options.style.includes("orto") && (e = {
"sky-color": "#37709e",
"sky-color": "#86bbd5",
"sky-horizon-blend": 0.3,
"horizon-color": "#e1e3e3",
"horizon-fog-blend": 0.9,
"fog-ground-blend": 0.85,
"horizon-color": "#ffffff33",
"horizon-fog-blend": 0.1,
"fog-ground-blend": 0.75,
"fog-color": "#c5d6d6"
}), this.map.options.style.includes("mapa_estandard_general") && (e = {
"sky-color": "#a5f0f0",
Expand Down Expand Up @@ -66624,7 +66627,14 @@ let Ah, $f, Sr, gi, oW = class {
const r = this._createCitiesMapboxLayer();
this.map.getLayer(gi.map3dOptions.layerId3d) || (this.map.addLayer(r, gi.map3dOptions.layerIdOrder), this.map.setLayerZoomRange(gi.map3dOptions.layerId3d, gi.map3dOptions.minZoomRange, gi.map3dOptions.maxZoomRange), r.deck.setProps({
effects: [i]
}), this._raiseText3DStyle());
}), this._raiseText3DStyle()), this.map.setSky({
"sky-color": "#86bbd5",
"sky-horizon-blend": 0.3,
"horizon-color": "#ffffff33",
"horizon-fog-blend": 0.1,
"fog-ground-blend": 0.75,
"fog-color": "#c5d6d6"
});
} else
this.map.getLayer(gi.map3dOptions.layerId3d) && (this.map.removeLayer(gi.map3dOptions.layerId3d), this.map.setTerrain(null));
} catch (t) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { p as Ui } from "./index-BFMDzCuG.mjs";
import { p as Ui } from "./index-DScdZFZm.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
42 changes: 42 additions & 0 deletions dist/mapicgc-gl.css
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,48 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
width: 100% !important;
z-index: 99999;
}








































/* CUSTOM */

.basemap-group {
font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: 600;
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-BFMDzCuG.mjs";
import { C as p, a as s, M as r } from "./index-DScdZFZm.mjs";
export {
p as CompareMaps,
s as Config,
Expand Down
6 changes: 3 additions & 3 deletions dist/mapicgc-gl.umd.js

Large diffs are not rendered by default.

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.84",
"version": "0.0.85",
"description": "mapicgc-gl-js library",
"author": "Institut Cartogràfic i Geològic de Catalunya",
"license": "BSD-3-Clause",
Expand Down
42 changes: 42 additions & 0 deletions public/mapicgc-gl.css
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,48 @@ a.maplibregl-ctrl-logo.maplibregl-compact {
width: 100% !important;
z-index: 99999;
}








































/* CUSTOM */

.basemap-group {
font: 12px/20px 'Helvetica Neue', Arial, Helvetica, sans-serif;
font-weight: 600;
Expand Down
2 changes: 1 addition & 1 deletion src/constants/ConfigICGC.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Config {
try {
const response = await axios.get(urlConfigICGC, { timeout: timeOut });
if (response.data) {

return response.data;
} else {
console.log("Resposta sense dades:", response);
Expand Down
20 changes: 14 additions & 6 deletions src/map/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -934,12 +934,12 @@ setSky(options) {
if (options === undefined) {
if (this.map.options.style.includes("orto")) {
options = {
"sky-color": "#37709e",
"sky-horizon-blend": 0.3,
"horizon-color": "#e1e3e3",
"horizon-fog-blend": 0.9,
"fog-ground-blend": 0.85,
"fog-color": "#c5d6d6",
'sky-color': '#86bbd5',
'sky-horizon-blend': 0.3,
'horizon-color': '#ffffff33',
'horizon-fog-blend': 0.1,
'fog-ground-blend': 0.75,
'fog-color': '#c5d6d6'
};
}
if (this.map.options.style.includes("mapa_estandard_general")) {
Expand Down Expand Up @@ -3217,6 +3217,14 @@ setSky(options) {
});
this._raiseText3DStyle();
}
this.map.setSky({
'sky-color': '#86bbd5',
'sky-horizon-blend': 0.3,
'horizon-color': '#ffffff33',
'horizon-fog-blend': 0.1,
'fog-ground-blend': 0.75,
'fog-color': '#c5d6d6'
});
} else {
if (this.map.getLayer(defaultOptions.map3dOptions.layerId3d)) {
this.map.removeLayer(defaultOptions.map3dOptions.layerId3d);
Expand Down
3 changes: 3 additions & 0 deletions src/mapicgc-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@
"TOPO": "https://geoserveis.icgc.cat/contextmaps/icgc_mapa_estandard_general.json",
"ORTO": "https://geoserveis.icgc.cat/contextmaps/icgc_orto_estandard.json",
"ORTO3D": "https://tilemaps.icgc.cat/cdn/styles/icgc_orto_3d.json",
"ORTOHYBRID": "https://geoserveis.icgc.cat/contextmaps/icgc_orto_hibrida.json",
"ADMIN": "https://geoserveis.icgc.cat/contextmaps/icgc_delimitacio_limits_administratius.json",
"DARK": "https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_fosc.json",
"LIGHT": "https://geoserveis.icgc.cat/contextmaps/icgc_mapa_base_gris.json",
Expand All @@ -842,6 +843,7 @@
"Layers": {
"Orto": {
"ortofotoColorProvisional": "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_provisional",
"ortofotoColor2023": "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2023",
"ortofotoColor2022": "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2022",
"ortofotoColor2021": "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2021",
"ortofotoColor2020": "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_2020",
Expand Down Expand Up @@ -869,6 +871,7 @@
"ortofotoBlancINegre1945": "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_blanc_i_negre_1945",
"ortofotoColorSerieAnual": "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_color_serie_anual",
"ortofotoInfraroigProvisional": "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_provisional",
"ortofotoInfraroig2023": "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2023",
"ortofotoInfraroig2022": "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2022",
"ortofotoInfraroig2021": "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2021",
"ortofotoInfraroig2020": "https://geoserveis.icgc.cat/servei/catalunya/orto-territorial/wms?&bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&STYLES=&srs=EPSG:3857&transparent=true&width=256&height=256&layers=ortofoto_infraroig_2020",
Expand Down
4 changes: 2 additions & 2 deletions test/exemples/addMapStyle.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
<script>
async function initMap() {
const data = await mapicgcgl.Config.getConfigICGC();
console.log('d', data)

const map = new mapicgcgl.Map({
container: 'map',
style: data.Styles.ORTO,
style: data.Styles.ORTO3D,
center: [1.1464, 41.706],
zoom: 7.4,
hash: true,
Expand Down

0 comments on commit e6de1da

Please sign in to comment.