Skip to content

Commit

Permalink
Merge pull request #4812 from UNDP-Data/release/develop-to-main
Browse files Browse the repository at this point in the history
[RELEASE] Merge develop to main
  • Loading branch information
JinIgarashi authored Feb 7, 2025
2 parents ebbd45f + e469d87 commit 5d2b603
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
6 changes: 6 additions & 0 deletions sites/geohub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# geohub

## 1.22.37

### Patch Changes

- c431709: fix: fixed bug of error of duplicate layer in CEEI dashboard.

## 1.22.36

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion sites/geohub/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "geohub",
"version": "1.22.36",
"version": "1.22.37",
"description": "GeoHub is a geospatial visualization data portal built by UNDP using sveltekit",
"scripts": {
"dev": "pnpm prebuild && vite dev",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
let colorGroups = $state(getColorGroups());
const openSimulateModal = () => {
if (layerDetails.sliders) {
sliders = [...layerDetails.sliders];
} else {
sliders = [...defaultSliders];
}
showSimulateModal = true;
};
Expand Down Expand Up @@ -78,7 +84,12 @@
const tippyTooltip = initTooltipTippy();
let sliders = $state([
const defaultSliders: {
id: number;
percentage: number;
label: string;
locked: boolean;
}[] = [
{ id: 1, percentage: 7.1429, label: 'Solar Power Potential', locked: false },
{ id: 2, percentage: 7.1429, label: 'Wind Speed', locked: false },
{ id: 3, percentage: 7.1429, label: 'Geothermal Power Potential', locked: false },
Expand Down Expand Up @@ -108,7 +119,9 @@
label: 'Fossil Fuel Share on Energy Capacity and Generation',
locked: false
}
]);
];
let sliders = $state(defaultSliders);
let pillarSliders = $state([
{ id: 1, percentage: 28.57, label: 'Potential', locked: false },
Expand Down Expand Up @@ -307,7 +320,7 @@
multiplierMap[slider.label] = multiplier;
});
applyDataSimulation($mapStore, index, sliders, multiplierMap);
applyDataSimulation($mapStore, index, $state.snapshot(sliders), multiplierMap);
};
const handleClicked = (callback: (index?: number) => unknown, index?: number) => () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ export interface Layer {
layer: AddLayerObject;
bounds: LngLatBoundsLike;
data: object[];
sliders?;
sliders?: {
id: number;
percentage: number;
label: string;
locked: boolean;
}[];
muliplierMap?: Map;
isVisible: boolean;
isMapLoaded: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ export const uploadData = async (map: Map, index: number) => {
map.once('sourcedata', (e) => {
const waiting = () => {
if (e.sourceId === layers[index].sourceId && e.isSourceLoaded) {
layers[index].data = results.data;
layers[index].data = results.data as object[];
layersStore.set(layers);
applyDataSimulation(map, index, layers[index].sliders, layers[index].muliplierMap);
toast.push(`Map data for layer ${layers[index].name} has been updated`);
Expand Down

0 comments on commit 5d2b603

Please sign in to comment.