vue-openlayers-plugin 1.0.59 → 1.0.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -69141,17 +69141,27 @@ function getUnitOptions(type) {
69141
69141
  }
69142
69142
  const STORAGE_CONFIG = {
69143
69143
  ENABLED: false,
69144
+ // 默认禁用本地存储
69144
69145
  MAX_MEASUREMENTS: 100,
69146
+ // 减少到100条,避免过多累积
69145
69147
  MAX_LAYER_CONFIGS: 30,
69148
+ // 减少到30个,够用即可
69146
69149
  MAX_SEARCH_HISTORY: 20,
69150
+ // 新增:搜索历史限制
69147
69151
  QUOTA_WARNING_THRESHOLD: 0.6,
69152
+ // 配额警告阈值(60%)
69148
69153
  AUTO_CLEANUP_THRESHOLD: 0.7,
69154
+ // 自动清理阈值(70%)
69149
69155
  COMPRESSION_ENABLED: true,
69156
+ // 是否启用压缩
69150
69157
  BATCH_CLEANUP_SIZE: 10,
69158
+ // 减少批量清理数量
69151
69159
  // 新增:数据过期时间配置(毫秒)
69152
69160
  DATA_EXPIRY: {
69153
69161
  MEASUREMENTS: 30 * 24 * 60 * 60 * 1e3,
69162
+ // 30天
69154
69163
  MAP_STATE: 7 * 24 * 60 * 60 * 1e3,
69164
+ // 7天
69155
69165
  SEARCH_HISTORY: 7 * 24 * 60 * 60 * 1e3
69156
69166
  // 7天
69157
69167
  }
@@ -69206,7 +69216,9 @@ class MapStorage {
69206
69216
  cleanupExpiredData() {
69207
69217
  try {
69208
69218
  const measurements = this.getMeasurements();
69209
- const validMeasurements = measurements.filter((m2) => !m2.timestamp || !this.isDataExpired(m2.timestamp, "MEASUREMENTS"));
69219
+ const validMeasurements = measurements.filter(
69220
+ (m2) => !m2.timestamp || !this.isDataExpired(m2.timestamp, "MEASUREMENTS")
69221
+ );
69210
69222
  if (validMeasurements.length !== measurements.length) {
69211
69223
  this.saveMeasurements(validMeasurements);
69212
69224
  console.log(`清理过期测量结果:${measurements.length} -> ${validMeasurements.length}`);
@@ -69325,7 +69337,6 @@ class MapStorage {
69325
69337
  */
69326
69338
  safeSetItem(key, value) {
69327
69339
  if (!this.storageEnabled) {
69328
- console.log("存储功能已禁用,跳过存储操作");
69329
69340
  return false;
69330
69341
  }
69331
69342
  try {
@@ -69392,7 +69403,7 @@ class MapStorage {
69392
69403
  timestamp: m2.timestamp || Date.now()
69393
69404
  }));
69394
69405
  const success = this.safeSetItem(this.storageKeys.MEASUREMENTS, JSON.stringify(limitedMeasurements));
69395
- if (!success) {
69406
+ if (!success && this.storageEnabled) {
69396
69407
  console.error("保存测量结果失败: 存储空间不足");
69397
69408
  }
69398
69409
  } catch (error2) {
@@ -69485,7 +69496,7 @@ class MapStorage {
69485
69496
  return optimizedConfig;
69486
69497
  });
69487
69498
  const success = this.safeSetItem(this.storageKeys.LAYER_CONFIGS, JSON.stringify(configsToSave));
69488
- if (!success) {
69499
+ if (!success && this.storageEnabled) {
69489
69500
  console.error("保存图层配置失败: 存储空间不足");
69490
69501
  }
69491
69502
  } catch (error2) {
@@ -69511,7 +69522,7 @@ class MapStorage {
69511
69522
  try {
69512
69523
  const state = { center: center2, zoom, rotation, timestamp: Date.now() };
69513
69524
  const success = this.safeSetItem(this.storageKeys.MAP_STATE, JSON.stringify(state));
69514
- if (!success) {
69525
+ if (!success && this.storageEnabled) {
69515
69526
  console.error("保存地图状态失败: 存储空间不足");
69516
69527
  }
69517
69528
  } catch (error2) {
@@ -69588,7 +69599,12 @@ class MapStorage {
69588
69599
  * 手动清理存储
69589
69600
  */
69590
69601
  manualCleanup(options = {}) {
69591
- const { clearMeasurements = false, clearLayerConfigs = false, clearMapState = false, keepRecentCount = 50 } = options;
69602
+ const {
69603
+ clearMeasurements = false,
69604
+ clearLayerConfigs = false,
69605
+ clearMapState = false,
69606
+ keepRecentCount = 50
69607
+ } = options;
69592
69608
  if (clearMeasurements) {
69593
69609
  if (keepRecentCount > 0) {
69594
69610
  const measurements = this.getMeasurements();
@@ -81406,15 +81422,14 @@ class GeoJSONLocationTool {
81406
81422
  this.map = map2;
81407
81423
  }
81408
81424
  }
81409
- var FilterType;
81410
- (function(FilterType2) {
81425
+ var FilterType = /* @__PURE__ */ ((FilterType2) => {
81411
81426
  FilterType2["ATTRIBUTE"] = "attribute";
81412
81427
  FilterType2["SPATIAL"] = "spatial";
81413
81428
  FilterType2["CQL"] = "cql";
81414
81429
  FilterType2["CUSTOM"] = "custom";
81415
- })(FilterType || (FilterType = {}));
81416
- var FilterOperator;
81417
- (function(FilterOperator2) {
81430
+ return FilterType2;
81431
+ })(FilterType || {});
81432
+ var FilterOperator = /* @__PURE__ */ ((FilterOperator2) => {
81418
81433
  FilterOperator2["EQUAL"] = "equal";
81419
81434
  FilterOperator2["NOT_EQUAL"] = "not_equal";
81420
81435
  FilterOperator2["GREATER_THAN"] = "greater_than";
@@ -81427,9 +81442,9 @@ var FilterOperator;
81427
81442
  FilterOperator2["BETWEEN"] = "between";
81428
81443
  FilterOperator2["IS_NULL"] = "is_null";
81429
81444
  FilterOperator2["IS_NOT_NULL"] = "is_not_null";
81430
- })(FilterOperator || (FilterOperator = {}));
81431
- var SpatialFilterType;
81432
- (function(SpatialFilterType2) {
81445
+ return FilterOperator2;
81446
+ })(FilterOperator || {});
81447
+ var SpatialFilterType = /* @__PURE__ */ ((SpatialFilterType2) => {
81433
81448
  SpatialFilterType2["INTERSECTS"] = "intersects";
81434
81449
  SpatialFilterType2["CONTAINS"] = "contains";
81435
81450
  SpatialFilterType2["WITHIN"] = "within";
@@ -81437,7 +81452,8 @@ var SpatialFilterType;
81437
81452
  SpatialFilterType2["CROSSES"] = "crosses";
81438
81453
  SpatialFilterType2["OVERLAPS"] = "overlaps";
81439
81454
  SpatialFilterType2["DISJOINT"] = "disjoint";
81440
- })(SpatialFilterType || (SpatialFilterType = {}));
81455
+ return SpatialFilterType2;
81456
+ })(SpatialFilterType || {});
81441
81457
  let BaseLayer$2 = class BaseLayer2 {
81442
81458
  constructor(config) {
81443
81459
  __publicField(this, "config");
@@ -81847,8 +81863,7 @@ let BaseLayer$2 = class BaseLayer2 {
81847
81863
  this.addFilter(filter2);
81848
81864
  }
81849
81865
  };
81850
- var LayerType$1;
81851
- (function(LayerType2) {
81866
+ var LayerType$1 = /* @__PURE__ */ ((LayerType2) => {
81852
81867
  LayerType2["TILE"] = "tile";
81853
81868
  LayerType2["WMS"] = "wms";
81854
81869
  LayerType2["WMTS"] = "wmts";
@@ -81863,7 +81878,8 @@ var LayerType$1;
81863
81878
  LayerType2["CANVAS"] = "canvas";
81864
81879
  LayerType2["IMAGE_VECTOR"] = "image_vector";
81865
81880
  LayerType2["VECTOR_TILE"] = "vector_tile";
81866
- })(LayerType$1 || (LayerType$1 = {}));
81881
+ return LayerType2;
81882
+ })(LayerType$1 || {});
81867
81883
  class TileLayerHandler extends BaseLayer$2 {
81868
81884
  constructor() {
81869
81885
  super(...arguments);
@@ -82106,17 +82122,27 @@ class WMSLayerHandler extends BaseLayer$2 {
82106
82122
  const source = layer2.getSource();
82107
82123
  if (!source)
82108
82124
  return void 0;
82109
- return source.getFeatureInfoUrl(coordinate, resolution, projection2, {
82110
- "INFO_FORMAT": "application/json",
82111
- "FEATURE_COUNT": 10,
82112
- ...params2
82113
- });
82125
+ return source.getFeatureInfoUrl(
82126
+ coordinate,
82127
+ resolution,
82128
+ projection2,
82129
+ {
82130
+ "INFO_FORMAT": "application/json",
82131
+ "FEATURE_COUNT": 10,
82132
+ ...params2
82133
+ }
82134
+ );
82114
82135
  }
82115
82136
  /**
82116
82137
  * 通过坐标获取要素信息
82117
82138
  */
82118
82139
  async getFeatureInfoAtCoordinate(coordinate, options = {}) {
82119
- const { infoFormat = "application/json", featureCount = 10, resolution, projection: projection2 = "EPSG:3857" } = options;
82140
+ const {
82141
+ infoFormat = "application/json",
82142
+ featureCount = 10,
82143
+ resolution,
82144
+ projection: projection2 = "EPSG:3857"
82145
+ } = options;
82120
82146
  try {
82121
82147
  const map2 = this.map;
82122
82148
  if (!map2) {
@@ -82130,10 +82156,15 @@ class WMSLayerHandler extends BaseLayer$2 {
82130
82156
  console.warn("无法获取地图分辨率");
82131
82157
  return [];
82132
82158
  }
82133
- const url = this.getFeatureInfoUrl(coordinate, currentResolution, currentProjection, {
82134
- "INFO_FORMAT": infoFormat,
82135
- "FEATURE_COUNT": featureCount
82136
- });
82159
+ const url = this.getFeatureInfoUrl(
82160
+ coordinate,
82161
+ currentResolution,
82162
+ currentProjection,
82163
+ {
82164
+ "INFO_FORMAT": infoFormat,
82165
+ "FEATURE_COUNT": featureCount
82166
+ }
82167
+ );
82137
82168
  if (!url) {
82138
82169
  console.warn("无法构建GetFeatureInfo请求URL");
82139
82170
  return [];
@@ -82668,7 +82699,13 @@ class WFSLayerHandler extends BaseLayer$2 {
82668
82699
  * 便捷方法:添加WFS属性过滤器
82669
82700
  */
82670
82701
  addWFSAttributeFilter(id, property, value, operator = "equalTo", description) {
82671
- this.addAttributeFilter(id, property, value, operator === "equalTo" ? FilterOperator.EQUAL : FilterOperator.LIKE, description);
82702
+ this.addAttributeFilter(
82703
+ id,
82704
+ property,
82705
+ value,
82706
+ operator === "equalTo" ? FilterOperator.EQUAL : FilterOperator.LIKE,
82707
+ description
82708
+ );
82672
82709
  }
82673
82710
  /**
82674
82711
  * 便捷方法:移除WFS过滤器
@@ -82736,8 +82773,7 @@ class WFSLayerHandler extends BaseLayer$2 {
82736
82773
  }
82737
82774
  }
82738
82775
  }
82739
- var GeometryType$2;
82740
- (function(GeometryType2) {
82776
+ var GeometryType$2 = /* @__PURE__ */ ((GeometryType2) => {
82741
82777
  GeometryType2["POINT"] = "Point";
82742
82778
  GeometryType2["LINE_STRING"] = "LineString";
82743
82779
  GeometryType2["POLYGON"] = "Polygon";
@@ -82746,7 +82782,8 @@ var GeometryType$2;
82746
82782
  GeometryType2["MULTI_POLYGON"] = "MultiPolygon";
82747
82783
  GeometryType2["GEOMETRY_COLLECTION"] = "GeometryCollection";
82748
82784
  GeometryType2["CIRCLE"] = "Circle";
82749
- })(GeometryType$2 || (GeometryType$2 = {}));
82785
+ return GeometryType2;
82786
+ })(GeometryType$2 || {});
82750
82787
  class StyleFactory {
82751
82788
  /**
82752
82789
  * 创建填充样式
@@ -82786,7 +82823,6 @@ class StyleFactory {
82786
82823
  const textStyle = new Text$5({
82787
82824
  text: config.text,
82788
82825
  font: config.font || `${config.fontSize || 12}px ${config.fontFamily || "Arial"}`,
82789
- scale: config.scale,
82790
82826
  fill: this.createFill(config.fill),
82791
82827
  stroke: this.createStroke(config.stroke),
82792
82828
  offsetX: config.offsetX,
@@ -82794,10 +82830,6 @@ class StyleFactory {
82794
82830
  textAlign: config.textAlign,
82795
82831
  textBaseline: config.textBaseline,
82796
82832
  rotation: config.rotation,
82797
- rotateWithView: config.rotateWithView,
82798
- maxAngle: config.maxAngle,
82799
- placement: config.placement,
82800
- overflow: config.overflow,
82801
82833
  backgroundFill: this.createFill(config.backgroundFill),
82802
82834
  backgroundStroke: this.createStroke(config.backgroundStroke),
82803
82835
  padding: config.padding
@@ -82897,8 +82929,7 @@ class StyleFactory {
82897
82929
  });
82898
82930
  }
82899
82931
  if (config == null ? void 0 : config.text) {
82900
- const textCfg = { placement: "line", overflow: true, ...config.text };
82901
- styleOptions.text = this.createText(textCfg);
82932
+ styleOptions.text = this.createText(config.text);
82902
82933
  }
82903
82934
  return new Style$3(styleOptions);
82904
82935
  }
@@ -83106,7 +83137,7 @@ const _StyleManager = class _StyleManager {
83106
83137
  */
83107
83138
  createStyleFunction(styleConfig) {
83108
83139
  return (feature2, resolution) => {
83109
- var _a3, _b3;
83140
+ var _a3;
83110
83141
  const geometryType = StyleFactory.getFeatureGeometryType(feature2);
83111
83142
  const defaultConfig = this.getDefaultStyle(geometryType);
83112
83143
  const customConfig = styleConfig == null ? void 0 : styleConfig[geometryType];
@@ -83115,11 +83146,11 @@ const _StyleManager = class _StyleManager {
83115
83146
  const textCfg = { ...finalConfig.text };
83116
83147
  let content2 = textCfg.text;
83117
83148
  if (!content2 && typeof textCfg.field === "string") {
83118
- const v5 = (_a3 = feature2 == null ? void 0 : feature2.get) == null ? void 0 : _a3.call(feature2, textCfg.field);
83149
+ const v5 = feature2.get(textCfg.field);
83119
83150
  content2 = v5 !== void 0 && v5 !== null ? String(v5) : "";
83120
83151
  }
83121
83152
  if (typeof textCfg.template === "string" && textCfg.template.length > 0) {
83122
- const props = ((_b3 = feature2 == null ? void 0 : feature2.getProperties) == null ? void 0 : _b3.call(feature2)) || {};
83153
+ const props = ((_a3 = feature2.getProperties) == null ? void 0 : _a3.call(feature2)) || {};
83123
83154
  content2 = textCfg.template.replace(/\{([^}]+)\}/g, (_m, key) => {
83124
83155
  const v5 = props[key];
83125
83156
  return v5 !== void 0 && v5 !== null ? String(v5) : "";
@@ -83210,6 +83241,7 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
83210
83241
  constructor(config, map2) {
83211
83242
  super(config, map2);
83212
83243
  __publicField(this, "styleConfig");
83244
+ // 新增:缓存启用的过滤器和原始要素集合
83213
83245
  __publicField(this, "currentFilters", []);
83214
83246
  __publicField(this, "originalFeatures", []);
83215
83247
  }
@@ -83242,23 +83274,8 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
83242
83274
  } else if (this.config.url) {
83243
83275
  const source = new VectorSource$2({
83244
83276
  url: this.config.url,
83245
- format: new GeoJSON$4({
83246
- featureProjection: mapProjection
83247
- })
83277
+ format: new GeoJSON$4({ featureProjection: mapProjection })
83248
83278
  });
83249
- try {
83250
- const logOnce = (e8) => {
83251
- var _a4, _b3;
83252
- try {
83253
- const props = ((_b3 = (_a4 = e8.feature) == null ? void 0 : _a4.getProperties) == null ? void 0 : _b3.call(_a4)) || {};
83254
- console.log("[GeoJSONLayerHandler] addfeature 属性示例:", props);
83255
- } catch (_2) {
83256
- }
83257
- source.un("addfeature", logOnce);
83258
- };
83259
- source.on("addfeature", logOnce);
83260
- } catch (e8) {
83261
- }
83262
83279
  source.on("featuresloadend", () => {
83263
83280
  this.originalFeatures = source.getFeatures();
83264
83281
  });
@@ -83272,39 +83289,16 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
83272
83289
  */
83273
83290
  createStyleFunction() {
83274
83291
  this.parseStyleConfig();
83275
- const baseStyleFn = styleManager.createStyleFunction(this.styleConfig);
83276
- return (feature2, resolution) => {
83277
- var _a3, _b3, _c2, _d, _e2, _f;
83278
- const style = baseStyleFn(feature2, resolution);
83279
- try {
83280
- const geometry2 = (_a3 = feature2 == null ? void 0 : feature2.getGeometry) == null ? void 0 : _a3.call(feature2);
83281
- const geometryType = ((_b3 = geometry2 == null ? void 0 : geometry2.getType) == null ? void 0 : _b3.call(geometry2)) || "Point";
83282
- const textCfg = (_d = (_c2 = this.styleConfig) == null ? void 0 : _c2[geometryType]) == null ? void 0 : _d.text;
83283
- if (textCfg && this.map && typeof this.map.getView === "function") {
83284
- const z2 = (_f = (_e2 = this.map.getView()).getZoom) == null ? void 0 : _f.call(_e2);
83285
- if (typeof z2 === "number") {
83286
- const minZ = textCfg.minZoom;
83287
- const maxZ = textCfg.maxZoom;
83288
- const outOfRange = minZ != null && z2 < minZ || maxZ != null && z2 > maxZ;
83289
- if (outOfRange && typeof style.setText === "function") {
83290
- style.setText(null);
83291
- }
83292
- }
83293
- }
83294
- } catch (_2) {
83295
- }
83296
- return style;
83297
- };
83292
+ return styleManager.createStyleFunction(this.styleConfig);
83298
83293
  }
83299
83294
  /**
83300
83295
  * 解析样式配置
83301
83296
  */
83302
83297
  parseStyleConfig() {
83303
- var _a3;
83304
83298
  if (!this.styleConfig) {
83305
83299
  this.styleConfig = {};
83306
83300
  }
83307
- const style = (_a3 = this.config) == null ? void 0 : _a3.style;
83301
+ const style = this.config.style;
83308
83302
  if (style && typeof style === "object") {
83309
83303
  const polygonStyle2 = {};
83310
83304
  if (style.fill)
@@ -83314,12 +83308,12 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
83314
83308
  if (style.text)
83315
83309
  polygonStyle2.text = style.text;
83316
83310
  if (Object.keys(polygonStyle2).length > 0) {
83317
- this.styleConfig.Polygon = {
83318
- ...this.styleConfig.Polygon || {},
83311
+ this.styleConfig[GeometryType$2.POLYGON] = {
83312
+ ...this.styleConfig[GeometryType$2.POLYGON] || {},
83319
83313
  ...polygonStyle2
83320
83314
  };
83321
- this.styleConfig.MultiPolygon = {
83322
- ...this.styleConfig.MultiPolygon || {},
83315
+ this.styleConfig[GeometryType$2.MULTI_POLYGON] = {
83316
+ ...this.styleConfig[GeometryType$2.MULTI_POLYGON] || {},
83323
83317
  ...polygonStyle2
83324
83318
  };
83325
83319
  }
@@ -83329,12 +83323,12 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
83329
83323
  if (style.text)
83330
83324
  lineStyle2.text = style.text;
83331
83325
  if (Object.keys(lineStyle2).length > 0) {
83332
- this.styleConfig.LineString = {
83333
- ...this.styleConfig.LineString || {},
83326
+ this.styleConfig[GeometryType$2.LINE_STRING] = {
83327
+ ...this.styleConfig[GeometryType$2.LINE_STRING] || {},
83334
83328
  ...lineStyle2
83335
83329
  };
83336
- this.styleConfig.MultiLineString = {
83337
- ...this.styleConfig.MultiLineString || {},
83330
+ this.styleConfig[GeometryType$2.MULTI_LINE_STRING] = {
83331
+ ...this.styleConfig[GeometryType$2.MULTI_LINE_STRING] || {},
83338
83332
  ...lineStyle2
83339
83333
  };
83340
83334
  }
@@ -83348,12 +83342,12 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
83348
83342
  if (style.text)
83349
83343
  pointStyle2.text = style.text;
83350
83344
  if (Object.keys(pointStyle2).length > 0) {
83351
- this.styleConfig.Point = {
83352
- ...this.styleConfig.Point || {},
83345
+ this.styleConfig[GeometryType$2.POINT] = {
83346
+ ...this.styleConfig[GeometryType$2.POINT] || {},
83353
83347
  ...pointStyle2
83354
83348
  };
83355
- this.styleConfig.MultiPoint = {
83356
- ...this.styleConfig.MultiPoint || {},
83349
+ this.styleConfig[GeometryType$2.MULTI_POINT] = {
83350
+ ...this.styleConfig[GeometryType$2.MULTI_POINT] || {},
83357
83351
  ...pointStyle2
83358
83352
  };
83359
83353
  }
@@ -83484,13 +83478,11 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
83484
83478
  * 设置基于属性的样式
83485
83479
  */
83486
83480
  setPropertyBasedStyle(propertyName, styleMapping, defaultStyleConfig) {
83487
- const styleFunction = styleManager.createPropertyBasedStyleFunction(
83488
- propertyName,
83489
- styleMapping,
83490
- defaultStyleConfig
83491
- );
83481
+ if (defaultStyleConfig) {
83482
+ this.styleConfig = defaultStyleConfig;
83483
+ }
83492
83484
  const layer2 = this.getLayer();
83493
- layer2.setStyle(styleFunction);
83485
+ layer2.setStyle(this.createStyleFunction());
83494
83486
  }
83495
83487
  /**
83496
83488
  * 定位到图层中的所有要素
@@ -83675,7 +83667,6 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
83675
83667
  * 应用过滤器(实现基类的抽象方法)
83676
83668
  */
83677
83669
  applyFilters() {
83678
- debugger;
83679
83670
  const layer2 = this.getLayer();
83680
83671
  const source = layer2.getSource();
83681
83672
  if (!source)
@@ -83805,7 +83796,7 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
83805
83796
  { regex: /^(\w+)\s*<=\s*([^'\s]+)$/, operator: FilterOperator.LESS_EQUAL },
83806
83797
  // property LIKE 'pattern'
83807
83798
  { regex: /^(\w+)\s+LIKE\s+'([^']*)'$/i, operator: FilterOperator.LIKE },
83808
- // property IN ('a','b',...) 或 property IN (1,2,...)
83799
+ // property IN ('a','b',...) 或 property IN (1,2,...),支持半角/全角括号
83809
83800
  { regex: /^(\w+)\s+IN\s*[\((]\s*([\s\S]+?)\s*[\))]\s*$/i, operator: FilterOperator.IN }
83810
83801
  ];
83811
83802
  for (const pattern of patterns) {
@@ -83872,7 +83863,9 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
83872
83863
  const targetValue = config.caseSensitive ? String(featureValue) : String(featureValue).toLowerCase();
83873
83864
  return targetValue.includes(searchValue);
83874
83865
  case FilterOperator.IN:
83875
- return Array.isArray(filterValue) && filterValue.includes(featureValue);
83866
+ if (!Array.isArray(filterValue))
83867
+ return false;
83868
+ return filterValue.some((v5) => String(v5) === String(featureValue));
83876
83869
  case FilterOperator.BETWEEN:
83877
83870
  if (Array.isArray(filterValue) && filterValue.length === 2) {
83878
83871
  const numValue = Number(featureValue);
@@ -83911,6 +83904,7 @@ class KMLLayerHandler extends BaseLayer$2 {
83911
83904
  this.kmlFormat = new KML$1({
83912
83905
  className: this.config.className,
83913
83906
  extractStyles: true,
83907
+ // 提取KML中的样式
83914
83908
  showPointNames: false
83915
83909
  // 不显示点名称
83916
83910
  });
@@ -85330,7 +85324,10 @@ class ClusterLayerHandler extends BaseLayer$2 {
85330
85324
  */
85331
85325
  createClusterStyleFunction() {
85332
85326
  this.parseStyleConfig();
85333
- return styleManager.createClusterStyleFunction(this.clusterStyleConfig, this.singleFeatureStyleConfig);
85327
+ return styleManager.createClusterStyleFunction(
85328
+ this.clusterStyleConfig,
85329
+ this.singleFeatureStyleConfig
85330
+ );
85334
85331
  }
85335
85332
  /**
85336
85333
  * 解析样式配置
@@ -85350,6 +85347,7 @@ class ClusterLayerHandler extends BaseLayer$2 {
85350
85347
  return {
85351
85348
  circle: {
85352
85349
  radius: 15,
85350
+ // 动态半径将在样式管理器中处理
85353
85351
  fill: { color: legacyStyle.clusterFillColor || "rgba(255, 153, 0, 0.8)" },
85354
85352
  stroke: {
85355
85353
  color: legacyStyle.clusterStrokeColor || "#fff",
@@ -85524,9 +85522,13 @@ class ImageVectorLayerHandler extends BaseLayer$2 {
85524
85522
  style: this.createStyleFunction(),
85525
85523
  // ImageVector图层特有的配置
85526
85524
  imageRatio: this.config.imageRatio || 1,
85525
+ // 图像比率,用于高分辨率显示
85527
85526
  renderBuffer: this.config.renderBuffer || 100,
85527
+ // 渲染缓冲区
85528
85528
  renderOrder: this.config.renderOrder,
85529
+ // 渲染顺序
85529
85530
  background: this.config.background,
85531
+ // 背景色
85530
85532
  declutter: this.config.declutter || false
85531
85533
  // 是否启用标注避让
85532
85534
  });
@@ -85635,7 +85637,11 @@ class ImageVectorLayerHandler extends BaseLayer$2 {
85635
85637
  * 设置基于属性的样式
85636
85638
  */
85637
85639
  setPropertyBasedStyle(propertyName, styleMapping, defaultStyleConfig) {
85638
- const styleFunction = styleManager.createPropertyBasedStyleFunction(propertyName, styleMapping, defaultStyleConfig);
85640
+ const styleFunction = styleManager.createPropertyBasedStyleFunction(
85641
+ propertyName,
85642
+ styleMapping,
85643
+ defaultStyleConfig
85644
+ );
85639
85645
  const layer2 = this.getLayer();
85640
85646
  layer2.setStyle(styleFunction);
85641
85647
  }
@@ -85760,6 +85766,7 @@ class SuperMapTiledMapServiceHandler extends BaseLayer$2 {
85760
85766
  xyzOptions.tileGrid = new TileGrid$3({
85761
85767
  extent: extent3,
85762
85768
  origin: [-180, 90],
85769
+ // 左上角原点
85763
85770
  resolutions: this.generateResolutions(),
85764
85771
  tileSize: [256, 256]
85765
85772
  });
@@ -464601,9 +464608,13 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
464601
464608
  if (config.center && config.center.length >= 2) {
464602
464609
  const layerCenter = config.center;
464603
464610
  const isInView = layerCenter[0] >= mapExtent[0] && layerCenter[0] <= mapExtent[2] && layerCenter[1] >= mapExtent[1] && layerCenter[1] <= mapExtent[3];
464604
- console.log(`图层中心点 [${layerCenter[0]}, ${layerCenter[1]}] 是否在当前视图内: ${isInView}`);
464611
+ console.log(
464612
+ `图层中心点 [${layerCenter[0]}, ${layerCenter[1]}] 是否在当前视图内: ${isInView}`
464613
+ );
464605
464614
  if (!isInView) {
464606
- console.warn(`⚠️ 图层 ${config.name} 的中心点不在当前地图视图范围内,可能需要缩放到图层位置`);
464615
+ console.warn(
464616
+ `⚠️ 图层 ${config.name} 的中心点不在当前地图视图范围内,可能需要缩放到图层位置`
464617
+ );
464607
464618
  }
464608
464619
  }
464609
464620
  }
@@ -464615,7 +464626,9 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
464615
464626
  if (this.styleApplied || this.styleApplyAttempts >= this.maxStyleApplyAttempts)
464616
464627
  return;
464617
464628
  this.styleApplyAttempts++;
464618
- console.log(`尝试应用样式到SuperMap图层 ${this.config.name},第 ${this.styleApplyAttempts} 次`);
464629
+ console.log(
464630
+ `尝试应用样式到SuperMap图层 ${this.config.name},第 ${this.styleApplyAttempts} 次`
464631
+ );
464619
464632
  setTimeout(() => {
464620
464633
  if (this.layer && this.config.style) {
464621
464634
  try {
@@ -464623,7 +464636,10 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
464623
464636
  this.styleApplied = true;
464624
464637
  console.log(`成功应用样式到SuperMap图层 ${this.config.name}`);
464625
464638
  } catch (error2) {
464626
- console.warn(`应用样式到SuperMap图层 ${this.config.name} 失败:`, error2);
464639
+ console.warn(
464640
+ `应用样式到SuperMap图层 ${this.config.name} 失败:`,
464641
+ error2
464642
+ );
464627
464643
  if (this.styleApplyAttempts < this.maxStyleApplyAttempts) {
464628
464644
  setTimeout(() => this.tryApplyStyles(), 500);
464629
464645
  }
@@ -464676,6 +464692,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
464676
464692
  const sourceOptions = {
464677
464693
  url: config.url,
464678
464694
  wrapX: true,
464695
+ // SuperMap服务通常不需要wrapX
464679
464696
  format: config.format || "webp"
464680
464697
  };
464681
464698
  try {
@@ -464716,13 +464733,19 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
464716
464733
  console.log("📏 瓦片大小:", tileSize);
464717
464734
  } else {
464718
464735
  console.warn("map.json中没有bounds信息,使用默认配置");
464719
- const tileGrid = await this.createTileGrid(projection2.getCode(), config);
464736
+ const tileGrid = await this.createTileGrid(
464737
+ projection2.getCode(),
464738
+ config
464739
+ );
464720
464740
  if (tileGrid)
464721
464741
  sourceOptions.tileGrid = tileGrid;
464722
464742
  }
464723
464743
  } else {
464724
464744
  console.warn(`无法获取map.json (${response.status}), 使用默认配置`);
464725
- const tileGrid = await this.createTileGrid(projection2.getCode(), config);
464745
+ const tileGrid = await this.createTileGrid(
464746
+ projection2.getCode(),
464747
+ config
464748
+ );
464726
464749
  if (tileGrid)
464727
464750
  sourceOptions.tileGrid = tileGrid;
464728
464751
  }
@@ -464759,6 +464782,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
464759
464782
  origin,
464760
464783
  extent: extent3,
464761
464784
  resolutions,
464785
+ // 只显示前5个分辨率
464762
464786
  tileSize,
464763
464787
  configOrigin: config.origin,
464764
464788
  calculatedOrigin: [extent3[0], extent3[3]]
@@ -464905,7 +464929,12 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
464905
464929
  * @returns Promise<any[]> 查询到的要素数组
464906
464930
  */
464907
464931
  async queryFeatureByPointOL(lon2, lat2, options = {}) {
464908
- const { datasetNames = ["hms:Football_field"], serviceUrl = "http://172.16.201.151/iserver/services/data-hms-public/rest/data", tolerance: tolerance2 = 0.027, vectorLayer = null } = options;
464932
+ const {
464933
+ datasetNames = ["hms:Football_field"],
464934
+ serviceUrl = "http://172.16.201.151/iserver/services/data-hms-public/rest/data",
464935
+ tolerance: tolerance2 = 0.027,
464936
+ vectorLayer = null
464937
+ } = options;
464909
464938
  const point2 = new Point$b([lon2, lat2]);
464910
464939
  let smGeom = Util2.toSuperMapGeometry(point2);
464911
464940
  if (!smGeom) {
@@ -464925,36 +464954,39 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
464925
464954
  // tolerance 参数在此版本中不支持,已移除
464926
464955
  });
464927
464956
  return new Promise((resolve, reject2) => {
464928
- new FeatureService2(serviceUrl).getFeaturesByGeometry(queryParams, (result) => {
464929
- var _a3, _b3, _c2;
464930
- if (result.error) {
464931
- console.error("iServer 错误:", result.error);
464932
- reject2(result.error);
464933
- return;
464934
- }
464935
- const rawFeatures = ((_b3 = (_a3 = result.result) == null ? void 0 : _a3.features) == null ? void 0 : _b3.features) || [];
464936
- console.log("SuperMap查询结果:", result);
464937
- console.log("原始要素数组:", rawFeatures);
464938
- const features2 = rawFeatures.map((feature2) => {
464939
- console.log("转换前的SuperMap要素:", feature2);
464940
- console.log("要素的fieldNames:", feature2.fieldNames);
464941
- console.log("要素的fieldValues:", feature2.fieldValues);
464942
- const transformedFeature = this.transformSupermapFeature(feature2);
464943
- console.log("转换后的标准要素:", transformedFeature);
464944
- console.log("转换后的properties:", transformedFeature.properties);
464945
- return transformedFeature;
464946
- });
464947
- if (vectorLayer) {
464948
- (_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
464949
- features2.forEach((f2) => {
464950
- var _a4;
464951
- const olFeat = new Feature$6(Util2.toSuperMapGeometry(f2.geometry));
464952
- olFeat.setProperties(f2.properties || {});
464953
- (_a4 = vectorLayer.getSource()) == null ? void 0 : _a4.addFeature(olFeat);
464957
+ new FeatureService2(serviceUrl).getFeaturesByGeometry(
464958
+ queryParams,
464959
+ (result) => {
464960
+ var _a3, _b3, _c2;
464961
+ if (result.error) {
464962
+ console.error("iServer 错误:", result.error);
464963
+ reject2(result.error);
464964
+ return;
464965
+ }
464966
+ const rawFeatures = ((_b3 = (_a3 = result.result) == null ? void 0 : _a3.features) == null ? void 0 : _b3.features) || [];
464967
+ console.log("SuperMap查询结果:", result);
464968
+ console.log("原始要素数组:", rawFeatures);
464969
+ const features2 = rawFeatures.map((feature2) => {
464970
+ console.log("转换前的SuperMap要素:", feature2);
464971
+ console.log("要素的fieldNames:", feature2.fieldNames);
464972
+ console.log("要素的fieldValues:", feature2.fieldValues);
464973
+ const transformedFeature = this.transformSupermapFeature(feature2);
464974
+ console.log("转换后的标准要素:", transformedFeature);
464975
+ console.log("转换后的properties:", transformedFeature.properties);
464976
+ return transformedFeature;
464954
464977
  });
464978
+ if (vectorLayer) {
464979
+ (_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
464980
+ features2.forEach((f2) => {
464981
+ var _a4;
464982
+ const olFeat = new Feature$6(Util2.toSuperMapGeometry(f2.geometry));
464983
+ olFeat.setProperties(f2.properties || {});
464984
+ (_a4 = vectorLayer.getSource()) == null ? void 0 : _a4.addFeature(olFeat);
464985
+ });
464986
+ }
464987
+ resolve(features2);
464955
464988
  }
464956
- resolve(features2);
464957
- });
464989
+ );
464958
464990
  });
464959
464991
  }
464960
464992
  /**
@@ -464966,7 +464998,12 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
464966
464998
  */
464967
464999
  async getFeaturesByBuffer(lon2 = 93.53179023100006, lat2 = 42.81598224900006, options = {}) {
464968
465000
  try {
464969
- const { bufferDistance = 0.027, datasetNames = ["hms:Football_field"], serviceUrl = "http://172.16.201.151/iserver/services/data-hms-public/rest/data", vectorLayer = null } = options;
465001
+ const {
465002
+ bufferDistance = 0.027,
465003
+ datasetNames = ["hms:Football_field"],
465004
+ serviceUrl = "http://172.16.201.151/iserver/services/data-hms-public/rest/data",
465005
+ vectorLayer = null
465006
+ } = options;
464970
465007
  const olPoint = new Point$b([lon2, lat2]);
464971
465008
  let smGeom = Util2.toSuperMapGeometry(olPoint);
464972
465009
  console.log("Util.toSuperMapGeometry ->", smGeom);
@@ -464976,46 +465013,54 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
464976
465013
  smGeom = new SuperMap2.Geometry.Point(lon2, lat2);
464977
465014
  console.log("使用全局 SuperMap.Geometry.Point 构建 smGeom:", smGeom);
464978
465015
  } else {
464979
- console.warn("无法取得全局 SuperMap,无法构造 SuperMap.Geometry.Point。建议使用方案A的 REST 调用绕开。");
465016
+ console.warn(
465017
+ "无法取得全局 SuperMap,无法构造 SuperMap.Geometry.Point。建议使用方案A的 REST 调用绕开。"
465018
+ );
464980
465019
  }
464981
465020
  }
464982
465021
  if (!smGeom) {
464983
- console.error("无法构建 SuperMap Geometry(smGeom 为 null)。请使用方案A 或检查 iClient 的引入方式。");
465022
+ console.error(
465023
+ "无法构建 SuperMap Geometry(smGeom 为 null)。请使用方案A 或检查 iClient 的引入方式。"
465024
+ );
464984
465025
  return [];
464985
465026
  }
464986
465027
  const bufferParams = new GetFeaturesByBufferParameters({
464987
465028
  datasetNames,
464988
465029
  bufferDistance,
465030
+ // 举例(300m ≈ 0.0027°),注意单位和坐标系一致
464989
465031
  geometry: smGeom,
464990
465032
  spatialQueryMode: "INTERSECT"
464991
465033
  });
464992
465034
  return new Promise((resolve, reject2) => {
464993
- new FeatureService2(serviceUrl).getFeaturesByBuffer(bufferParams, (serviceResult) => {
464994
- var _a3, _b3, _c2, _d;
464995
- console.log("serviceResult:", serviceResult);
464996
- if (serviceResult.error) {
464997
- console.error("iServer error:", serviceResult.error);
464998
- reject2(new Error("iServer 返回错误,详见控制台"));
464999
- return;
465000
- }
465001
- const rawFeatures = ((_b3 = (_a3 = serviceResult.result) == null ? void 0 : _a3.features) == null ? void 0 : _b3.features) || [];
465002
- const feats = rawFeatures.map((f2) => {
465003
- const transformedFeature = this.transformSupermapFeature(f2);
465004
- console.log("Buffer查询 - 转换前的SuperMap数据:", f2);
465005
- console.log("Buffer查询 - 转换后的标准数据:", transformedFeature);
465006
- const olFeat = new Feature$6(Util2.toSuperMapGeometry(f2.geometry));
465007
- olFeat.setProperties(transformedFeature.properties || {});
465008
- return olFeat;
465009
- });
465010
- if (vectorLayer) {
465011
- (_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
465012
- if (feats.length) {
465013
- (_d = vectorLayer.getSource()) == null ? void 0 : _d.addFeatures(feats);
465035
+ new FeatureService2(serviceUrl).getFeaturesByBuffer(
465036
+ bufferParams,
465037
+ (serviceResult) => {
465038
+ var _a3, _b3, _c2, _d;
465039
+ console.log("serviceResult:", serviceResult);
465040
+ if (serviceResult.error) {
465041
+ console.error("iServer error:", serviceResult.error);
465042
+ reject2(new Error("iServer 返回错误,详见控制台"));
465043
+ return;
465014
465044
  }
465045
+ const rawFeatures = ((_b3 = (_a3 = serviceResult.result) == null ? void 0 : _a3.features) == null ? void 0 : _b3.features) || [];
465046
+ const feats = rawFeatures.map((f2) => {
465047
+ const transformedFeature = this.transformSupermapFeature(f2);
465048
+ console.log("Buffer查询 - 转换前的SuperMap数据:", f2);
465049
+ console.log("Buffer查询 - 转换后的标准数据:", transformedFeature);
465050
+ const olFeat = new Feature$6(Util2.toSuperMapGeometry(f2.geometry));
465051
+ olFeat.setProperties(transformedFeature.properties || {});
465052
+ return olFeat;
465053
+ });
465054
+ if (vectorLayer) {
465055
+ (_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
465056
+ if (feats.length) {
465057
+ (_d = vectorLayer.getSource()) == null ? void 0 : _d.addFeatures(feats);
465058
+ }
465059
+ }
465060
+ console.log("查询并绘制完成,count:", feats.length);
465061
+ resolve(feats);
465015
465062
  }
465016
- console.log("查询并绘制完成,count:", feats.length);
465017
- resolve(feats);
465018
- });
465063
+ );
465019
465064
  });
465020
465065
  } catch (err2) {
465021
465066
  console.error("queryBuffer 捕获异常:", err2);
@@ -465048,14 +465093,27 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
465048
465093
  console.warn("SuperMap图层缺少服务URL,无法进行要素查询");
465049
465094
  return [];
465050
465095
  }
465051
- const { maxFeatures = 100, datasetNames, returnContent = true, targetProjection } = options;
465096
+ const {
465097
+ maxFeatures = 100,
465098
+ datasetNames,
465099
+ returnContent = true,
465100
+ targetProjection
465101
+ } = options;
465052
465102
  try {
465053
465103
  const mapProjection = (_a3 = this.map) == null ? void 0 : _a3.getView().getProjection();
465054
465104
  const projectionCode = targetProjection || (mapProjection == null ? void 0 : mapProjection.getCode()) || "EPSG:4326";
465055
465105
  let transformedBounds = bounds2;
465056
465106
  if (mapProjection && targetProjection && mapProjection.getCode() !== targetProjection) {
465057
- const bottomLeft = transform$l([bounds2[0], bounds2[1]], mapProjection.getCode(), targetProjection);
465058
- const topRight = transform$l([bounds2[2], bounds2[3]], mapProjection.getCode(), targetProjection);
465107
+ const bottomLeft = transform$l(
465108
+ [bounds2[0], bounds2[1]],
465109
+ mapProjection.getCode(),
465110
+ targetProjection
465111
+ );
465112
+ const topRight = transform$l(
465113
+ [bounds2[2], bounds2[3]],
465114
+ mapProjection.getCode(),
465115
+ targetProjection
465116
+ );
465059
465117
  transformedBounds = [
465060
465118
  bottomLeft[0],
465061
465119
  bottomLeft[1],
@@ -465077,22 +465135,29 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
465077
465135
  });
465078
465136
  const boundsService = new GetFeaturesByBoundsService(serviceUrl);
465079
465137
  return new Promise((resolve, reject2) => {
465080
- boundsService.getFeaturesByBounds(boundsParams, (serviceResult) => {
465081
- var _a4;
465082
- if (serviceResult.type === "processCompleted") {
465083
- const result = serviceResult.result;
465084
- if (result && result.features) {
465085
- console.log(`SuperMap边界查询成功,找到 ${result.features.length} 个要素`);
465086
- resolve(result.features);
465138
+ boundsService.getFeaturesByBounds(
465139
+ boundsParams,
465140
+ (serviceResult) => {
465141
+ var _a4;
465142
+ if (serviceResult.type === "processCompleted") {
465143
+ const result = serviceResult.result;
465144
+ if (result && result.features) {
465145
+ console.log(
465146
+ `SuperMap边界查询成功,找到 ${result.features.length} 个要素`
465147
+ );
465148
+ resolve(result.features);
465149
+ } else {
465150
+ console.log("SuperMap边界查询完成,但未找到要素");
465151
+ resolve([]);
465152
+ }
465087
465153
  } else {
465088
- console.log("SuperMap边界查询完成,但未找到要素");
465089
- resolve([]);
465154
+ console.error("SuperMap边界查询失败:", serviceResult.error);
465155
+ reject2(
465156
+ new Error(((_a4 = serviceResult.error) == null ? void 0 : _a4.errorMsg) || "边界查询失败")
465157
+ );
465090
465158
  }
465091
- } else {
465092
- console.error("SuperMap边界查询失败:", serviceResult.error);
465093
- reject2(new Error(((_a4 = serviceResult.error) == null ? void 0 : _a4.errorMsg) || "边界查询失败"));
465094
465159
  }
465095
- });
465160
+ );
465096
465161
  });
465097
465162
  } catch (error2) {
465098
465163
  console.error("SuperMap边界查询异常:", error2);
@@ -465111,7 +465176,13 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
465111
465176
  console.warn("SuperMap图层缺少服务URL,无法进行要素查询");
465112
465177
  return [];
465113
465178
  }
465114
- const { maxFeatures = 100, datasetNames, returnContent = true, spatialQueryMode = "INTERSECT", targetProjection } = options;
465179
+ const {
465180
+ maxFeatures = 100,
465181
+ datasetNames,
465182
+ returnContent = true,
465183
+ spatialQueryMode = "INTERSECT",
465184
+ targetProjection
465185
+ } = options;
465115
465186
  try {
465116
465187
  const serviceUrl = this.buildDataServiceUrl(config.url);
465117
465188
  console.log(`开始SuperMap几何查询:`, {
@@ -465128,22 +465199,29 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
465128
465199
  });
465129
465200
  const geometryService = new GetFeaturesByGeometryService(serviceUrl);
465130
465201
  return new Promise((resolve, reject2) => {
465131
- geometryService.getFeaturesByGeometry(geometryParams, (serviceResult) => {
465132
- var _a3;
465133
- if (serviceResult.type === "processCompleted") {
465134
- const result = serviceResult.result;
465135
- if (result && result.features) {
465136
- console.log(`SuperMap几何查询成功,找到 ${result.features.length} 个要素`);
465137
- resolve(result.features);
465202
+ geometryService.getFeaturesByGeometry(
465203
+ geometryParams,
465204
+ (serviceResult) => {
465205
+ var _a3;
465206
+ if (serviceResult.type === "processCompleted") {
465207
+ const result = serviceResult.result;
465208
+ if (result && result.features) {
465209
+ console.log(
465210
+ `SuperMap几何查询成功,找到 ${result.features.length} 个要素`
465211
+ );
465212
+ resolve(result.features);
465213
+ } else {
465214
+ console.log("SuperMap几何查询完成,但未找到要素");
465215
+ resolve([]);
465216
+ }
465138
465217
  } else {
465139
- console.log("SuperMap几何查询完成,但未找到要素");
465140
- resolve([]);
465218
+ console.error("SuperMap几何查询失败:", serviceResult.error);
465219
+ reject2(
465220
+ new Error(((_a3 = serviceResult.error) == null ? void 0 : _a3.errorMsg) || "几何查询失败")
465221
+ );
465141
465222
  }
465142
- } else {
465143
- console.error("SuperMap几何查询失败:", serviceResult.error);
465144
- reject2(new Error(((_a3 = serviceResult.error) == null ? void 0 : _a3.errorMsg) || "几何查询失败"));
465145
465223
  }
465146
- });
465224
+ );
465147
465225
  });
465148
465226
  } catch (error2) {
465149
465227
  console.error("SuperMap几何查询异常:", error2);
@@ -465162,7 +465240,12 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
465162
465240
  console.warn("SuperMap图层缺少服务URL,无法进行要素查询");
465163
465241
  return [];
465164
465242
  }
465165
- const { maxFeatures = 100, datasetNames, returnContent = true, targetProjection } = options;
465243
+ const {
465244
+ maxFeatures = 100,
465245
+ datasetNames,
465246
+ returnContent = true,
465247
+ targetProjection
465248
+ } = options;
465166
465249
  try {
465167
465250
  const serviceUrl = this.buildDataServiceUrl(config.url);
465168
465251
  console.log(`开始SuperMap SQL查询:`, {
@@ -465185,7 +465268,9 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
465185
465268
  if (serviceResult.type === "processCompleted") {
465186
465269
  const result = serviceResult.result;
465187
465270
  if (result && result.features) {
465188
- console.log(`SuperMap SQL查询成功,找到 ${result.features.length} 个要素`);
465271
+ console.log(
465272
+ `SuperMap SQL查询成功,找到 ${result.features.length} 个要素`
465273
+ );
465189
465274
  resolve(result.features);
465190
465275
  } else {
465191
465276
  console.log("SuperMap SQL查询完成,但未找到要素");
@@ -465233,7 +465318,9 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
465233
465318
  if (serviceResult.type === "processCompleted") {
465234
465319
  const result = serviceResult.result;
465235
465320
  if (result && result.features) {
465236
- console.log(`SuperMap ID查询成功,找到 ${result.features.length} 个要素`);
465321
+ console.log(
465322
+ `SuperMap ID查询成功,找到 ${result.features.length} 个要素`
465323
+ );
465237
465324
  resolve(result.features);
465238
465325
  } else {
465239
465326
  console.log("SuperMap ID查询完成,但未找到要素");
@@ -465263,7 +465350,10 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
465263
465350
  return mapUrl;
465264
465351
  }
465265
465352
  if (url.pathname.includes("/rest/maps/")) {
465266
- const dataServiceUrl = mapUrl.replace(/\/rest\/maps\/.*$/, "/rest/data");
465353
+ const dataServiceUrl = mapUrl.replace(
465354
+ /\/rest\/maps\/.*$/,
465355
+ "/rest/data"
465356
+ );
465267
465357
  console.log(`构建数据服务URL: ${mapUrl} -> ${dataServiceUrl}`);
465268
465358
  return dataServiceUrl;
465269
465359
  }
@@ -465273,7 +465363,9 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
465273
465363
  const serviceName = pathParts[servicesIndex + 1];
465274
465364
  const basePath = pathParts.slice(0, servicesIndex + 2).join("/");
465275
465365
  const dataServiceUrl = `${url.protocol}//${url.host}/${basePath}/rest/data`;
465276
- console.log(`从服务名称构建数据服务URL: ${mapUrl} -> ${dataServiceUrl}`);
465366
+ console.log(
465367
+ `从服务名称构建数据服务URL: ${mapUrl} -> ${dataServiceUrl}`
465368
+ );
465277
465369
  return dataServiceUrl;
465278
465370
  }
465279
465371
  throw new Error(`无法解析SuperMap服务URL格式: ${mapUrl}`);
@@ -465317,24 +465409,37 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
465317
465409
  */
465318
465410
  async getFeatureInfoAtCoordinate(coordinate, options = {}) {
465319
465411
  var _a3, _b3, _c2, _d, _e2, _f;
465320
- const { bufferDistance = 100, maxFeatures = options.featureCount || 10, queryMethod } = options;
465412
+ const {
465413
+ bufferDistance = 100,
465414
+ maxFeatures = options.featureCount || 10,
465415
+ queryMethod
465416
+ } = options;
465321
465417
  try {
465322
465418
  let features2 = [];
465323
465419
  const finalQueryMethod = queryMethod || ((_a3 = this.config.supermapConfig) == null ? void 0 : _a3.queryMethod) || "point";
465324
465420
  console.log(`使用查询方式: ${finalQueryMethod}`);
465325
465421
  if (finalQueryMethod === "buffer") {
465326
465422
  const configuredBufferDistance = ((_b3 = this.config.supermapConfig) == null ? void 0 : _b3.bufferDistance) || bufferDistance;
465327
- features2 = await this.getFeaturesByBuffer(coordinate[0], coordinate[1], {
465328
- bufferDistance: configuredBufferDistance / 1e3,
465329
- datasetNames: (_c2 = this.config.supermapConfig) == null ? void 0 : _c2.datasetNames,
465330
- serviceUrl: (_d = this.config.supermapConfig) == null ? void 0 : _d.featureServiceUrl
465331
- });
465423
+ features2 = await this.getFeaturesByBuffer(
465424
+ coordinate[0],
465425
+ coordinate[1],
465426
+ {
465427
+ bufferDistance: configuredBufferDistance / 1e3,
465428
+ // 转换为度数单位
465429
+ datasetNames: (_c2 = this.config.supermapConfig) == null ? void 0 : _c2.datasetNames,
465430
+ serviceUrl: (_d = this.config.supermapConfig) == null ? void 0 : _d.featureServiceUrl
465431
+ }
465432
+ );
465332
465433
  } else {
465333
- features2 = await this.queryFeatureByPointOL(coordinate[0], coordinate[1], {
465334
- datasetNames: (_e2 = this.config.supermapConfig) == null ? void 0 : _e2.datasetNames,
465335
- serviceUrl: (_f = this.config.supermapConfig) == null ? void 0 : _f.featureServiceUrl
465336
- // tolerance 参数已移除,使用默认值
465337
- });
465434
+ features2 = await this.queryFeatureByPointOL(
465435
+ coordinate[0],
465436
+ coordinate[1],
465437
+ {
465438
+ datasetNames: (_e2 = this.config.supermapConfig) == null ? void 0 : _e2.datasetNames,
465439
+ serviceUrl: (_f = this.config.supermapConfig) == null ? void 0 : _f.featureServiceUrl
465440
+ // tolerance 参数已移除,使用默认值
465441
+ }
465442
+ );
465338
465443
  }
465339
465444
  return features2.slice(0, maxFeatures).map((feature2) => {
465340
465445
  if (feature2 && typeof feature2.getProperties === "function") {
@@ -465412,7 +465517,9 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
465412
465517
  * 检查是否是天地图URL
465413
465518
  */
465414
465519
  isTiandituUrl(url) {
465415
- return _TiandituLayerHandler.TIANDITU_DOMAINS.some((domain) => url.includes(domain));
465520
+ return _TiandituLayerHandler.TIANDITU_DOMAINS.some(
465521
+ (domain) => url.includes(domain)
465522
+ );
465416
465523
  }
465417
465524
  /**
465418
465525
  * 检查是否是开发模式
@@ -465426,7 +465533,9 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
465426
465533
  convertToProxyUrl(originalUrl) {
465427
465534
  const urlObj = new URL(originalUrl);
465428
465535
  const pathParts = urlObj.pathname.split("/");
465429
- const serviceType = pathParts.find((part) => Object.values(_TiandituLayerHandler.TIANDITU_SERVICES).includes(part));
465536
+ const serviceType = pathParts.find(
465537
+ (part) => Object.values(_TiandituLayerHandler.TIANDITU_SERVICES).includes(part)
465538
+ );
465430
465539
  if (!serviceType) {
465431
465540
  console.warn("无法识别天地图服务类型,使用默认代理路径");
465432
465541
  return `/api/tianditu${urlObj.pathname}${urlObj.search}`;
@@ -465443,7 +465552,9 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
465443
465552
  return null;
465444
465553
  const urlObj = new URL(this.config.url);
465445
465554
  const pathParts = urlObj.pathname.split("/");
465446
- return pathParts.find((part) => Object.values(_TiandituLayerHandler.TIANDITU_SERVICES).includes(part)) || null;
465555
+ return pathParts.find(
465556
+ (part) => Object.values(_TiandituLayerHandler.TIANDITU_SERVICES).includes(part)
465557
+ ) || null;
465447
465558
  }
465448
465559
  /**
465449
465560
  * 设置天地图密钥
@@ -465503,7 +465614,12 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
465503
465614
  * 创建标准天地图URL
465504
465615
  */
465505
465616
  static createTiandituUrl(serviceType, options = {}) {
465506
- const { tk = "YOUR_TIANDITU_KEY", domain = "t{0-7}.tianditu.gov.cn", format: format2 = "tiles", style = "default" } = options;
465617
+ const {
465618
+ tk = "YOUR_TIANDITU_KEY",
465619
+ domain = "t{0-7}.tianditu.gov.cn",
465620
+ format: format2 = "tiles",
465621
+ style = "default"
465622
+ } = options;
465507
465623
  const service = _TiandituLayerHandler.TIANDITU_SERVICES[serviceType];
465508
465624
  if (!service) {
465509
465625
  throw new Error(`不支持的天地图服务类型: ${serviceType}`);
@@ -465533,10 +465649,15 @@ __publicField(_TiandituLayerHandler, "TIANDITU_DOMAINS", [
465533
465649
  ]);
465534
465650
  __publicField(_TiandituLayerHandler, "TIANDITU_SERVICES", {
465535
465651
  "img": "img_w",
465652
+ // 卫星影像
465536
465653
  "vec": "vec_w",
465654
+ // 矢量地图
465537
465655
  "cva": "cva_w",
465656
+ // 矢量注记
465538
465657
  "cia": "cia_w",
465658
+ // 影像注记
465539
465659
  "ter": "ter_w",
465660
+ // 地形图
465540
465661
  "cta": "cta_w"
465541
465662
  // 地形注记
465542
465663
  });
@@ -465552,6 +465673,7 @@ class CanvasLayerHandler extends BaseLayer$2 {
465552
465673
  className: this.config.className,
465553
465674
  canvasFunction: this.getCanvasFunction(),
465554
465675
  projection: "EPSG:4326",
465676
+ // 默认投影
465555
465677
  ratio: 1
465556
465678
  });
465557
465679
  const imageLayer = new ImageLayer$3({
@@ -465575,7 +465697,13 @@ class CanvasLayerHandler extends BaseLayer$2 {
465575
465697
  canvas.width = size2[0];
465576
465698
  canvas.height = size2[1];
465577
465699
  const canvasConfig = this.config.canvasConfig || {};
465578
- const { backgroundColor: backgroundColor2 = "transparent", gridSize = 50, gridColor = "#cccccc", showGrid = false, customDrawFunction } = canvasConfig;
465700
+ const {
465701
+ backgroundColor: backgroundColor2 = "transparent",
465702
+ gridSize = 50,
465703
+ gridColor = "#cccccc",
465704
+ showGrid = false,
465705
+ customDrawFunction
465706
+ } = canvasConfig;
465579
465707
  if (backgroundColor2 !== "transparent") {
465580
465708
  context.fillStyle = backgroundColor2;
465581
465709
  context.fillRect(0, 0, canvas.width, canvas.height);
@@ -465730,11 +465858,17 @@ class VectorTileLayerHandler extends BaseLayer$2 {
465730
465858
  style: this.createStyleFunction(),
465731
465859
  // VectorTile图层特有的配置
465732
465860
  renderBuffer: this.config.renderBuffer || 100,
465861
+ // 渲染缓冲区
465733
465862
  renderOrder: this.config.renderOrder,
465863
+ // 渲染顺序
465734
465864
  renderMode: this.config.renderMode || "hybrid",
465865
+ // 渲染模式:'hybrid' | 'vector'
465735
465866
  declutter: this.config.declutter || false,
465867
+ // 是否启用标注避让
465736
465868
  background: this.config.background,
465869
+ // 背景色
465737
465870
  preload: this.config.preload || 0,
465871
+ // 预加载级别
465738
465872
  useInterimTilesOnError: this.config.useInterimTilesOnError !== false
465739
465873
  // 错误时使用临时瓦片
465740
465874
  });
@@ -465754,6 +465888,7 @@ class VectorTileLayerHandler extends BaseLayer$2 {
465754
465888
  minZoom: config.minZoom || 0,
465755
465889
  tileSize: config.tileSize || 512,
465756
465890
  overlaps: config.overlaps !== false,
465891
+ // 默认允许重叠
465757
465892
  projection: config.projection || "EPSG:4326"
465758
465893
  };
465759
465894
  if (config.tileGrid) {
@@ -466056,11 +466191,15 @@ class VectorTileLayerHandler extends BaseLayer$2 {
466056
466191
  const extent3 = view.calculateExtent();
466057
466192
  const resolution = view.getResolution();
466058
466193
  try {
466059
- source.forEachFeatureAtCoordinateAndResolution(extent3, resolution || 1, (feature2) => {
466060
- const props = feature2.getProperties();
466061
- const { geometry: geometry2, ...dataProps } = props;
466062
- properties.push(dataProps);
466063
- });
466194
+ source.forEachFeatureAtCoordinateAndResolution(
466195
+ extent3,
466196
+ resolution || 1,
466197
+ (feature2) => {
466198
+ const props = feature2.getProperties();
466199
+ const { geometry: geometry2, ...dataProps } = props;
466200
+ properties.push(dataProps);
466201
+ }
466202
+ );
466064
466203
  } catch (error2) {
466065
466204
  console.warn("获取VectorTile要素属性时出错:", error2);
466066
466205
  }
@@ -466226,6 +466365,28 @@ const _LayerFactory = class _LayerFactory {
466226
466365
  __publicField(_LayerFactory, "instance");
466227
466366
  let LayerFactory = _LayerFactory;
466228
466367
  const layerFactory = LayerFactory.getInstance();
466368
+ class LayerEventBus {
466369
+ constructor() {
466370
+ __publicField(this, "emitter");
466371
+ this.emitter = mitt();
466372
+ }
466373
+ emit(type, event) {
466374
+ this.emitter.emit(type, event);
466375
+ }
466376
+ on(type, handler) {
466377
+ this.emitter.on(type, handler);
466378
+ }
466379
+ off(type, handler) {
466380
+ this.emitter.off(type, handler);
466381
+ }
466382
+ clear() {
466383
+ this.emitter.all.clear();
466384
+ }
466385
+ }
466386
+ function createLayerEventBus() {
466387
+ return new LayerEventBus();
466388
+ }
466389
+ const layerEventBus = mitt();
466229
466390
  class LayerManager {
466230
466391
  constructor(map2, eventBus, storage2) {
466231
466392
  __publicField(this, "map");
@@ -466256,6 +466417,7 @@ class LayerManager {
466256
466417
  ...config,
466257
466418
  id: layerId,
466258
466419
  visible: config.visible ?? false,
466420
+ // 默认设置为false,避免意外激活图层
466259
466421
  opacity: config.opacity ?? 1,
466260
466422
  zIndex: config.zIndex ?? 0
466261
466423
  };
@@ -466416,6 +466578,15 @@ class LayerManager {
466416
466578
  return true;
466417
466579
  } catch (error2) {
466418
466580
  console.error("添加图层失败:", error2);
466581
+ this.pendingLayerConfigs.set(fullConfig.id, fullConfig);
466582
+ this.saveLayerConfigs();
466583
+ this.eventBus.emit("layer-added", {
466584
+ layerId: fullConfig.id,
466585
+ layerName: fullConfig.name,
466586
+ layerType: fullConfig.type,
466587
+ visible: fullConfig.visible ?? false,
466588
+ layerConfig: fullConfig
466589
+ });
466419
466590
  return false;
466420
466591
  }
466421
466592
  }
@@ -466432,6 +466603,7 @@ class LayerManager {
466432
466603
  ...childConfig,
466433
466604
  id: childLayerId,
466434
466605
  visible: groupConfig.visible ?? false,
466606
+ // 子图层的可见性完全跟随组图层
466435
466607
  opacity: childConfig.opacity ?? groupConfig.opacity
466436
466608
  };
466437
466609
  if (this.addLayer(childFullConfig)) {
@@ -466446,6 +466618,7 @@ class LayerManager {
466446
466618
  ...layerConfig,
466447
466619
  id: layerLayerId,
466448
466620
  visible: groupConfig.visible ?? false,
466621
+ // 子图层的可见性完全跟随组图层
466449
466622
  opacity: layerConfig.opacity ?? groupConfig.opacity
466450
466623
  };
466451
466624
  if (this.addLayer(layerFullConfig)) {
@@ -466659,7 +466832,9 @@ class LayerManager {
466659
466832
  async hideOtherBasemaps(currentBasemapId) {
466660
466833
  try {
466661
466834
  const allConfigs = [...this.layerConfigs.values(), ...this.pendingLayerConfigs.values()];
466662
- const basemapConfigs = allConfigs.filter((config) => this.isBasemapLayer(config.id) && config.id !== currentBasemapId);
466835
+ const basemapConfigs = allConfigs.filter(
466836
+ (config) => this.isBasemapLayer(config.id) && config.id !== currentBasemapId
466837
+ );
466663
466838
  for (const config of basemapConfigs) {
466664
466839
  if (config.visible) {
466665
466840
  const handler = this.layerHandlers.get(config.id);
@@ -466684,7 +466859,9 @@ class LayerManager {
466684
466859
  async hideOtherBasemapsOnInit(currentBasemapId) {
466685
466860
  try {
466686
466861
  const allConfigs = [...this.layerConfigs.values(), ...this.pendingLayerConfigs.values()];
466687
- const basemapConfigs = allConfigs.filter((config) => this.isBasemapLayer(config.id) && config.id !== currentBasemapId && config.visible);
466862
+ const basemapConfigs = allConfigs.filter(
466863
+ (config) => this.isBasemapLayer(config.id) && config.id !== currentBasemapId && config.visible
466864
+ );
466688
466865
  for (const config of basemapConfigs) {
466689
466866
  const handler = this.layerHandlers.get(config.id);
466690
466867
  if (handler) {
@@ -466753,14 +466930,33 @@ class LayerManager {
466753
466930
  * @param baseIndex 基础索引值,默认为1
466754
466931
  */
466755
466932
  reorderLayers(layerIds, baseIndex = 1) {
466933
+ const total = layerIds.length;
466756
466934
  layerIds.forEach((layerId, index2) => {
466757
466935
  const handler = this.layerHandlers.get(layerId);
466936
+ const zIndex2 = baseIndex + (total - 1 - index2);
466758
466937
  if (handler) {
466759
- const zIndex2 = baseIndex + (layerIds.length - 1 - index2);
466760
466938
  handler.setZIndex(zIndex2);
466761
466939
  console.log(`图层 ${layerId} 设置 z-index: ${zIndex2}`);
466762
466940
  }
466941
+ const config = this.layerConfigs.get(layerId) || this.pendingLayerConfigs.get(layerId);
466942
+ if (config) {
466943
+ config.zIndex = zIndex2;
466944
+ if (this.layerConfigs.has(layerId)) {
466945
+ this.layerConfigs.set(layerId, config);
466946
+ } else if (this.pendingLayerConfigs.has(layerId)) {
466947
+ this.pendingLayerConfigs.set(layerId, config);
466948
+ }
466949
+ }
466763
466950
  });
466951
+ this.saveLayerConfigs();
466952
+ try {
466953
+ this.eventBus.emit("layer-order-changed", { layerIds });
466954
+ } catch (e8) {
466955
+ }
466956
+ try {
466957
+ layerEventBus.emit("layer-order-changed", { layerIds });
466958
+ } catch (e8) {
466959
+ }
466764
466960
  }
466765
466961
  /**
466766
466962
  * 获取图层的当前层级
@@ -466970,11 +467166,15 @@ class LayerManager {
466970
467166
  try {
466971
467167
  if (config.type === "TileSuperMapRest" || config.type === "tilesupermaprest" || config.type === "TILESUPERMAPREST") {
466972
467168
  if ("getFeatureInfoAtCoordinate" in handler) {
466973
- const features2 = await handler.getFeatureInfoAtCoordinate(coordinate, {
466974
- bufferDistance: 80,
466975
- maxFeatures: (options == null ? void 0 : options.featureCount) || 10,
466976
- returnContent: true
466977
- });
467169
+ const features2 = await handler.getFeatureInfoAtCoordinate(
467170
+ coordinate,
467171
+ {
467172
+ bufferDistance: 80,
467173
+ // 默认5米缓冲区
467174
+ maxFeatures: (options == null ? void 0 : options.featureCount) || 10,
467175
+ returnContent: true
467176
+ }
467177
+ );
466978
467178
  if (features2 && features2.length > 0) {
466979
467179
  results.push({
466980
467180
  layerId,
@@ -466986,10 +467186,13 @@ class LayerManager {
466986
467186
  }
466987
467187
  } else if (config.type === "wms" || config.type === "WMS") {
466988
467188
  if ("getFeatureInfoAtCoordinate" in handler) {
466989
- const features2 = await handler.getFeatureInfoAtCoordinate(coordinate, {
466990
- infoFormat: (options == null ? void 0 : options.infoFormat) || "application/json",
466991
- featureCount: (options == null ? void 0 : options.featureCount) || 10
466992
- });
467189
+ const features2 = await handler.getFeatureInfoAtCoordinate(
467190
+ coordinate,
467191
+ {
467192
+ infoFormat: (options == null ? void 0 : options.infoFormat) || "application/json",
467193
+ featureCount: (options == null ? void 0 : options.featureCount) || 10
467194
+ }
467195
+ );
466993
467196
  if (features2 && features2.length > 0) {
466994
467197
  results.push({
466995
467198
  layerId,
@@ -467054,28 +467257,6 @@ class LayerManager {
467054
467257
  this.layerConfigs.clear();
467055
467258
  }
467056
467259
  }
467057
- class LayerEventBus {
467058
- constructor() {
467059
- __publicField(this, "emitter");
467060
- this.emitter = mitt();
467061
- }
467062
- emit(type, event) {
467063
- this.emitter.emit(type, event);
467064
- }
467065
- on(type, handler) {
467066
- this.emitter.on(type, handler);
467067
- }
467068
- off(type, handler) {
467069
- this.emitter.off(type, handler);
467070
- }
467071
- clear() {
467072
- this.emitter.all.clear();
467073
- }
467074
- }
467075
- function createLayerEventBus() {
467076
- return new LayerEventBus();
467077
- }
467078
- const layerEventBus = mitt();
467079
467260
  const DEFAULT_HIGHLIGHT_STYLE = {
467080
467261
  fill: {
467081
467262
  color: "rgba(255, 255, 0, 0.3)",
@@ -467594,12 +467775,12 @@ const _hoisted_3$k = {
467594
467775
  };
467595
467776
  const _hoisted_4$k = { class: "image-popup-main" };
467596
467777
  const _hoisted_5$k = { class: "image-container" };
467597
- const _hoisted_6$i = ["src", "alt"];
467598
- const _hoisted_7$e = {
467778
+ const _hoisted_6$h = ["src", "alt"];
467779
+ const _hoisted_7$f = {
467599
467780
  key: 0,
467600
467781
  class: "image-loading"
467601
467782
  };
467602
- const _hoisted_8$b = {
467783
+ const _hoisted_8$c = {
467603
467784
  key: 1,
467604
467785
  class: "image-error"
467605
467786
  };
@@ -467777,12 +467958,12 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
467777
467958
  onLoad: handleImageLoad,
467778
467959
  onError: handleImageError,
467779
467960
  onClick: handleImageClick
467780
- }, null, 40, _hoisted_6$i),
467781
- imageLoading.value ? (openBlock(), createElementBlock("div", _hoisted_7$e, [..._cache[4] || (_cache[4] = [
467961
+ }, null, 40, _hoisted_6$h),
467962
+ imageLoading.value ? (openBlock(), createElementBlock("div", _hoisted_7$f, [..._cache[4] || (_cache[4] = [
467782
467963
  createElementVNode("div", { class: "loading-spinner" }, null, -1),
467783
467964
  createElementVNode("span", null, "加载中...", -1)
467784
467965
  ])])) : createCommentVNode("", true),
467785
- imageError.value ? (openBlock(), createElementBlock("div", _hoisted_8$b, [..._cache[5] || (_cache[5] = [
467966
+ imageError.value ? (openBlock(), createElementBlock("div", _hoisted_8$c, [..._cache[5] || (_cache[5] = [
467786
467967
  createElementVNode("span", null, "图片加载失败", -1)
467787
467968
  ])])) : createCommentVNode("", true),
467788
467969
  imageList.value.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_9$a, [
@@ -467893,12 +468074,12 @@ const _hoisted_5$j = {
467893
468074
  key: 3,
467894
468075
  class: "search-container"
467895
468076
  };
467896
- const _hoisted_6$h = {
468077
+ const _hoisted_6$g = {
467897
468078
  key: 4,
467898
468079
  class: "data-stats"
467899
468080
  };
467900
- const _hoisted_7$d = { key: 0 };
467901
- const _hoisted_8$a = {
468081
+ const _hoisted_7$e = { key: 0 };
468082
+ const _hoisted_8$b = {
467902
468083
  key: 5,
467903
468084
  class: "table-view"
467904
468085
  };
@@ -468155,11 +468336,11 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
468155
468336
  clearable: ""
468156
468337
  }, null, 8, ["modelValue"])
468157
468338
  ])) : createCommentVNode("", true),
468158
- _ctx.config.showStats ? (openBlock(), createElementBlock("div", _hoisted_6$h, [
468339
+ _ctx.config.showStats ? (openBlock(), createElementBlock("div", _hoisted_6$g, [
468159
468340
  createElementVNode("span", null, "共 " + toDisplayString(filteredData.value.length) + " 条记录", 1),
468160
- searchQuery.value ? (openBlock(), createElementBlock("span", _hoisted_7$d, "(已过滤 " + toDisplayString(arrayData.value.length - filteredData.value.length) + " 条)", 1)) : createCommentVNode("", true)
468341
+ searchQuery.value ? (openBlock(), createElementBlock("span", _hoisted_7$e, "(已过滤 " + toDisplayString(arrayData.value.length - filteredData.value.length) + " 条)", 1)) : createCommentVNode("", true)
468161
468342
  ])) : createCommentVNode("", true),
468162
- currentView.value === "table" ? (openBlock(), createElementBlock("div", _hoisted_8$a, [
468343
+ currentView.value === "table" ? (openBlock(), createElementBlock("div", _hoisted_8$b, [
468163
468344
  createElementVNode("div", _hoisted_9$9, [
468164
468345
  createElementVNode("table", _hoisted_10$9, [
468165
468346
  createElementVNode("thead", null, [
@@ -470019,9 +470200,9 @@ const _hoisted_4$i = {
470019
470200
  class: "px-5 py-4 border-t border-gray-200 bg-gray-50 flex justify-end gap-3"
470020
470201
  };
470021
470202
  const _hoisted_5$i = ["onMousedown"];
470022
- const _hoisted_6$g = { class: "text-base font-semibold text-gray-800 flex-1 overflow-hidden text-ellipsis whitespace-nowrap" };
470023
- const _hoisted_7$c = { class: "flex items-center gap-2" };
470024
- const _hoisted_8$9 = { class: "flex-1 overflow-auto min-h-0 h-0" };
470203
+ const _hoisted_6$f = { class: "text-base font-semibold text-gray-800 flex-1 overflow-hidden text-ellipsis whitespace-nowrap" };
470204
+ const _hoisted_7$d = { class: "flex items-center gap-2" };
470205
+ const _hoisted_8$a = { class: "flex-1 overflow-auto min-h-0 h-0" };
470025
470206
  const _hoisted_9$8 = {
470026
470207
  key: 0,
470027
470208
  class: "px-5 py-4 border-t border-gray-200 bg-gray-50 flex justify-end gap-3"
@@ -470535,12 +470716,12 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
470535
470716
  class: normalizeClass(["flex items-center justify-between px-5 py-4 border-b border-gray-200 bg-gray-50", { "cursor-move": _ctx.draggable && !isFullscreen.value }]),
470536
470717
  onMousedown: startDrag
470537
470718
  }, [
470538
- createElementVNode("div", _hoisted_6$g, [
470719
+ createElementVNode("div", _hoisted_6$f, [
470539
470720
  renderSlot(_ctx.$slots, "title", {}, () => [
470540
470721
  createTextVNode(toDisplayString(_ctx.title), 1)
470541
470722
  ], true)
470542
470723
  ]),
470543
- createElementVNode("div", _hoisted_7$c, [
470724
+ createElementVNode("div", _hoisted_7$d, [
470544
470725
  _ctx.showFullscreen ? (openBlock(), createBlock(unref(ElButton), {
470545
470726
  key: 0,
470546
470727
  class: "w-6 h-6 border-none bg-transparent cursor-pointer flex items-center justify-center rounded text-gray-500 transition-all duration-200 hover:bg-gray-200 hover:text-gray-600",
@@ -470567,7 +470748,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
470567
470748
  })) : createCommentVNode("", true)
470568
470749
  ])
470569
470750
  ], 34),
470570
- createElementVNode("div", _hoisted_8$9, [
470751
+ createElementVNode("div", _hoisted_8$a, [
470571
470752
  renderSlot(_ctx.$slots, "default", {}, void 0, true)
470572
470753
  ]),
470573
470754
  _ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_9$8, [
@@ -470628,7 +470809,7 @@ const _hoisted_2$h = { class: "basemap-grid" };
470628
470809
  const _hoisted_3$h = ["onClick"];
470629
470810
  const _hoisted_4$h = { class: "basemap-preview" };
470630
470811
  const _hoisted_5$h = ["src", "alt"];
470631
- const _hoisted_6$f = { class: "basemap-name" };
470812
+ const _hoisted_6$e = { class: "basemap-name" };
470632
470813
  const _sfc_main$j = /* @__PURE__ */ defineComponent({
470633
470814
  __name: "BasemapPanel",
470634
470815
  props: {
@@ -470875,7 +471056,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
470875
471056
  loading: "lazy"
470876
471057
  }, null, 8, _hoisted_5$h)
470877
471058
  ]),
470878
- createElementVNode("div", _hoisted_6$f, toDisplayString(basemap.name), 1)
471059
+ createElementVNode("div", _hoisted_6$e, toDisplayString(basemap.name), 1)
470879
471060
  ], 10, _hoisted_3$h);
470880
471061
  }), 128))
470881
471062
  ])
@@ -471223,9 +471404,9 @@ const _hoisted_2$g = { class: "measurement-header flex justify-between items-cen
471223
471404
  const _hoisted_3$g = { class: "measurement-result py-8 text-center" };
471224
471405
  const _hoisted_4$g = { class: "result-value" };
471225
471406
  const _hoisted_5$g = { class: "tool-grid flex-1 py-5" };
471226
- const _hoisted_6$e = ["onClick"];
471227
- const _hoisted_7$b = ["src", "alt"];
471228
- const _hoisted_8$8 = { class: "tool-label" };
471407
+ const _hoisted_6$d = ["onClick"];
471408
+ const _hoisted_7$c = ["src", "alt"];
471409
+ const _hoisted_8$9 = { class: "tool-label" };
471229
471410
  const _sfc_main$i = /* @__PURE__ */ defineComponent({
471230
471411
  __name: "MeasurementDialog",
471231
471412
  props: {
@@ -471551,9 +471732,9 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
471551
471732
  src: tool.icon,
471552
471733
  alt: tool.label,
471553
471734
  class: "tool-icon"
471554
- }, null, 8, _hoisted_7$b),
471555
- createElementVNode("span", _hoisted_8$8, toDisplayString(tool.label), 1)
471556
- ], 10, _hoisted_6$e);
471735
+ }, null, 8, _hoisted_7$c),
471736
+ createElementVNode("span", _hoisted_8$9, toDisplayString(tool.label), 1)
471737
+ ], 10, _hoisted_6$d);
471557
471738
  }), 64))
471558
471739
  ])
471559
471740
  ])
@@ -471829,9 +472010,9 @@ const _hoisted_2$e = {
471829
472010
  const _hoisted_3$e = { class: "region-group" };
471830
472011
  const _hoisted_4$e = { class: "region-items" };
471831
472012
  const _hoisted_5$e = { class: "region-group" };
471832
- const _hoisted_6$d = { class: "region-items" };
471833
- const _hoisted_7$a = { class: "region-group" };
471834
- const _hoisted_8$7 = { class: "region-items" };
472013
+ const _hoisted_6$c = { class: "region-items" };
472014
+ const _hoisted_7$b = { class: "region-group" };
472015
+ const _hoisted_8$8 = { class: "region-items" };
471835
472016
  const _hoisted_9$7 = { class: "region-group" };
471836
472017
  const _hoisted_10$7 = { class: "region-items" };
471837
472018
  const _hoisted_11$7 = { class: "region-group" };
@@ -472982,7 +473163,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
472982
473163
  ]),
472983
473164
  createElementVNode("div", _hoisted_5$e, [
472984
473165
  _cache[3] || (_cache[3] = createElementVNode("div", { class: "group-title" }, "东北", -1)),
472985
- createElementVNode("div", _hoisted_6$d, [
473166
+ createElementVNode("div", _hoisted_6$c, [
472986
473167
  (openBlock(true), createElementBlock(Fragment, null, renderList(regions.northeast, (region) => {
472987
473168
  return openBlock(), createBlock(_component_el_button, {
472988
473169
  key: region.code,
@@ -472998,9 +473179,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
472998
473179
  }), 128))
472999
473180
  ])
473000
473181
  ]),
473001
- createElementVNode("div", _hoisted_7$a, [
473182
+ createElementVNode("div", _hoisted_7$b, [
473002
473183
  _cache[4] || (_cache[4] = createElementVNode("div", { class: "group-title" }, "华东", -1)),
473003
- createElementVNode("div", _hoisted_8$7, [
473184
+ createElementVNode("div", _hoisted_8$8, [
473004
473185
  (openBlock(true), createElementBlock(Fragment, null, renderList(regions.east, (region) => {
473005
473186
  return openBlock(), createBlock(_component_el_button, {
473006
473187
  key: region.code,
@@ -473719,9 +473900,9 @@ const _hoisted_2$c = { class: "toolbar" };
473719
473900
  const _hoisted_3$c = { class: "search-filter" };
473720
473901
  const _hoisted_4$c = { class: "bookmarks-grid" };
473721
473902
  const _hoisted_5$c = ["onClick"];
473722
- const _hoisted_6$c = { class: "bookmark-thumbnail" };
473723
- const _hoisted_7$9 = { class: "thumbnail-placeholder" };
473724
- const _hoisted_8$6 = { class: "bookmark-overlay" };
473903
+ const _hoisted_6$b = { class: "bookmark-thumbnail" };
473904
+ const _hoisted_7$a = { class: "thumbnail-placeholder" };
473905
+ const _hoisted_8$7 = { class: "bookmark-overlay" };
473725
473906
  const _hoisted_9$6 = { class: "bookmark-info" };
473726
473907
  const _hoisted_10$6 = { class: "bookmark-title" };
473727
473908
  const _hoisted_11$6 = { class: "bookmark-meta" };
@@ -474123,8 +474304,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
474123
474304
  class: "bookmark-card",
474124
474305
  onClick: ($event) => applyBookmark(bookmark)
474125
474306
  }, [
474126
- createElementVNode("div", _hoisted_6$c, [
474127
- createElementVNode("div", _hoisted_7$9, [
474307
+ createElementVNode("div", _hoisted_6$b, [
474308
+ createElementVNode("div", _hoisted_7$a, [
474128
474309
  createVNode$1(_component_el_icon, {
474129
474310
  size: "40",
474130
474311
  color: "#409eff"
@@ -474135,7 +474316,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
474135
474316
  _: 1
474136
474317
  })
474137
474318
  ]),
474138
- createElementVNode("div", _hoisted_8$6, [
474319
+ createElementVNode("div", _hoisted_8$7, [
474139
474320
  createVNode$1(_component_el_button_group, null, {
474140
474321
  default: withCtx(() => [
474141
474322
  createVNode$1(_component_el_button, {
@@ -474435,12 +474616,12 @@ const _hoisted_2$b = { class: "h-150 overflow-y-auto" };
474435
474616
  const _hoisted_3$b = { class: "flex items-center justify-between" };
474436
474617
  const _hoisted_4$b = { class: "mb-5" };
474437
474618
  const _hoisted_5$b = { class: "mb-3" };
474438
- const _hoisted_6$b = {
474619
+ const _hoisted_6$a = {
474439
474620
  key: 0,
474440
474621
  class: "mb-3"
474441
474622
  };
474442
- const _hoisted_7$8 = { class: "flex gap-2" };
474443
- const _hoisted_8$5 = { class: "mb-5" };
474623
+ const _hoisted_7$9 = { class: "flex gap-2" };
474624
+ const _hoisted_8$6 = { class: "mb-5" };
474444
474625
  const _hoisted_9$5 = { class: "mb-3" };
474445
474626
  const _hoisted_10$5 = { class: "mb-3" };
474446
474627
  const _hoisted_11$5 = { key: 0 };
@@ -475010,8 +475191,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
475010
475191
  _: 1
475011
475192
  }, 8, ["modelValue"])
475012
475193
  ]),
475013
- printSettings.paperSize === "Custom" ? (openBlock(), createElementBlock("div", _hoisted_6$b, [
475014
- createElementVNode("div", _hoisted_7$8, [
475194
+ printSettings.paperSize === "Custom" ? (openBlock(), createElementBlock("div", _hoisted_6$a, [
475195
+ createElementVNode("div", _hoisted_7$9, [
475015
475196
  createVNode$1(_component_el_input, {
475016
475197
  modelValue: printSettings.customWidth,
475017
475198
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => printSettings.customWidth = $event),
@@ -475051,7 +475232,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
475051
475232
  }, 8, ["modelValue"])
475052
475233
  ])
475053
475234
  ]),
475054
- createElementVNode("div", _hoisted_8$5, [
475235
+ createElementVNode("div", _hoisted_8$6, [
475055
475236
  _cache[23] || (_cache[23] = createElementVNode("label", { class: "block text-sm font-medium text-gray-700 mb-2" }, "地图设置", -1)),
475056
475237
  createElementVNode("div", _hoisted_9$5, [
475057
475238
  createVNode$1(_component_el_select, {
@@ -475511,8 +475692,8 @@ const _hoisted_2$a = { class: "continuous-switch" };
475511
475692
  const _hoisted_3$a = { class: "tools-grid" };
475512
475693
  const _hoisted_4$a = ["onClick"];
475513
475694
  const _hoisted_5$a = ["src"];
475514
- const _hoisted_6$a = { class: "tool-label" };
475515
- const _hoisted_7$7 = {
475695
+ const _hoisted_6$9 = { class: "tool-label" };
475696
+ const _hoisted_7$8 = {
475516
475697
  key: 0,
475517
475698
  class: "stop-drawing-section"
475518
475699
  };
@@ -476081,11 +476262,11 @@ const _sfc_main$c = {
476081
476262
  key: 1,
476082
476263
  class: normalizeClass([tool.icon, "tool-icon-large"])
476083
476264
  }, null, 2)),
476084
- createElementVNode("span", _hoisted_6$a, toDisplayString(tool.label), 1)
476265
+ createElementVNode("span", _hoisted_6$9, toDisplayString(tool.label), 1)
476085
476266
  ], 8, _hoisted_4$a);
476086
476267
  }), 128))
476087
476268
  ]),
476088
- activeDrawingTool.value && continuousDrawing.value ? (openBlock(), createElementBlock("div", _hoisted_7$7, [
476269
+ activeDrawingTool.value && continuousDrawing.value ? (openBlock(), createElementBlock("div", _hoisted_7$8, [
476089
476270
  createVNode$1(_component_el_button, {
476090
476271
  type: "danger",
476091
476272
  size: "small",
@@ -476108,8 +476289,8 @@ const _hoisted_2$9 = { class: "toolbar" };
476108
476289
  const _hoisted_3$9 = { class: "toolbar-left" };
476109
476290
  const _hoisted_4$9 = { class: "data-count" };
476110
476291
  const _hoisted_5$9 = { class: "list-content" };
476111
- const _hoisted_6$9 = { class: "tree-node" };
476112
- const _hoisted_7$6 = {
476292
+ const _hoisted_6$8 = { class: "tree-node" };
476293
+ const _hoisted_7$7 = {
476113
476294
  key: 1,
476114
476295
  class: "empty-state"
476115
476296
  };
@@ -476172,13 +476353,13 @@ const _sfc_main$b = {
476172
476353
  class: "tree-component"
476173
476354
  }, {
476174
476355
  default: withCtx(({ data }) => [
476175
- createElementVNode("div", _hoisted_6$9, [
476356
+ createElementVNode("div", _hoisted_6$8, [
476176
476357
  _cache[3] || (_cache[3] = createElementVNode("i", { class: "i-carbon-folder node-icon" }, null, -1)),
476177
476358
  createElementVNode("span", null, toDisplayString(data.label), 1)
476178
476359
  ])
476179
476360
  ]),
476180
476361
  _: 1
476181
- }, 8, ["data"])) : (openBlock(), createElementBlock("div", _hoisted_7$6, "暂无数据"))
476362
+ }, 8, ["data"])) : (openBlock(), createElementBlock("div", _hoisted_7$7, "暂无数据"))
476182
476363
  ])
476183
476364
  ]);
476184
476365
  };
@@ -476190,8 +476371,8 @@ const _hoisted_2$8 = { class: "toolbar" };
476190
476371
  const _hoisted_3$8 = { class: "toolbar-left" };
476191
476372
  const _hoisted_4$8 = ["onClick"];
476192
476373
  const _hoisted_5$8 = { class: "toolbar-right" };
476193
- const _hoisted_6$8 = ["onClick"];
476194
- const _hoisted_7$5 = { class: "content-area" };
476374
+ const _hoisted_6$7 = ["onClick"];
476375
+ const _hoisted_7$6 = { class: "content-area" };
476195
476376
  const _sfc_main$a = {
476196
476377
  __name: "index",
476197
476378
  setup(__props) {
@@ -476286,14 +476467,14 @@ const _sfc_main$a = {
476286
476467
  createElementVNode("i", {
476287
476468
  class: normalizeClass([tool.icon, "tool-icon"]),
476288
476469
  onClick: ($event) => handleToolClick(tool, "right", idx)
476289
- }, null, 10, _hoisted_6$8)
476470
+ }, null, 10, _hoisted_6$7)
476290
476471
  ]),
476291
476472
  _: 2
476292
476473
  }, 1032, ["content"]);
476293
476474
  }), 64))
476294
476475
  ])
476295
476476
  ]),
476296
- createElementVNode("div", _hoisted_7$5, [
476477
+ createElementVNode("div", _hoisted_7$6, [
476297
476478
  createVNode$1(_component_el_tabs, {
476298
476479
  modelValue: activeTab.value,
476299
476480
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTab.value = $event),
@@ -477414,9 +477595,9 @@ const _hoisted_3$7 = {
477414
477595
  };
477415
477596
  const _hoisted_4$7 = { class: "section-title" };
477416
477597
  const _hoisted_5$7 = ["onClick"];
477417
- const _hoisted_6$7 = { class: "item-content" };
477418
- const _hoisted_7$4 = { class: "item-name" };
477419
- const _hoisted_8$4 = { class: "item-address" };
477598
+ const _hoisted_6$6 = { class: "item-content" };
477599
+ const _hoisted_7$5 = { class: "item-name" };
477600
+ const _hoisted_8$5 = { class: "item-address" };
477420
477601
  const _hoisted_9$4 = {
477421
477602
  key: 1,
477422
477603
  class: "search-section"
@@ -477789,9 +477970,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
477789
477970
  ]),
477790
477971
  _: 1
477791
477972
  }),
477792
- createElementVNode("div", _hoisted_6$7, [
477793
- createElementVNode("div", _hoisted_7$4, toDisplayString(item.name), 1),
477794
- createElementVNode("div", _hoisted_8$4, toDisplayString(item.address), 1)
477973
+ createElementVNode("div", _hoisted_6$6, [
477974
+ createElementVNode("div", _hoisted_7$5, toDisplayString(item.name), 1),
477975
+ createElementVNode("div", _hoisted_8$5, toDisplayString(item.address), 1)
477795
477976
  ])
477796
477977
  ], 10, _hoisted_5$7)
477797
477978
  ]);
@@ -478419,9 +478600,9 @@ const _hoisted_2$6 = { class: "panel-actions" };
478419
478600
  const _hoisted_3$6 = { class: "panel-content max-h-125 overflow-y-auto" };
478420
478601
  const _hoisted_4$6 = { class: "p-2" };
478421
478602
  const _hoisted_5$6 = { class: "legend-content p-2" };
478422
- const _hoisted_6$6 = { key: 0 };
478423
- const _hoisted_7$3 = { class: "text-xs text-gray-600" };
478424
- const _hoisted_8$3 = { key: 1 };
478603
+ const _hoisted_6$5 = { key: 0 };
478604
+ const _hoisted_7$4 = { class: "text-xs text-gray-600" };
478605
+ const _hoisted_8$4 = { key: 1 };
478425
478606
  const _hoisted_9$3 = { class: "text-xs text-gray-600" };
478426
478607
  const _hoisted_10$3 = { key: 2 };
478427
478608
  const _hoisted_11$3 = { class: "relative mb-2" };
@@ -478688,7 +478869,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
478688
478869
  }, {
478689
478870
  default: withCtx(() => [
478690
478871
  createElementVNode("div", _hoisted_5$6, [
478691
- legend.type === "symbol" ? (openBlock(), createElementBlock("div", _hoisted_6$6, [
478872
+ legend.type === "symbol" ? (openBlock(), createElementBlock("div", _hoisted_6$5, [
478692
478873
  (openBlock(true), createElementBlock(Fragment, null, renderList(legend.items, (item) => {
478693
478874
  return openBlock(), createElementBlock("div", {
478694
478875
  key: item.value,
@@ -478698,10 +478879,10 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
478698
478879
  class: "w-4 h-4 mr-2 border border-gray-300",
478699
478880
  style: normalizeStyle$1(getSymbolStyle(item))
478700
478881
  }, null, 4),
478701
- createElementVNode("span", _hoisted_7$3, toDisplayString(item.label), 1)
478882
+ createElementVNode("span", _hoisted_7$4, toDisplayString(item.label), 1)
478702
478883
  ]);
478703
478884
  }), 128))
478704
- ])) : legend.type === "color" ? (openBlock(), createElementBlock("div", _hoisted_8$3, [
478885
+ ])) : legend.type === "color" ? (openBlock(), createElementBlock("div", _hoisted_8$4, [
478705
478886
  (openBlock(true), createElementBlock(Fragment, null, renderList(legend.items, (item) => {
478706
478887
  return openBlock(), createElementBlock("div", {
478707
478888
  key: item.value,
@@ -479187,15 +479368,22 @@ class LayerTreeManager {
479187
479368
  __publicField(this, "layerGroups", ref([]));
479188
479369
  // 默认展开的节点
479189
479370
  __publicField(this, "defaultExpandedKeys", ref([]));
479190
- // 默认选中的节点(基于图层可见性)
479371
+ // 默认选中的节点(基于图层及其children的可见性)
479191
479372
  __publicField(this, "defaultCheckedKeys", computed(() => {
479192
479373
  const checkedKeys = [];
479374
+ const collectVisibleIds = (layer2) => {
479375
+ if (layer2.visible && layer2.type !== "group") {
479376
+ checkedKeys.push(layer2.id);
479377
+ }
479378
+ if (layer2.children && Array.isArray(layer2.children)) {
479379
+ layer2.children.forEach((child) => collectVisibleIds(child));
479380
+ }
479381
+ };
479193
479382
  this.layerGroups.value.forEach((group2) => {
479194
479383
  let allVisible = true;
479195
479384
  group2.layers.forEach((layer2) => {
479196
- if (layer2.visible) {
479197
- checkedKeys.push(layer2.id);
479198
- } else {
479385
+ collectVisibleIds(layer2);
479386
+ if (!layer2.visible) {
479199
479387
  allVisible = false;
479200
479388
  }
479201
479389
  });
@@ -479266,6 +479454,10 @@ class LayerTreeManager {
479266
479454
  * @param data 树节点数据
479267
479455
  */
479268
479456
  handleLayerDoubleClick(data) {
479457
+ if (data.type === "group") {
479458
+ this.handleGroupDoubleClick(data);
479459
+ return;
479460
+ }
479269
479461
  if (data.type !== "layer" || !data.layerData) {
479270
479462
  return;
479271
479463
  }
@@ -479343,6 +479535,96 @@ class LayerTreeManager {
479343
479535
  ElMessage.error(`定位到图层失败: ${data.layerData.name}`);
479344
479536
  }
479345
479537
  }
479538
+ /**
479539
+ * 处理分组双击事件 - 聚合定位到分组范围
479540
+ * @param data 分组树节点数据
479541
+ */
479542
+ handleGroupDoubleClick(data) {
479543
+ var _a3;
479544
+ if (!this.layerManager || !this.map) {
479545
+ ElMessage.warning("地图或图层管理器未初始化");
479546
+ return;
479547
+ }
479548
+ const collectLayerConfigs = (node, acc) => {
479549
+ if (node.type === "layer" && node.layerData) {
479550
+ acc.push(node.layerData);
479551
+ if (node.children && node.children.length > 0) {
479552
+ node.children.forEach((child) => collectLayerConfigs(child, acc));
479553
+ }
479554
+ } else if (node.type === "group" && node.children && node.children.length > 0) {
479555
+ node.children.forEach((child) => collectLayerConfigs(child, acc));
479556
+ }
479557
+ };
479558
+ const allConfigs = [];
479559
+ collectLayerConfigs(data, allConfigs);
479560
+ if (allConfigs.length === 0) {
479561
+ ElMessage.info("分组下没有图层");
479562
+ return;
479563
+ }
479564
+ const extent3 = createEmpty$1();
479565
+ let hasValidExtent = false;
479566
+ for (const cfg of allConfigs) {
479567
+ if (cfg.visible === false)
479568
+ continue;
479569
+ const handler = this.layerManager.getLayerHandler(cfg.id);
479570
+ if (!handler)
479571
+ continue;
479572
+ const layer2 = handler.getLayer();
479573
+ if (!layer2)
479574
+ continue;
479575
+ const source = (_a3 = layer2.getSource) == null ? void 0 : _a3.call(layer2);
479576
+ let layerExtent = null;
479577
+ if (source && typeof source.getExtent === "function") {
479578
+ layerExtent = source.getExtent();
479579
+ } else if (source && source.getTileGrid && typeof source.getTileGrid === "function") {
479580
+ const tileGrid = source.getTileGrid();
479581
+ if (tileGrid && typeof tileGrid.getExtent === "function") {
479582
+ layerExtent = tileGrid.getExtent();
479583
+ }
479584
+ }
479585
+ if (layerExtent && Array.isArray(layerExtent) && layerExtent.every((v5) => isFinite(v5))) {
479586
+ extend$e(extent3, layerExtent);
479587
+ hasValidExtent = true;
479588
+ }
479589
+ }
479590
+ const view = this.map.getView();
479591
+ const defaultAnimationConfig = {
479592
+ enabled: true,
479593
+ duration: 1e3,
479594
+ easing: "ease-out",
479595
+ maxZoom: 16,
479596
+ padding: [50, 50, 50, 50]
479597
+ };
479598
+ if (!hasValidExtent || isEmpty$4(extent3)) {
479599
+ const centerCfg = allConfigs.find((c2) => Array.isArray(c2.center) && c2.center.length === 2);
479600
+ if (centerCfg && centerCfg.center) {
479601
+ const mapProjection = view.getProjection().getCode();
479602
+ const center2 = mapProjection === "EPSG:4326" || mapProjection === "EPSG:4490" ? centerCfg.center : fromLonLat$1(centerCfg.center);
479603
+ {
479604
+ view.animate({
479605
+ center: center2,
479606
+ zoom: 12,
479607
+ duration: defaultAnimationConfig.duration,
479608
+ easing: this.getEasingFunction(defaultAnimationConfig.easing)
479609
+ });
479610
+ }
479611
+ ElMessage.success(`已定位到图层组中心点: ${data.label}`);
479612
+ return;
479613
+ }
479614
+ ElMessage.info(`无法计算图层组范围: ${data.label}`);
479615
+ return;
479616
+ }
479617
+ const fitOptions = {
479618
+ padding: defaultAnimationConfig.padding,
479619
+ maxZoom: defaultAnimationConfig.maxZoom
479620
+ };
479621
+ {
479622
+ fitOptions.duration = defaultAnimationConfig.duration;
479623
+ fitOptions.easing = this.getEasingFunction(defaultAnimationConfig.easing);
479624
+ }
479625
+ view.fit(extent3, fitOptions);
479626
+ ElMessage.success(`已定位到图层组: ${data.label}`);
479627
+ }
479346
479628
  /**
479347
479629
  * 获取缓动函数
479348
479630
  * @param easing 缓动类型
@@ -479380,13 +479662,13 @@ class LayerTreeManager {
479380
479662
  * @returns 是否允许放置
479381
479663
  */
479382
479664
  allowDrop(draggingNode, dropNode, type) {
479383
- const draggingParent = this.findParentGroup(draggingNode.data.id);
479384
- const dropParent = this.findParentGroup(dropNode.data.id);
479665
+ const draggingContainer = this.findParentContainerNode(draggingNode.data.id);
479666
+ const dropContainer = this.findParentContainerNode(dropNode.data.id);
479385
479667
  if (dropNode.data.type === "group") {
479386
- return type === "inner" && (draggingParent == null ? void 0 : draggingParent.id) === dropNode.data.id;
479668
+ return type === "inner" && (draggingContainer == null ? void 0 : draggingContainer.id) === dropNode.data.id;
479387
479669
  }
479388
479670
  if (dropNode.data.type === "layer") {
479389
- return (type === "prev" || type === "next") && (draggingParent == null ? void 0 : draggingParent.id) === (dropParent == null ? void 0 : dropParent.id);
479671
+ return (type === "prev" || type === "next") && !!draggingContainer && !!dropContainer && draggingContainer.id === dropContainer.id;
479390
479672
  }
479391
479673
  return false;
479392
479674
  }
@@ -479396,13 +479678,71 @@ class LayerTreeManager {
479396
479678
  * @returns 父分组或null
479397
479679
  */
479398
479680
  findParentGroup(nodeId) {
479681
+ const containsId = (layer2, targetId) => {
479682
+ if (layer2.id === targetId)
479683
+ return true;
479684
+ if (Array.isArray(layer2.children)) {
479685
+ return layer2.children.some((child) => containsId(child, targetId));
479686
+ }
479687
+ return false;
479688
+ };
479399
479689
  for (const group2 of this.layerGroups.value) {
479400
- if (group2.layers.some((layer2) => layer2.id === nodeId)) {
479690
+ if (group2.layers.some((layer2) => containsId(layer2, nodeId))) {
479401
479691
  return group2;
479402
479692
  }
479403
479693
  }
479404
479694
  return null;
479405
479695
  }
479696
+ /**
479697
+ * 在 layerGroups 中递归查找指定 ID 的图层配置
479698
+ */
479699
+ findLayerConfigById(targetId) {
479700
+ const search = (layers) => {
479701
+ for (const layer2 of layers) {
479702
+ if (layer2.id === targetId)
479703
+ return layer2;
479704
+ if (Array.isArray(layer2.children) && layer2.children.length > 0) {
479705
+ const found = search(layer2.children);
479706
+ if (found)
479707
+ return found;
479708
+ }
479709
+ }
479710
+ return null;
479711
+ };
479712
+ for (const group2 of this.layerGroups.value) {
479713
+ const found = search(group2.layers);
479714
+ if (found)
479715
+ return found;
479716
+ }
479717
+ return null;
479718
+ }
479719
+ /**
479720
+ * 查找节点所属的父“容器”节点(分组或带children的图层)
479721
+ * @param nodeId 节点ID
479722
+ * @returns 父容器的树节点,或null
479723
+ */
479724
+ findParentContainerNode(nodeId) {
479725
+ const search = (container) => {
479726
+ if (!container.children || container.children.length === 0)
479727
+ return null;
479728
+ for (const child of container.children) {
479729
+ if (child.id === nodeId)
479730
+ return container;
479731
+ if (child.children && child.children.length > 0) {
479732
+ const found = search(child);
479733
+ if (found)
479734
+ return found;
479735
+ }
479736
+ }
479737
+ return null;
479738
+ };
479739
+ for (const groupNode of this.treeData.value) {
479740
+ const found = search(groupNode);
479741
+ if (found)
479742
+ return found;
479743
+ }
479744
+ return null;
479745
+ }
479406
479746
  /**
479407
479747
  * 节点拖拽完成事件
479408
479748
  * @param draggingNode 拖拽节点
@@ -479411,31 +479751,53 @@ class LayerTreeManager {
479411
479751
  * @param ev 事件对象
479412
479752
  */
479413
479753
  onNodeDrop(draggingNode, dropNode, dropType, ev) {
479754
+ var _a3, _b3, _c2, _d;
479414
479755
  console.log("拖拽完成:", {
479415
479756
  dragging: draggingNode.data.label,
479416
479757
  drop: dropNode.data.label,
479417
479758
  type: dropType
479418
479759
  });
479419
- const draggingLayer = draggingNode.data.layerData;
479420
- if (!draggingLayer || !this.layerManager) {
479760
+ if (!this.layerManager) {
479421
479761
  return;
479422
479762
  }
479423
- const parentGroup = this.findParentGroup(draggingLayer.id);
479424
- if (!parentGroup) {
479763
+ const containerNode = dropType === "inner" && ((_a3 = dropNode == null ? void 0 : dropNode.data) == null ? void 0 : _a3.type) === "group" ? dropNode : dropNode == null ? void 0 : dropNode.parent;
479764
+ const childNodes = containerNode == null ? void 0 : containerNode.childNodes;
479765
+ const subsetNewOrder = (childNodes || []).map((node) => {
479766
+ var _a4, _b4;
479767
+ return (_b4 = (_a4 = node == null ? void 0 : node.data) == null ? void 0 : _a4.layerData) == null ? void 0 : _b4.id;
479768
+ }).filter((id) => !!id);
479769
+ const draggingLayer = (_b3 = draggingNode == null ? void 0 : draggingNode.data) == null ? void 0 : _b3.layerData;
479770
+ const realContainerNode = draggingLayer ? this.findParentContainerNode(draggingLayer.id) : null;
479771
+ if (!realContainerNode) {
479425
479772
  return;
479426
479773
  }
479427
- parentGroup.layers;
479428
- const newOrder = [];
479429
- const groupNode = this.treeData.value.find((node) => node.id === parentGroup.id);
479430
- if (groupNode && groupNode.children) {
479431
- groupNode.children.forEach((child) => {
479432
- if (child.layerData) {
479433
- newOrder.push(child.layerData.id);
479434
- }
479435
- });
479774
+ let fullOrderIds = [];
479775
+ const subsetSet = new Set(subsetNewOrder);
479776
+ if (((_c2 = realContainerNode.data) == null ? void 0 : _c2.type) === "group") {
479777
+ const realGroup = this.layerGroups.value.find((g2) => g2.id === realContainerNode.data.id);
479778
+ if (realGroup && Array.isArray(realGroup.layers) && subsetNewOrder.length > 0) {
479779
+ const idToLayer = new Map(realGroup.layers.map((l2) => [l2.id, l2]));
479780
+ let idx = 0;
479781
+ const reordered = realGroup.layers.map((l2) => subsetSet.has(l2.id) ? idToLayer.get(subsetNewOrder[idx++]) : l2);
479782
+ realGroup.layers = reordered;
479783
+ fullOrderIds = realGroup.layers.map((l2) => l2.id).filter((id) => !!this.layerManager.getLayerHandler(id));
479784
+ }
479785
+ } else if (((_d = realContainerNode.data) == null ? void 0 : _d.type) === "layer") {
479786
+ const parentLayerConfig = this.findLayerConfigById(realContainerNode.data.id);
479787
+ if (parentLayerConfig && Array.isArray(parentLayerConfig.children) && subsetNewOrder.length > 0) {
479788
+ const idToChild = new Map(parentLayerConfig.children.map((c2) => [c2.id, c2]));
479789
+ let idx = 0;
479790
+ const reorderedChildren = parentLayerConfig.children.map((c2) => subsetSet.has(c2.id) ? idToChild.get(subsetNewOrder[idx++]) : c2);
479791
+ parentLayerConfig.children = reorderedChildren;
479792
+ fullOrderIds = parentLayerConfig.children.map((c2) => c2.id).filter((id) => !!this.layerManager.getLayerHandler(id));
479793
+ }
479436
479794
  }
479437
- this.layerManager.reorderLayers(newOrder);
479438
- ElMessage.success(`图层 "${draggingLayer.name}" 已重新排序`);
479795
+ if (fullOrderIds.length > 0) {
479796
+ this.layerManager.reorderLayers(fullOrderIds);
479797
+ } else if (subsetNewOrder.length > 0) {
479798
+ this.layerManager.reorderLayers(subsetNewOrder);
479799
+ }
479800
+ ElMessage.success(`已在同一容器内重新排序并保存:${draggingNode.data.label}`);
479439
479801
  }
479440
479802
  /**
479441
479803
  * 获取图层图标类名
@@ -479714,9 +480076,9 @@ const _hoisted_2$5 = { class: "config-section" };
479714
480076
  const _hoisted_3$5 = { class: "config-item" };
479715
480077
  const _hoisted_4$5 = { class: "value-text" };
479716
480078
  const _hoisted_5$5 = { class: "config-item" };
479717
- const _hoisted_6$5 = { class: "value-text" };
479718
- const _hoisted_7$2 = { class: "config-item" };
479719
- const _hoisted_8$2 = { class: "value-text" };
480079
+ const _hoisted_6$4 = { class: "value-text" };
480080
+ const _hoisted_7$3 = { class: "config-item" };
480081
+ const _hoisted_8$3 = { class: "value-text" };
479720
480082
  const _hoisted_9$2 = { class: "config-item" };
479721
480083
  const _hoisted_10$2 = { class: "value-text" };
479722
480084
  const _hoisted_11$2 = { class: "config-section" };
@@ -479775,9 +480137,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
479775
480137
  step: 1,
479776
480138
  onInput: handleFilterChange
479777
480139
  }, null, 8, ["modelValue"]),
479778
- createElementVNode("span", _hoisted_6$5, toDisplayString(_ctx.filters.saturate) + "%", 1)
480140
+ createElementVNode("span", _hoisted_6$4, toDisplayString(_ctx.filters.saturate) + "%", 1)
479779
480141
  ]),
479780
- createElementVNode("div", _hoisted_7$2, [
480142
+ createElementVNode("div", _hoisted_7$3, [
479781
480143
  _cache[13] || (_cache[13] = createElementVNode("label", null, "亮度:", -1)),
479782
480144
  createVNode$1(_component_el_slider, {
479783
480145
  modelValue: _ctx.filters.brightness,
@@ -479787,7 +480149,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
479787
480149
  step: 1,
479788
480150
  onInput: handleFilterChange
479789
480151
  }, null, 8, ["modelValue"]),
479790
- createElementVNode("span", _hoisted_8$2, toDisplayString(_ctx.filters.brightness) + "%", 1)
480152
+ createElementVNode("span", _hoisted_8$3, toDisplayString(_ctx.filters.brightness) + "%", 1)
479791
480153
  ]),
479792
480154
  createElementVNode("div", _hoisted_9$2, [
479793
480155
  _cache[14] || (_cache[14] = createElementVNode("label", null, "对比度:", -1)),
@@ -479909,9 +480271,9 @@ const _hoisted_3$4 = {
479909
480271
  };
479910
480272
  const _hoisted_4$4 = { class: "config-item" };
479911
480273
  const _hoisted_5$4 = { class: "value-text" };
479912
- const _hoisted_6$4 = { class: "config-item" };
479913
- const _hoisted_7$1 = { class: "value-text" };
479914
- const _hoisted_8$1 = {
480274
+ const _hoisted_6$3 = { class: "config-item" };
480275
+ const _hoisted_7$2 = { class: "value-text" };
480276
+ const _hoisted_8$2 = {
479915
480277
  key: 1,
479916
480278
  class: "config-section"
479917
480279
  };
@@ -479967,7 +480329,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
479967
480329
  }, null, 8, ["modelValue"]),
479968
480330
  createElementVNode("span", _hoisted_5$4, toDisplayString(_ctx.layerData.clusterDistance) + "px", 1)
479969
480331
  ]),
479970
- createElementVNode("div", _hoisted_6$4, [
480332
+ createElementVNode("div", _hoisted_6$3, [
479971
480333
  _cache[7] || (_cache[7] = createElementVNode("label", null, "最小距离:", -1)),
479972
480334
  createVNode$1(_component_el_slider, {
479973
480335
  modelValue: _ctx.layerData.minDistance,
@@ -479977,10 +480339,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
479977
480339
  size: "small",
479978
480340
  onInput: handleClusterDistanceChange
479979
480341
  }, null, 8, ["modelValue"]),
479980
- createElementVNode("span", _hoisted_7$1, toDisplayString(_ctx.layerData.minDistance) + "px", 1)
480342
+ createElementVNode("span", _hoisted_7$2, toDisplayString(_ctx.layerData.minDistance) + "px", 1)
479981
480343
  ])
479982
480344
  ])) : createCommentVNode("", true),
479983
- isSuperMapLayer.value ? (openBlock(), createElementBlock("div", _hoisted_8$1, [
480345
+ isSuperMapLayer.value ? (openBlock(), createElementBlock("div", _hoisted_8$2, [
479984
480346
  _cache[13] || (_cache[13] = createElementVNode("h5", null, "SuperMap配置", -1)),
479985
480347
  createElementVNode("div", _hoisted_9$1, [
479986
480348
  _cache[9] || (_cache[9] = createElementVNode("label", null, "图片格式:", -1)),
@@ -480051,15 +480413,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
480051
480413
  }
480052
480414
  });
480053
480415
  const LayerStyleConfig = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-21ab8d8c"]]);
480054
- const _hoisted_1$3 = {
480055
- key: 0,
480056
- class: "group-node"
480057
- };
480058
- const _hoisted_2$3 = { class: "font-medium" };
480059
- const _hoisted_3$3 = { class: "layer-info" };
480060
- const _hoisted_4$3 = { class: "layer-name" };
480061
- const _hoisted_5$3 = { class: "opacity-control" };
480062
- const _hoisted_6$3 = { class: "opacity-value" };
480416
+ const _hoisted_1$3 = { class: "font-medium" };
480417
+ const _hoisted_2$3 = { class: "layer-info" };
480418
+ const _hoisted_3$3 = { class: "layer-name" };
480419
+ const _hoisted_4$3 = { class: "opacity-control" };
480420
+ const _hoisted_5$3 = { class: "opacity-value" };
480063
480421
  const _sfc_main$3 = /* @__PURE__ */ defineComponent({
480064
480422
  __name: "LayerTreeNode",
480065
480423
  props: {
@@ -480076,6 +480434,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
480076
480434
  const handleDoubleClick = () => {
480077
480435
  emit("doubleClick", props.data);
480078
480436
  };
480437
+ const handleGroupDoubleClick = () => {
480438
+ emit("doubleClick", props.data);
480439
+ };
480079
480440
  const handleOpacityChange = () => {
480080
480441
  emit("opacityChange", props.data.layerData);
480081
480442
  };
@@ -480098,22 +480459,26 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
480098
480459
  onDblclick: _cache[6] || (_cache[6] = withModifiers(() => {
480099
480460
  }, ["stop"]))
480100
480461
  }, [
480101
- _ctx.data.type === "group" ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
480462
+ _ctx.data.type === "group" ? (openBlock(), createElementBlock("div", {
480463
+ key: 0,
480464
+ class: "group-node",
480465
+ onDblclick: withModifiers(handleGroupDoubleClick, ["stop", "prevent"])
480466
+ }, [
480102
480467
  createVNode$1(_component_el_icon, { class: "mr-2" }, {
480103
480468
  default: withCtx(() => [
480104
480469
  createVNode$1(unref(folder_opened_default))
480105
480470
  ]),
480106
480471
  _: 1
480107
480472
  }),
480108
- createElementVNode("span", _hoisted_2$3, toDisplayString(_ctx.data.label), 1)
480109
- ])) : (openBlock(), createElementBlock("div", {
480473
+ createElementVNode("span", _hoisted_1$3, toDisplayString(_ctx.data.label), 1)
480474
+ ], 32)) : (openBlock(), createElementBlock("div", {
480110
480475
  key: 1,
480111
480476
  class: "layer-item",
480112
480477
  onDblclick: withModifiers(handleDoubleClick, ["stop", "prevent"]),
480113
480478
  onClick: _cache[5] || (_cache[5] = withModifiers(() => {
480114
480479
  }, ["stop"]))
480115
480480
  }, [
480116
- createElementVNode("div", _hoisted_3$3, [
480481
+ createElementVNode("div", _hoisted_2$3, [
480117
480482
  createVNode$1(_component_el_icon, {
480118
480483
  class: normalizeClass(["layer-icon", layerIconClass.value])
480119
480484
  }, {
@@ -480122,7 +480487,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
480122
480487
  ]),
480123
480488
  _: 1
480124
480489
  }, 8, ["class"]),
480125
- createElementVNode("span", _hoisted_4$3, toDisplayString(_ctx.data.label), 1)
480490
+ createElementVNode("span", _hoisted_3$3, toDisplayString(_ctx.data.label), 1)
480126
480491
  ]),
480127
480492
  createElementVNode("div", {
480128
480493
  class: "layer-controls",
@@ -480133,7 +480498,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
480133
480498
  onDblclick: _cache[4] || (_cache[4] = withModifiers(() => {
480134
480499
  }, ["stop"]))
480135
480500
  }, [
480136
- createElementVNode("div", _hoisted_5$3, [
480501
+ createElementVNode("div", _hoisted_4$3, [
480137
480502
  createVNode$1(_component_el_slider, {
480138
480503
  modelValue: _ctx.data.layerData.opacity,
480139
480504
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.data.layerData.opacity = $event),
@@ -480143,7 +480508,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
480143
480508
  class: "opacity-slider",
480144
480509
  onInput: handleOpacityChange
480145
480510
  }, null, 8, ["modelValue"]),
480146
- createElementVNode("span", _hoisted_6$3, toDisplayString(_ctx.data.layerData.opacity) + "%", 1)
480511
+ createElementVNode("span", _hoisted_5$3, toDisplayString(_ctx.data.layerData.opacity) + "%", 1)
480147
480512
  ]),
480148
480513
  createVNode$1(_component_el_popover, {
480149
480514
  placement: "left",
@@ -480187,13 +480552,15 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
480187
480552
  };
480188
480553
  }
480189
480554
  });
480190
- const LayerTreeNode = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-7bff1f66"]]);
480555
+ const LayerTreeNode = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-0c99df63"]]);
480191
480556
  const _hoisted_1$2 = { class: "flex-1 overflow-y-auto p-4" };
480192
- const _hoisted_2$2 = { class: "global-style-panel" };
480193
- const _hoisted_3$2 = { class: "config-section" };
480194
- const _hoisted_4$2 = { class: "config-item" };
480195
- const _hoisted_5$2 = { class: "current-style-display" };
480196
- const _hoisted_6$2 = { class: "style-preview" };
480557
+ const _hoisted_2$2 = { class: "pb-2 flex items-center justify-between" };
480558
+ const _hoisted_3$2 = { class: "text-xs font-semibold text-gray-700 px-1 py-1 border-b border-gray-200 mb-2" };
480559
+ const _hoisted_4$2 = { class: "global-style-panel" };
480560
+ const _hoisted_5$2 = { class: "config-section" };
480561
+ const _hoisted_6$2 = { class: "config-item" };
480562
+ const _hoisted_7$1 = { class: "current-style-display" };
480563
+ const _hoisted_8$1 = { class: "style-preview" };
480197
480564
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480198
480565
  __name: "LayerPanel",
480199
480566
  props: {
@@ -480210,17 +480577,25 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480210
480577
  const layerTreeManager = new LayerTreeManager();
480211
480578
  const layerConfigManager = new LayerConfigManager();
480212
480579
  const defaultExpandedKeys = computed(() => layerTreeManager.defaultExpandedKeys.value);
480213
- const defaultCheckedKeys = ref([]);
480214
- const treeData = ref([]);
480215
- onMounted(() => {
480216
- try {
480217
- defaultCheckedKeys.value = Array.isArray(layerTreeManager.defaultCheckedKeys.value) ? [...layerTreeManager.defaultCheckedKeys.value] : [];
480218
- const source = layerTreeManager.treeData.value;
480219
- treeData.value = source ? JSON.parse(JSON.stringify(source)) : [];
480220
- } catch (e8) {
480221
- defaultCheckedKeys.value = layerTreeManager.defaultCheckedKeys.value || [];
480222
- treeData.value = layerTreeManager.treeData.value || [];
480223
- }
480580
+ const defaultCheckedKeys = computed(
480581
+ () => layerTreeManager.defaultCheckedKeys.value
480582
+ );
480583
+ const treeData = computed(() => layerTreeManager.treeData.value);
480584
+ const dialogProps = computed(() => {
480585
+ var _a3;
480586
+ const ui2 = ((_a3 = config == null ? void 0 : config.value) == null ? void 0 : _a3.ui) || {};
480587
+ return {
480588
+ title: ui2.title ?? "图层管理",
480589
+ width: ui2.width ?? "350px",
480590
+ height: ui2.height ?? "600px",
480591
+ modal: ui2.modal ?? false,
480592
+ draggable: ui2.draggable ?? true,
480593
+ resizable: ui2.resizable ?? true,
480594
+ showClose: ui2.showClose ?? true,
480595
+ position: ui2.position ?? "right",
480596
+ cacheId: ui2.cacheId ?? "layer-dialog",
480597
+ className: ui2.className ?? "layer-dialog"
480598
+ };
480224
480599
  });
480225
480600
  const handleLayerDoubleClick = (data) => {
480226
480601
  layerTreeManager.handleLayerDoubleClick(data, layerManager.value, map2.value);
@@ -480234,12 +480609,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480234
480609
  const onNodeDrop2 = (draggingNode, dropNode, dropType, ev) => {
480235
480610
  layerTreeManager.onNodeDrop(draggingNode, dropNode, dropType, ev);
480236
480611
  };
480237
- const onTreeCheck = (data, { checkedKeys, checkedNodes }) => {
480238
- const allNodes = getAllTreeNodes(treeData.value);
480612
+ const onTreeCheck = (data, ctx2) => {
480613
+ const checkedKeys = ctx2 == null ? void 0 : ctx2.checkedKeys;
480239
480614
  const group2 = layerGroups.value.find((g2) => g2.layers.some((l2) => l2.id === data.id));
480240
480615
  if ((group2 == null ? void 0 : group2.id) === "baseLayers") {
480241
480616
  isProcessingBasemap.value = true;
480242
- if (checkedKeys.includes(data.id)) {
480617
+ const willCheck2 = checkedKeys ? checkedKeys.includes(data.id) : !defaultCheckedKeys.value.includes(data.id);
480618
+ if (willCheck2) {
480243
480619
  let selectedLayer2 = null;
480244
480620
  group2.layers.forEach((layer2) => {
480245
480621
  if (layer2.id === data.id) {
@@ -480282,36 +480658,32 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480282
480658
  }
480283
480659
  return;
480284
480660
  }
480285
- allNodes.forEach((node) => {
480286
- if (!checkedKeys.includes(node.id)) {
480287
- if (node.type === "layer" && node.layerData) {
480288
- node.layerData.visible = false;
480289
- handleLayerVisibilityChange(node.layerData);
480290
- } else if (node.type === "group") {
480291
- const group22 = layerGroups.value.find((g2) => g2.id === node.id);
480292
- if (group22) {
480293
- group22.layers.forEach((layer2) => {
480294
- layer2.visible = false;
480295
- handleLayerVisibilityChange(layer2);
480296
- });
480297
- }
480298
- }
480299
- }
480300
- });
480301
- checkedNodes.forEach((node) => {
480661
+ const willCheck = checkedKeys ? checkedKeys.includes(data.id) : !defaultCheckedKeys.value.includes(data.id);
480662
+ const toggleNodeAndChildren = (node, checked) => {
480302
480663
  if (node.type === "layer" && node.layerData) {
480303
- node.layerData.visible = true;
480664
+ node.layerData.visible = checked;
480304
480665
  handleLayerVisibilityChange(node.layerData);
480305
- } else if (node.type === "group") {
480306
- const group22 = layerGroups.value.find((g2) => g2.id === node.id);
480307
- if (group22) {
480308
- group22.layers.forEach((layer2) => {
480309
- layer2.visible = true;
480310
- handleLayerVisibilityChange(layer2);
480311
- });
480666
+ if (node.layerData.type === "group") {
480667
+ return;
480312
480668
  }
480313
480669
  }
480314
- });
480670
+ if (node.children && node.children.length > 0) {
480671
+ node.children.forEach((child) => toggleNodeAndChildren(child, checked));
480672
+ }
480673
+ };
480674
+ if (data.type === "group") {
480675
+ const targetGroup = layerGroups.value.find((g2) => g2.id === data.id);
480676
+ if (targetGroup) {
480677
+ targetGroup.layers.forEach((layer2) => {
480678
+ layer2.visible = willCheck;
480679
+ handleLayerVisibilityChange(layer2);
480680
+ });
480681
+ } else {
480682
+ toggleNodeAndChildren(data, willCheck);
480683
+ }
480684
+ } else {
480685
+ toggleNodeAndChildren(data, willCheck);
480686
+ }
480315
480687
  nextTick(() => {
480316
480688
  syncTreeCheckedState();
480317
480689
  });
@@ -480329,61 +480701,79 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480329
480701
  const props = __props;
480330
480702
  const config = inject("layerPanelConfig");
480331
480703
  const map2 = inject("map");
480332
- inject("eventBus");
480704
+ const eventBus = inject("eventBus");
480333
480705
  inject("storage");
480334
480706
  const mapManager = inject("mapManager");
480335
- const dialogProps = computed(() => {
480336
- var _a3;
480337
- const ui2 = ((_a3 = config == null ? void 0 : config.value) == null ? void 0 : _a3.ui) || {};
480338
- return {
480339
- title: ui2.title ?? "图层管理",
480340
- width: ui2.width ?? "350px",
480341
- height: ui2.height ?? "600px",
480342
- modal: ui2.modal ?? false,
480343
- draggable: ui2.draggable ?? true,
480344
- resizable: ui2.resizable ?? true,
480345
- showClose: ui2.showClose ?? true,
480346
- position: ui2.position ?? "right",
480347
- cacheId: ui2.cacheId ?? "layer-dialog",
480348
- className: ui2.className ?? "layer-dialog"
480349
- };
480350
- });
480351
- watch(config, (newConfig) => {
480352
- var _a3, _b3, _c2;
480353
- console.log("🔍 [LayerPanel] config变化:", newConfig);
480354
- if (newConfig) {
480355
- console.log("🔍 [LayerPanel] baseLayers数量:", ((_a3 = newConfig.baseLayers) == null ? void 0 : _a3.length) || 0);
480356
- console.log("🔍 [LayerPanel] overlayLayers数量:", ((_b3 = newConfig.overlayLayers) == null ? void 0 : _b3.length) || 0);
480357
- console.log("🔍 [LayerPanel] vectorLayers数量:", ((_c2 = newConfig.vectorLayers) == null ? void 0 : _c2.length) || 0);
480358
- if (newConfig.overlayLayers && newConfig.overlayLayers.length > 0) {
480359
- console.log("🔍 [LayerPanel] overlayLayers详情:", newConfig.overlayLayers);
480707
+ const zIndexVersion = ref(0);
480708
+ watch(
480709
+ config,
480710
+ (newConfig) => {
480711
+ var _a3, _b3, _c2;
480712
+ console.log("🔍 [LayerPanel] config变化:", newConfig);
480713
+ if (newConfig) {
480714
+ console.log(
480715
+ "🔍 [LayerPanel] baseLayers数量:",
480716
+ ((_a3 = newConfig.baseLayers) == null ? void 0 : _a3.length) || 0
480717
+ );
480718
+ console.log(
480719
+ "🔍 [LayerPanel] overlayLayers数量:",
480720
+ ((_b3 = newConfig.overlayLayers) == null ? void 0 : _b3.length) || 0
480721
+ );
480722
+ console.log(
480723
+ "🔍 [LayerPanel] vectorLayers数量:",
480724
+ ((_c2 = newConfig.vectorLayers) == null ? void 0 : _c2.length) || 0
480725
+ );
480726
+ if (newConfig.overlayLayers && newConfig.overlayLayers.length > 0) {
480727
+ console.log(
480728
+ "🔍 [LayerPanel] overlayLayers详情:",
480729
+ newConfig.overlayLayers
480730
+ );
480731
+ }
480360
480732
  }
480361
- }
480362
- }, { immediate: true, deep: true });
480733
+ },
480734
+ { immediate: true, deep: true }
480735
+ );
480363
480736
  const layers = ref([]);
480364
480737
  ref(null);
480365
480738
  const emit = __emit;
480366
480739
  ref(false);
480367
480740
  ref(null);
480368
- const layerManager = computed(() => {
480369
- var _a3;
480370
- return ((_a3 = mapManager == null ? void 0 : mapManager.value) == null ? void 0 : _a3.getLayerManager()) || null;
480371
- });
480741
+ const layerManager = computed(
480742
+ () => {
480743
+ var _a3;
480744
+ return ((_a3 = mapManager == null ? void 0 : mapManager.value) == null ? void 0 : _a3.getLayerManager()) || null;
480745
+ }
480746
+ );
480372
480747
  const getAllConfigLayers = () => {
480373
480748
  console.log("🔍 [LayerPanel] getAllConfigLayers被调用");
480374
480749
  console.log("🔍 [LayerPanel] config.value:", config.value);
480375
480750
  const allLayers = [];
480376
480751
  if (config.value.baseLayers) {
480377
- console.log("🔍 [LayerPanel] 添加baseLayers:", config.value.baseLayers.length, "个");
480752
+ console.log(
480753
+ "🔍 [LayerPanel] 添加baseLayers:",
480754
+ config.value.baseLayers.length,
480755
+ "个"
480756
+ );
480378
480757
  allLayers.push(...config.value.baseLayers);
480379
480758
  }
480380
480759
  if (config.value.overlayLayers) {
480381
- console.log("🔍 [LayerPanel] 添加overlayLayers:", config.value.overlayLayers.length, "个");
480382
- console.log("🔍 [LayerPanel] overlayLayers详情:", config.value.overlayLayers);
480760
+ console.log(
480761
+ "🔍 [LayerPanel] 添加overlayLayers:",
480762
+ config.value.overlayLayers.length,
480763
+ "个"
480764
+ );
480765
+ console.log(
480766
+ "🔍 [LayerPanel] overlayLayers详情:",
480767
+ config.value.overlayLayers
480768
+ );
480383
480769
  allLayers.push(...config.value.overlayLayers);
480384
480770
  }
480385
480771
  if (config.value.vectorLayers) {
480386
- console.log("🔍 [LayerPanel] 添加vectorLayers:", config.value.vectorLayers.length, "个");
480772
+ console.log(
480773
+ "🔍 [LayerPanel] 添加vectorLayers:",
480774
+ config.value.vectorLayers.length,
480775
+ "个"
480776
+ );
480387
480777
  allLayers.push(...config.value.vectorLayers);
480388
480778
  }
480389
480779
  console.log("🔍 [LayerPanel] 总共获取到图层数量:", allLayers.length);
@@ -480415,7 +480805,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480415
480805
  });
480416
480806
  }
480417
480807
  baseLayers.forEach((baseLayer) => {
480418
- const originalLayer = configLayers.find((layer2) => layer2.id === baseLayer.id);
480808
+ const originalLayer = configLayers.find(
480809
+ (layer2) => layer2.id === baseLayer.id
480810
+ );
480419
480811
  if (originalLayer) {
480420
480812
  originalLayer.visible = baseLayer.visible;
480421
480813
  }
@@ -480423,21 +480815,43 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480423
480815
  }
480424
480816
  for (const layerConfig of configLayers) {
480425
480817
  if (!layers.value.find((l2) => l2.id === layerConfig.id)) {
480426
- console.log("🔍 [LayerPanel] 注册图层配置:", layerConfig.id, "可见:", layerConfig.visible);
480818
+ console.log(
480819
+ "🔍 [LayerPanel] 注册图层配置:",
480820
+ layerConfig.id,
480821
+ "可见:",
480822
+ layerConfig.visible
480823
+ );
480427
480824
  const success = await layerManager.value.addLayer(layerConfig);
480428
480825
  if (success) {
480429
- const addedLayerConfig = layerManager.value.getLayerConfig(layerConfig.id);
480826
+ const addedLayerConfig = layerManager.value.getLayerConfig(
480827
+ layerConfig.id
480828
+ );
480430
480829
  if (addedLayerConfig) {
480431
480830
  layers.value.push(addedLayerConfig);
480432
- console.log("🔍 [LayerPanel] 图层配置已注册:", layerConfig.id, "已加载:", layerManager.value.isLayerLoaded(layerConfig.id));
480831
+ console.log(
480832
+ "🔍 [LayerPanel] 图层配置已注册:",
480833
+ layerConfig.id,
480834
+ "已加载:",
480835
+ layerManager.value.isLayerLoaded(layerConfig.id)
480836
+ );
480433
480837
  }
480434
480838
  } else {
480435
- console.error("🔍 [LayerPanel] 图层配置注册失败:", layerConfig.id, layerConfig.type);
480839
+ console.error(
480840
+ "🔍 [LayerPanel] 图层配置注册失败:",
480841
+ layerConfig.id,
480842
+ layerConfig.type
480843
+ );
480436
480844
  }
480437
480845
  }
480438
480846
  }
480439
- console.log("🔍 [LayerPanel] 配置应用完成,已加载图层数量:", layerManager.value.getAllLayerConfigs().filter((config2) => layerManager.value.isLayerLoaded(config2.id)).length);
480440
- console.log("🔍 [LayerPanel] 总图层配置数量:", layerManager.value.getAllLayerConfigs().length);
480847
+ console.log(
480848
+ "🔍 [LayerPanel] 配置应用完成,已加载图层数量:",
480849
+ layerManager.value.getAllLayerConfigs().filter((config2) => layerManager.value.isLayerLoaded(config2.id)).length
480850
+ );
480851
+ console.log(
480852
+ "🔍 [LayerPanel] 总图层配置数量:",
480853
+ layerManager.value.getAllLayerConfigs().length
480854
+ );
480441
480855
  } catch (error2) {
480442
480856
  console.error("Failed to apply config to map:", error2);
480443
480857
  ElMessage.error(`配置应用失败: ${error2.message}`);
@@ -480493,6 +480907,23 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480493
480907
  const handleClose = () => {
480494
480908
  emit("update:modelValue", false);
480495
480909
  };
480910
+ const expandedKeys = ref([]);
480911
+ const onNodeExpand = (data) => {
480912
+ debugger;
480913
+ const id = data == null ? void 0 : data.id;
480914
+ if (!id)
480915
+ return;
480916
+ if (!expandedKeys.value.includes(id))
480917
+ expandedKeys.value.push(id);
480918
+ initializeExpandedKeys();
480919
+ };
480920
+ const onNodeCollapse = (data) => {
480921
+ const id = data == null ? void 0 : data.id;
480922
+ if (!id)
480923
+ return;
480924
+ expandedKeys.value = expandedKeys.value.filter((k2) => k2 !== id);
480925
+ initializeExpandedKeys();
480926
+ };
480496
480927
  const layerGroups = computed(() => {
480497
480928
  var _a3, _b3, _c2, _d, _e2, _f;
480498
480929
  const ensureFilterProperty = (layers2) => {
@@ -480527,18 +480958,24 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480527
480958
  };
480528
480959
  if (layers.value.length > 0) {
480529
480960
  const groups2 = [];
480530
- const baseLayerIds = new Set((((_a3 = config == null ? void 0 : config.value) == null ? void 0 : _a3.baseLayers) || []).map((layer2) => layer2.id));
480531
- const overlayLayerIds = new Set((((_b3 = config == null ? void 0 : config.value) == null ? void 0 : _b3.overlayLayers) || []).map((layer2) => layer2.id));
480532
- const vectorLayerIds = new Set((((_c2 = config == null ? void 0 : config.value) == null ? void 0 : _c2.vectorLayers) || []).map((layer2) => layer2.id));
480533
- const baseLayersList = ensureFilterProperty(layers.value.filter(
480534
- (layer2) => baseLayerIds.has(layer2.id)
480535
- ));
480536
- const overlayLayersList = ensureFilterProperty(layers.value.filter(
480537
- (layer2) => overlayLayerIds.has(layer2.id)
480538
- ));
480539
- const vectorLayersList = ensureFilterProperty(layers.value.filter(
480540
- (layer2) => vectorLayerIds.has(layer2.id)
480541
- ));
480961
+ const baseLayerIds = new Set(
480962
+ (((_a3 = config == null ? void 0 : config.value) == null ? void 0 : _a3.baseLayers) || []).map((layer2) => layer2.id)
480963
+ );
480964
+ const overlayLayerIds = new Set(
480965
+ (((_b3 = config == null ? void 0 : config.value) == null ? void 0 : _b3.overlayLayers) || []).map((layer2) => layer2.id)
480966
+ );
480967
+ const vectorLayerIds = new Set(
480968
+ (((_c2 = config == null ? void 0 : config.value) == null ? void 0 : _c2.vectorLayers) || []).map((layer2) => layer2.id)
480969
+ );
480970
+ const baseLayersList = ensureFilterProperty(
480971
+ layers.value.filter((layer2) => baseLayerIds.has(layer2.id))
480972
+ );
480973
+ const overlayLayersList = ensureFilterProperty(
480974
+ layers.value.filter((layer2) => overlayLayerIds.has(layer2.id))
480975
+ );
480976
+ const vectorLayersList = ensureFilterProperty(
480977
+ layers.value.filter((layer2) => vectorLayerIds.has(layer2.id))
480978
+ );
480542
480979
  if (baseLayersList.length > 0) {
480543
480980
  groups2.push({
480544
480981
  id: "baseLayers",
@@ -480594,49 +481031,110 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480594
481031
  }
480595
481032
  return groups;
480596
481033
  });
481034
+ const activeTreeType = ref("classification");
481035
+ const classificationGroups = computed(() => {
481036
+ zIndexVersion.value;
481037
+ const vectorGroup = layerGroups.value.find((g2) => g2.id === "vectorLayers");
481038
+ if (!vectorGroup)
481039
+ return [];
481040
+ const buckets = /* @__PURE__ */ new Map();
481041
+ const getClassification = (layer2) => {
481042
+ const anyLayer = layer2;
481043
+ const meta = anyLayer.metadata || {};
481044
+ return anyLayer.classificationName ?? meta.classificationName ?? anyLayer.sslx ?? "未分类";
481045
+ };
481046
+ const getZ = (id) => {
481047
+ var _a3;
481048
+ try {
481049
+ return ((_a3 = layerManager.value) == null ? void 0 : _a3.getLayerZIndex(id)) ?? 0;
481050
+ } catch (e8) {
481051
+ return 0;
481052
+ }
481053
+ };
481054
+ for (const layer2 of vectorGroup.layers) {
481055
+ const key = getClassification(layer2) || "未分类";
481056
+ const arr = buckets.get(key) ?? [];
481057
+ arr.push(layer2);
481058
+ buckets.set(key, arr);
481059
+ }
481060
+ const groups = [];
481061
+ buckets.forEach((arr, key) => {
481062
+ const sorted = [...arr].sort((a3, b10) => getZ(b10.id) - getZ(a3.id));
481063
+ groups.push({
481064
+ id: `class:${key}`,
481065
+ name: key,
481066
+ layers: sorted
481067
+ });
481068
+ });
481069
+ return groups;
481070
+ });
481071
+ const effectiveLayerGroups = computed(() => {
481072
+ return activeTreeType.value === "classification" ? classificationGroups.value : layerGroups.value;
481073
+ });
481074
+ const classificationTreeRefs = ref({});
481075
+ const buildLayerNodeLocal = (layer2) => {
481076
+ const node = {
481077
+ id: layer2.id,
481078
+ label: layer2.name,
481079
+ type: "layer",
481080
+ layerType: layer2.type,
481081
+ layerData: layer2
481082
+ };
481083
+ if (layer2.children && Array.isArray(layer2.children) && layer2.children.length > 0) {
481084
+ const getZ = (id) => {
481085
+ var _a3;
481086
+ try {
481087
+ return ((_a3 = layerManager.value) == null ? void 0 : _a3.getLayerZIndex(id)) ?? 0;
481088
+ } catch (e8) {
481089
+ return 0;
481090
+ }
481091
+ };
481092
+ const sortedChildren = [...layer2.children].sort((a3, b10) => getZ(b10.id) - getZ(a3.id));
481093
+ node.children = sortedChildren.map((child) => buildLayerNodeLocal(child));
481094
+ }
481095
+ return node;
481096
+ };
481097
+ const getGroupTreeData = (group2) => {
481098
+ zIndexVersion.value;
481099
+ return group2.layers.map((layer2) => buildLayerNodeLocal(layer2));
481100
+ };
480597
481101
  const initializeExpandedKeys = () => {
480598
- layerTreeManager.setDefaultExpandedKeys(layerGroups.value.map((group2) => group2.id));
481102
+ const groupIds = effectiveLayerGroups.value.map((group2) => group2.id);
481103
+ const union3 = Array.from(/* @__PURE__ */ new Set([...groupIds, ...expandedKeys.value]));
481104
+ layerTreeManager.setDefaultExpandedKeys(union3);
480599
481105
  };
480600
481106
  const syncTreeCheckedState = () => {
480601
- if (treeRef.value) {
480602
- const checkedKeys = layerTreeManager.defaultCheckedKeys.value;
480603
- treeRef.value.setCheckedKeys(checkedKeys);
481107
+ const checkedKeys = defaultCheckedKeys.value;
481108
+ if (activeTreeType.value === "classification") {
481109
+ Object.values(classificationTreeRefs.value).forEach((tree) => {
481110
+ try {
481111
+ tree == null ? void 0 : tree.setCheckedKeys(checkedKeys);
481112
+ } catch (e8) {
481113
+ }
481114
+ });
481115
+ } else {
481116
+ if (treeRef.value) {
481117
+ treeRef.value.setCheckedKeys(checkedKeys);
481118
+ }
480604
481119
  }
480605
481120
  };
480606
- const hasTreeSnapshot = ref(false);
480607
- const expectedLayerCount = computed(() => {
480608
- var _a3, _b3, _c2;
480609
- const c2 = (config == null ? void 0 : config.value) || {};
480610
- const total = (((_a3 = c2.baseLayers) == null ? void 0 : _a3.length) || 0) + (((_b3 = c2.overlayLayers) == null ? void 0 : _b3.length) || 0) + (((_c2 = c2.vectorLayers) == null ? void 0 : _c2.length) || 0);
480611
- return total;
480612
- });
480613
481121
  watchEffect(() => {
480614
- if (layerGroups.value.length > 0) {
480615
- layerTreeManager.setLayerGroups(layerGroups.value);
480616
- layerTreeManager.setDefaultExpandedKeys(layerGroups.value.map((group2) => group2.id));
481122
+ if (effectiveLayerGroups.value.length > 0) {
481123
+ layerTreeManager.setLayerGroups(effectiveLayerGroups.value);
481124
+ const groupIds = effectiveLayerGroups.value.map((group2) => group2.id);
481125
+ const union3 = Array.from(/* @__PURE__ */ new Set([...groupIds, ...expandedKeys.value]));
481126
+ layerTreeManager.setDefaultExpandedKeys(union3);
480617
481127
  initializeExpandedKeys();
480618
- if (!hasTreeSnapshot.value) {
480619
- const isInitialRegistrationDone = layers.value.length >= expectedLayerCount.value || expectedLayerCount.value === 0;
480620
- console.log("🔍 [LayerPanel] 快照准备检查: layers.length=", layers.value.length, " expected=", expectedLayerCount.value, " done=", isInitialRegistrationDone);
480621
- if (isInitialRegistrationDone) {
480622
- try {
480623
- defaultCheckedKeys.value = Array.isArray(layerTreeManager.defaultCheckedKeys.value) ? [...layerTreeManager.defaultCheckedKeys.value] : [];
480624
- const source = layerTreeManager.treeData.value;
480625
- treeData.value = source ? JSON.parse(JSON.stringify(source)) : [];
480626
- } catch (e8) {
480627
- defaultCheckedKeys.value = layerTreeManager.defaultCheckedKeys.value || [];
480628
- treeData.value = layerTreeManager.treeData.value || [];
480629
- }
480630
- hasTreeSnapshot.value = true;
480631
- }
480632
- }
480633
481128
  nextTick(() => {
480634
481129
  syncTreeCheckedState();
480635
481130
  });
480636
481131
  }
480637
481132
  });
480638
481133
  const layerVisibilityState = computed(() => {
480639
- return layers.value.map((layer2) => ({ id: layer2.id, visible: layer2.visible }));
481134
+ return layers.value.map((layer2) => ({
481135
+ id: layer2.id,
481136
+ visible: layer2.visible
481137
+ }));
480640
481138
  });
480641
481139
  const isProcessingBasemap = ref(false);
480642
481140
  const activeMainTab = ref("layers");
@@ -480686,7 +481184,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480686
481184
  if (!layerConfigManager["layerManager"]) {
480687
481185
  layerConfigManager.initialize(layerManager.value);
480688
481186
  }
480689
- layerConfigManager.updateClusterDistance(layerData, layerManager.value, updateLayerConfig);
481187
+ layerConfigManager.updateClusterDistance(
481188
+ layerData,
481189
+ layerManager.value,
481190
+ updateLayerConfig
481191
+ );
480690
481192
  };
480691
481193
  const updateSuperMapConfig = (layerData) => {
480692
481194
  if (!layerManager.value) {
@@ -480696,7 +481198,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480696
481198
  if (!layerConfigManager["layerManager"]) {
480697
481199
  layerConfigManager.initialize(layerManager.value);
480698
481200
  }
480699
- layerConfigManager.updateSuperMapConfig(layerData, layerManager.value, updateLayerConfig);
481201
+ layerConfigManager.updateSuperMapConfig(
481202
+ layerData,
481203
+ layerManager.value,
481204
+ updateLayerConfig
481205
+ );
480700
481206
  };
480701
481207
  const resetLayerStyle = (layerData) => {
480702
481208
  if (!layerManager.value) {
@@ -480706,7 +481212,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480706
481212
  if (!layerConfigManager["layerManager"]) {
480707
481213
  layerConfigManager.initialize(layerManager.value);
480708
481214
  }
480709
- layerConfigManager.resetLayerStyle(layerData, updateClusterDistance, updateSuperMapConfig);
481215
+ layerConfigManager.resetLayerStyle(
481216
+ layerData,
481217
+ updateClusterDistance,
481218
+ updateSuperMapConfig
481219
+ );
480710
481220
  };
480711
481221
  const handleLayerVisibilityChange = async (layer2) => {
480712
481222
  if (layerManager.value) {
@@ -480715,9 +481225,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480715
481225
  updateLayerConfig(layer2.id, {
480716
481226
  visible: layer2.visible
480717
481227
  });
480718
- console.log("🔍 [LayerPanel] 图层可见性已更新:", layer2.id, "可见:", layer2.visible, "已加载:", layerManager.value.isLayerLoaded(layer2.id));
480719
481228
  } catch (error2) {
480720
- console.error("🔍 [LayerPanel] 更新图层可见性失败:", layer2.id, error2);
480721
481229
  ElMessage.error(`图层 ${layer2.name} 可见性更新失败`);
480722
481230
  return;
480723
481231
  }
@@ -480747,7 +481255,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480747
481255
  }
480748
481256
  };
480749
481257
  const handleBasemapChanged = (event) => {
480750
- const baseLayersGroup = layerGroups.value.find((group2) => group2.id === "baseLayers");
481258
+ const baseLayersGroup = layerGroups.value.find(
481259
+ (group2) => group2.id === "baseLayers"
481260
+ );
480751
481261
  if (!baseLayersGroup)
480752
481262
  return;
480753
481263
  baseLayersGroup.layers.forEach((layer2) => {
@@ -480765,34 +481275,46 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480765
481275
  });
480766
481276
  };
480767
481277
  const handleBasemapSwitchRequest = (event) => {
480768
- const baseLayersGroup = layerGroups.value.find((group2) => group2.id === "baseLayers");
481278
+ const baseLayersGroup = layerGroups.value.find(
481279
+ (group2) => group2.id === "baseLayers"
481280
+ );
480769
481281
  if (!baseLayersGroup) {
480770
481282
  console.warn("未找到底图分组");
480771
481283
  return;
480772
481284
  }
480773
481285
  if (event.basemapConfig === null) {
480774
- const targetLayer2 = baseLayersGroup.layers.find((layer2) => layer2.id === event.basemapId);
481286
+ const targetLayer2 = baseLayersGroup.layers.find(
481287
+ (layer2) => layer2.id === event.basemapId
481288
+ );
480775
481289
  if (targetLayer2 && targetLayer2.visible) {
480776
481290
  targetLayer2.visible = false;
480777
481291
  handleLayerVisibilityChange(targetLayer2);
480778
481292
  nextTick(() => {
480779
481293
  if (treeRef.value) {
480780
481294
  const currentCheckedKeys = treeRef.value.getCheckedKeys();
480781
- const newCheckedKeys = currentCheckedKeys.filter((key) => key !== event.basemapId);
481295
+ const newCheckedKeys = currentCheckedKeys.filter(
481296
+ (key) => key !== event.basemapId
481297
+ );
480782
481298
  treeRef.value.setCheckedKeys(newCheckedKeys);
480783
481299
  }
480784
481300
  });
480785
481301
  }
480786
481302
  return;
480787
481303
  }
480788
- let targetLayer = baseLayersGroup.layers.find((layer2) => layer2.id === event.basemapId);
481304
+ let targetLayer = baseLayersGroup.layers.find(
481305
+ (layer2) => layer2.id === event.basemapId
481306
+ );
480789
481307
  if (!targetLayer && layerManager.value && event.basemapConfig) {
480790
481308
  const success = layerManager.value.addLayer(event.basemapConfig);
480791
481309
  if (success) {
480792
481310
  const allLayerConfigs = layerManager.value.getAllLayerConfigs();
480793
481311
  layers.value = allLayerConfigs;
480794
- const updatedBaseLayersGroup = layerGroups.value.find((group2) => group2.id === "baseLayers");
480795
- targetLayer = updatedBaseLayersGroup == null ? void 0 : updatedBaseLayersGroup.layers.find((layer2) => layer2.id === event.basemapId);
481312
+ const updatedBaseLayersGroup = layerGroups.value.find(
481313
+ (group2) => group2.id === "baseLayers"
481314
+ );
481315
+ targetLayer = updatedBaseLayersGroup == null ? void 0 : updatedBaseLayersGroup.layers.find(
481316
+ (layer2) => layer2.id === event.basemapId
481317
+ );
480796
481318
  }
480797
481319
  }
480798
481320
  if (!targetLayer) {
@@ -480815,18 +481337,40 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480815
481337
  onMounted(() => {
480816
481338
  layerEventBus.on("basemap-changed", handleBasemapChanged);
480817
481339
  layerEventBus.on("basemap-switch-request", handleBasemapSwitchRequest);
481340
+ try {
481341
+ eventBus == null ? void 0 : eventBus.on("layer-order-changed", () => {
481342
+ zIndexVersion.value++;
481343
+ });
481344
+ } catch (e8) {
481345
+ }
481346
+ try {
481347
+ layerEventBus.on("layer-order-changed", () => {
481348
+ zIndexVersion.value++;
481349
+ });
481350
+ } catch (e8) {
481351
+ }
480818
481352
  });
480819
481353
  onUnmounted(() => {
480820
481354
  layerEventBus.off("basemap-changed", handleBasemapChanged);
480821
481355
  layerEventBus.off("basemap-switch-request", handleBasemapSwitchRequest);
481356
+ try {
481357
+ eventBus == null ? void 0 : eventBus.off("layer-order-changed");
481358
+ } catch (e8) {
481359
+ }
481360
+ try {
481361
+ layerEventBus.off("layer-order-changed");
481362
+ } catch (e8) {
481363
+ }
480822
481364
  });
480823
481365
  return (_ctx, _cache) => {
481366
+ const _component_el_radio_button = resolveComponent("el-radio-button");
481367
+ const _component_el_radio_group = resolveComponent("el-radio-group");
480824
481368
  const _component_el_tree = resolveComponent("el-tree");
480825
481369
  const _component_el_tab_pane = resolveComponent("el-tab-pane");
480826
481370
  const _component_el_tabs = resolveComponent("el-tabs");
480827
481371
  return openBlock(), createBlock(CustomDialog, {
480828
481372
  modelValue: visible.value,
480829
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => visible.value = $event),
481373
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => visible.value = $event),
480830
481374
  title: dialogProps.value.title,
480831
481375
  width: dialogProps.value.width,
480832
481376
  height: dialogProps.value.height,
@@ -480859,11 +481403,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480859
481403
  defaultExpandedKeys: defaultExpandedKeys.value,
480860
481404
  defaultCheckedKeys: defaultCheckedKeys.value,
480861
481405
  syncTreeCheckedState,
480862
- getAllTreeNodes
481406
+ getAllTreeNodes,
481407
+ onNodeExpand
480863
481408
  }, void 0, true) : (openBlock(), createBlock(_component_el_tabs, {
480864
481409
  key: 1,
480865
481410
  modelValue: activeMainTab.value,
480866
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => activeMainTab.value = $event),
481411
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => activeMainTab.value = $event),
480867
481412
  class: "main-tabs"
480868
481413
  }, {
480869
481414
  default: withCtx(() => [
@@ -480873,7 +481418,32 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480873
481418
  }, {
480874
481419
  default: withCtx(() => [
480875
481420
  createElementVNode("div", _hoisted_1$2, [
480876
- createVNode$1(_component_el_tree, {
481421
+ createElementVNode("div", _hoisted_2$2, [
481422
+ _cache[7] || (_cache[7] = createElementVNode("div", { class: "text-sm text-gray-600" }, "树形视图", -1)),
481423
+ createVNode$1(_component_el_radio_group, {
481424
+ modelValue: activeTreeType.value,
481425
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTreeType.value = $event),
481426
+ size: "small"
481427
+ }, {
481428
+ default: withCtx(() => [
481429
+ createVNode$1(_component_el_radio_button, { label: "default" }, {
481430
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [
481431
+ createTextVNode("按配置分组", -1)
481432
+ ])]),
481433
+ _: 1
481434
+ }),
481435
+ createVNode$1(_component_el_radio_button, { label: "classification" }, {
481436
+ default: withCtx(() => [..._cache[6] || (_cache[6] = [
481437
+ createTextVNode("按分类分组", -1)
481438
+ ])]),
481439
+ _: 1
481440
+ })
481441
+ ]),
481442
+ _: 1
481443
+ }, 8, ["modelValue"])
481444
+ ]),
481445
+ activeTreeType.value === "default" ? (openBlock(), createBlock(_component_el_tree, {
481446
+ key: 0,
480877
481447
  ref_key: "treeRef",
480878
481448
  ref: treeRef,
480879
481449
  data: treeData.value,
@@ -480883,11 +481453,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480883
481453
  "default-checked-keys": defaultCheckedKeys.value,
480884
481454
  "show-checkbox": true,
480885
481455
  "check-strictly": false,
481456
+ "expand-on-click-node": false,
480886
481457
  draggable: true,
480887
481458
  "allow-drop": allowDrop,
480888
481459
  "allow-drag": allowDrag3,
480889
481460
  onCheck: onTreeCheck,
480890
481461
  onNodeDrop: onNodeDrop2,
481462
+ onNodeExpand,
481463
+ onNodeCollapse,
480891
481464
  class: "layer-tree"
480892
481465
  }, {
480893
481466
  default: withCtx(({ node, data }) => [
@@ -480902,7 +481475,47 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480902
481475
  }, null, 8, ["data", "layer-tree-manager"])
480903
481476
  ]),
480904
481477
  _: 1
480905
- }, 8, ["data", "default-expanded-keys", "default-checked-keys"])
481478
+ }, 8, ["data", "default-expanded-keys", "default-checked-keys"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(classificationGroups.value, (group2) => {
481479
+ return openBlock(), createElementBlock("div", {
481480
+ key: group2.id,
481481
+ class: "mb-3"
481482
+ }, [
481483
+ createElementVNode("div", _hoisted_3$2, toDisplayString(group2.name), 1),
481484
+ createVNode$1(_component_el_tree, {
481485
+ ref_for: true,
481486
+ ref: (el) => classificationTreeRefs.value[group2.id] = el,
481487
+ data: getGroupTreeData(group2),
481488
+ props: treeProps,
481489
+ "node-key": "id",
481490
+ "default-expanded-keys": defaultExpandedKeys.value,
481491
+ "default-checked-keys": defaultCheckedKeys.value,
481492
+ "show-checkbox": true,
481493
+ "check-strictly": false,
481494
+ "expand-on-click-node": false,
481495
+ draggable: true,
481496
+ "allow-drop": allowDrop,
481497
+ "allow-drag": allowDrag3,
481498
+ onCheck: onTreeCheck,
481499
+ onNodeDrop: onNodeDrop2,
481500
+ onNodeExpand,
481501
+ onNodeCollapse,
481502
+ class: "layer-tree"
481503
+ }, {
481504
+ default: withCtx(({ node, data }) => [
481505
+ createVNode$1(LayerTreeNode, {
481506
+ data,
481507
+ "layer-tree-manager": unref(layerTreeManager),
481508
+ onDoubleClick: handleLayerDoubleClick,
481509
+ onOpacityChange: updateLayerOpacity,
481510
+ onClusterDistanceChange: updateClusterDistance,
481511
+ onSuperMapConfigChange: updateSuperMapConfig,
481512
+ onStyleReset: resetLayerStyle
481513
+ }, null, 8, ["data", "layer-tree-manager"])
481514
+ ]),
481515
+ _: 2
481516
+ }, 1032, ["data", "default-expanded-keys", "default-checked-keys"])
481517
+ ]);
481518
+ }), 128))
480906
481519
  ])
480907
481520
  ]),
480908
481521
  _: 1
@@ -480912,10 +481525,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480912
481525
  name: "style"
480913
481526
  }, {
480914
481527
  default: withCtx(() => [
480915
- createElementVNode("div", _hoisted_2$2, [
481528
+ createElementVNode("div", _hoisted_4$2, [
480916
481529
  createVNode$1(_component_el_tabs, {
480917
481530
  modelValue: activeStyleTab.value,
480918
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => activeStyleTab.value = $event),
481531
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => activeStyleTab.value = $event),
480919
481532
  class: "style-tabs"
480920
481533
  }, {
480921
481534
  default: withCtx(() => [
@@ -480938,11 +481551,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480938
481551
  name: "custom"
480939
481552
  }, {
480940
481553
  default: withCtx(() => [
480941
- createElementVNode("div", _hoisted_3$2, [
480942
- createElementVNode("div", _hoisted_4$2, [
481554
+ createElementVNode("div", _hoisted_5$2, [
481555
+ createElementVNode("div", _hoisted_6$2, [
480943
481556
  createVNode$1(unref(ElInput), {
480944
481557
  modelValue: unref(globalCustomCss),
480945
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(globalCustomCss) ? globalCustomCss.value = $event : null),
481558
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(globalCustomCss) ? globalCustomCss.value = $event : null),
480946
481559
  type: "textarea",
480947
481560
  rows: 6,
480948
481561
  class: "custom-css-input",
@@ -480950,9 +481563,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480950
481563
  onInput: updateGlobalStyle
480951
481564
  }, null, 8, ["modelValue"])
480952
481565
  ]),
480953
- createElementVNode("div", _hoisted_5$2, [
480954
- _cache[4] || (_cache[4] = createElementVNode("h6", null, "当前应用的样式:", -1)),
480955
- createElementVNode("div", _hoisted_6$2, toDisplayString(currentAppliedStyle.value), 1)
481566
+ createElementVNode("div", _hoisted_7$1, [
481567
+ _cache[8] || (_cache[8] = createElementVNode("h6", null, "当前应用的样式:", -1)),
481568
+ createElementVNode("div", _hoisted_8$1, toDisplayString(currentAppliedStyle.value), 1)
480956
481569
  ])
480957
481570
  ])
480958
481571
  ]),
@@ -480974,7 +481587,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
480974
481587
  };
480975
481588
  }
480976
481589
  });
480977
- const LayerPanel = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-b22e4e93"]]);
481590
+ const LayerPanel = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-063e717d"]]);
480978
481591
  const _hoisted_1$1 = {
480979
481592
  key: 2,
480980
481593
  class: "tooltip-content"
@@ -482412,7 +483025,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
482412
483025
  };
482413
483026
  }
482414
483027
  });
482415
- const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a8800082"]]);
483028
+ const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-09347cf4"]]);
482416
483029
  var u8 = Uint8Array;
482417
483030
  var u16 = Uint16Array;
482418
483031
  var i32 = Int32Array;
@@ -490684,7 +491297,7 @@ function(t3) {
490684
491297
  */
490685
491298
  function(t3) {
490686
491299
  function e8() {
490687
- return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-577641ae.mjs")).catch(function(t4) {
491300
+ return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-741c7deb.mjs")).catch(function(t4) {
490688
491301
  return Promise.reject(new Error("Could not load canvg: " + t4));
490689
491302
  }).then(function(t4) {
490690
491303
  return t4.default ? t4.default : t4;