更新图例,处理小于零的异常数据显示

This commit is contained in:
JIANG
2025-11-14 17:49:19 +08:00
parent dd93b37685
commit 09684b2171
4 changed files with 42 additions and 22 deletions

View File

@@ -214,17 +214,6 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
}),
});
};
// 定义 valves 图层的样式函数,使用固定图标
// const valveStyle = () => {
// const valveIcon = "/icons/valve.svg";
// return new Style({
// image: new Icon({
// src: valveIcon,
// scale: 0.1, // 根据需要调整图标大小
// anchor: [0.5, 0.5], // 图标锚点居中
// }),
// });
// };
const valveStyle = {
"icon-src": "/icons/valve.svg",
"icon-scale": 0.1,
@@ -681,7 +670,7 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
getPosition: (d: any) => d.position,
fontFamily: "Monaco, monospace",
getText: (d: any) =>
d[pipeText] ? (d[pipeText] as number).toFixed(3) : "",
d[pipeText] ? Math.abs(d[pipeText] as number).toFixed(3) : "",
getSize: 18,
fontWeight: "bold",
getColor: [0, 0, 0],