vue-openlayers-plugin 1.0.46 → 1.0.48

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.
Files changed (48) hide show
  1. package/lib/{index-21e41cb8.mjs → index-6010d8cc.mjs} +1455 -131
  2. package/lib/{index.es-35628045.mjs → index.es-a22271e1.mjs} +1 -1
  3. package/lib/index.esm.js +4 -1
  4. package/lib/index.umd.js +1430 -106
  5. package/lib/style.css +4 -4
  6. package/package.json +1 -1
  7. package/types/src/components/CustomOpenlayer/components/MapSearch/MapSearch.vue.d.ts +2 -0
  8. package/types/src/components/CustomOpenlayer/components/MapSearch/MapSearch.vue.d.ts.map +1 -1
  9. package/types/src/components/CustomOpenlayer/examples/FilterExamples.d.ts +104 -0
  10. package/types/src/components/CustomOpenlayer/examples/FilterExamples.d.ts.map +1 -0
  11. package/types/src/components/CustomOpenlayer/test/FilterSystemTest.d.ts +57 -0
  12. package/types/src/components/CustomOpenlayer/test/FilterSystemTest.d.ts.map +1 -0
  13. package/types/src/components/CustomOpenlayer/types/index.d.ts +74 -12
  14. package/types/src/components/CustomOpenlayer/types/index.d.ts.map +1 -1
  15. package/types/src/components/CustomOpenlayer/utils/layers/BaseLayer.d.ts +74 -4
  16. package/types/src/components/CustomOpenlayer/utils/layers/BaseLayer.d.ts.map +1 -1
  17. package/types/src/components/CustomOpenlayer/utils/layers/CanvasLayerHandler.d.ts +6 -1
  18. package/types/src/components/CustomOpenlayer/utils/layers/CanvasLayerHandler.d.ts.map +1 -1
  19. package/types/src/components/CustomOpenlayer/utils/layers/ClusterLayerHandler.d.ts +35 -1
  20. package/types/src/components/CustomOpenlayer/utils/layers/ClusterLayerHandler.d.ts.map +1 -1
  21. package/types/src/components/CustomOpenlayer/utils/layers/GMLLayerHandler.d.ts +25 -3
  22. package/types/src/components/CustomOpenlayer/utils/layers/GMLLayerHandler.d.ts.map +1 -1
  23. package/types/src/components/CustomOpenlayer/utils/layers/GeoJSONLayerHandler.d.ts +37 -0
  24. package/types/src/components/CustomOpenlayer/utils/layers/GeoJSONLayerHandler.d.ts.map +1 -1
  25. package/types/src/components/CustomOpenlayer/utils/layers/HeatmapLayerHandler.d.ts +35 -0
  26. package/types/src/components/CustomOpenlayer/utils/layers/HeatmapLayerHandler.d.ts.map +1 -1
  27. package/types/src/components/CustomOpenlayer/utils/layers/KMLLayerHandler.d.ts +24 -2
  28. package/types/src/components/CustomOpenlayer/utils/layers/KMLLayerHandler.d.ts.map +1 -1
  29. package/types/src/components/CustomOpenlayer/utils/layers/TiandituLayerHandler.d.ts +6 -0
  30. package/types/src/components/CustomOpenlayer/utils/layers/TiandituLayerHandler.d.ts.map +1 -1
  31. package/types/src/components/CustomOpenlayer/utils/layers/TileLayerHandler.d.ts +6 -0
  32. package/types/src/components/CustomOpenlayer/utils/layers/TileLayerHandler.d.ts.map +1 -1
  33. package/types/src/components/CustomOpenlayer/utils/layers/VectorTileLayerHandler.d.ts +30 -0
  34. package/types/src/components/CustomOpenlayer/utils/layers/VectorTileLayerHandler.d.ts.map +1 -1
  35. package/types/src/components/CustomOpenlayer/utils/layers/WFSLayerHandler.d.ts +25 -9
  36. package/types/src/components/CustomOpenlayer/utils/layers/WFSLayerHandler.d.ts.map +1 -1
  37. package/types/src/components/CustomOpenlayer/utils/layers/WKTLayerHandler.d.ts +24 -2
  38. package/types/src/components/CustomOpenlayer/utils/layers/WKTLayerHandler.d.ts.map +1 -1
  39. package/types/src/components/CustomOpenlayer/utils/layers/WMSLayerHandler.d.ts +26 -0
  40. package/types/src/components/CustomOpenlayer/utils/layers/WMSLayerHandler.d.ts.map +1 -1
  41. package/types/src/components/CustomOpenlayer/utils/layers/WMTSLayerHandler.d.ts +6 -0
  42. package/types/src/components/CustomOpenlayer/utils/layers/WMTSLayerHandler.d.ts.map +1 -1
  43. package/types/src/components/CustomOpenlayer/utils/layers/interfaces.d.ts +2 -2
  44. package/types/src/components/CustomOpenlayer/utils/layers/interfaces.d.ts.map +1 -1
  45. package/types/src/components/CustomOpenlayer/utils/storage.d.ts +13 -4
  46. package/types/src/components/CustomOpenlayer/utils/storage.d.ts.map +1 -1
  47. package/types/src/components/CustomOpenlayer/utils/tiandituSearchApi.d.ts.map +1 -1
  48. package/types/tsconfig.tsbuildinfo +1 -1
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => {
4
4
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
5
  return value;
6
6
  };
7
- import { getCurrentInstance, inject, ref, computed, unref, getCurrentScope, onScopeDispose, shallowRef, watchEffect, readonly, onMounted, nextTick, watch, isRef, warn as warn$3, provide, defineComponent, openBlock, createElementBlock, mergeProps, renderSlot, createElementVNode, toRef, onUnmounted, useAttrs as useAttrs$1, useSlots, normalizeClass, normalizeStyle as normalizeStyle$1, createCommentVNode, Fragment, createBlock, withCtx, resolveDynamicComponent, withModifiers, toDisplayString, onBeforeUnmount, createVNode as createVNode$1, Transition, withDirectives, createTextVNode, vShow, Text as Text$6, reactive, h as h$4, shallowReactive, isVNode, render as render$3, markRaw, toRefs, resolveComponent, withKeys, renderList, createApp, resolveDirective, Teleport } from "vue";
7
+ import { getCurrentInstance, inject, ref, computed, unref, getCurrentScope, onScopeDispose, shallowRef, watchEffect, readonly, onMounted, nextTick, watch, isRef, warn as warn$3, provide, defineComponent, openBlock, createElementBlock, mergeProps, renderSlot, createElementVNode, toRef, onUnmounted, useAttrs as useAttrs$1, useSlots, normalizeClass, normalizeStyle as normalizeStyle$1, createCommentVNode, Fragment, createBlock, withCtx, resolveDynamicComponent, withModifiers, toDisplayString, onBeforeUnmount, createVNode as createVNode$1, Transition, withDirectives, createTextVNode, vShow, Text as Text$7, reactive, h as h$4, shallowReactive, isVNode, render as render$3, markRaw, toRefs, resolveComponent, withKeys, renderList, createApp, resolveDirective, Teleport } from "vue";
8
8
  import { Feature as Feature$6, Map as Map$8 } from "ol";
9
9
  function _mergeNamespaces(n2, m2) {
10
10
  for (var i = 0; i < m2.length; i++) {
@@ -58,7 +58,7 @@ const Shape$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
58
58
  return Rect$1;
59
59
  },
60
60
  get Text() {
61
- return Text$3;
61
+ return Text$4;
62
62
  }
63
63
  }, Symbol.toStringTag, { value: "Module" }));
64
64
  const Shape = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
@@ -97,7 +97,7 @@ const Shape = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
97
97
  return Rect;
98
98
  },
99
99
  get Text() {
100
- return Text$2;
100
+ return Text$3;
101
101
  }
102
102
  }, Symbol.toStringTag, { value: "Module" }));
103
103
  const configProviderContextKey = Symbol();
