Skip to content

Commit

Permalink
Merge pull request #2447 from eurodatacube/ui-panels-cat
Browse files Browse the repository at this point in the history
Mainly baselayer and overlays related fixes
  • Loading branch information
lubojr authored Jan 18, 2024
2 parents a2136c4 + c3cf019 commit eef4d39
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 75 deletions.
17 changes: 2 additions & 15 deletions app/src/components/map/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -941,20 +941,14 @@ export default {
methods: {
updateLayers(layerCollection, newLayers) {
const layersToRemove = layerCollection.getArray()
.filter((l) => !newLayers.find((nL) => nL.get('name') === l.get('name')));
.filter((l) => !newLayers.find((nL) => (nL.get('name') === l.get('name') && nL.get('visible') === l.get('visible'))));
const layersToAdd = newLayers
.filter((nL) => !layerCollection.getArray().find((l) => l.get('name') === nL.get('name')));
let selectFallbackExclusiveLayer = false;
.filter((nL) => !layerCollection.getArray().find((l) => l.get('name') === nL.get('name') && nL.get('visible') === l.get('visible')));
// remove old layers not needed in new collection
layersToRemove.forEach((removedLayer) => {
const layer = layerCollection.getArray()
.find((l) => l.get('name') === removedLayer.get('name'));
if (!layer) { return; }
if (layer.get('layerControlExclusive') && layer.getVisible()) {
selectFallbackExclusiveLayer = true;
}
layerCollection.remove(layer);
});
Expand All @@ -964,12 +958,6 @@ export default {
if (!layer) { return; }
layerCollection.push(layer);
});
// if a currently visible exclusive layer was removed,
// make the first of the new ones visible instead
if (selectFallbackExclusiveLayer) {
layerCollection.getArray()[layerCollection.getArray().length - 1].setVisible(true);
}
},
updateBaseLayers() {
const { map } = getMapInstance(this.mapId);
Expand All @@ -981,7 +969,6 @@ export default {
.filter(Boolean)
.map((l) => {
const createdLayer = createLayerFromConfig(l, map);
createdLayer.set('layerControlExclusive', true);
return createdLayer;
});
Expand Down
82 changes: 32 additions & 50 deletions app/src/config/gtif.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,10 @@ export const layerNameMapping = Object.freeze({
S2L2A_REP4: {
minZoom: 7,
layers: 'SENTINEL-2-L2A-TRUE-COLOR',
subAoiTransparent: true,
},
S1GRD_REP4: {
minZoom: 7,
layers: 'E8_SENTINEL1',
subAoiTransparent: true,
},
});

Expand Down Expand Up @@ -244,6 +242,19 @@ const getDailyDates = (start, end) => {
return dateArray;
};

const solarAndGreenRoofDefaults = [
baseLayers.s1EodcBackscattervv,
baseLayers.s1EodcBackscattervh,
baseLayers.geolandbasemap,
{
...baseLayers.bmapgelaende, visible: true,
},
baseLayers.bmaporthofoto30cm,
baseLayers.eoxosm,
baseLayers.cloudless,
baseLayers.terrainLight,
];

const energyTransitionDefaults = {
baseLayers: [
baseLayers.bodenwertigkeitskarte_agri,
Expand Down Expand Up @@ -330,6 +341,7 @@ export const indicatorsDefinition = Object.freeze({
baseLayers.s1EodcBackscattervv,
baseLayers.s1EodcBackscattervh],
dataInfo: 'SWE',
subAoiTransparent: true,
},
REP4_2: {
maxDecimals: 5,
Expand All @@ -346,15 +358,19 @@ export const indicatorsDefinition = Object.freeze({
baseLayers.s1EodcBackscattervv,
baseLayers.s1EodcBackscattervh],
dataInfo: 'SWE',
subAoiTransparent: true,
},
REP4_4: {
dataInfo: 'WSE',
subAoiTransparent: true,
},
REP4_5: {
dataInfo: 'SWE',
subAoiTransparent: true,
},
REP4_6: {
dataInfo: 'SWE',
subAoiTransparent: true,
maxDecimals: 5,
baseLayers: [{
...baseLayers.bmaporthofoto30cm, visible: true,
Expand Down Expand Up @@ -414,87 +430,51 @@ export const indicatorsDefinition = Object.freeze({
customAreaIndicator: true,
},
SOL1: {
baseLayers: [{
...baseLayers.bmapgelaende,
visible: true,
}, baseLayers.bmaporthofoto30cm],
baseLayers: solarAndGreenRoofDefaults,
customAreaIndicator: true,
},
SOL1_1: {
baseLayers: [{
...baseLayers.bmapgelaende,
visible: true,
}, baseLayers.bmaporthofoto30cm],
baseLayers: solarAndGreenRoofDefaults,
customAreaIndicator: true,
},
SOL1_2: {
baseLayers: [{
...baseLayers.bmapgelaende,
visible: true,
}, baseLayers.bmaporthofoto30cm],
baseLayers: solarAndGreenRoofDefaults,
customAreaIndicator: true,
},
SOL1_3: {
baseLayers: [{
...baseLayers.bmapgelaende,
visible: true,
}, baseLayers.bmaporthofoto30cm],
baseLayers: solarAndGreenRoofDefaults,
customAreaIndicator: true,
},
SOL1_4: {
baseLayers: [{
...baseLayers.bmapgelaende,
visible: true,
}, baseLayers.bmaporthofoto30cm],
baseLayers: solarAndGreenRoofDefaults,
customAreaIndicator: true,
},
SOL1_5: {
baseLayers: [{
...baseLayers.bmapgelaende,
visible: true,
}, baseLayers.bmaporthofoto30cm],
baseLayers: solarAndGreenRoofDefaults,
customAreaIndicator: true,
},
SOL1_6: {
baseLayers: [{
...baseLayers.bmapgelaende,
visible: true,
}, baseLayers.bmaporthofoto30cm],
baseLayers: solarAndGreenRoofDefaults,
customAreaIndicator: true,
},
SOL1_7: {
baseLayers: [{
...baseLayers.bmapgelaende,
visible: true,
}, baseLayers.bmaporthofoto30cm],
baseLayers: solarAndGreenRoofDefaults,
customAreaIndicator: true,
},
SOL2: {
baseLayers: [{
...baseLayers.bmapgelaende,
visible: true,
}, baseLayers.bmaporthofoto30cm],
baseLayers: solarAndGreenRoofDefaults,
customAreaIndicator: true,
},
SOL2_1: {
baseLayers: [{
...baseLayers.bmapgelaende,
visible: true,
}, baseLayers.bmaporthofoto30cm],
baseLayers: solarAndGreenRoofDefaults,
customAreaIndicator: true,
},
SOL2_2: {
baseLayers: [{
...baseLayers.bmapgelaende,
visible: true,
}, baseLayers.bmaporthofoto30cm],
baseLayers: solarAndGreenRoofDefaults,
customAreaIndicator: true,
},
SOL2_3: {
baseLayers: [{
...baseLayers.bmapgelaende,
visible: true,
}, baseLayers.bmaporthofoto30cm],
baseLayers: solarAndGreenRoofDefaults,
customAreaIndicator: true,
},
LST: {
Expand Down Expand Up @@ -1239,6 +1219,7 @@ function createSOL1Config(indicatorCode, selectedVariable) {
},
display: [{
dataInfo: indicatorCode,
minZoom: 8,
baseUrl: 'https://xcube-geodb.brockmann-consult.de/geoserver/geodb_debd884d-92f9-4979-87b6-eadef1139394/wms?',
STYLES: selectedVariable,
layers: 'geodb_debd884d-92f9-4979-87b6-eadef1139394:GTIF_AT_Rooftops_PV_bundesland_3857_v1',
Expand Down Expand Up @@ -1304,6 +1285,7 @@ function createSOL2Config(indicatorCode, selectedVariable) {
},
display: [{
dataInfo: indicatorCode,
minZoom: 8,
baseUrl: 'https://xcube-geodb.brockmann-consult.de/geoserver/geodb_debd884d-92f9-4979-87b6-eadef1139394/wms?',
STYLES: selectedVariable,
layers: 'geodb_debd884d-92f9-4979-87b6-eadef1139394:GTIF_AT_Rooftops_PV_bundesland_3857_v1',
Expand Down
20 changes: 10 additions & 10 deletions app/src/config/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@ export const baseLayers = Object.freeze({
url: '//s2maps-tiles.eu/wmts/1.0.0/s2cloudless-2021_3857/default/g/{z}/{y}/{x}.jpg',
attribution: '{ EOxCloudless 2021: <a xmlns:dct="http://purl.org/dc/terms/" href="//s2maps.eu" target="_blank" property="dct:title">Sentinel-2 cloudless - s2maps.eu</a> by <a xmlns:cc="http://creativecommons.org/ns#" href="//eox.at" target="_blank" property="cc:attributionName" rel="cc:attributionURL">EOX IT Services GmbH</a> (Contains modified Copernicus Sentinel data 2021) }',
visible: false,
maxZoom: 17,
maxNativeZoom: 17,
protocol: 'xyz',
},
cloudless2018: {
name: 'EOxCloudless 2018',
url: '//s2maps-tiles.eu/wmts/1.0.0/s2cloudless-2018_3857/default/g/{z}/{y}/{x}.jpg',
attribution: '{ EOxCloudless 2018: <a xmlns:dct="http://purl.org/dc/terms/" href="//s2maps.eu" target="_blank" property="dct:title">Sentinel-2 cloudless - s2maps.eu</a> by <a xmlns:cc="http://creativecommons.org/ns#" href="//eox.at" target="_blank" property="cc:attributionName" rel="cc:attributionURL">EOX IT Services GmbH</a> (Contains modified Copernicus Sentinel data 2018) }',
visible: false,
maxZoom: 17,
maxNativeZoom: 17,
protocol: 'xyz',
},
terrainLight: {
name: 'Terrain light',
url: '//s2maps-tiles.eu/wmts/1.0.0/terrain-light_3857/default/g/{z}/{y}/{x}.jpg',
attribution: '{ Terrain light: Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors and <a href="//maps.eox.at/#data" target="_blank">others</a>, Rendering &copy; <a href="http://eox.at" target="_blank">EOX</a> }',
maxZoom: 16,
maxNativeZoom: 16,
visible: false,
protocol: 'xyz',
},
eoxosm: {
name: 'OSM Background',
url: '//s2maps-tiles.eu/wmts/1.0.0/osm_3857/default/g/{z}/{y}/{x}.jpg',
attribution: '{ OSM: Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors and <a href="//maps.eox.at/#data" target="_blank">others</a>, Rendering &copy; <a href="http://eox.at" target="_blank">EOX</a> }',
maxZoom: 16,
maxNativeZoom: 16,
visible: false,
protocol: 'xyz',
},
Expand All @@ -58,23 +58,23 @@ export const baseLayers = Object.freeze({
url: '//maps1.wien.gv.at/basemap/geolandbasemap/normal/google3857/{z}/{y}/{x}.png',
attribution: '{ Datenquelle: <a href="https://basemap.at" target="_blank" property="dct:title">basemap.at</a> }',
visible: false,
maxZoom: 18,
maxNativeZoom: 18,
protocol: 'xyz',
},
bmapgelaende: {
name: 'Geoland Basemap Gelände',
url: '//maps1.wien.gv.at/basemap/bmapgelaende/grau/google3857/{z}/{y}/{x}.jpeg',
attribution: '{ Datenquelle: <a href="https://basemap.at" target="_blank" property="dct:title">basemap.at</a> }',
visible: false,
maxZoom: 18,
maxNativeZoom: 18,
protocol: 'xyz',
},
bmaporthofoto30cm: {
name: 'Geoland Basemap Orthofoto',
url: '//maps1.wien.gv.at/basemap/bmaporthofoto30cm/normal/google3857/{z}/{y}/{x}.jpeg',
attribution: '{ Datenquelle: <a href="https://basemap.at" target="_blank" property="dct:title">basemap.at</a> }',
visible: false,
maxZoom: 18,
maxNativeZoom: 18,
protocol: 'xyz',
},
bodenwertigkeitskarte_agri: {
Expand Down Expand Up @@ -158,15 +158,15 @@ export const baseLayers = Object.freeze({
url: '//s1map.eodc.eu/vv/{z}/{x}/{-y}.png',
attribution: 'Bauer-Marschallinger, B., Cao, S., Navacchi, C., Freeman, V., Reuß, F., Geudtner, D., Rommen, B., Vega, F. C., Snoeij, P., Attema, E., Reimer, C., & Wagner, W. (2021). The Sentinel-1 Global Backscatter Model (S1GBM) - Mapping Earth Land Surface with C-Band Microwaves (1.0) [Data set]. TU Wien. https://doi.org/10.48436/n2d1v-gqb91',
visible: false,
maxZoom: 13,
maxNativeZoom: 13,
protocol: 'xyz',
},
s1EodcBackscattervh: {
name: 'EODC Sentinel 1 VH Polarisation',
url: '//s1map.eodc.eu/vh/{z}/{x}/{-y}.png',
attribution: 'Bauer-Marschallinger, B., Cao, S., Navacchi, C., Freeman, V., Reuß, F., Geudtner, D., Rommen, B., Vega, F. C., Snoeij, P., Attema, E., Reimer, C., & Wagner, W. (2021). The Sentinel-1 Global Backscatter Model (S1GBM) - Mapping Earth Land Surface with C-Band Microwaves (1.0) [Data set]. TU Wien. https://doi.org/10.48436/n2d1v-gqb91',
visible: false,
maxZoom: 13,
maxNativeZoom: 13,
protocol: 'xyz',
},
terrainLightStereoNorth: {
Expand Down Expand Up @@ -209,7 +209,7 @@ export const overlayLayers = Object.freeze({
url: '//s2maps-tiles.eu/wmts/1.0.0/overlay_base_bright_3857/default/g/{z}/{y}/{x}.jpg',
attribution: '{ Overlay: Data &copy; <a href="http://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors, Made with Natural Earth, Rendering &copy; <a href="//eox.at" target="_blank">EOX</a> }',
visible: false,
maxZoom: 14,
maxNativeZoom: 14,
protocol: 'xyz',
},
powerOpenInfrastructure: {
Expand Down

0 comments on commit eef4d39

Please sign in to comment.