feat(map): manage agent overlays in layer panel
This commit is contained in:
@@ -54,8 +54,7 @@ describe("workbench supply layer controls", () => {
|
||||
"scada-flow",
|
||||
"water_quality_monitoring_points",
|
||||
"fx_20200423_pipes",
|
||||
"fx_20200811_dn100_pipes",
|
||||
"simulation"
|
||||
"fx_20200811_dn100_pipes"
|
||||
])
|
||||
);
|
||||
expect(items.find((item) => item.id === "fx_20200423_pipes")).toMatchObject({
|
||||
@@ -104,12 +103,30 @@ describe("workbench supply layer controls", () => {
|
||||
"valves",
|
||||
"reservoirs",
|
||||
"scada-pressure",
|
||||
"scada-flow",
|
||||
"simulation"
|
||||
"scada-flow"
|
||||
]);
|
||||
});
|
||||
|
||||
it("defines map-matched symbols for model, source GIS, and analysis layers", () => {
|
||||
it("lists actual presentation overlays with their visibility and removes cleared entries", () => {
|
||||
const overlays = [
|
||||
{ id: "presentation:investigation:area", title: "爆管影响范围", description: "Agent 调查 · 空间范围", featureCount: 1, visible: true },
|
||||
{ id: "presentation:chat:area", title: "投诉点热力", description: "Agent 对话 · 热力分布", featureCount: 8, visible: false }
|
||||
];
|
||||
const items = createLayerControlItems(INITIAL_LAYER_VISIBILITY, undefined, {}, overlays);
|
||||
|
||||
expect(items.filter((item) => item.group === "analysis")).toMatchObject([
|
||||
{ id: overlays[0].id, label: "爆管影响范围", visible: true, featureCount: 1 },
|
||||
{ id: overlays[1].id, label: "投诉点热力", visible: false, featureCount: 8 }
|
||||
]);
|
||||
expect(createVisibleMapLegendItems(items).filter((item) => item.group === "analysis")).toMatchObject([
|
||||
{ label: "爆管影响范围", layerControlId: overlays[0].id, shape: "area" }
|
||||
]);
|
||||
const cleared = createLayerControlItems(INITIAL_LAYER_VISIBILITY);
|
||||
expect(cleared.filter((item) => item.group === "analysis")).toEqual([]);
|
||||
expect(createVisibleMapLegendItems(cleared).filter((item) => item.group === "analysis")).toEqual([]);
|
||||
});
|
||||
|
||||
it("defines map-matched symbols for model and source GIS layers", () => {
|
||||
expect(MAP_LEGEND_ITEMS.map((item) => item.id)).toEqual([
|
||||
"major-pipe",
|
||||
"medium-pipe",
|
||||
@@ -134,8 +151,7 @@ describe("workbench supply layer controls", () => {
|
||||
"source-hydrant",
|
||||
"source-connection",
|
||||
"source-customer-meter",
|
||||
"source-non-residential-meter",
|
||||
"impact-area"
|
||||
"source-non-residential-meter"
|
||||
]);
|
||||
expect(MAP_LEGEND_ITEMS.find((item) => item.id === "valve")).toMatchObject({
|
||||
imageSrc: "/map/valve.png"
|
||||
@@ -186,11 +202,6 @@ describe("workbench supply layer controls", () => {
|
||||
).toMatchObject({
|
||||
imageSrc: "/map/gis-non-residential-meter.svg"
|
||||
});
|
||||
expect(MAP_LEGEND_ITEMS.find((item) => item.id === "impact-area")).toMatchObject({
|
||||
groupLabel: "分析覆盖",
|
||||
layerControlId: "simulation",
|
||||
shape: "area"
|
||||
});
|
||||
});
|
||||
|
||||
it("keeps the legend synchronized with visible layer controls", () => {
|
||||
@@ -222,8 +233,7 @@ describe("workbench supply layer controls", () => {
|
||||
|
||||
const reducedItems = createLayerControlItems({
|
||||
...INITIAL_LAYER_VISIBILITY,
|
||||
valves: false,
|
||||
simulation: false
|
||||
valves: false
|
||||
});
|
||||
const reducedLegendIds = createVisibleMapLegendItems(reducedItems).map((item) => item.id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user