新增项目选择弹窗(预设选项),支持变更环境变量

This commit is contained in:
JIANG
2026-02-10 16:13:04 +08:00
parent 8ea70d04ad
commit 1e8af75b88
6 changed files with 234 additions and 11 deletions

View File

@@ -40,15 +40,15 @@ interface MapClickEvent {
// ========== 常量配置 ==========
/**
* GeoServer 服务配置
* GeoServer 服务配置获取函数
*/
const GEOSERVER_CONFIG = {
const getGeoserverConfig = () => ({
url: config.MAP_URL,
workspace: config.MAP_WORKSPACE,
layers: ["geo_pipes_mat", "geo_junctions_mat", "geo_valves"],
wfsVersion: "1.0.0",
outputFormat: "application/json",
} as const;
});
/**
* 地图交互配置
@@ -176,7 +176,7 @@ const convertRenderFeatureToFeature = (
* @returns WFS 查询 URL
*/
const buildWfsUrl = (layer: string, orFilter: string): string => {
const { url, workspace, wfsVersion, outputFormat } = GEOSERVER_CONFIG;
const { url, workspace, wfsVersion, outputFormat } = getGeoserverConfig();
const params = new URLSearchParams({
service: "WFS",
version: wfsVersion,
@@ -233,7 +233,7 @@ const queryFeaturesByIds = async (
try {
if (!layer) {
// 查询所有配置的图层
const promises = GEOSERVER_CONFIG.layers.map((layerName) =>
const promises = getGeoserverConfig().layers.map((layerName) =>
fetchFeaturesFromLayer(layerName, orFilter)
);