@@ -3872,7 +3872,7 @@ const useButton = (props, emit) => {
3872
3872
  const defaultSlot = (_a3 = slots.default) == null ? void 0 : _a3.call(slots);
3873
3873
  if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
3874
3874
  const slot = defaultSlot[0];
3875
- if ((slot == null ? void 0 : slot.type) === Text$6) {
3875
+ if ((slot == null ? void 0 : slot.type) === Text$7) {
3876
3876
  const text2 = slot.children;
3877
3877
  return /^\p{Unified_Ideograph}{2}$/u.test(text2.trim());
3878
3878
  }
@@ -21015,7 +21015,7 @@ function defaultGeometryFunction$1(feature2) {
21015
21015
  }
21016
21016
  const Style$3 = Style$2;
21017
21017
  const DEFAULT_FILL_COLOR$1 = "#333";
21018
- let Text$4 = class Text {
21018
+ let Text$5 = class Text2 {
21019
21019
  /**
21020
21020
  * @param {Options} [options] Options.
21021
21021
  */
@@ -21051,7 +21051,7 @@ let Text$4 = class Text {
21051
21051
  */
21052
21052
  clone() {
21053
21053
  const scale3 = this.getScale();
21054
- return new Text({
21054
+ return new Text2({
21055
21055
  font: this.getFont(),
21056
21056
  placement: this.getPlacement(),
21057
21057
  repeat: this.getRepeat(),
@@ -21431,7 +21431,7 @@ let Text$4 = class Text {
21431
21431
  this.padding_ = padding2;
21432
21432
  }
21433
21433
  };
21434
- const Text$5 = Text$4;
21434
+ const Text$6 = Text$5;
21435
21435
  function always$2(context) {
21436
21436
  return true;
21437
21437
  }
@@ -21767,7 +21767,7 @@ function buildText$1(flatStyle, context) {
21767
21767
  flatStyle,
21768
21768
  prefix + "declutter-mode"
21769
21769
  );
21770
- const text2 = new Text$5({ declutterMode });
21770
+ const text2 = new Text$6({ declutterMode });
21771
21771
  return function(context2) {
21772
21772
  text2.setText(evaluateValue(context2));
21773
21773
  if (evaluateFill) {
@@ -58629,7 +58629,7 @@ class SearchMarkerManager {
58629
58629
  width: 2
58630
58630
  })
58631
58631
  }),
58632
- text: new Text$5({
58632
+ text: new Text$6({
58633
58633
  text: String(index2 + 1),
58634
58634
  font: "12px Arial",
58635
58635
  fill: new Fill$2({
@@ -59765,7 +59765,7 @@ class PointDrawing extends BaseDrawing {
59765
59765
  * 创建文字样式
59766
59766
  */
59767
59767
  createTextStyle() {
59768
- const textStyle = new Text$5({
59768
+ const textStyle = new Text$6({
59769
59769
  text: this._style.textContent,
59770
59770
  font: `${this._style.fontSize || 14}px ${this._style.fontFamily || "Arial"}`,
59771
59771
  fill: new Fill$2({
@@ -60277,7 +60277,7 @@ class LineDrawing extends BaseDrawing {
60277
60277
  const coordinates2 = this._config.coordinates;
60278
60278
  const midIndex = Math.floor(coordinates2.length / 2);
60279
60279
  const midPoint2 = coordinates2[midIndex];
60280
- const textStyle = new Text$5({
60280
+ const textStyle = new Text$6({
60281
60281
  text: formattedLength,
60282
60282
  font: `${this._style.fontSize || 12}px ${this._style.fontFamily || "Arial"}`,
60283
60283
  fill: new Fill$2({
@@ -60307,7 +60307,7 @@ class LineDrawing extends BaseDrawing {
60307
60307
  const coordinates2 = this._config.coordinates;
60308
60308
  const midIndex = Math.floor(coordinates2.length / 2);
60309
60309
  const midPoint2 = coordinates2[midIndex];
60310
- const textStyle = new Text$5({
60310
+ const textStyle = new Text$6({
60311
60311
  text: this._style.textContent,
60312
60312
  font: `${this._style.fontSize || 14}px ${this._style.fontFamily || "Arial"}`,
60313
60313
  fill: new Fill$2({
@@ -60867,7 +60867,7 @@ class PolygonDrawing extends BaseDrawing {
60867
60867
  const formattedArea = this.formatArea(area2);
60868
60868
  const geometry2 = (_a3 = this.feature) == null ? void 0 : _a3.getGeometry();
60869
60869
  const center2 = geometry2 ? geometry2.getInteriorPoint().getCoordinates() : [0, 0];
60870
- const textStyle = new Text$5({
60870
+ const textStyle = new Text$6({
60871
60871
  text: formattedArea,
60872
60872
  font: `${this._style.fontSize || 12}px ${this._style.fontFamily || "Arial"}`,
60873
60873
  fill: new Fill$2({
@@ -60900,7 +60900,7 @@ class PolygonDrawing extends BaseDrawing {
60900
60900
  const geometry2 = (_a3 = this.feature) == null ? void 0 : _a3.getGeometry();
60901
60901
  const center2 = geometry2 ? geometry2.getInteriorPoint().getCoordinates() : [0, 0];
60902
60902
  const offsetCenter = [center2[0], center2[1] + 20];
60903
- const textStyle = new Text$5({
60903
+ const textStyle = new Text$6({
60904
60904
  text: `周长: ${formattedPerimeter}`,
60905
60905
  font: `${this._style.fontSize || 10}px ${this._style.fontFamily || "Arial"}`,
60906
60906
  fill: new Fill$2({
@@ -60930,7 +60930,7 @@ class PolygonDrawing extends BaseDrawing {
60930
60930
  var _a3;
60931
60931
  const geometry2 = (_a3 = this.feature) == null ? void 0 : _a3.getGeometry();
60932
60932
  const center2 = geometry2 ? geometry2.getInteriorPoint().getCoordinates() : [0, 0];
60933
- const textStyle = new Text$5({
60933
+ const textStyle = new Text$6({
60934
60934
  text: this._style.textContent,
60935
60935
  font: `${this._style.fontSize || 14}px ${this._style.fontFamily || "Arial"}`,
60936
60936
  fill: new Fill$2({
@@ -61459,7 +61459,7 @@ class TextDrawing extends BaseDrawing {
61459
61459
  * 创建样式
61460
61460
  */
61461
61461
  createStyle() {
61462
- const textStyle = new Text$5({
61462
+ const textStyle = new Text$6({
61463
61463
  text: this._style.textContent,
61464
61464
  font: this.getFontString(),
61465
61465
  fill: new Fill$2({
@@ -61945,7 +61945,7 @@ class MultiPolygonDrawing extends BaseDrawing {
61945
61945
  const areaText = this.formatArea(area2);
61946
61946
  styles.push(new Style$3({
61947
61947
  geometry: new ol.geom.Point(center2),
61948
- text: new Text$5({
61948
+ text: new Text$6({
61949
61949
  text: areaText,
61950
61950
  font: `${this._style.fontSize || 12}px ${this._style.fontFamily || "Arial"}`,
61951
61951
  fill: new Fill$2({
@@ -61982,7 +61982,7 @@ class MultiPolygonDrawing extends BaseDrawing {
61982
61982
  const offsetCenter = [center2[0], center2[1] - 20];
61983
61983
  styles.push(new Style$3({
61984
61984
  geometry: new ol.geom.Point(offsetCenter),
61985
- text: new Text$5({
61985
+ text: new Text$6({
61986
61986
  text: perimeterText,
61987
61987
  font: `${(this._style.fontSize || 12) - 2}px ${this._style.fontFamily || "Arial"}`,
61988
61988
  fill: new Fill$2({
@@ -62016,7 +62016,7 @@ class MultiPolygonDrawing extends BaseDrawing {
62016
62016
  if (center2) {
62017
62017
  styles.push(new Style$3({
62018
62018
  geometry: new ol.geom.Point(center2),
62019
- text: new Text$5({
62019
+ text: new Text$6({
62020
62020
  text: `${index2 + 1}`,
62021
62021
  font: `bold ${this._style.indexFontSize || 12}px ${this._style.fontFamily || "Arial"}`,
62022
62022
  fill: new Fill$2({
@@ -62048,7 +62048,7 @@ class MultiPolygonDrawing extends BaseDrawing {
62048
62048
  const center2 = geometry2 ? this.getMultiPolygonCenter() : [0, 0];
62049
62049
  return new Style$3({
62050
62050
  geometry: new ol.geom.Point(center2),
62051
- text: new Text$5({
62051
+ text: new Text$6({
62052
62052
  text: this._style.textContent || "",
62053
62053
  font: `${this._style.fontSize || 14}px ${this._style.fontFamily || "Arial"}`,
62054
62054
  fill: new Fill$2({
@@ -62823,7 +62823,7 @@ class MultiPointDrawing extends BaseDrawing {
62823
62823
  ];
62824
62824
  styles.push(new Style$3({
62825
62825
  geometry: new Point$b(offsetCoord),
62826
- text: new Text$5({
62826
+ text: new Text$6({
62827
62827
  text: `${index2 + 1}`,
62828
62828
  font: `bold ${this._style.indexFontSize || 12}px ${this._style.fontFamily || "Arial"}`,
62829
62829
  fill: new Fill$2({
@@ -62860,7 +62860,7 @@ class MultiPointDrawing extends BaseDrawing {
62860
62860
  ];
62861
62861
  styles.push(new Style$3({
62862
62862
  geometry: new Point$b(offsetCoord),
62863
- text: new Text$5({
62863
+ text: new Text$6({
62864
62864
  text: coordText,
62865
62865
  font: `${(this._style.fontSize || 12) - 2}px ${this._style.fontFamily || "Arial"}`,
62866
62866
  fill: new Fill$2({
@@ -62889,7 +62889,7 @@ class MultiPointDrawing extends BaseDrawing {
62889
62889
  const center2 = this.getMultiPointCenter();
62890
62890
  return new Style$3({
62891
62891
  geometry: new Point$b(center2),
62892
- text: new Text$5({
62892
+ text: new Text$6({
62893
62893
  text: this._style.textContent || "",
62894
62894
  font: `${this._style.fontSize || 14}px ${this._style.fontFamily || "Arial"}`,
62895
62895
  fill: new Fill$2({
@@ -63639,7 +63639,7 @@ class MultiLineStringDrawing extends BaseDrawing {
63639
63639
  ];
63640
63640
  styles.push(new Style$3({
63641
63641
  geometry: new Point$b(offsetPoint),
63642
- text: new Text$5({
63642
+ text: new Text$6({
63643
63643
  text: `${index2 + 1}`,
63644
63644
  font: `bold ${this._style.indexFontSize || 12}px ${this._style.fontFamily || "Arial"}`,
63645
63645
  fill: new Fill$2({
@@ -63690,7 +63690,7 @@ class MultiLineStringDrawing extends BaseDrawing {
63690
63690
  ];
63691
63691
  styles.push(new Style$3({
63692
63692
  geometry: new Point$b(offsetPosition),
63693
- text: new Text$5({
63693
+ text: new Text$6({
63694
63694
  text: lengthText,
63695
63695
  font: `${(this._style.fontSize || 12) - 1}px ${this._style.fontFamily || "Arial"}`,
63696
63696
  fill: new Fill$2({
@@ -63719,7 +63719,7 @@ class MultiLineStringDrawing extends BaseDrawing {
63719
63719
  const center2 = this.getMultiLineStringCenter();
63720
63720
  return new Style$3({
63721
63721
  geometry: new Point$b(center2),
63722
- text: new Text$5({
63722
+ text: new Text$6({
63723
63723
  text: this._style.textContent || "",
63724
63724
  font: `${this._style.fontSize || 14}px ${this._style.fontFamily || "Arial"}`,
63725
63725
  fill: new Fill$2({
@@ -66807,7 +66807,7 @@ class PointWithTextDrawing extends BaseDrawing {
66807
66807
  */
66808
66808
  createTextStyle() {
66809
66809
  const textOffset = this.calculateTextOffset();
66810
- const textStyle = new Text$5({
66810
+ const textStyle = new Text$6({
66811
66811
  text: this._style.textContent,
66812
66812
  font: this.getFontString(),
66813
66813
  fill: new Fill$2({
@@ -67786,7 +67786,7 @@ class ImageDrawing extends BaseDrawing {
67786
67786
  * 创建文字样式
67787
67787
  */
67788
67788
  createTextStyle() {
67789
- const textStyle = new Text$5({
67789
+ const textStyle = new Text$6({
67790
67790
  text: this._style.textContent,
67791
67791
  font: `${this._style.fontSize || 12}px ${this._style.fontFamily || "Arial"}`,
67792
67792
  fill: new Fill$2({
@@ -68546,7 +68546,7 @@ class MilitaryDrawing extends BaseDrawing {
68546
68546
  geometry2 = new Point$b([0, 0]);
68547
68547
  }
68548
68548
  }
68549
- const textStyle = new Text$5({
68549
+ const textStyle = new Text$6({
68550
68550
  text: this._style.textContent,
68551
68551
  font: `${this._style.fontSize || 12}px ${this._style.fontFamily || "Arial"}`,
68552
68552
  fill: new Fill$2({
@@ -69140,18 +69140,31 @@ function getUnitOptions(type) {
69140
69140
  }
69141
69141
  }
69142
69142
  const STORAGE_CONFIG = {
69143
- MAX_MEASUREMENTS: 200,
69144
- // 最大测量结果数量(降低到200)
69145
- MAX_LAYER_CONFIGS: 50,
69146
- // 最大图层配置数量(降低到50)
69143
+ ENABLED: false,
69144
+ // 默认禁用本地存储
69145
+ MAX_MEASUREMENTS: 100,
69146
+ // 减少到100条,避免过多累积
69147
+ MAX_LAYER_CONFIGS: 30,
69148
+ // 减少到30个,够用即可
69149
+ MAX_SEARCH_HISTORY: 20,
69150
+ // 新增:搜索历史限制
69147
69151
  QUOTA_WARNING_THRESHOLD: 0.6,
69148
69152
  // 配额警告阈值(60%)
69149
69153
  AUTO_CLEANUP_THRESHOLD: 0.7,
69150
69154
  // 自动清理阈值(70%)
69151
69155
  COMPRESSION_ENABLED: true,
69152
69156
  // 是否启用压缩
69153
- BATCH_CLEANUP_SIZE: 20
69154
- // 批量清理数量(降低到20)
69157
+ BATCH_CLEANUP_SIZE: 10,
69158
+ // 减少批量清理数量
69159
+ // 新增:数据过期时间配置(毫秒)
69160
+ DATA_EXPIRY: {
69161
+ MEASUREMENTS: 30 * 24 * 60 * 60 * 1e3,
69162
+ // 30天
69163
+ MAP_STATE: 7 * 24 * 60 * 60 * 1e3,
69164
+ // 7天
69165
+ SEARCH_HISTORY: 7 * 24 * 60 * 60 * 1e3
69166
+ // 7天
69167
+ }
69155
69168
  };
69156
69169
  class DataCompressor {
69157
69170
  static compress(data) {
@@ -69170,18 +69183,54 @@ class DataCompressor {
69170
69183
  }
69171
69184
  }
69172
69185
  class MapStorage {
69173
- // 防止递归清理
69174
- constructor(instanceId) {
69186
+ // 存储是否启用
69187
+ constructor(instanceId, enableStorage = false) {
69175
69188
  __publicField(this, "storageKeys");
69176
69189
  __publicField(this, "instanceId");
69177
69190
  __publicField(this, "isCleaningUp", false);
69191
+ // 防止递归清理
69192
+ __publicField(this, "storageEnabled", false);
69178
69193
  this.instanceId = instanceId || "default";
69194
+ this.storageEnabled = enableStorage || STORAGE_CONFIG.ENABLED;
69179
69195
  this.storageKeys = {
69180
69196
  MEASUREMENTS: `${this.instanceId}_openlayer_measurements`,
69181
69197
  LAYER_CONFIGS: `${this.instanceId}_openlayer_layer_configs`,
69182
69198
  MAP_STATE: `${this.instanceId}_openlayer_map_state`
69183
69199
  };
69184
- this.initCleanup();
69200
+ if (this.storageEnabled) {
69201
+ this.initCleanup();
69202
+ this.cleanupExpiredData();
69203
+ }
69204
+ }
69205
+ /**
69206
+ * 检查数据是否过期
69207
+ */
69208
+ isDataExpired(timestamp, dataType) {
69209
+ const now2 = Date.now();
69210
+ const expiry = STORAGE_CONFIG.DATA_EXPIRY[dataType];
69211
+ return now2 - timestamp > expiry;
69212
+ }
69213
+ /**
69214
+ * 清理过期数据
69215
+ */
69216
+ cleanupExpiredData() {
69217
+ try {
69218
+ const measurements = this.getMeasurements();
69219
+ const validMeasurements = measurements.filter(
69220
+ (m2) => !m2.timestamp || !this.isDataExpired(m2.timestamp, "MEASUREMENTS")
69221
+ );
69222
+ if (validMeasurements.length !== measurements.length) {
69223
+ this.saveMeasurements(validMeasurements);
69224
+ console.log(`清理过期测量结果:${measurements.length} -> ${validMeasurements.length}`);
69225
+ }
69226
+ const mapState = this.getMapState();
69227
+ if (mapState && mapState.timestamp && this.isDataExpired(mapState.timestamp, "MAP_STATE")) {
69228
+ localStorage.removeItem(this.storageKeys.MAP_STATE);
69229
+ console.log("清理过期地图状态");
69230
+ }
69231
+ } catch (error2) {
69232
+ console.error("清理过期数据失败:", error2);
69233
+ }
69185
69234
  }
69186
69235
  /**
69187
69236
  * 初始化清理过量数据
@@ -69287,6 +69336,10 @@ class MapStorage {
69287
69336
  * 安全存储数据(带配额检查)
69288
69337
  */
69289
69338
  safeSetItem(key, value) {
69339
+ if (!this.storageEnabled) {
69340
+ console.log("存储功能已禁用,跳过存储操作");
69341
+ return false;
69342
+ }
69290
69343
  try {
69291
69344
  if (!this.isCleaningUp) {
69292
69345
  const quota = this.checkStorageQuota();
@@ -69326,6 +69379,9 @@ class MapStorage {
69326
69379
  * 安全获取数据(带解压缩)
69327
69380
  */
69328
69381
  safeGetItem(key) {
69382
+ if (!this.storageEnabled) {
69383
+ return null;
69384
+ }
69329
69385
  try {
69330
69386
  const item = localStorage.getItem(key);
69331
69387
  if (item) {
@@ -69368,11 +69424,19 @@ class MapStorage {
69368
69424
  }
69369
69425
  }
69370
69426
  /**
69371
- * 添加单个测量结果
69427
+ * 添加单个测量结果(优化版本 - 避免重复ID)
69372
69428
  */
69373
69429
  addMeasurement(measurement) {
69374
69430
  const measurements = this.getMeasurements();
69375
- measurements.push(measurement);
69431
+ if (measurement.id) {
69432
+ const existingIndex = measurements.findIndex((m2) => m2.id === measurement.id);
69433
+ if (existingIndex !== -1) {
69434
+ measurements[existingIndex] = { ...measurement, timestamp: Date.now() };
69435
+ this.saveMeasurements(measurements);
69436
+ return;
69437
+ }
69438
+ }
69439
+ measurements.push({ ...measurement, timestamp: Date.now() });
69376
69440
  this.saveMeasurements(measurements);
69377
69441
  }
69378
69442
  /**
@@ -69389,17 +69453,35 @@ class MapStorage {
69389
69453
  localStorage.removeItem(this.storageKeys.MEASUREMENTS);
69390
69454
  }
69391
69455
  /**
69392
- * 保存图层配置
69456
+ * 保存图层配置(优化版本 - 避免重复存储相同配置)
69393
69457
  */
69394
69458
  saveLayerConfigs(configs) {
69395
69459
  try {
69396
- const limitedConfigs = configs.slice(0, STORAGE_CONFIG.MAX_LAYER_CONFIGS);
69460
+ const existingConfigs = this.getLayerConfigs();
69461
+ const existingConfigMap = new Map(existingConfigs.map((config) => [config.id, config]));
69462
+ const mergedConfigs = [];
69463
+ const processedIds = /* @__PURE__ */ new Set();
69464
+ configs.forEach((config) => {
69465
+ if (config.id && !processedIds.has(config.id)) {
69466
+ mergedConfigs.push(config);
69467
+ processedIds.add(config.id);
69468
+ }
69469
+ });
69470
+ existingConfigs.forEach((config) => {
69471
+ if (config.id && !processedIds.has(config.id)) {
69472
+ mergedConfigs.push(config);
69473
+ processedIds.add(config.id);
69474
+ }
69475
+ });
69476
+ const limitedConfigs = mergedConfigs.slice(0, STORAGE_CONFIG.MAX_LAYER_CONFIGS);
69397
69477
  const configsToSave = limitedConfigs.map((config) => {
69398
69478
  const optimizedConfig = {
69399
69479
  id: config.id,
69400
69480
  name: config.name,
69401
69481
  type: config.type,
69402
- visible: config.visible
69482
+ visible: config.visible,
69483
+ timestamp: Date.now()
69484
+ // 添加时间戳
69403
69485
  };
69404
69486
  if (config.url)
69405
69487
  optimizedConfig.url = config.url;
@@ -69464,6 +69546,10 @@ class MapStorage {
69464
69546
  * 清空所有缓存
69465
69547
  */
69466
69548
  clearAll() {
69549
+ if (!this.storageEnabled) {
69550
+ console.log("存储功能已禁用,跳过清空操作");
69551
+ return;
69552
+ }
69467
69553
  Object.values(this.storageKeys).forEach((key) => {
69468
69554
  localStorage.removeItem(key);
69469
69555
  });
@@ -69472,6 +69558,9 @@ class MapStorage {
69472
69558
  * 获取存储大小(KB)
69473
69559
  */
69474
69560
  getStorageSize() {
69561
+ if (!this.storageEnabled) {
69562
+ return 0;
69563
+ }
69475
69564
  let total = 0;
69476
69565
  Object.values(this.storageKeys).forEach((key) => {
69477
69566
  const item = localStorage.getItem(key);
@@ -69572,10 +69661,10 @@ class MapStorage {
69572
69661
  }
69573
69662
  }
69574
69663
  }
69575
- function createMapStorage(instanceId) {
69576
- return new MapStorage(instanceId);
69664
+ function createMapStorage(instanceId, enableStorage = false) {
69665
+ return new MapStorage(instanceId, enableStorage);
69577
69666
  }
69578
- new MapStorage("global");
69667
+ new MapStorage("global", false);
69579
69668
  class MeasurementTool {
69580
69669
  constructor(map2, storage2, options = {}) {
69581
69670
  __publicField(this, "map");
@@ -74596,7 +74685,7 @@ function createStyleDefaults() {
74596
74685
  color: [51, 51, 51, 1],
74597
74686
  width: 2
74598
74687
  });
74599
- DEFAULT_TEXT_STYLE = new Text$5({
74688
+ DEFAULT_TEXT_STYLE = new Text$6({
74600
74689
  font: "bold 16px Helvetica",
74601
74690
  fill: DEFAULT_FILL_STYLE,
74602
74691
  stroke: DEFAULT_TEXT_STROKE_STYLE,
@@ -75495,7 +75584,7 @@ function labelStyleParser(node, objectStack) {
75495
75584
  return;
75496
75585
  }
75497
75586
  const styleObject = objectStack[objectStack.length - 1];
75498
- const textStyle = new Text$5({
75587
+ const textStyle = new Text$6({
75499
75588
  fill: new Fill$2({
75500
75589
  color: (
75501
75590
  /** @type {import("../color.js").Color} */
@@ -81343,6 +81432,8 @@ let BaseLayer$2 = class BaseLayer2 {
81343
81432
  __publicField(this, "config");
81344
81433
  __publicField(this, "layer", null);
81345
81434
  __publicField(this, "map", null);
81435
+ /** 图层过滤器集合 */
81436
+ __publicField(this, "filters", /* @__PURE__ */ new Map());
81346
81437
  this.config = { ...config };
81347
81438
  this.processConfig();
81348
81439
  }
@@ -81589,6 +81680,129 @@ let BaseLayer$2 = class BaseLayer2 {
81589
81680
  this.layer = null;
81590
81681
  this.map = null;
81591
81682
  }
81683
+ // ==================== 过滤器管理方法 ====================
81684
+ /**
81685
+ * 添加过滤器
81686
+ * @param filter 过滤器配置
81687
+ */
81688
+ addFilter(filter2) {
81689
+ this.filters.set(filter2.id, filter2);
81690
+ this.applyFilters();
81691
+ }
81692
+ /**
81693
+ * 移除过滤器
81694
+ * @param filterId 过滤器ID
81695
+ */
81696
+ removeFilter(filterId) {
81697
+ if (this.filters.has(filterId)) {
81698
+ this.filters.delete(filterId);
81699
+ this.applyFilters();
81700
+ }
81701
+ }
81702
+ /**
81703
+ * 更新过滤器
81704
+ * @param filterId 过滤器ID
81705
+ * @param updates 更新的配置
81706
+ */
81707
+ updateFilter(filterId, updates) {
81708
+ const filter2 = this.filters.get(filterId);
81709
+ if (filter2) {
81710
+ const updatedFilter = { ...filter2, ...updates };
81711
+ this.filters.set(filterId, updatedFilter);
81712
+ this.applyFilters();
81713
+ }
81714
+ }
81715
+ /**
81716
+ * 获取过滤器
81717
+ * @param filterId 过滤器ID
81718
+ */
81719
+ getFilter(filterId) {
81720
+ return this.filters.get(filterId);
81721
+ }
81722
+ /**
81723
+ * 获取所有过滤器
81724
+ */
81725
+ getAllFilters() {
81726
+ return Array.from(this.filters.values());
81727
+ }
81728
+ /**
81729
+ * 获取启用的过滤器
81730
+ */
81731
+ getEnabledFilters() {
81732
+ return this.getAllFilters().filter((filter2) => filter2.enabled !== false);
81733
+ }
81734
+ /**
81735
+ * 清除所有过滤器
81736
+ */
81737
+ clearAllFilters() {
81738
+ this.filters.clear();
81739
+ this.applyFilters();
81740
+ }
81741
+ /**
81742
+ * 启用/禁用过滤器
81743
+ * @param filterId 过滤器ID
81744
+ * @param enabled 是否启用
81745
+ */
81746
+ toggleFilter(filterId, enabled) {
81747
+ const filter2 = this.filters.get(filterId);
81748
+ if (filter2) {
81749
+ filter2.enabled = enabled;
81750
+ this.applyFilters();
81751
+ }
81752
+ }
81753
+ /**
81754
+ * 便捷方法:添加属性过滤器
81755
+ * @param id 过滤器ID
81756
+ * @param property 属性名
81757
+ * @param value 过滤值
81758
+ * @param operator 操作符
81759
+ * @param name 过滤器名称
81760
+ */
81761
+ addAttributeFilter(id, property, value, operator = FilterOperator.EQUAL, name) {
81762
+ const filter2 = {
81763
+ id,
81764
+ type: FilterType.ATTRIBUTE,
81765
+ enabled: true,
81766
+ name: name || `${property} ${operator} ${value}`,
81767
+ property,
81768
+ operator,
81769
+ value
81770
+ };
81771
+ this.addFilter(filter2);
81772
+ }
81773
+ /**
81774
+ * 便捷方法:添加CQL过滤器(主要用于WMS图层)
81775
+ * @param id 过滤器ID
81776
+ * @param expression CQL表达式
81777
+ * @param name 过滤器名称
81778
+ */
81779
+ addCQLFilter(id, expression, name) {
81780
+ const filter2 = {
81781
+ id,
81782
+ type: FilterType.CQL,
81783
+ enabled: true,
81784
+ name: name || `CQL: ${expression}`,
81785
+ cqlExpression: expression
81786
+ };
81787
+ this.addFilter(filter2);
81788
+ }
81789
+ /**
81790
+ * 便捷方法:添加自定义过滤器
81791
+ * @param id 过滤器ID
81792
+ * @param filterFunction 过滤函数
81793
+ * @param name 过滤器名称
81794
+ * @param params 过滤器参数
81795
+ */
81796
+ addCustomFilter(id, filterFunction, name, params2) {
81797
+ const filter2 = {
81798
+ id,
81799
+ type: FilterType.CUSTOM,
81800
+ enabled: true,
81801
+ name: name || `Custom Filter: ${id}`,
81802
+ filterFunction
81803
+ };
81804
+ this.addFilter(filter2);
81805
+ }
81592
81806
  };
81593
81807
  var LayerType$1 = /* @__PURE__ */ ((LayerType2) => {
81594
81808
  LayerType2["TILE"] = "tile";
@@ -81767,7 +81981,50 @@ class TileLayerHandler extends BaseLayer$2 {
81767
81981
  source.setUrl(url);
81768
81982
  }
81769
81983
  }
81770
- }
81984
+ /**
81985
+ * 应用过滤器(瓦片图层不支持过滤)
81986
+ * @param filters 过滤器数组
81987
+ */
81988
+ applyFilters(filters) {
81989
+ console.warn("TileLayerHandler: 瓦片图层不支持客户端过滤功能。瓦片图层使用预渲染的图像瓦片,无法进行动态过滤。");
81990
+ console.info("TileLayerHandler: 如需过滤功能,请考虑:");
81991
+ console.info("1. 使用矢量图层(GeoJSON、WFS等)替代瓦片图层");
81992
+ console.info("2. 在服务端预先生成不同的瓦片集以满足过滤需求");
81993
+ console.info("3. 使用WMS图层并配置服务端过滤参数");
81994
+ }
81995
+ }
81996
+ var FilterType$1 = /* @__PURE__ */ ((FilterType2) => {
81997
+ FilterType2["ATTRIBUTE"] = "attribute";
81998
+ FilterType2["SPATIAL"] = "spatial";
81999
+ FilterType2["CQL"] = "cql";
82000
+ FilterType2["CUSTOM"] = "custom";
82001
+ return FilterType2;
82002
+ })(FilterType$1 || {});
82003
+ var FilterOperator$1 = /* @__PURE__ */ ((FilterOperator2) => {
82004
+ FilterOperator2["EQUAL"] = "equal";
82005
+ FilterOperator2["NOT_EQUAL"] = "not_equal";
82006
+ FilterOperator2["GREATER_THAN"] = "greater_than";
82007
+ FilterOperator2["LESS_THAN"] = "less_than";
82008
+ FilterOperator2["GREATER_EQUAL"] = "greater_equal";
82009
+ FilterOperator2["LESS_EQUAL"] = "less_equal";
82010
+ FilterOperator2["LIKE"] = "like";
82011
+ FilterOperator2["IN"] = "in";
82012
+ FilterOperator2["NOT_IN"] = "not_in";
82013
+ FilterOperator2["BETWEEN"] = "between";
82014
+ FilterOperator2["IS_NULL"] = "is_null";
82015
+ FilterOperator2["IS_NOT_NULL"] = "is_not_null";
82016
+ return FilterOperator2;
82017
+ })(FilterOperator$1 || {});
82018
+ var SpatialFilterType = /* @__PURE__ */ ((SpatialFilterType2) => {
82019
+ SpatialFilterType2["INTERSECTS"] = "intersects";
82020
+ SpatialFilterType2["CONTAINS"] = "contains";
82021
+ SpatialFilterType2["WITHIN"] = "within";
82022
+ SpatialFilterType2["TOUCHES"] = "touches";
82023
+ SpatialFilterType2["CROSSES"] = "crosses";
82024
+ SpatialFilterType2["OVERLAPS"] = "overlaps";
82025
+ SpatialFilterType2["DISJOINT"] = "disjoint";
82026
+ return SpatialFilterType2;
82027
+ })(SpatialFilterType || {});
81771
82028
  class WMSLayerHandler extends BaseLayer$2 {
81772
82029
  createLayer() {
81773
82030
  const source = this.createWMSSource();
@@ -81953,6 +82210,109 @@ class WMSLayerHandler extends BaseLayer$2 {
81953
82210
  }
81954
82211
  return features2;
81955
82212
  }
82213
+ /**
82214
+ * 应用过滤器(实现基类的抽象方法)
82215
+ */
82216
+ applyFilters() {
82217
+ const enabledFilters = this.getEnabledFilters();
82218
+ const attributeFilters = enabledFilters.filter((filter2) => filter2.type === FilterType$1.ATTRIBUTE);
82219
+ const cqlFilters = enabledFilters.filter((filter2) => filter2.type === FilterType$1.CQL);
82220
+ const allCQLExpressions = [];
82221
+ attributeFilters.forEach((filter2) => {
82222
+ const config = filter2;
82223
+ const cqlExpression = this.convertAttributeFilterToCQL(config);
82224
+ if (cqlExpression) {
82225
+ allCQLExpressions.push(`(${cqlExpression})`);
82226
+ }
82227
+ });
82228
+ cqlFilters.forEach((filter2) => {
82229
+ const config = filter2;
82230
+ allCQLExpressions.push(`(${config.cqlExpression})`);
82231
+ });
82232
+ if (allCQLExpressions.length > 0) {
82233
+ const combinedCQL = allCQLExpressions.join(" AND ");
82234
+ this.updateParams({ "CQL_FILTER": combinedCQL });
82235
+ console.log("WMS图层应用CQL过滤器:", combinedCQL);
82236
+ } else {
82237
+ this.updateParams({ "CQL_FILTER": void 0 });
82238
+ console.log("WMS图层清除CQL过滤器");
82239
+ }
82240
+ }
82241
+ /**
82242
+ * 将属性过滤器转换为CQL表达式
82243
+ */
82244
+ convertAttributeFilterToCQL(config) {
82245
+ const { property, operator, value } = config;
82246
+ if (!property || value === void 0 || value === null) {
82247
+ return null;
82248
+ }
82249
+ switch (operator) {
82250
+ case FilterOperator$1.EQUAL:
82251
+ return typeof value === "string" ? `${property} = '${value}'` : `${property} = ${value}`;
82252
+ case FilterOperator$1.NOT_EQUAL:
82253
+ return typeof value === "string" ? `${property} <> '${value}'` : `${property} <> ${value}`;
82254
+ case FilterOperator$1.GREATER_THAN:
82255
+ return `${property} > ${value}`;
82256
+ case FilterOperator$1.GREATER_EQUAL:
82257
+ return `${property} >= ${value}`;
82258
+ case FilterOperator$1.LESS_THAN:
82259
+ return `${property} < ${value}`;
82260
+ case FilterOperator$1.LESS_EQUAL:
82261
+ return `${property} <= ${value}`;
82262
+ case FilterOperator$1.LIKE:
82263
+ return `${property} LIKE '%${value}%'`;
82264
+ case FilterOperator$1.IN:
82265
+ if (Array.isArray(value)) {
82266
+ const valueList = value.map((v5) => typeof v5 === "string" ? `'${v5}'` : v5).join(",");
82267
+ return `${property} IN (${valueList})`;
82268
+ }
82269
+ return null;
82270
+ case FilterOperator$1.BETWEEN:
82271
+ if (Array.isArray(value) && value.length === 2) {
82272
+ return `${property} BETWEEN ${value[0]} AND ${value[1]}`;
82273
+ }
82274
+ return null;
82275
+ case FilterOperator$1.IS_NULL:
82276
+ return `${property} IS NULL`;
82277
+ case FilterOperator$1.IS_NOT_NULL:
82278
+ return `${property} IS NOT NULL`;
82279
+ default:
82280
+ console.warn(`WMS图层不支持的过滤器操作符: ${operator}`);
82281
+ return null;
82282
+ }
82283
+ }
82284
+ /**
82285
+ * 便捷方法:设置CQL过滤器
82286
+ * @param expression CQL表达式
82287
+ * @param filterId 过滤器ID,默认为'default'
82288
+ */
82289
+ setCQLFilter(expression, filterId = "default") {
82290
+ this.addCQLFilter(filterId, expression);
82291
+ }
82292
+ /**
82293
+ * 便捷方法:清除CQL过滤器
82294
+ * @param filterId 过滤器ID,如果不指定则清除所有CQL过滤器
82295
+ */
82296
+ clearCQLFilter(filterId) {
82297
+ if (filterId) {
82298
+ this.removeFilter(filterId);
82299
+ } else {
82300
+ const cqlFilters = this.getAllFilters().filter((filter2) => filter2.type === FilterType$1.CQL);
82301
+ cqlFilters.forEach((filter2) => this.removeFilter(filter2.id));
82302
+ }
82303
+ }
82304
+ /**
82305
+ * 便捷方法:添加多个CQL过滤条件
82306
+ * @param conditions CQL条件数组
82307
+ * @param operator 连接操作符,默认为'AND'
82308
+ * @param filterId 过滤器ID,默认为'multi'
82309
+ */
82310
+ addMultipleCQLConditions(conditions, operator = "AND", filterId = "multi") {
82311
+ if (conditions.length === 0)
82312
+ return;
82313
+ const expression = conditions.map((condition) => `(${condition})`).join(` ${operator} `);
82314
+ this.setCQLFilter(expression, filterId);
82315
+ }
81956
82316
  }
81957
82317
  class WMTSLayerHandler extends BaseLayer$2 {
81958
82318
  constructor() {
@@ -82073,6 +82433,17 @@ class WMTSLayerHandler extends BaseLayer$2 {
82073
82433
  this.config.wmtsStyle = style;
82074
82434
  this.layer = null;
82075
82435
  }
82436
+ /**
82437
+ * 应用过滤器(WMTS图层不支持过滤)
82438
+ * @param filters 过滤器数组
82439
+ */
82440
+ applyFilters(filters) {
82441
+ console.warn("WMTSLayerHandler: WMTS图层不支持客户端过滤功能。WMTS是预渲染的瓦片服务,无法进行动态过滤。");
82442
+ console.info("WMTSLayerHandler: 如需过滤功能,请考虑:");
82443
+ console.info("1. 使用WFS图层替代WMTS图层");
82444
+ console.info("2. 在服务端配置不同的WMTS图层以满足过滤需求");
82445
+ console.info("3. 使用WMS图层并配置CQL过滤器");
82446
+ }
82076
82447
  }
82077
82448
  class WFSLayerHandler extends BaseLayer$2 {
82078
82449
  constructor(config) {
@@ -82220,27 +82591,86 @@ class WFSLayerHandler extends BaseLayer$2 {
82220
82591
  }
82221
82592
  }
82222
82593
  /**
82223
- * 添加过滤器
82594
+ * 添加过滤器(重写基类方法以支持WFS特定逻辑)
82224
82595
  */
82225
82596
  addFilter(filter2) {
82597
+ super.addFilter(filter2);
82226
82598
  if (!this.config.wfsConfig) {
82227
82599
  this.config.wfsConfig = {};
82228
82600
  }
82229
82601
  if (!this.config.wfsConfig.filters) {
82230
82602
  this.config.wfsConfig.filters = [];
82231
82603
  }
82232
- this.config.wfsConfig.filters.push(filter2);
82604
+ if (filter2.type === FilterType$1.ATTRIBUTE) {
82605
+ const config = filter2;
82606
+ const wfsFilter = {
82607
+ type: "equalTo",
82608
+ // 默认使用equalTo,可以根据需要扩展
82609
+ property: config.property,
82610
+ value: config.value
82611
+ };
82612
+ this.config.wfsConfig.filters.push(wfsFilter);
82613
+ }
82233
82614
  this.refresh();
82234
82615
  }
82235
82616
  /**
82236
- * 清除所有过滤器
82617
+ * 清除所有过滤器(重写基类方法以支持WFS特定逻辑)
82237
82618
  */
82238
- clearFilters() {
82619
+ clearAllFilters() {
82620
+ super.clearAllFilters();
82239
82621
  if (this.config.wfsConfig) {
82240
82622
  this.config.wfsConfig.filters = [];
82241
82623
  this.refresh();
82242
82624
  }
82243
82625
  }
82626
+ /**
82627
+ * 应用过滤器(实现基类的抽象方法)
82628
+ */
82629
+ applyFilters() {
82630
+ const enabledFilters = this.getEnabledFilters();
82631
+ if (!this.config.wfsConfig) {
82632
+ this.config.wfsConfig = {};
82633
+ }
82634
+ this.config.wfsConfig.filters = [];
82635
+ enabledFilters.forEach((filter2) => {
82636
+ if (filter2.type === FilterType$1.ATTRIBUTE) {
82637
+ const config = filter2;
82638
+ const wfsFilter = {
82639
+ type: "equalTo",
82640
+ // 默认使用equalTo,可以根据需要扩展
82641
+ property: config.property,
82642
+ value: config.value
82643
+ };
82644
+ this.config.wfsConfig.filters.push(wfsFilter);
82645
+ }
82646
+ });
82647
+ this.refresh();
82648
+ }
82649
+ /**
82650
+ * 便捷方法:添加WFS属性过滤器
82651
+ */
82652
+ addWFSAttributeFilter(id, property, value, operator = "equalTo", description) {
82653
+ this.addAttributeFilter(id, property, value, operator === "equalTo" ? "eq" : "like", description);
82654
+ }
82655
+ /**
82656
+ * 便捷方法:移除WFS过滤器
82657
+ */
82658
+ removeWFSFilter(id) {
82659
+ this.removeFilter(id);
82660
+ }
82661
+ /**
82662
+ * 便捷方法:清除所有WFS过滤器
82663
+ */
82664
+ clearAllWFSFilters() {
82665
+ this.clearAllFilters();
82666
+ }
82667
+ /**
82668
+ * 获取当前WFS过滤器配置
82669
+ */
82670
+ getWFSFilters() {
82671
+ var _a3;
82672
+ return ((_a3 = this.config.wfsConfig) == null ? void 0 : _a3.filters) || [];
82673
+ }
82244
82674
  /**
82245
82675
  * 获取要素数量
82246
82676
  */
@@ -82335,7 +82765,7 @@ class StyleFactory {
82335
82765
  static createText(config) {
82336
82766
  if (!config)
82337
82767
  return void 0;
82338
- const textStyle = new Text$5({
82768
+ const textStyle = new Text$6({
82339
82769
  text: config.text,
82340
82770
  font: config.font || `${config.fontSize || 12}px ${config.fontFamily || "Arial"}`,
82341
82771
  fill: this.createFill(config.fill),
@@ -82736,8 +83166,8 @@ __publicField(_StyleManager, "instance");
82736
83166
  let StyleManager = _StyleManager;
82737
83167
  const styleManager = StyleManager.getInstance();
82738
83168
  class GeoJSONLayerHandler extends BaseLayer$2 {
82739
- constructor() {
82740
- super(...arguments);
83169
+ constructor(config, map2) {
83170
+ super(config, map2);
82741
83171
  __publicField(this, "styleConfig");
82742
83172
  }
82743
83173
  createLayer() {
@@ -83092,6 +83522,186 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
83092
83522
  });
83093
83523
  return extent3;
83094
83524
  }
83525
+ /**
83526
+ * 应用过滤器(实现基类的抽象方法)
83527
+ */
83528
+ applyFilters() {
83529
+ const layer2 = this.getLayer();
83530
+ const source = layer2.getSource();
83531
+ if (!source)
83532
+ return;
83533
+ const enabledFilters = this.getEnabledFilters();
83534
+ const features2 = source.getFeatures();
83535
+ if (enabledFilters.length === 0) {
83536
+ features2.forEach((feature2) => {
83537
+ feature2.setStyle(void 0);
83538
+ });
83539
+ return;
83540
+ }
83541
+ features2.forEach((feature2) => {
83542
+ let visible = true;
83543
+ for (const filter2 of enabledFilters) {
83544
+ if (!this.checkFeatureAgainstFilter(feature2, filter2)) {
83545
+ visible = false;
83546
+ break;
83547
+ }
83548
+ }
83549
+ feature2.setStyle(visible ? void 0 : new Style$3({}));
83550
+ });
83551
+ }
83552
+ /**
83553
+ * 检查要素是否符合过滤器条件
83554
+ */
83555
+ checkFeatureAgainstFilter(feature2, filter2) {
83556
+ switch (filter2.type) {
83557
+ case FilterType$1.ATTRIBUTE:
83558
+ return this.checkAttributeFilter(feature2, filter2);
83559
+ case FilterType$1.CQL:
83560
+ return this.checkCQLFilter(feature2, filter2);
83561
+ case FilterType$1.CUSTOM:
83562
+ const customConfig = filter2;
83563
+ return customConfig.filterFunction(feature2);
83564
+ default:
83565
+ console.warn(`不支持的过滤器类型: ${filter2.type}`);
83566
+ return true;
83567
+ }
83568
+ }
83569
+ /**
83570
+ * 检查 CQL 过滤器
83571
+ * 将 CQL 表达式转换为属性过滤器进行检查
83572
+ */
83573
+ checkCQLFilter(feature2, config) {
83574
+ try {
83575
+ const cqlExpression = config.cqlExpression.trim();
83576
+ const attributeFilters = this.parseCQLExpression(cqlExpression);
83577
+ for (const attributeFilter of attributeFilters) {
83578
+ if (!this.checkAttributeFilter(feature2, attributeFilter)) {
83579
+ return false;
83580
+ }
83581
+ }
83582
+ return true;
83583
+ } catch (error2) {
83584
+ console.warn(`CQL 表达式解析失败: ${config.cqlExpression}`, error2);
83585
+ return true;
83586
+ }
83587
+ }
83588
+ /**
83589
+ * 解析 CQL 表达式,转换为属性过滤器数组
83590
+ * 支持基本的 CQL 语法:property = 'value', property > value, property LIKE 'pattern'
83591
+ */
83592
+ parseCQLExpression(cqlExpression) {
83593
+ const filters = [];
83594
+ let expression = cqlExpression.replace(/^\s*\(\s*|\s*\)\s*$/g, "").trim();
83595
+ const conditions = expression.split(/\s+AND\s+/i);
83596
+ for (let i = 0; i < conditions.length; i++) {
83597
+ const condition = conditions[i].trim();
83598
+ const filter2 = this.parseSingleCQLCondition(condition, i);
83599
+ if (filter2) {
83600
+ filters.push(filter2);
83601
+ }
83602
+ }
83603
+ return filters;
83604
+ }
83605
+ /**
83606
+ * 解析单个 CQL 条件
83607
+ */
83608
+ parseSingleCQLCondition(condition, index2) {
83609
+ const patterns = [
83610
+ // property = 'value' 或 property = value
83611
+ { regex: /^(\w+)\s*=\s*'([^']*)'$/, operator: FilterOperator$1.EQUAL },
83612
+ { regex: /^(\w+)\s*=\s*([^'\s]+)$/, operator: FilterOperator$1.EQUAL },
83613
+ // property != 'value' 或 property <> 'value'
83614
+ { regex: /^(\w+)\s*(?:!=|<>)\s*'([^']*)'$/, operator: FilterOperator$1.NOT_EQUAL },
83615
+ { regex: /^(\w+)\s*(?:!=|<>)\s*([^'\s]+)$/, operator: FilterOperator$1.NOT_EQUAL },
83616
+ // property > value
83617
+ { regex: /^(\w+)\s*>\s*([^'\s]+)$/, operator: FilterOperator$1.GREATER_THAN },
83618
+ // property >= value
83619
+ { regex: /^(\w+)\s*>=\s*([^'\s]+)$/, operator: FilterOperator$1.GREATER_EQUAL },
83620
+ // property < value
83621
+ { regex: /^(\w+)\s*<\s*([^'\s]+)$/, operator: FilterOperator$1.LESS_THAN },
83622
+ // property <= value
83623
+ { regex: /^(\w+)\s*<=\s*([^'\s]+)$/, operator: FilterOperator$1.LESS_EQUAL },
83624
+ // property LIKE 'pattern'
83625
+ { regex: /^(\w+)\s+LIKE\s+'([^']*)'$/i, operator: FilterOperator$1.LIKE }
83626
+ ];
83627
+ for (const pattern of patterns) {
83628
+ const match2 = condition.match(pattern.regex);
83629
+ if (match2) {
83630
+ const property = match2[1];
83631
+ let value = match2[2];
83632
+ if (pattern.operator !== FilterOperator$1.LIKE && pattern.operator !== FilterOperator$1.EQUAL) {
83633
+ const numValue = Number(value);
83634
+ if (!isNaN(numValue)) {
83635
+ value = numValue;
83636
+ }
83637
+ }
83638
+ return {
83639
+ id: `cql_parsed_${index2}`,
83640
+ type: FilterType$1.ATTRIBUTE,
83641
+ enabled: true,
83642
+ name: `CQL: ${condition}`,
83643
+ property,
83644
+ operator: pattern.operator,
83645
+ value,
83646
+ caseSensitive: false
83647
+ };
83648
+ }
83649
+ }
83650
+ console.warn(`无法解析 CQL 条件: ${condition}`);
83651
+ return null;
83652
+ }
83653
+ /**
83654
+ * 检查属性过滤器
83655
+ */
83656
+ checkAttributeFilter(feature2, config) {
83657
+ const featureValue = feature2.get(config.property);
83658
+ const filterValue = config.value;
83659
+ const operator = config.operator;
83660
+ if (featureValue === void 0 || featureValue === null) {
83661
+ return false;
83662
+ }
83663
+ switch (operator) {
83664
+ case FilterOperator$1.EQUAL:
83665
+ return featureValue === filterValue;
83666
+ case FilterOperator$1.NOT_EQUAL:
83667
+ return featureValue !== filterValue;
83668
+ case FilterOperator$1.GREATER_THAN:
83669
+ return Number(featureValue) > Number(filterValue);
83670
+ case FilterOperator$1.GREATER_EQUAL:
83671
+ return Number(featureValue) >= Number(filterValue);
83672
+ case FilterOperator$1.LESS_THAN:
83673
+ return Number(featureValue) < Number(filterValue);
83674
+ case FilterOperator$1.LESS_EQUAL:
83675
+ return Number(featureValue) <= Number(filterValue);
83676
+ case FilterOperator$1.LIKE:
83677
+ const searchValue = config.caseSensitive ? filterValue : filterValue.toLowerCase();
83678
+ const targetValue = config.caseSensitive ? String(featureValue) : String(featureValue).toLowerCase();
83679
+ return targetValue.includes(searchValue);
83680
+ case FilterOperator$1.IN:
83681
+ return Array.isArray(filterValue) && filterValue.includes(featureValue);
83682
+ case FilterOperator$1.BETWEEN:
83683
+ if (Array.isArray(filterValue) && filterValue.length === 2) {
83684
+ const numValue = Number(featureValue);
83685
+ return numValue >= Number(filterValue[0]) && numValue <= Number(filterValue[1]);
83686
+ }
83687
+ return false;
83688
+ default:
83689
+ console.warn(`不支持的操作符: ${operator}`);
83690
+ return true;
83691
+ }
83692
+ }
83693
+ /**
83694
+ * 便捷方法:按属性值过滤
83695
+ */
83696
+ filterFeaturesByProperty(property, value) {
83697
+ this.addAttributeFilter("legacy", property, value, "eq", `${property} = ${value}`);
83698
+ }
83699
+ /**
83700
+ * 便捷方法:清除所有过滤器
83701
+ */
83702
+ clearAllFeatureFilters() {
83703
+ this.clearAllFilters();
83704
+ }
83095
83705
  }
83096
83706
  class KMLLayerHandler extends BaseLayer$2 {
83097
83707
  constructor(config, map2) {
@@ -83152,7 +83762,7 @@ class KMLLayerHandler extends BaseLayer$2 {
83152
83762
  width: ((_j = (_i2 = styleConfig.circle) == null ? void 0 : _i2.stroke) == null ? void 0 : _j.width) || 1
83153
83763
  })
83154
83764
  }),
83155
- text: styleConfig.text ? new Text$5({
83765
+ text: styleConfig.text ? new Text$6({
83156
83766
  font: styleConfig.text.font || "12px Calibri,sans-serif",
83157
83767
  fill: new Fill$2({
83158
83768
  color: ((_k = styleConfig.text.fill) == null ? void 0 : _k.color) || "#000"
@@ -83266,6 +83876,100 @@ class KMLLayerHandler extends BaseLayer$2 {
83266
83876
  feature2.setStyle(void 0);
83267
83877
  });
83268
83878
  }
83879
+ /**
83880
+ * 应用过滤器(实现基类的抽象方法)
83881
+ */
83882
+ applyFilters() {
83883
+ if (!this.vectorSource)
83884
+ return;
83885
+ const enabledFilters = this.getEnabledFilters();
83886
+ const features2 = this.vectorSource.getFeatures();
83887
+ if (enabledFilters.length === 0) {
83888
+ features2.forEach((feature2) => {
83889
+ feature2.setStyle(void 0);
83890
+ });
83891
+ return;
83892
+ }
83893
+ features2.forEach((feature2) => {
83894
+ let visible = true;
83895
+ for (const filter2 of enabledFilters) {
83896
+ if (!this.checkFeatureAgainstFilter(feature2, filter2)) {
83897
+ visible = false;
83898
+ break;
83899
+ }
83900
+ }
83901
+ feature2.setStyle(visible ? void 0 : new Style$3({}));
83902
+ });
83903
+ }
83904
+ /**
83905
+ * 检查要素是否符合过滤器条件
83906
+ */
83907
+ checkFeatureAgainstFilter(feature2, filter2) {
83908
+ switch (filter2.type) {
83909
+ case FilterType$1.ATTRIBUTE:
83910
+ return this.checkAttributeFilter(feature2, filter2);
83911
+ case FilterType$1.CUSTOM:
83912
+ const customConfig = filter2;
83913
+ return customConfig.filterFunction(feature2);
83914
+ default:
83915
+ console.warn(`不支持的过滤器类型: ${filter2.type}`);
83916
+ return true;
83917
+ }
83918
+ }
83919
+ /**
83920
+ * 检查属性过滤器
83921
+ */
83922
+ checkAttributeFilter(feature2, config) {
83923
+ const featureValue = feature2.get(config.property);
83924
+ const filterValue = config.value;
83925
+ const operator = config.operator || "eq";
83926
+ if (featureValue === void 0 || featureValue === null) {
83927
+ return false;
83928
+ }
83929
+ switch (operator) {
83930
+ case "eq":
83931
+ return featureValue === filterValue;
83932
+ case "ne":
83933
+ return featureValue !== filterValue;
83934
+ case "gt":
83935
+ return Number(featureValue) > Number(filterValue);
83936
+ case "gte":
83937
+ return Number(featureValue) >= Number(filterValue);
83938
+ case "lt":
83939
+ return Number(featureValue) < Number(filterValue);
83940
+ case "lte":
83941
+ return Number(featureValue) <= Number(filterValue);
83942
+ case "like":
83943
+ const searchValue = config.caseSensitive ? filterValue : filterValue.toLowerCase();
83944
+ const targetValue = config.caseSensitive ? String(featureValue) : String(featureValue).toLowerCase();
83945
+ return targetValue.includes(searchValue);
83946
+ case "in":
83947
+ return Array.isArray(filterValue) && filterValue.includes(featureValue);
83948
+ case "between":
83949
+ if (Array.isArray(filterValue) && filterValue.length === 2) {
83950
+ const numValue = Number(featureValue);
83951
+ return numValue >= Number(filterValue[0]) && numValue <= Number(filterValue[1]);
83952
+ }
83953
+ return false;
83954
+ default:
83955
+ console.warn(`不支持的操作符: ${operator}`);
83956
+ return true;
83957
+ }
83958
+ }
83959
+ /**
83960
+ * 便捷方法:按属性值过滤(保持向后兼容)
83961
+ * @deprecated 建议使用 addAttributeFilter 方法
83962
+ */
83963
+ filterFeaturesByProperty(property, value) {
83964
+ this.addAttributeFilter("legacy", property, value, "eq", `${property} = ${value}`);
83965
+ }
83966
+ /**
83967
+ * 便捷方法:清除所有过滤器(保持向后兼容)
83968
+ * @deprecated 建议使用 clearAllFilters 方法
83969
+ */
83970
+ clearAllFeatureFilters() {
83971
+ this.clearAllFilters();
83972
+ }
83269
83973
  /**
83270
83974
  * 获取要素属性信息
83271
83975
  */
@@ -83301,27 +84005,9 @@ class GMLLayerHandler extends BaseLayer$2 {
83301
84005
  */
83302
84006
  initializeGMLFormat() {
83303
84007
  const gmlConfig = this.config.gmlConfig || {};
83304
- const version2 = gmlConfig.version || "3.2";
83305
- switch (version2) {
83306
- case "2":
83307
- case "2.0":
83308
- this.gmlFormat = new GML$1({
83309
- srsName: gmlConfig.srsName || "EPSG:4326"
83310
- });
83311
- break;
83312
- case "3":
83313
- case "3.0":
83314
- this.gmlFormat = new GML3$1({
83315
- srsName: gmlConfig.srsName || "EPSG:4326"
83316
- });
83317
- break;
83318
- case "3.2":
83319
- default:
83320
- this.gmlFormat = new GML32$1({
83321
- srsName: gmlConfig.srsName || "EPSG:4326"
83322
- });
83323
- break;
83324
- }
84008
+ this.gmlFormat = new GML$1({
84009
+ srsName: gmlConfig.srsName || "EPSG:4326"
84010
+ });
83325
84011
  }
83326
84012
  /**
83327
84013
  * 创建图层
@@ -83363,7 +84049,7 @@ class GMLLayerHandler extends BaseLayer$2 {
83363
84049
  width: ((_j = (_i2 = styleConfig.circle) == null ? void 0 : _i2.stroke) == null ? void 0 : _j.width) || 1
83364
84050
  })
83365
84051
  }),
83366
- text: styleConfig.text ? new Text$5({
84052
+ text: styleConfig.text ? new Text({
83367
84053
  font: styleConfig.text.font || "12px Calibri,sans-serif",
83368
84054
  fill: new Fill$2({
83369
84055
  color: ((_k = styleConfig.text.fill) == null ? void 0 : _k.color) || "#000"
@@ -83517,6 +84203,100 @@ class GMLLayerHandler extends BaseLayer$2 {
83517
84203
  feature2.setStyle(void 0);
83518
84204
  });
83519
84205
  }
84206
+ /**
84207
+ * 应用过滤器(实现基类的抽象方法)
84208
+ */
84209
+ applyFilters() {
84210
+ if (!this.vectorSource)
84211
+ return;
84212
+ const enabledFilters = this.getEnabledFilters();
84213
+ const features2 = this.vectorSource.getFeatures();
84214
+ if (enabledFilters.length === 0) {
84215
+ features2.forEach((feature2) => {
84216
+ feature2.setStyle(void 0);
84217
+ });
84218
+ return;
84219
+ }
84220
+ features2.forEach((feature2) => {
84221
+ let visible = true;
84222
+ for (const filter2 of enabledFilters) {
84223
+ if (!this.checkFeatureAgainstFilter(feature2, filter2)) {
84224
+ visible = false;
84225
+ break;
84226
+ }
84227
+ }
84228
+ feature2.setStyle(visible ? void 0 : new Style$3({}));
84229
+ });
84230
+ }
84231
+ /**
84232
+ * 检查要素是否符合过滤器条件
84233
+ */
84234
+ checkFeatureAgainstFilter(feature2, filter2) {
84235
+ switch (filter2.type) {
84236
+ case FilterType$1.ATTRIBUTE:
84237
+ return this.checkAttributeFilter(feature2, filter2);
84238
+ case FilterType$1.CUSTOM:
84239
+ const customConfig = filter2;
84240
+ return customConfig.filterFunction(feature2);
84241
+ default:
84242
+ console.warn(`不支持的过滤器类型: ${filter2.type}`);
84243
+ return true;
84244
+ }
84245
+ }
84246
+ /**
84247
+ * 检查属性过滤器
84248
+ */
84249
+ checkAttributeFilter(feature2, config) {
84250
+ const featureValue = feature2.get(config.property);
84251
+ const filterValue = config.value;
84252
+ const operator = config.operator || "eq";
84253
+ if (featureValue === void 0 || featureValue === null) {
84254
+ return false;
84255
+ }
84256
+ switch (operator) {
84257
+ case "eq":
84258
+ return featureValue === filterValue;
84259
+ case "ne":
84260
+ return featureValue !== filterValue;
84261
+ case "gt":
84262
+ return Number(featureValue) > Number(filterValue);
84263
+ case "gte":
84264
+ return Number(featureValue) >= Number(filterValue);
84265
+ case "lt":
84266
+ return Number(featureValue) < Number(filterValue);
84267
+ case "lte":
84268
+ return Number(featureValue) <= Number(filterValue);
84269
+ case "like":
84270
+ const searchValue = config.caseSensitive ? filterValue : filterValue.toLowerCase();
84271
+ const targetValue = config.caseSensitive ? String(featureValue) : String(featureValue).toLowerCase();
84272
+ return targetValue.includes(searchValue);
84273
+ case "in":
84274
+ return Array.isArray(filterValue) && filterValue.includes(featureValue);
84275
+ case "between":
84276
+ if (Array.isArray(filterValue) && filterValue.length === 2) {
84277
+ const numValue = Number(featureValue);
84278
+ return numValue >= Number(filterValue[0]) && numValue <= Number(filterValue[1]);
84279
+ }
84280
+ return false;
84281
+ default:
84282
+ console.warn(`不支持的操作符: ${operator}`);
84283
+ return true;
84284
+ }
84285
+ }
84286
+ /**
84287
+ * 便捷方法:按属性值过滤(保持向后兼容)
84288
+ * @deprecated 建议使用 addAttributeFilter 方法
84289
+ */
84290
+ filterFeaturesByProperty(property, value) {
84291
+ this.addAttributeFilter("legacy", property, value, "eq", `${property} = ${value}`);
84292
+ }
84293
+ /**
84294
+ * 便捷方法:清除所有过滤器(保持向后兼容)
84295
+ * @deprecated 建议使用 clearAllFilters 方法
84296
+ */
84297
+ clearAllFeatureFilters() {
84298
+ this.clearAllFilters();
84299
+ }
83520
84300
  /**
83521
84301
  * 获取要素属性信息
83522
84302
  */
@@ -83651,7 +84431,7 @@ class WKTLayerHandler extends BaseLayer$2 {
83651
84431
  width: ((_j = (_i2 = styleConfig.circle) == null ? void 0 : _i2.stroke) == null ? void 0 : _j.width) || 2
83652
84432
  })
83653
84433
  }),
83654
- text: styleConfig.text ? new Text$5({
84434
+ text: styleConfig.text ? new Text$6({
83655
84435
  font: styleConfig.text.font || "12px Calibri,sans-serif",
83656
84436
  fill: new Fill$2({
83657
84437
  color: ((_k = styleConfig.text.fill) == null ? void 0 : _k.color) || "#000"
@@ -83819,6 +84599,100 @@ class WKTLayerHandler extends BaseLayer$2 {
83819
84599
  feature2.setStyle(void 0);
83820
84600
  });
83821
84601
  }
84602
+ /**
84603
+ * 应用过滤器(实现基类的抽象方法)
84604
+ */
84605
+ applyFilters() {
84606
+ if (!this.vectorSource)
84607
+ return;
84608
+ const enabledFilters = this.getEnabledFilters();
84609
+ const features2 = this.vectorSource.getFeatures();
84610
+ if (enabledFilters.length === 0) {
84611
+ features2.forEach((feature2) => {
84612
+ feature2.setStyle(void 0);
84613
+ });
84614
+ return;
84615
+ }
84616
+ features2.forEach((feature2) => {
84617
+ let visible = true;
84618
+ for (const filter2 of enabledFilters) {
84619
+ if (!this.checkFeatureAgainstFilter(feature2, filter2)) {
84620
+ visible = false;
84621
+ break;
84622
+ }
84623
+ }
84624
+ feature2.setStyle(visible ? void 0 : new Style$3({}));
84625
+ });
84626
+ }
84627
+ /**
84628
+ * 检查要素是否符合过滤器条件
84629
+ */
84630
+ checkFeatureAgainstFilter(feature2, filter2) {
84631
+ switch (filter2.type) {
84632
+ case FilterType$1.ATTRIBUTE:
84633
+ return this.checkAttributeFilter(feature2, filter2);
84634
+ case FilterType$1.CUSTOM:
84635
+ const customConfig = filter2;
84636
+ return customConfig.filterFunction(feature2);
84637
+ default:
84638
+ console.warn(`不支持的过滤器类型: ${filter2.type}`);
84639
+ return true;
84640
+ }
84641
+ }
84642
+ /**
84643
+ * 检查属性过滤器
84644
+ */
84645
+ checkAttributeFilter(feature2, config) {
84646
+ const featureValue = feature2.get(config.property);
84647
+ const filterValue = config.value;
84648
+ const operator = config.operator || "eq";
84649
+ if (featureValue === void 0 || featureValue === null) {
84650
+ return false;
84651
+ }
84652
+ switch (operator) {
84653
+ case "eq":
84654
+ return featureValue === filterValue;
84655
+ case "ne":
84656
+ return featureValue !== filterValue;
84657
+ case "gt":
84658
+ return Number(featureValue) > Number(filterValue);
84659
+ case "gte":
84660
+ return Number(featureValue) >= Number(filterValue);
84661
+ case "lt":
84662
+ return Number(featureValue) < Number(filterValue);
84663
+ case "lte":
84664
+ return Number(featureValue) <= Number(filterValue);
84665
+ case "like":
84666
+ const searchValue = config.caseSensitive ? filterValue : filterValue.toLowerCase();
84667
+ const targetValue = config.caseSensitive ? String(featureValue) : String(featureValue).toLowerCase();
84668
+ return targetValue.includes(searchValue);
84669
+ case "in":
84670
+ return Array.isArray(filterValue) && filterValue.includes(featureValue);
84671
+ case "between":
84672
+ if (Array.isArray(filterValue) && filterValue.length === 2) {
84673
+ const numValue = Number(featureValue);
84674
+ return numValue >= Number(filterValue[0]) && numValue <= Number(filterValue[1]);
84675
+ }
84676
+ return false;
84677
+ default:
84678
+ console.warn(`不支持的操作符: ${operator}`);
84679
+ return true;
84680
+ }
84681
+ }
84682
+ /**
84683
+ * 便捷方法:按属性值过滤(保持向后兼容)
84684
+ * @deprecated 建议使用 addAttributeFilter 方法
84685
+ */
84686
+ filterFeaturesByProperty(property, value) {
84687
+ this.addAttributeFilter("legacy", property, value, "eq", `${property} = ${value}`);
84688
+ }
84689
+ /**
84690
+ * 便捷方法:清除所有过滤器(保持向后兼容)
84691
+ * @deprecated 建议使用 clearAllFilters 方法
84692
+ */
84693
+ clearAllFeatureFilters() {
84694
+ this.clearAllFilters();
84695
+ }
83822
84696
  /**
83823
84697
  * 获取要素属性信息
83824
84698
  */
@@ -83854,6 +84728,11 @@ class WKTLayerHandler extends BaseLayer$2 {
83854
84728
  }
83855
84729
  }
83856
84730
  class HeatmapLayerHandler extends BaseLayer$2 {
84731
+ constructor() {
84732
+ super(...arguments);
84733
+ __publicField(this, "currentFilters", []);
84734
+ __publicField(this, "originalFeatures", []);
84735
+ }
83857
84736
  createLayer() {
83858
84737
  const vectorSource = this.createVectorSource();
83859
84738
  const heatmapLayer = new Heatmap$3({
@@ -83881,16 +84760,147 @@ class HeatmapLayerHandler extends BaseLayer$2 {
83881
84760
  const features2 = format2.readFeatures(this.config.data, {
83882
84761
  featureProjection: "EPSG:4326"
83883
84762
  });
83884
- return new VectorSource$2({ features: features2 });
84763
+ this.originalFeatures = features2;
84764
+ return new VectorSource$2({ features: this.originalFeatures });
83885
84765
  } else if (this.config.url) {
83886
- return new VectorSource$2({
84766
+ const vectorSource = new VectorSource$2({
83887
84767
  url: this.config.url,
83888
84768
  format: format2
83889
84769
  });
84770
+ vectorSource.on("featuresloadend", () => {
84771
+ this.originalFeatures = vectorSource.getFeatures();
84772
+ });
84773
+ return vectorSource;
83890
84774
  } else {
83891
84775
  return new VectorSource$2();
83892
84776
  }
83893
84777
  }
84778
+ /**
84779
+ * 应用过滤器
84780
+ */
84781
+ applyFilters(filters) {
84782
+ console.log("HeatmapLayerHandler: 应用过滤器", filters);
84783
+ this.currentFilters = filters;
84784
+ const layer2 = this.getLayer();
84785
+ const source = layer2.getSource();
84786
+ if (!source || this.originalFeatures.length === 0) {
84787
+ console.warn("HeatmapLayerHandler: 无法应用过滤器 - 数据源或原始要素为空");
84788
+ return;
84789
+ }
84790
+ if (filters.length === 0) {
84791
+ source.clear();
84792
+ source.addFeatures(this.originalFeatures);
84793
+ console.log("HeatmapLayerHandler: 清除所有过滤器,显示所有要素");
84794
+ return;
84795
+ }
84796
+ const filteredFeatures = this.originalFeatures.filter((feature2) => {
84797
+ return filters.every((filter2) => this.checkFeatureAgainstFilter(feature2, filter2));
84798
+ });
84799
+ source.clear();
84800
+ source.addFeatures(filteredFeatures);
84801
+ console.log(`HeatmapLayerHandler: 过滤完成,显示 ${filteredFeatures.length}/${this.originalFeatures.length} 个要素`);
84802
+ }
84803
+ /**
84804
+ * 检查要素是否符合过滤条件
84805
+ */
84806
+ checkFeatureAgainstFilter(feature2, filter2) {
84807
+ switch (filter2.type) {
84808
+ case FilterType.ATTRIBUTE:
84809
+ return this.checkAttributeFilter(feature2, filter2.config);
84810
+ case FilterType.CQL:
84811
+ console.warn("HeatmapLayerHandler: CQL过滤器暂不支持");
84812
+ return true;
84813
+ default:
84814
+ console.warn("HeatmapLayerHandler: 未知的过滤器类型:", filter2.type);
84815
+ return true;
84816
+ }
84817
+ }
84818
+ /**
84819
+ * 检查属性过滤条件
84820
+ */
84821
+ checkAttributeFilter(feature2, config) {
84822
+ const properties = feature2.getProperties();
84823
+ const value = properties[config.property];
84824
+ if (value === void 0 || value === null) {
84825
+ return config.operator === FilterOperator.IS_NULL;
84826
+ }
84827
+ switch (config.operator) {
84828
+ case FilterOperator.EQUAL:
84829
+ return String(value) === String(config.value);
84830
+ case FilterOperator.NOT_EQUAL:
84831
+ return String(value) !== String(config.value);
84832
+ case FilterOperator.GREATER_THAN:
84833
+ return Number(value) > Number(config.value);
84834
+ case FilterOperator.LESS_THAN:
84835
+ return Number(value) < Number(config.value);
84836
+ case FilterOperator.GREATER_THAN_OR_EQUAL:
84837
+ return Number(value) >= Number(config.value);
84838
+ case FilterOperator.LESS_THAN_OR_EQUAL:
84839
+ return Number(value) <= Number(config.value);
84840
+ case FilterOperator.LIKE:
84841
+ const pattern = String(config.value).replace(/%/g, ".*");
84842
+ const regex = new RegExp(pattern, "i");
84843
+ return regex.test(String(value));
84844
+ case FilterOperator.IN:
84845
+ if (Array.isArray(config.value)) {
84846
+ return config.value.includes(value);
84847
+ }
84848
+ return false;
84849
+ case FilterOperator.BETWEEN:
84850
+ if (Array.isArray(config.value) && config.value.length === 2) {
84851
+ const numValue = Number(value);
84852
+ return numValue >= Number(config.value[0]) && numValue <= Number(config.value[1]);
84853
+ }
84854
+ return false;
84855
+ case FilterOperator.IS_NULL:
84856
+ return false;
84857
+ case FilterOperator.IS_NOT_NULL:
84858
+ return true;
84859
+ default:
84860
+ console.warn("HeatmapLayerHandler: 未知的属性过滤操作符:", config.operator);
84861
+ return true;
84862
+ }
84863
+ }
84864
+ /**
84865
+ * 根据属性过滤要素(便捷方法)
84866
+ */
84867
+ filterFeaturesByProperty(property, value, operator = FilterOperator.EQUAL) {
84868
+ const filter2 = {
84869
+ type: FilterType.ATTRIBUTE,
84870
+ config: {
84871
+ property,
84872
+ operator,
84873
+ value
84874
+ }
84875
+ };
84876
+ this.applyFilters([filter2]);
84877
+ }
84878
+ /**
84879
+ * 清除所有过滤器
84880
+ */
84881
+ clearAllFeatureFilters() {
84882
+ this.applyFilters([]);
84883
+ }
84884
+ /**
84885
+ * 获取当前应用的过滤器
84886
+ */
84887
+ getCurrentFilters() {
84888
+ return [...this.currentFilters];
84889
+ }
84890
+ /**
84891
+ * 获取原始要素数量(未过滤的)
84892
+ */
84893
+ getOriginalFeatureCount() {
84894
+ return this.originalFeatures.length;
84895
+ }
84896
+ /**
84897
+ * 获取过滤后的要素数量
84898
+ */
84899
+ getFilteredFeatureCount() {
84900
+ const layer2 = this.getLayer();
84901
+ const source = layer2.getSource();
84902
+ return source ? source.getFeatures().length : 0;
84903
+ }
83894
84904
  /**
83895
84905
  * 获取权重函数
83896
84906
  */
@@ -83942,7 +84952,11 @@ class HeatmapLayerHandler extends BaseLayer$2 {
83942
84952
  });
83943
84953
  return feature2;
83944
84954
  });
84955
+ this.originalFeatures.push(...features2);
83945
84956
  source.addFeatures(features2);
84957
+ if (this.currentFilters.length > 0) {
84958
+ this.applyFilters(this.currentFilters);
84959
+ }
83946
84960
  }
83947
84961
  }
83948
84962
  /**
@@ -83953,6 +84967,8 @@ class HeatmapLayerHandler extends BaseLayer$2 {
83953
84967
  const source = layer2.getSource();
83954
84968
  if (source) {
83955
84969
  source.clear();
84970
+ this.originalFeatures = [];
84971
+ this.currentFilters = [];
83956
84972
  }
83957
84973
  }
83958
84974
  /**
@@ -83969,6 +84985,8 @@ class ClusterLayerHandler extends BaseLayer$2 {
83969
84985
  super(...arguments);
83970
84986
  __publicField(this, "clusterStyleConfig");
83971
84987
  __publicField(this, "singleFeatureStyleConfig");
84988
+ __publicField(this, "currentFilters", []);
84989
+ __publicField(this, "originalFeatures", []);
83972
84990
  }
83973
84991
  createLayer() {
83974
84992
  const vectorSource = this.createVectorSource();
@@ -83992,16 +85010,145 @@ class ClusterLayerHandler extends BaseLayer$2 {
83992
85010
  const features2 = format2.readFeatures(this.config.data, {
83993
85011
  featureProjection: "EPSG:4326"
83994
85012
  });
83995
- return new VectorSource$2({ features: features2 });
85013
+ this.originalFeatures = features2;
85014
+ return new VectorSource$2({ features: this.originalFeatures });
83996
85015
  } else if (this.config.url) {
83997
- return new VectorSource$2({
85016
+ const vectorSource = new VectorSource$2({
83998
85017
  url: this.config.url,
83999
85018
  format: format2
84000
85019
  });
85020
+ vectorSource.on("featuresloadend", () => {
85021
+ this.originalFeatures = vectorSource.getFeatures();
85022
+ });
85023
+ return vectorSource;
84001
85024
  } else {
84002
85025
  return new VectorSource$2();
84003
85026
  }
84004
85027
  }
85028
+ /**
85029
+ * 应用过滤器
85030
+ */
85031
+ applyFilters(filters) {
85032
+ console.log("ClusterLayerHandler: 应用过滤器", filters);
85033
+ this.currentFilters = filters;
85034
+ const vectorSource = this.getVectorSource();
85035
+ if (!vectorSource || this.originalFeatures.length === 0) {
85036
+ console.warn("ClusterLayerHandler: 无法应用过滤器 - 数据源或原始要素为空");
85037
+ return;
85038
+ }
85039
+ if (filters.length === 0) {
85040
+ vectorSource.clear();
85041
+ vectorSource.addFeatures(this.originalFeatures);
85042
+ console.log("ClusterLayerHandler: 清除所有过滤器,显示所有要素");
85043
+ return;
85044
+ }
85045
+ const filteredFeatures = this.originalFeatures.filter((feature2) => {
85046
+ return filters.every((filter2) => this.checkFeatureAgainstFilter(feature2, filter2));
85047
+ });
85048
+ vectorSource.clear();
85049
+ vectorSource.addFeatures(filteredFeatures);
85050
+ console.log(`ClusterLayerHandler: 过滤完成,显示 ${filteredFeatures.length}/${this.originalFeatures.length} 个要素`);
85051
+ }
85052
+ /**
85053
+ * 检查要素是否符合过滤条件
85054
+ */
85055
+ checkFeatureAgainstFilter(feature2, filter2) {
85056
+ switch (filter2.type) {
85057
+ case FilterType.ATTRIBUTE:
85058
+ return this.checkAttributeFilter(feature2, filter2.config);
85059
+ case FilterType.CQL:
85060
+ console.warn("ClusterLayerHandler: CQL过滤器暂不支持");
85061
+ return true;
85062
+ default:
85063
+ console.warn("ClusterLayerHandler: 未知的过滤器类型:", filter2.type);
85064
+ return true;
85065
+ }
85066
+ }
85067
+ /**
85068
+ * 检查属性过滤条件
85069
+ */
85070
+ checkAttributeFilter(feature2, config) {
85071
+ const properties = feature2.getProperties();
85072
+ const value = properties[config.property];
85073
+ if (value === void 0 || value === null) {
85074
+ return config.operator === FilterOperator.IS_NULL;
85075
+ }
85076
+ switch (config.operator) {
85077
+ case FilterOperator.EQUAL:
85078
+ return String(value) === String(config.value);
85079
+ case FilterOperator.NOT_EQUAL:
85080
+ return String(value) !== String(config.value);
85081
+ case FilterOperator.GREATER_THAN:
85082
+ return Number(value) > Number(config.value);
85083
+ case FilterOperator.LESS_THAN:
85084
+ return Number(value) < Number(config.value);
85085
+ case FilterOperator.GREATER_THAN_OR_EQUAL:
85086
+ return Number(value) >= Number(config.value);
85087
+ case FilterOperator.LESS_THAN_OR_EQUAL:
85088
+ return Number(value) <= Number(config.value);
85089
+ case FilterOperator.LIKE:
85090
+ const pattern = String(config.value).replace(/%/g, ".*");
85091
+ const regex = new RegExp(pattern, "i");
85092
+ return regex.test(String(value));
85093
+ case FilterOperator.IN:
85094
+ if (Array.isArray(config.value)) {
85095
+ return config.value.includes(value);
85096
+ }
85097
+ return false;
85098
+ case FilterOperator.BETWEEN:
85099
+ if (Array.isArray(config.value) && config.value.length === 2) {
85100
+ const numValue = Number(value);
85101
+ return numValue >= Number(config.value[0]) && numValue <= Number(config.value[1]);
85102
+ }
85103
+ return false;
85104
+ case FilterOperator.IS_NULL:
85105
+ return false;
85106
+ case FilterOperator.IS_NOT_NULL:
85107
+ return true;
85108
+ default:
85109
+ console.warn("ClusterLayerHandler: 未知的属性过滤操作符:", config.operator);
85110
+ return true;
85111
+ }
85112
+ }
85113
+ /**
85114
+ * 根据属性过滤要素(便捷方法)
85115
+ */
85116
+ filterFeaturesByProperty(property, value, operator = FilterOperator.EQUAL) {
85117
+ const filter2 = {
85118
+ type: FilterType.ATTRIBUTE,
85119
+ config: {
85120
+ property,
85121
+ operator,
85122
+ value
85123
+ }
85124
+ };
85125
+ this.applyFilters([filter2]);
85126
+ }
85127
+ /**
85128
+ * 清除所有过滤器
85129
+ */
85130
+ clearAllFeatureFilters() {
85131
+ this.applyFilters([]);
85132
+ }
85133
+ /**
85134
+ * 获取当前应用的过滤器
85135
+ */
85136
+ getCurrentFilters() {
85137
+ return [...this.currentFilters];
85138
+ }
85139
+ /**
85140
+ * 获取原始要素数量(未过滤的)
85141
+ */
85142
+ getOriginalFeatureCount() {
85143
+ return this.originalFeatures.length;
85144
+ }
85145
+ /**
85146
+ * 获取过滤后的要素数量
85147
+ */
85148
+ getFilteredFeatureCount() {
85149
+ const vectorSource = this.getVectorSource();
85150
+ return vectorSource ? vectorSource.getFeatures().length : 0;
85151
+ }
84005
85152
  /**
84006
85153
  * 创建聚合样式函数
84007
85154
  */
@@ -84101,7 +85248,11 @@ class ClusterLayerHandler extends BaseLayer$2 {
84101
85248
  }, {
84102
85249
  featureProjection: "EPSG:4326"
84103
85250
  });
85251
+ this.originalFeatures.push(...olFeatures);
84104
85252
  vectorSource.addFeatures(olFeatures);
85253
+ if (this.currentFilters.length > 0) {
85254
+ this.applyFilters(this.currentFilters);
85255
+ }
84105
85256
  }
84106
85257
  }
84107
85258
  /**
@@ -84111,6 +85262,8 @@ class ClusterLayerHandler extends BaseLayer$2 {
84111
85262
  const vectorSource = this.getVectorSource();
84112
85263
  if (vectorSource) {
84113
85264
  vectorSource.clear();
85265
+ this.originalFeatures = [];
85266
+ this.currentFilters = [];
84114
85267
  }
84115
85268
  }
84116
85269
  /**
@@ -279730,38 +280883,38 @@ var Rect$1 = (
279730
280883
  return Rect2;
279731
280884
  }(ShapeBase$1)
279732
280885
  );
279733
- var Text$3 = (
280886
+ var Text$4 = (
279734
280887
  /** @class */
279735
280888
  function(_super) {
279736
- __extends$B(Text3, _super);
279737
- function Text3() {
280889
+ __extends$B(Text4, _super);
280890
+ function Text4() {
279738
280891
  return _super !== null && _super.apply(this, arguments) || this;
279739
280892
  }
279740
- Text3.prototype.getDefaultAttrs = function() {
280893
+ Text4.prototype.getDefaultAttrs = function() {
279741
280894
  var attrs = _super.prototype.getDefaultAttrs.call(this);
279742
280895
  return __assign$m(__assign$m({}, attrs), { x: 0, y: 0, text: null, fontSize: 12, fontFamily: "sans-serif", fontStyle: "normal", fontWeight: "normal", fontVariant: "normal", textAlign: "start", textBaseline: "bottom" });
279743
280896
  };
279744
- Text3.prototype.isOnlyHitBox = function() {
280897
+ Text4.prototype.isOnlyHitBox = function() {
279745
280898
  return true;
279746
280899
  };
279747
- Text3.prototype.initAttrs = function(attrs) {
280900
+ Text4.prototype.initAttrs = function(attrs) {
279748
280901
  this._assembleFont();
279749
280902
  if (attrs.text) {
279750
280903
  this._setText(attrs.text);
279751
280904
  }
279752
280905
  };
279753
- Text3.prototype._assembleFont = function() {
280906
+ Text4.prototype._assembleFont = function() {
279754
280907
  var attrs = this.attrs;
279755
280908
  attrs.font = assembleFont(attrs);
279756
280909
  };
279757
- Text3.prototype._setText = function(text2) {
280910
+ Text4.prototype._setText = function(text2) {
279758
280911
  var textArr = null;
279759
280912
  if (isString$2(text2) && text2.indexOf("\n") !== -1) {
279760
280913
  textArr = text2.split("\n");
279761
280914
  }
279762
280915
  this.set("textArr", textArr);
279763
280916
  };
279764
- Text3.prototype.onAttrChange = function(name, value, originValue) {
280917
+ Text4.prototype.onAttrChange = function(name, value, originValue) {
279765
280918
  _super.prototype.onAttrChange.call(this, name, value, originValue);
279766
280919
  if (name.startsWith("font")) {
279767
280920
  this._assembleFont();
@@ -279770,13 +280923,13 @@ var Text$3 = (
279770
280923
  this._setText(value);
279771
280924
  }
279772
280925
  };
279773
- Text3.prototype._getSpaceingY = function() {
280926
+ Text4.prototype._getSpaceingY = function() {
279774
280927
  var attrs = this.attrs;
279775
280928
  var lineHeight2 = attrs.lineHeight;
279776
280929
  var fontSize2 = attrs.fontSize * 1;
279777
280930
  return lineHeight2 ? lineHeight2 - fontSize2 : fontSize2 * 0.14;
279778
280931
  };
279779
- Text3.prototype._drawTextArr = function(context, textArr, isFill) {
280932
+ Text4.prototype._drawTextArr = function(context, textArr, isFill) {
279780
280933
  var attrs = this.attrs;
279781
280934
  var textBaseline = attrs.textBaseline;
279782
280935
  var x2 = attrs.x;
@@ -279800,7 +280953,7 @@ var Text$3 = (
279800
280953
  }
279801
280954
  });
279802
280955
  };
279803
- Text3.prototype._drawText = function(context, isFill) {
280956
+ Text4.prototype._drawText = function(context, isFill) {
279804
280957
  var attrs = this.attr();
279805
280958
  var x2 = attrs.x;
279806
280959
  var y2 = attrs.y;
@@ -279818,7 +280971,7 @@ var Text$3 = (
279818
280971
  }
279819
280972
  }
279820
280973
  };
279821
- Text3.prototype.strokeAndFill = function(context) {
280974
+ Text4.prototype.strokeAndFill = function(context) {
279822
280975
  var _a3 = this.attrs, lineWidth = _a3.lineWidth, opacity2 = _a3.opacity, strokeOpacity = _a3.strokeOpacity, fillOpacity = _a3.fillOpacity;
279823
280976
  if (this.isStroke()) {
279824
280977
  if (lineWidth > 0) {
@@ -279839,13 +280992,13 @@ var Text$3 = (
279839
280992
  }
279840
280993
  this.afterDrawPath(context);
279841
280994
  };
279842
- Text3.prototype.fill = function(context) {
280995
+ Text4.prototype.fill = function(context) {
279843
280996
  this._drawText(context, true);
279844
280997
  };
279845
- Text3.prototype.stroke = function(context) {
280998
+ Text4.prototype.stroke = function(context) {
279846
280999
  this._drawText(context, false);
279847
281000
  };
279848
- return Text3;
281001
+ return Text4;
279849
281002
  }(ShapeBase$1)
279850
281003
  );
279851
281004
  function invertFromMatrix(v5, matrix2) {
@@ -281214,22 +282367,22 @@ var ANCHOR_MAP = {
281214
282367
  right: "end",
281215
282368
  end: "end"
281216
282369
  };
281217
- var Text$2 = (
282370
+ var Text$3 = (
281218
282371
  /** @class */
281219
282372
  function(_super) {
281220
- __extends$A(Text3, _super);
281221
- function Text3() {
282373
+ __extends$A(Text4, _super);
282374
+ function Text4() {
281222
282375
  var _this = _super !== null && _super.apply(this, arguments) || this;
281223
282376
  _this.type = "text";
281224
282377
  _this.canFill = true;
281225
282378
  _this.canStroke = true;
281226
282379
  return _this;
281227
282380
  }
281228
- Text3.prototype.getDefaultAttrs = function() {
282381
+ Text4.prototype.getDefaultAttrs = function() {
281229
282382
  var attrs = _super.prototype.getDefaultAttrs.call(this);
281230
282383
  return __assign$l(__assign$l({}, attrs), { x: 0, y: 0, text: null, fontSize: 12, fontFamily: "sans-serif", fontStyle: "normal", fontWeight: "normal", fontVariant: "normal", textAlign: "start", textBaseline: "bottom" });
281231
282384
  };
281232
- Text3.prototype.createPath = function(context, targetAttrs) {
282385
+ Text4.prototype.createPath = function(context, targetAttrs) {
281233
282386
  var _this = this;
281234
282387
  var attrs = this.attr();
281235
282388
  var el = this.get("el");
@@ -281246,7 +282399,7 @@ var Text$2 = (
281246
282399
  el.setAttribute("paint-order", "stroke");
281247
282400
  el.setAttribute("style", "stroke-linecap:butt; stroke-linejoin:miter;");
281248
282401
  };
281249
- Text3.prototype._setFont = function() {
282402
+ Text4.prototype._setFont = function() {
281250
282403
  var el = this.get("el");
281251
282404
  var _a3 = this.attr(), textBaseline = _a3.textBaseline, textAlign2 = _a3.textAlign;
281252
282405
  var browser2 = detect();
@@ -281257,7 +282410,7 @@ var Text$2 = (
281257
282410
  }
281258
282411
  el.setAttribute("text-anchor", ANCHOR_MAP[textAlign2] || "left");
281259
282412
  };
281260
- Text3.prototype._setText = function(text2) {
282413
+ Text4.prototype._setText = function(text2) {
281261
282414
  var el = this.get("el");
281262
282415
  var _a3 = this.attr(), x2 = _a3.x, _b3 = _a3.textBaseline, baseline = _b3 === void 0 ? "bottom" : _b3;
281263
282416
  if (!text2) {
@@ -281288,7 +282441,7 @@ var Text$2 = (
281288
282441
  el.innerHTML = text2;
281289
282442
  }
281290
282443
  };
281291
- return Text3;
282444
+ return Text4;
281292
282445
  }(ShapeBase)
281293
282446
  );
281294
282447
  var regexLG$1 = /^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i;
@@ -364595,7 +365748,7 @@ function defaultGeometryFunction(feature2) {
364595
365748
  }
364596
365749
  const Style$1 = Style2;
364597
365750
  const DEFAULT_FILL_COLOR = "#333";
364598
- class Text2 {
365751
+ let Text$1 = class Text3 {
364599
365752
  /**
364600
365753
  * @param {Options} [options] Options.
364601
365754
  */
@@ -364631,7 +365784,7 @@ class Text2 {
364631
365784
  */
364632
365785
  clone() {
364633
365786
  const scale3 = this.getScale();
364634
- return new Text2({
365787
+ return new Text3({
364635
365788
  font: this.getFont(),
364636
365789
  placement: this.getPlacement(),
364637
365790
  repeat: this.getRepeat(),
@@ -365010,8 +366163,8 @@ class Text2 {
365010
366163
  setPadding(padding2) {
365011
366164
  this.padding_ = padding2;
365012
366165
  }
365013
- }
365014
- const Text$1 = Text2;
366166
+ };
366167
+ const Text$2 = Text$1;
365015
366168
  const HIT_DETECT_RESOLUTION = 0.5;
365016
366169
  function createHitDetectionImageData(size2, transforms2, features2, styleFunction, extent3, resolution, rotation, squaredTolerance, projection2) {
365017
366170
  const userExtent = projection2 ? toUserExtent(extent3) : extent3;
@@ -367675,7 +368828,7 @@ function buildText(flatStyle, context) {
367675
368828
  flatStyle,
367676
368829
  prefix + "declutter-mode"
367677
368830
  );
367678
- const text2 = new Text$1({ declutterMode });
368831
+ const text2 = new Text$2({ declutterMode });
367679
368832
  return function(context2) {
367680
368833
  text2.setText(evaluateValue(context2));
367681
368834
  if (evaluateFill) {
@@ -377528,7 +378681,7 @@ class StyleUtils {
377528
378681
  */
377529
378682
  static toOLTextStyle(style, text2) {
377530
378683
  return new Style$1({
377531
- text: new Text$1({
378684
+ text: new Text$2({
377532
378685
  font: (style.fontStyle || "") + " " + (style.fontWeight || "") + " " + (style.fontSize || "") + " " + style.fontFamily,
377533
378686
  text: text2,
377534
378687
  textAlign: style.textAlign,
@@ -378173,7 +379326,7 @@ class StyleUtils {
378173
379326
  const { offsetX, offsetY, rotation = 0 } = parameters;
378174
379327
  const offset = StyleUtils.getTextOffset(fontSize2, offsetX, offsetY);
378175
379328
  return new Style$1({
378176
- text: new Text$1({
379329
+ text: new Text$2({
378177
379330
  text: text2,
378178
379331
  font: fontSize2 + " supermapol-icons",
378179
379332
  placement: "point",
@@ -437773,7 +438926,7 @@ class VectorTileStyles extends Observable$1 {
437773
438926
  }
437774
438927
  function getDefaultSelectedTextStyle() {
437775
438928
  return new Style$1({
437776
- text: new Text$1({
438929
+ text: new Text$2({
437777
438930
  font: "15px Microsoft YaHei",
437778
438931
  fill: new FillStyle({
437779
438932
  color: "blue"
@@ -443889,7 +445042,7 @@ class MapboxStyles extends Observable$1 {
443889
445042
  color: "rgba(255, 0, 0, 1)",
443890
445043
  width: 10
443891
445044
  }),
443892
- text: new Text$1({
445045
+ text: new Text$2({
443893
445046
  font: 'normal 400 11.19px "Microsoft YaHei"',
443894
445047
  placement: "point",
443895
445048
  fill: new FillStyle({
@@ -448173,7 +449326,7 @@ class Graticule extends VectorLayer$1 {
448173
449326
  this.lonLabelPosition_ = options.lonLabelPosition == void 0 ? 0 : options.lonLabelPosition;
448174
449327
  this.latLabelPosition_ = options.latLabelPosition == void 0 ? 1 : options.latLabelPosition;
448175
449328
  this.lonLabelStyleBase_ = new Style$1({
448176
- text: options.lonLabelStyle !== void 0 ? options.lonLabelStyle.clone() : new Text$1({
449329
+ text: options.lonLabelStyle !== void 0 ? options.lonLabelStyle.clone() : new Text$2({
448177
449330
  font: "12px Calibri,sans-serif",
448178
449331
  textBaseline: "bottom",
448179
449332
  fill: new FillStyle({
@@ -448191,7 +449344,7 @@ class Graticule extends VectorLayer$1 {
448191
449344
  return this.lonLabelStyleBase_;
448192
449345
  };
448193
449346
  this.latLabelStyleBase_ = new Style$1({
448194
- text: options.latLabelStyle !== void 0 ? options.latLabelStyle.clone() : new Text$1({
449347
+ text: options.latLabelStyle !== void 0 ? options.latLabelStyle.clone() : new Text$2({
448195
449348
  font: "12px Calibri,sans-serif",
448196
449349
  textAlign: "right",
448197
449350
  fill: new FillStyle({
@@ -460851,7 +462004,7 @@ class WebMap extends Observable$1 {
460851
462004
  });
460852
462005
  }
460853
462006
  return new Style$1({
460854
- text: new Text$1(option)
462007
+ text: new Text$2(option)
460855
462008
  });
460856
462009
  }
460857
462010
  /**
@@ -462669,7 +463822,7 @@ class WebMap extends Observable$1 {
462669
463822
  wrapX: false,
462670
463823
  targetSize: 0
462671
463824
  };
462672
- lonLabelStyle && (graticuleOptions.lonLabelStyle = new Text$1({
463825
+ lonLabelStyle && (graticuleOptions.lonLabelStyle = new Text$2({
462673
463826
  font: `${lonLabelStyle.fontSize} ${lonLabelStyle.fontFamily}`,
462674
463827
  textBaseline: lonLabelStyle.textBaseline,
462675
463828
  fill: new FillStyle({
@@ -462680,7 +463833,7 @@ class WebMap extends Observable$1 {
462680
463833
  width: lonLabelStyle.outlineWidth
462681
463834
  })
462682
463835
  }));
462683
- latLabelStyle && (graticuleOptions.latLabelStyle = new Text$1({
463836
+ latLabelStyle && (graticuleOptions.latLabelStyle = new Text$2({
462684
463837
  font: `${latLabelStyle.fontSize} ${latLabelStyle.fontFamily}`,
462685
463838
  textBaseline: latLabelStyle.textBaseline,
462686
463839
  fill: new FillStyle({
@@ -464303,6 +465456,17 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
464303
465456
  }
464304
465457
  return `https://${domain}/${service}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${service}&STYLE=${style}&TILEMATRIXSET=w&FORMAT=image/png&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk=${tk}`;
464305
465458
  }
465459
+ /**
465460
+ * 应用过滤器(天地图图层不支持过滤)
465461
+ * @param filters 过滤器数组
465462
+ */
465463
+ applyFilters(filters) {
465464
+ console.warn("TiandituLayerHandler: 天地图图层不支持客户端过滤功能。天地图是预渲染的瓦片服务,无法进行动态过滤。");
465465
+ console.info("TiandituLayerHandler: 如需过滤功能,请考虑:");
465466
+ console.info("1. 使用矢量图层(GeoJSON、WFS等)叠加在天地图上");
465467
+ console.info("2. 使用天地图作为底图,在其上添加可过滤的矢量图层");
465468
+ console.info("3. 考虑使用其他支持服务端过滤的地图服务");
465469
+ }
464306
465470
  };
464307
465471
  __publicField(_TiandituLayerHandler, "TIANDITU_DOMAINS", [
464308
465472
  "t0.tianditu.gov.cn",
@@ -464501,6 +465665,17 @@ class CanvasLayerHandler extends BaseLayer$2 {
464501
465665
  redraw() {
464502
465666
  this.refreshLayer();
464503
465667
  }
465668
+ /**
465669
+ * 应用过滤器(Canvas图层不支持过滤)
465670
+ * @param filters 过滤器数组
465671
+ */
465672
+ applyFilters(filters) {
465673
+ console.warn("CanvasLayerHandler: Canvas图层不支持客户端过滤功能。Canvas图层是基于自定义绘制函数的图像图层,无法进行要素级别的过滤。");
465674
+ console.info("CanvasLayerHandler: 如需过滤功能,请考虑:");
465675
+ console.info("1. 在Canvas绘制函数中实现自定义的过滤逻辑");
465676
+ console.info("2. 使用矢量图层(VectorLayerHandler)替代Canvas图层");
465677
+ console.info("3. 在数据源层面进行过滤后再传递给Canvas绘制函数");
465678
+ }
464504
465679
  }
464505
465680
  class VectorTileLayerHandler extends BaseLayer$2 {
464506
465681
  constructor() {
@@ -464728,6 +465903,144 @@ class VectorTileLayerHandler extends BaseLayer$2 {
464728
465903
  declutter: this.config.declutter || false
464729
465904
  };
464730
465905
  }
465906
+ // ==================== 过滤器功能 ====================
465907
+ /**
465908
+ * 应用过滤器(实现基类的抽象方法)
465909
+ * VectorTile图层通过样式函数实现过滤,隐藏不匹配的要素
465910
+ */
465911
+ applyFilters() {
465912
+ const layer2 = this.getLayer();
465913
+ if (!layer2)
465914
+ return;
465915
+ const enabledFilters = this.getEnabledFilters();
465916
+ if (enabledFilters.length === 0) {
465917
+ layer2.setStyle(this.createStyleFunction());
465918
+ console.log("VectorTile图层清除所有过滤器");
465919
+ return;
465920
+ }
465921
+ const originalStyleFunction = this.createStyleFunction();
465922
+ const filteredStyleFunction = (feature2, resolution) => {
465923
+ let visible = true;
465924
+ for (const filter2 of enabledFilters) {
465925
+ if (!this.checkFeatureAgainstFilter(feature2, filter2)) {
465926
+ visible = false;
465927
+ break;
465928
+ }
465929
+ }
465930
+ if (!visible) {
465931
+ return new Style$3({});
465932
+ }
465933
+ if (typeof originalStyleFunction === "function") {
465934
+ return originalStyleFunction(feature2, resolution);
465935
+ } else {
465936
+ return originalStyleFunction;
465937
+ }
465938
+ };
465939
+ layer2.setStyle(filteredStyleFunction);
465940
+ console.log(`VectorTile图层应用 ${enabledFilters.length} 个过滤器`);
465941
+ }
465942
+ /**
465943
+ * 检查要素是否符合过滤器条件
465944
+ */
465945
+ checkFeatureAgainstFilter(feature2, filter2) {
465946
+ switch (filter2.type) {
465947
+ case FilterType.ATTRIBUTE:
465948
+ return this.checkAttributeFilter(feature2, filter2);
465949
+ default:
465950
+ console.warn(`VectorTile图层不支持过滤器类型: ${filter2.type}`);
465951
+ return true;
465952
+ }
465953
+ }
465954
+ /**
465955
+ * 检查属性过滤器
465956
+ */
465957
+ checkAttributeFilter(feature2, config) {
465958
+ const featureValue = feature2.get(config.property);
465959
+ const filterValue = config.value;
465960
+ if (featureValue === void 0 || featureValue === null) {
465961
+ return config.operator === FilterOperator.IS_NULL;
465962
+ }
465963
+ switch (config.operator) {
465964
+ case FilterOperator.EQUAL:
465965
+ return featureValue === filterValue;
465966
+ case FilterOperator.NOT_EQUAL:
465967
+ return featureValue !== filterValue;
465968
+ case FilterOperator.GREATER_THAN:
465969
+ return Number(featureValue) > Number(filterValue);
465970
+ case FilterOperator.GREATER_THAN_OR_EQUAL:
465971
+ return Number(featureValue) >= Number(filterValue);
465972
+ case FilterOperator.LESS_THAN:
465973
+ return Number(featureValue) < Number(filterValue);
465974
+ case FilterOperator.LESS_THAN_OR_EQUAL:
465975
+ return Number(featureValue) <= Number(filterValue);
465976
+ case FilterOperator.LIKE:
465977
+ const pattern = filterValue.toString().replace(/%/g, ".*");
465978
+ const regex = new RegExp(pattern, "i");
465979
+ return regex.test(featureValue.toString());
465980
+ case FilterOperator.BETWEEN:
465981
+ if (Array.isArray(filterValue) && filterValue.length === 2) {
465982
+ const numValue = Number(featureValue);
465983
+ return numValue >= Number(filterValue[0]) && numValue <= Number(filterValue[1]);
465984
+ }
465985
+ return false;
465986
+ case FilterOperator.IN:
465987
+ if (Array.isArray(filterValue)) {
465988
+ return filterValue.includes(featureValue);
465989
+ }
465990
+ return false;
465991
+ case FilterOperator.IS_NULL:
465992
+ return featureValue === null || featureValue === void 0;
465993
+ case FilterOperator.IS_NOT_NULL:
465994
+ return featureValue !== null && featureValue !== void 0;
465995
+ default:
465996
+ console.warn(`不支持的过滤器操作符: ${config.operator}`);
465997
+ return true;
465998
+ }
465999
+ }
466000
+ /**
466001
+ * 便捷方法:按属性值过滤要素
466002
+ * @param property 属性名
466003
+ * @param value 过滤值
466004
+ * @param operator 操作符
466005
+ */
466006
+ filterFeaturesByProperty(property, value, operator = FilterOperator.EQUAL) {
466007
+ this.addAttributeFilter("vectortile_property_filter", property, value, operator, `${property} ${operator} ${value}`);
466008
+ }
466009
+ /**
466010
+ * 便捷方法:清除所有过滤器
466011
+ */
466012
+ clearAllFeatureFilters() {
466013
+ this.clearAllFilters();
466014
+ }
466015
+ /**
466016
+ * 获取要素属性信息(从当前可见的要素中获取)
466017
+ * 注意:VectorTile图层的要素是动态生成的,只能获取当前视口内的要素
466018
+ */
466019
+ getFeatureProperties() {
466020
+ const layer2 = this.getLayer();
466021
+ const source = layer2.getSource();
466022
+ if (!source || !this.map) {
466023
+ return [];
466024
+ }
466025
+ const properties = [];
466026
+ const view = this.map.getView();
466027
+ const extent3 = view.calculateExtent();
466028
+ const resolution = view.getResolution();
466029
+ try {
466030
+ source.forEachFeatureAtCoordinateAndResolution(
466031
+ extent3,
466032
+ resolution || 1,
466033
+ (feature2) => {
466034
+ const props = feature2.getProperties();
466035
+ const { geometry: geometry2, ...dataProps } = props;
466036
+ properties.push(dataProps);
466037
+ }
466038
+ );
466039
+ } catch (error2) {
466040
+ console.warn("获取VectorTile要素属性时出错:", error2);
466041
+ }
466042
+ return properties;
466043
+ }
464731
466044
  }
464732
466045
  const _LayerFactory = class _LayerFactory {
464733
466046
  constructor() {
@@ -465829,7 +467142,7 @@ class FeatureHighlightManager {
465829
467142
  if (this.styleConfig.text) {
465830
467143
  const properties = feature2.getProperties();
465831
467144
  const labelText = properties.name || properties.label || "高亮要素";
465832
- styleOptions.text = new Text$5({
467145
+ styleOptions.text = new Text$6({
465833
467146
  text: labelText,
465834
467147
  font: this.styleConfig.text.font || "12px Arial",
465835
467148
  fill: new Fill$2({
@@ -465883,7 +467196,7 @@ class FeatureHighlightManager {
465883
467196
  if (customStyleConfig == null ? void 0 : customStyleConfig.text) {
465884
467197
  const properties = feature2.getProperties();
465885
467198
  const labelText = properties.name || properties.label || "高亮要素";
465886
- styleOptions.text = new Text$5({
467199
+ styleOptions.text = new Text$6({
465887
467200
  text: labelText,
465888
467201
  font: customStyleConfig.text.font || "12px Arial",
465889
467202
  fill: new Fill$2({
@@ -475308,7 +476621,6 @@ class TiandituSearchApi {
475308
476621
  if (response.status != "200") {
475309
476622
  throw new Error(`天地图API返回错误: ${data.status}`);
475310
476623
  }
475311
- debugger;
475312
476624
  return this.transformResults(data, type);
475313
476625
  } catch (error2) {
475314
476626
  console.error("天地图搜索失败:", error2);
@@ -475846,6 +477158,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
475846
477158
  provider: "tianditu",
475847
477159
  maxResults: 10,
475848
477160
  showHistory: true,
477161
+ enableStorage: false,
477162
+ // 默认禁用存储
475849
477163
  searchDelay: 300,
475850
477164
  minSearchLength: 2
475851
477165
  }) }
@@ -475956,7 +477270,6 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
475956
477270
  isLoading.value = true;
475957
477271
  showResults.value = true;
475958
477272
  try {
475959
- debugger;
475960
477273
  const results = await searchService.search(query);
475961
477274
  searchResults.value = results;
475962
477275
  emit("search", query);
@@ -475999,13 +477312,21 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
475999
477312
  saveHistoryToStorage();
476000
477313
  };
476001
477314
  const saveHistoryToStorage = () => {
477315
+ if (!props.config.enableStorage) {
477316
+ return;
477317
+ }
476002
477318
  try {
476003
- localStorage.setItem("map-search-history", JSON.stringify(searchHistory.value));
477319
+ const limitedHistory = searchHistory.value.slice(0, 20);
477320
+ localStorage.setItem("map-search-history", JSON.stringify(limitedHistory));
476004
477321
  } catch (error2) {
476005
477322
  console.warn("保存搜索历史失败:", error2);
476006
477323
  }
476007
477324
  };
476008
477325
  const loadHistoryFromStorage = () => {
477326
+ if (!props.config.enableStorage) {
477327
+ searchHistory.value = [];
477328
+ return;
477329
+ }
476009
477330
  try {
476010
477331
  const stored = localStorage.getItem("map-search-history");
476011
477332
  if (stored) {
@@ -479553,7 +480874,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
479553
480874
  initialLegends: {},
479554
480875
  eventCallbacks: {},
479555
480876
  enableMeasurement: { type: Boolean, default: true },
479556
- enableStorage: { type: Boolean, default: true },
480877
+ enableStorage: { type: Boolean, default: false },
479557
480878
  storagePrefix: { default: "custom-openlayer" },
479558
480879
  tooltipTemplate: {},
479559
480880
  enablePopup: { type: Boolean, default: true },
@@ -479565,7 +480886,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
479565
480886
  const emit = __emit;
479566
480887
  const instanceId = ref(`map-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`);
479567
480888
  const eventBus = ref(createLayerEventBus());
479568
- const storage2 = ref(createMapStorage(instanceId.value));
480889
+ const storage2 = ref(createMapStorage(instanceId.value, props.enableStorage));
479569
480890
  const mapManager = ref(null);
479570
480891
  const isPickingCoordinate = ref(false);
479571
480892
  const tooltipData = ref([]);
@@ -480666,7 +481987,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
480666
481987
  };
480667
481988
  }
480668
481989
  });
480669
- const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-52263159"]]);
481990
+ const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-913ddcb9"]]);
480670
481991
  var u8 = Uint8Array;
480671
481992
  var u16 = Uint16Array;
480672
481993
  var i32 = Int32Array;
@@ -488938,7 +490259,7 @@ function(t3) {
488938
490259
  */
488939
490260
  function(t3) {
488940
490261
  function e8() {
488941
- return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-35628045.mjs")).catch(function(t4) {
490262
+ return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-a22271e1.mjs")).catch(function(t4) {
488942
490263
  return Promise.reject(new Error("Could not load canvg: " + t4));
488943
490264
  }).then(function(t4) {
488944
490265
  return t4.default ? t4.default : t4;
@@ -497859,6 +499180,9 @@ export {
497859
499180
  DrawingManagerFactory as a3,
497860
499181
  MapOperationTool as a4,
497861
499182
  htmlToPDF as a5,
499183
+ FilterType$1 as a6,
499184
+ FilterOperator$1 as a7,
499185
+ SpatialFilterType as a8,
497862
499186
  _defineProperty as b,
497863
499187
  commonjsGlobal as c,
497864
499188
  CustomDialog as d,