调整数据小数点位数显示;更换 valve 图标,上调 valvesLayer 的显示层级;特殊处理流量的样式显示
This commit is contained in:
@@ -400,7 +400,7 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (!mapRef.current) return;
|
||||
// 缓存 junction、pipe 数据,提供给 deck.gl 显示标签使用
|
||||
// 缓存 junction、pipe 数据,提供给 deck.gl 提供坐标供标签显示
|
||||
junctionSource.on("tileloadend", (event) => {
|
||||
try {
|
||||
if (event.tile instanceof VectorTile) {
|
||||
@@ -555,14 +555,14 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
|
||||
});
|
||||
// 重新排列图层顺序,确保顺序 点>线>面
|
||||
availableLayers.sort((a, b) => {
|
||||
// 明确顺序(点类优先)
|
||||
// 明确顺序(点类优先),这里 valves 特殊处理
|
||||
const order = [
|
||||
"valves",
|
||||
"junctions",
|
||||
"scada",
|
||||
"reservoirs",
|
||||
"pumps",
|
||||
"tanks",
|
||||
"valves",
|
||||
"pipes",
|
||||
].reverse();
|
||||
// 取值时做安全检查,兼容不同写法(properties.value 或 直接 value)
|
||||
@@ -850,7 +850,9 @@ const MapComponent: React.FC<MapComponentProps> = ({ children }) => {
|
||||
pipeProperties === "flow" && record.value < 0 && p.flowFlag > 0
|
||||
? [...p.path].reverse()
|
||||
: p.path,
|
||||
[pipeProperties]: record.value,
|
||||
// 流量数值
|
||||
[pipeProperties]:
|
||||
pipeProperties === "flow" ? Math.abs(record.value) : record.value,
|
||||
};
|
||||
}
|
||||
return p;
|
||||
|
||||
Reference in New Issue
Block a user