feat(workbench): integrate runtime data and map tooling
This commit is contained in:
@@ -9,8 +9,7 @@ import {
|
||||
import { SCADA_SOURCE_ID } from "./scada";
|
||||
|
||||
export const WATER_NETWORK_GLOBAL_VIEW = {
|
||||
bbox3857: [13508801.930066336, 3608163.3499832638, 13555650.638648884, 3633685.137885742],
|
||||
bbox4326: [121.35162408429075, 30.81049932304578, 121.77248479490075, 31.007207809222017]
|
||||
bbox3857: [13508801.930066336, 3608163.3499832638, 13555650.638648884, 3633685.137885742]
|
||||
} as const;
|
||||
|
||||
export const SOURCE_LAYERS = {
|
||||
@@ -19,7 +18,17 @@ export const SOURCE_LAYERS = {
|
||||
valves: "valves",
|
||||
reservoirs: "reservoirs",
|
||||
pumps: "pumps",
|
||||
tanks: "tanks"
|
||||
tanks: "tanks",
|
||||
water_quality_monitoring_points: "water_quality_monitoring_points",
|
||||
fx_20200423_drain_valves: "fx_20200423_drain_valves",
|
||||
fx_20200423_service_connections: "fx_20200423_service_connections",
|
||||
fx_20200423_flow_meters: "fx_20200423_flow_meters",
|
||||
fx_20200423_hydrants: "fx_20200423_hydrants",
|
||||
fx_20200423_customer_meters: "fx_20200423_customer_meters",
|
||||
fx_20200423_pipes: "fx_20200423_pipes",
|
||||
fx_20200423_valves: "fx_20200423_valves",
|
||||
fx_20200423_non_residential_meters: "fx_20200423_non_residential_meters",
|
||||
fx_20200811_dn100_pipes: "fx_20200811_dn100_pipes"
|
||||
} as const;
|
||||
|
||||
export const WATER_NETWORK_SOURCE_IDS = [
|
||||
@@ -29,7 +38,17 @@ export const WATER_NETWORK_SOURCE_IDS = [
|
||||
"reservoirs",
|
||||
"scada",
|
||||
"pumps",
|
||||
"tanks"
|
||||
"tanks",
|
||||
"water_quality_monitoring_points",
|
||||
"fx_20200423_drain_valves",
|
||||
"fx_20200423_service_connections",
|
||||
"fx_20200423_flow_meters",
|
||||
"fx_20200423_hydrants",
|
||||
"fx_20200423_customer_meters",
|
||||
"fx_20200423_pipes",
|
||||
"fx_20200423_valves",
|
||||
"fx_20200423_non_residential_meters",
|
||||
"fx_20200811_dn100_pipes"
|
||||
] as const;
|
||||
|
||||
export type WaterNetworkSourceId = (typeof WATER_NETWORK_SOURCE_IDS)[number];
|
||||
@@ -42,6 +61,8 @@ export type SupplyLayerCatalogItem = {
|
||||
availability: "required" | "probe";
|
||||
label: string;
|
||||
icon: string;
|
||||
group: "model" | "monitoring" | "source-gis";
|
||||
initialVisible: boolean;
|
||||
};
|
||||
|
||||
export const SUPPLY_LAYER_CATALOG = [
|
||||
@@ -52,7 +73,9 @@ export const SUPPLY_LAYER_CATALOG = [
|
||||
available: true,
|
||||
availability: "required",
|
||||
label: "管线",
|
||||
icon: "pipe"
|
||||
icon: "pipe",
|
||||
group: "model",
|
||||
initialVisible: true
|
||||
},
|
||||
{
|
||||
id: "junctions",
|
||||
@@ -61,7 +84,9 @@ export const SUPPLY_LAYER_CATALOG = [
|
||||
available: true,
|
||||
availability: "required",
|
||||
label: "节点",
|
||||
icon: "junction"
|
||||
icon: "junction",
|
||||
group: "model",
|
||||
initialVisible: true
|
||||
},
|
||||
{
|
||||
id: "valves",
|
||||
@@ -70,7 +95,9 @@ export const SUPPLY_LAYER_CATALOG = [
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "阀门",
|
||||
icon: "valve"
|
||||
icon: "valve",
|
||||
group: "model",
|
||||
initialVisible: true
|
||||
},
|
||||
{
|
||||
id: "reservoirs",
|
||||
@@ -79,7 +106,9 @@ export const SUPPLY_LAYER_CATALOG = [
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "水库",
|
||||
icon: "reservoir"
|
||||
icon: "reservoir",
|
||||
group: "model",
|
||||
initialVisible: true
|
||||
},
|
||||
{
|
||||
id: "scada",
|
||||
@@ -88,7 +117,9 @@ export const SUPPLY_LAYER_CATALOG = [
|
||||
available: true,
|
||||
availability: "required",
|
||||
label: "SCADA",
|
||||
icon: "scada-pressure"
|
||||
icon: "scada-pressure",
|
||||
group: "monitoring",
|
||||
initialVisible: true
|
||||
},
|
||||
{
|
||||
id: "pumps",
|
||||
@@ -97,7 +128,9 @@ export const SUPPLY_LAYER_CATALOG = [
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "水泵",
|
||||
icon: "pump"
|
||||
icon: "pump",
|
||||
group: "model",
|
||||
initialVisible: true
|
||||
},
|
||||
{
|
||||
id: "tanks",
|
||||
@@ -106,10 +139,130 @@ export const SUPPLY_LAYER_CATALOG = [
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "水箱",
|
||||
icon: "tank"
|
||||
icon: "tank",
|
||||
group: "model",
|
||||
initialVisible: true
|
||||
},
|
||||
{
|
||||
id: "water_quality_monitoring_points",
|
||||
sourceLayer: SOURCE_LAYERS.water_quality_monitoring_points,
|
||||
geometry: "point",
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "水质监测点",
|
||||
icon: "water-quality",
|
||||
group: "monitoring",
|
||||
initialVisible: true
|
||||
},
|
||||
{
|
||||
id: "fx_20200423_pipes",
|
||||
sourceLayer: SOURCE_LAYERS.fx_20200423_pipes,
|
||||
geometry: "line",
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "GIS 管线",
|
||||
icon: "source-pipe",
|
||||
group: "source-gis",
|
||||
initialVisible: false
|
||||
},
|
||||
{
|
||||
id: "fx_20200811_dn100_pipes",
|
||||
sourceLayer: SOURCE_LAYERS.fx_20200811_dn100_pipes,
|
||||
geometry: "line",
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "DN100+ 台账",
|
||||
icon: "source-pipe",
|
||||
group: "source-gis",
|
||||
initialVisible: false
|
||||
},
|
||||
{
|
||||
id: "fx_20200423_valves",
|
||||
sourceLayer: SOURCE_LAYERS.fx_20200423_valves,
|
||||
geometry: "point",
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "GIS 阀门",
|
||||
icon: "source-valve",
|
||||
group: "source-gis",
|
||||
initialVisible: false
|
||||
},
|
||||
{
|
||||
id: "fx_20200423_drain_valves",
|
||||
sourceLayer: SOURCE_LAYERS.fx_20200423_drain_valves,
|
||||
geometry: "point",
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "排水阀",
|
||||
icon: "source-valve",
|
||||
group: "source-gis",
|
||||
initialVisible: false
|
||||
},
|
||||
{
|
||||
id: "fx_20200423_flow_meters",
|
||||
sourceLayer: SOURCE_LAYERS.fx_20200423_flow_meters,
|
||||
geometry: "point",
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "流量仪",
|
||||
icon: "source-meter",
|
||||
group: "source-gis",
|
||||
initialVisible: false
|
||||
},
|
||||
{
|
||||
id: "fx_20200423_hydrants",
|
||||
sourceLayer: SOURCE_LAYERS.fx_20200423_hydrants,
|
||||
geometry: "point",
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "消火栓",
|
||||
icon: "source-hydrant",
|
||||
group: "source-gis",
|
||||
initialVisible: false
|
||||
},
|
||||
{
|
||||
id: "fx_20200423_service_connections",
|
||||
sourceLayer: SOURCE_LAYERS.fx_20200423_service_connections,
|
||||
geometry: "point",
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "接水点",
|
||||
icon: "source-connection",
|
||||
group: "source-gis",
|
||||
initialVisible: false
|
||||
},
|
||||
{
|
||||
id: "fx_20200423_customer_meters",
|
||||
sourceLayer: SOURCE_LAYERS.fx_20200423_customer_meters,
|
||||
geometry: "point",
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "用户水表",
|
||||
icon: "source-meter",
|
||||
group: "source-gis",
|
||||
initialVisible: false
|
||||
},
|
||||
{
|
||||
id: "fx_20200423_non_residential_meters",
|
||||
sourceLayer: SOURCE_LAYERS.fx_20200423_non_residential_meters,
|
||||
geometry: "point",
|
||||
available: true,
|
||||
availability: "probe",
|
||||
label: "非居民水表",
|
||||
icon: "source-meter",
|
||||
group: "source-gis",
|
||||
initialVisible: false
|
||||
}
|
||||
] as const satisfies readonly SupplyLayerCatalogItem[];
|
||||
|
||||
export const SOURCE_GIS_SOURCE_IDS = SUPPLY_LAYER_CATALOG.filter(
|
||||
(layer) => layer.group === "source-gis"
|
||||
).map((layer) => layer.id) as WaterNetworkSourceId[];
|
||||
|
||||
export function isSourceGisSourceId(value: string): value is WaterNetworkSourceId {
|
||||
return (SOURCE_GIS_SOURCE_IDS as readonly string[]).includes(value);
|
||||
}
|
||||
|
||||
export const AVAILABLE_WATER_NETWORK_SOURCE_IDS = SUPPLY_LAYER_CATALOG.filter(
|
||||
(layer) => layer.available
|
||||
).map((layer) => layer.id) as WaterNetworkSourceId[];
|
||||
@@ -155,8 +308,7 @@ function createGeoServerVectorSource(
|
||||
`${MAP_URL}/gwc/service/wmts/rest/${GEOSERVER_WORKSPACE}:${sourceLayer}/WebMercatorQuad/{z}/{y}/{x}?format=application/vnd.mapbox-vector-tile`
|
||||
],
|
||||
minzoom: 0,
|
||||
maxzoom: 24,
|
||||
bounds: [...WATER_NETWORK_GLOBAL_VIEW.bbox4326]
|
||||
maxzoom: 24
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user