调整参数

This commit is contained in:
JIANG
2025-11-18 11:31:57 +08:00
parent d91e618559
commit 01563c3c2d
2 changed files with 52 additions and 65 deletions

View File

@@ -15,47 +15,12 @@ import { FeatureLike } from "ol/Feature";
import Feature from "ol/Feature";
import StyleEditorPanel from "./StyleEditorPanel";
import StyleLegend from "./StyleLegend"; // 引入图例组件
import { handleMapClickSelectFeatures as mapClickSelectFeatures } from "@/utils/mapQueryService";
import { config } from "@/config/config";
const backendUrl = config.BACKEND_URL;
// 图层样式状态接口
interface StyleConfig {
property: string;
classificationMethod: string;
segments: number;
minSize: number;
maxSize: number;
minStrokeWidth: number;
maxStrokeWidth: number;
fixedStrokeWidth: number;
colorType: string;
startColor: string;
endColor: string;
showLabels: boolean;
opacity: number;
adjustWidthByProperty: boolean;
}
interface LegendStyleConfig {
layerId: string;
layerName: string;
property: string;
colors: string[];
type: string;
dimensions: number[];
breaks: number[];
}
interface LayerStyleState {
layerId: string;
layerName: string;
styleConfig: StyleConfig;
legendConfig: LegendStyleConfig;
isActive: boolean;
}
import { LayerStyleState } from "./StyleEditorPanel";
// 添加接口定义隐藏按钮的props
interface ToolbarProps {
@@ -93,8 +58,9 @@ const Toolbar: React.FC<ToolbarProps> = ({ hiddenButtons, queryType }) => {
maxStrokeWidth: 8,
fixedStrokeWidth: 3,
colorType: "gradient",
startColor: "rgba(51, 153, 204, 0.9)",
endColor: "rgba(204, 51, 51, 0.9)",
singlePaletteIndex: 0,
gradientPaletteIndex: 0,
rainbowPaletteIndex: 0,
showLabels: false,
opacity: 0.9,
adjustWidthByProperty: true,
@@ -123,8 +89,9 @@ const Toolbar: React.FC<ToolbarProps> = ({ hiddenButtons, queryType }) => {
maxStrokeWidth: 8,
fixedStrokeWidth: 3,
colorType: "gradient",
startColor: "rgba(51, 153, 204, 0.9)",
endColor: "rgba(204, 51, 51, 0.9)",
singlePaletteIndex: 0,
gradientPaletteIndex: 0,
rainbowPaletteIndex: 0,
showLabels: false,
opacity: 0.9,
adjustWidthByProperty: true,
@@ -149,7 +116,10 @@ const Toolbar: React.FC<ToolbarProps> = ({ hiddenButtons, queryType }) => {
layerName: state.layerName,
layerId: state.layerId,
}));
useEffect(() => {
console.log(layerStyleStates);
console.log("Active Legends:", activeLegendConfigs);
}, [layerStyleStates]);
// 创建高亮图层
useEffect(() => {
if (!map) return;