fix(map): convert actual demand display units
This commit is contained in:
@@ -24,7 +24,7 @@ import { TextLayer } from "@deck.gl/layers";
|
||||
import { TripsLayer } from "@deck.gl/geo-layers";
|
||||
import { CollisionFilterExtension } from "@deck.gl/extensions";
|
||||
import { ContourLayer } from "deck.gl";
|
||||
import { toM3h } from "@utils/units";
|
||||
import { isLpsFlowProperty, toM3h } from "@utils/units";
|
||||
import { usePathname } from "next/navigation";
|
||||
import {
|
||||
cleanupTransientMapResources,
|
||||
@@ -204,8 +204,7 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
|
||||
return junctionData.map((j) => {
|
||||
const record = nodeMap.get(j.id);
|
||||
let val = record ? record.value : undefined;
|
||||
// 在这合并时将实际需水量从 LPS 转换为大写表示
|
||||
if (val !== undefined && junctionText === "actualdemand") {
|
||||
if (val !== undefined && isLpsFlowProperty(junctionText)) {
|
||||
val = toM3h(val, "lps");
|
||||
}
|
||||
return record ? { ...j, [junctionText]: val } : j;
|
||||
@@ -236,7 +235,7 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
|
||||
return junctionData.map((j) => {
|
||||
const record = nodeMap.get(j.id);
|
||||
let val = record ? record.value : undefined;
|
||||
if (val !== undefined && junctionText === "actualdemand") {
|
||||
if (val !== undefined && isLpsFlowProperty(junctionText)) {
|
||||
val = toM3h(val, "lps");
|
||||
}
|
||||
return record ? { ...j, [junctionText]: val } : j;
|
||||
|
||||
Reference in New Issue
Block a user