Skip to content

Commit

Permalink
fix: map loading old indicator approach; issues of loading data when …
Browse files Browse the repository at this point in the history
…not available;
  • Loading branch information
santilland committed Jul 20, 2023
1 parent c98a857 commit 8d2ae91
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
11 changes: 7 additions & 4 deletions app/src/components/DataPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
:href="dataHrefCSV"
:download="downloadFileName"
target="_blank"
v-if="indicatorObject
v-if="dataObject
&& !showMap
&& !this.baseConfig.indicatorsDefinition[
indicatorObject.indicator
Expand Down Expand Up @@ -453,6 +453,9 @@ export default {
}
return indicatorObject;
},
dataObject() {
return this.$store.state.features.featureData;
},
dataHrefCSV() {
let dataHref = 'data:text/csv;charset=utf-8,';
const exportKeys = [
Expand All @@ -462,15 +465,15 @@ export default {
];
const header = `${exportKeys.join()}\n`;
let csv = header;
for (let i = 0; i < this.indicatorObject.time.length; i++) {
for (let i = 0; i < this.dataObject.time.length; i++) {
let row = '';
for (let kk = 0; kk < exportKeys.length; kk++) {
const cKey = exportKeys[kk];
let txtVal = '';
if (cKey === 'aoi') {
txtVal = `"${this.indicatorObject[cKey]}",`;
txtVal = `"${this.dataObject[cKey]}",`;
} else {
txtVal = `"${this.indicatorObject[cKey][i]}",`;
txtVal = `"${this.dataObject[cKey][i]}",`;
}
row += txtVal;
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/components/IndicatorData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<div style="width: 100%; height: 100%;"
v-else-if="mapchartIndicators.includes(indicatorObject.indicator)">
<map-chart
v-if='datacollection'
id="chart"
class="fill-height"
:width="null"
Expand All @@ -49,7 +50,7 @@
</div>
</div>
<div style="width: 100%; height: 100%;" v-else>
<line-chart v-if='lineChartIndicators.includes(indicatorObject.indicator)'
<line-chart v-if='lineChartIndicators.includes(indicatorObject.indicator) && dataObject'
id="chart" ref="lineChart"
@extentChanged="extentChanged"
class="fill-height"
Expand Down
3 changes: 2 additions & 1 deletion app/src/components/map/Map.vue
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ export default {
// the current indicator definition object.
// will use the "currentIndicator"-Prop if defined (dashboard)
// otherwise it will use the selected indicator from the store
return getIndicatorFilteredInputData(this.currentIndicator);
return this.$store.state.indicators.selectedIndicator;
// return getIndicatorFilteredInputData(this.currentIndicator);
},
drawnArea() {
// in store or prop saved as 'object', in this component and
Expand Down
2 changes: 2 additions & 0 deletions app/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ export async function loadIndicatorData(baseConfig, payload) {
*/
};
timeBasedLayerFound = true;
} else {
indicatorObject.display = null;
}

const times = [];
Expand Down

0 comments on commit 8d2ae91

Please sign in to comment.