vue-openlayers-plugin 1.0.48 → 1.0.49
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.
- package/lib/{index-6010d8cc.mjs → index-2dac53c6.mjs} +526 -652
- package/lib/{index.es-a22271e1.mjs → index.es-a3c51163.mjs} +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.umd.js +541 -670
- package/lib/style.css +16 -16
- package/package.json +1 -1
- package/types/src/components/CustomOpenlayer/components/MapSearch/MapSearch.vue.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/types/index.d.ts +25 -18
- package/types/src/components/CustomOpenlayer/types/index.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/drawing/IconDrawing.d.ts +4 -3
- package/types/src/components/CustomOpenlayer/utils/drawing/IconDrawing.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/eventBus.d.ts +2 -0
- package/types/src/components/CustomOpenlayer/utils/eventBus.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/BaseLayer.d.ts +10 -9
- package/types/src/components/CustomOpenlayer/utils/layers/BaseLayer.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/CanvasLayerHandler.d.ts +2 -3
- package/types/src/components/CustomOpenlayer/utils/layers/CanvasLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/ClusterLayerHandler.d.ts +3 -3
- package/types/src/components/CustomOpenlayer/utils/layers/ClusterLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/GMLLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/GeoJSONLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/HeatmapLayerHandler.d.ts +3 -3
- package/types/src/components/CustomOpenlayer/utils/layers/HeatmapLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/KMLLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/TiandituLayerHandler.d.ts +1 -3
- package/types/src/components/CustomOpenlayer/utils/layers/TiandituLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/TileLayerHandler.d.ts +1 -3
- package/types/src/components/CustomOpenlayer/utils/layers/TileLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/VectorTileLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/WFSLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/WKTLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/WMSLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/WMTSLayerHandler.d.ts +1 -3
- package/types/src/components/CustomOpenlayer/utils/layers/WMTSLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/interfaces.d.ts +12 -0
- package/types/src/components/CustomOpenlayer/utils/layers/interfaces.d.ts.map +1 -1
- package/types/tsconfig.layers.tsbuildinfo +1 -0
- 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$
|
|
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";
|
|
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$
|
|
61
|
+
return Text$3;
|
|
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$
|
|
100
|
+
return Text$2;
|
|
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$
|
|
3875
|
+
if ((slot == null ? void 0 : slot.type) === Text$6) {
|
|
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$
|
|
21018
|
+
let Text$4 = class Text {
|
|
21019
21019
|
/**
|
|
21020
21020
|
* @param {Options} [options] Options.
|
|
21021
21021
|
*/
|
|
@@ -21051,7 +21051,7 @@ let Text$5 = class Text2 {
|
|
|
21051
21051
|
*/
|
|
21052
21052
|
clone() {
|
|
21053
21053
|
const scale3 = this.getScale();
|
|
21054
|
-
return new
|
|
21054
|
+
return new Text({
|
|
21055
21055
|
font: this.getFont(),
|
|
21056
21056
|
placement: this.getPlacement(),
|
|
21057
21057
|
repeat: this.getRepeat(),
|
|
@@ -21431,7 +21431,7 @@ let Text$5 = class Text2 {
|
|
|
21431
21431
|
this.padding_ = padding2;
|
|
21432
21432
|
}
|
|
21433
21433
|
};
|
|
21434
|
-
const Text$
|
|
21434
|
+
const Text$5 = Text$4;
|
|
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$
|
|
21770
|
+
const text2 = new Text$5({ 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$
|
|
58632
|
+
text: new Text$5({
|
|
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$
|
|
59768
|
+
const textStyle = new Text$5({
|
|
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$
|
|
60280
|
+
const textStyle = new Text$5({
|
|
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$
|
|
60310
|
+
const textStyle = new Text$5({
|
|
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$
|
|
60870
|
+
const textStyle = new Text$5({
|
|
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$
|
|
60903
|
+
const textStyle = new Text$5({
|
|
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$
|
|
60933
|
+
const textStyle = new Text$5({
|
|
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$
|
|
61462
|
+
const textStyle = new Text$5({
|
|
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$
|
|
61948
|
+
text: new Text$5({
|
|
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$
|
|
61985
|
+
text: new Text$5({
|
|
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$
|
|
62019
|
+
text: new Text$5({
|
|
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$
|
|
62051
|
+
text: new Text$5({
|
|
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$
|
|
62826
|
+
text: new Text$5({
|
|
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$
|
|
62863
|
+
text: new Text$5({
|
|
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$
|
|
62892
|
+
text: new Text$5({
|
|
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$
|
|
63642
|
+
text: new Text$5({
|
|
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$
|
|
63693
|
+
text: new Text$5({
|
|
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$
|
|
63722
|
+
text: new Text$5({
|
|
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$
|
|
66810
|
+
const textStyle = new Text$5({
|
|
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$
|
|
67789
|
+
const textStyle = new Text$5({
|
|
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$
|
|
68549
|
+
const textStyle = new Text$5({
|
|
68550
68550
|
text: this._style.textContent,
|
|
68551
68551
|
font: `${this._style.fontSize || 12}px ${this._style.fontFamily || "Arial"}`,
|
|
68552
68552
|
fill: new Fill$2({
|
|
@@ -69141,27 +69141,17 @@ function getUnitOptions(type) {
|
|
|
69141
69141
|
}
|
|
69142
69142
|
const STORAGE_CONFIG = {
|
|
69143
69143
|
ENABLED: false,
|
|
69144
|
-
// 默认禁用本地存储
|
|
69145
69144
|
MAX_MEASUREMENTS: 100,
|
|
69146
|
-
// 减少到100条,避免过多累积
|
|
69147
69145
|
MAX_LAYER_CONFIGS: 30,
|
|
69148
|
-
// 减少到30个,够用即可
|
|
69149
69146
|
MAX_SEARCH_HISTORY: 20,
|
|
69150
|
-
// 新增:搜索历史限制
|
|
69151
69147
|
QUOTA_WARNING_THRESHOLD: 0.6,
|
|
69152
|
-
// 配额警告阈值(60%)
|
|
69153
69148
|
AUTO_CLEANUP_THRESHOLD: 0.7,
|
|
69154
|
-
// 自动清理阈值(70%)
|
|
69155
69149
|
COMPRESSION_ENABLED: true,
|
|
69156
|
-
// 是否启用压缩
|
|
69157
69150
|
BATCH_CLEANUP_SIZE: 10,
|
|
69158
|
-
// 减少批量清理数量
|
|
69159
69151
|
// 新增:数据过期时间配置(毫秒)
|
|
69160
69152
|
DATA_EXPIRY: {
|
|
69161
69153
|
MEASUREMENTS: 30 * 24 * 60 * 60 * 1e3,
|
|
69162
|
-
// 30天
|
|
69163
69154
|
MAP_STATE: 7 * 24 * 60 * 60 * 1e3,
|
|
69164
|
-
// 7天
|
|
69165
69155
|
SEARCH_HISTORY: 7 * 24 * 60 * 60 * 1e3
|
|
69166
69156
|
// 7天
|
|
69167
69157
|
}
|
|
@@ -69216,9 +69206,7 @@ class MapStorage {
|
|
|
69216
69206
|
cleanupExpiredData() {
|
|
69217
69207
|
try {
|
|
69218
69208
|
const measurements = this.getMeasurements();
|
|
69219
|
-
const validMeasurements = measurements.filter(
|
|
69220
|
-
(m2) => !m2.timestamp || !this.isDataExpired(m2.timestamp, "MEASUREMENTS")
|
|
69221
|
-
);
|
|
69209
|
+
const validMeasurements = measurements.filter((m2) => !m2.timestamp || !this.isDataExpired(m2.timestamp, "MEASUREMENTS"));
|
|
69222
69210
|
if (validMeasurements.length !== measurements.length) {
|
|
69223
69211
|
this.saveMeasurements(validMeasurements);
|
|
69224
69212
|
console.log(`清理过期测量结果:${measurements.length} -> ${validMeasurements.length}`);
|
|
@@ -69600,12 +69588,7 @@ class MapStorage {
|
|
|
69600
69588
|
* 手动清理存储
|
|
69601
69589
|
*/
|
|
69602
69590
|
manualCleanup(options = {}) {
|
|
69603
|
-
const {
|
|
69604
|
-
clearMeasurements = false,
|
|
69605
|
-
clearLayerConfigs = false,
|
|
69606
|
-
clearMapState = false,
|
|
69607
|
-
keepRecentCount = 50
|
|
69608
|
-
} = options;
|
|
69591
|
+
const { clearMeasurements = false, clearLayerConfigs = false, clearMapState = false, keepRecentCount = 50 } = options;
|
|
69609
69592
|
if (clearMeasurements) {
|
|
69610
69593
|
if (keepRecentCount > 0) {
|
|
69611
69594
|
const measurements = this.getMeasurements();
|
|
@@ -74685,7 +74668,7 @@ function createStyleDefaults() {
|
|
|
74685
74668
|
color: [51, 51, 51, 1],
|
|
74686
74669
|
width: 2
|
|
74687
74670
|
});
|
|
74688
|
-
DEFAULT_TEXT_STYLE = new Text$
|
|
74671
|
+
DEFAULT_TEXT_STYLE = new Text$5({
|
|
74689
74672
|
font: "bold 16px Helvetica",
|
|
74690
74673
|
fill: DEFAULT_FILL_STYLE,
|
|
74691
74674
|
stroke: DEFAULT_TEXT_STROKE_STYLE,
|
|
@@ -75584,7 +75567,7 @@ function labelStyleParser(node, objectStack) {
|
|
|
75584
75567
|
return;
|
|
75585
75568
|
}
|
|
75586
75569
|
const styleObject = objectStack[objectStack.length - 1];
|
|
75587
|
-
const textStyle = new Text$
|
|
75570
|
+
const textStyle = new Text$5({
|
|
75588
75571
|
fill: new Fill$2({
|
|
75589
75572
|
color: (
|
|
75590
75573
|
/** @type {import("../color.js").Color} */
|
|
@@ -81427,6 +81410,38 @@ class GeoJSONLocationTool {
|
|
|
81427
81410
|
this.map = map2;
|
|
81428
81411
|
}
|
|
81429
81412
|
}
|
|
81413
|
+
var FilterType;
|
|
81414
|
+
(function(FilterType2) {
|
|
81415
|
+
FilterType2["ATTRIBUTE"] = "attribute";
|
|
81416
|
+
FilterType2["SPATIAL"] = "spatial";
|
|
81417
|
+
FilterType2["CQL"] = "cql";
|
|
81418
|
+
FilterType2["CUSTOM"] = "custom";
|
|
81419
|
+
})(FilterType || (FilterType = {}));
|
|
81420
|
+
var FilterOperator;
|
|
81421
|
+
(function(FilterOperator2) {
|
|
81422
|
+
FilterOperator2["EQUAL"] = "equal";
|
|
81423
|
+
FilterOperator2["NOT_EQUAL"] = "not_equal";
|
|
81424
|
+
FilterOperator2["GREATER_THAN"] = "greater_than";
|
|
81425
|
+
FilterOperator2["LESS_THAN"] = "less_than";
|
|
81426
|
+
FilterOperator2["GREATER_EQUAL"] = "greater_equal";
|
|
81427
|
+
FilterOperator2["LESS_EQUAL"] = "less_equal";
|
|
81428
|
+
FilterOperator2["LIKE"] = "like";
|
|
81429
|
+
FilterOperator2["IN"] = "in";
|
|
81430
|
+
FilterOperator2["NOT_IN"] = "not_in";
|
|
81431
|
+
FilterOperator2["BETWEEN"] = "between";
|
|
81432
|
+
FilterOperator2["IS_NULL"] = "is_null";
|
|
81433
|
+
FilterOperator2["IS_NOT_NULL"] = "is_not_null";
|
|
81434
|
+
})(FilterOperator || (FilterOperator = {}));
|
|
81435
|
+
var SpatialFilterType;
|
|
81436
|
+
(function(SpatialFilterType2) {
|
|
81437
|
+
SpatialFilterType2["INTERSECTS"] = "intersects";
|
|
81438
|
+
SpatialFilterType2["CONTAINS"] = "contains";
|
|
81439
|
+
SpatialFilterType2["WITHIN"] = "within";
|
|
81440
|
+
SpatialFilterType2["TOUCHES"] = "touches";
|
|
81441
|
+
SpatialFilterType2["CROSSES"] = "crosses";
|
|
81442
|
+
SpatialFilterType2["OVERLAPS"] = "overlaps";
|
|
81443
|
+
SpatialFilterType2["DISJOINT"] = "disjoint";
|
|
81444
|
+
})(SpatialFilterType || (SpatialFilterType = {}));
|
|
81430
81445
|
let BaseLayer$2 = class BaseLayer2 {
|
|
81431
81446
|
constructor(config) {
|
|
81432
81447
|
__publicField(this, "config");
|
|
@@ -81437,6 +81452,23 @@ let BaseLayer$2 = class BaseLayer2 {
|
|
|
81437
81452
|
this.config = { ...config };
|
|
81438
81453
|
this.processConfig();
|
|
81439
81454
|
}
|
|
81455
|
+
/**
|
|
81456
|
+
* 获取过滤组合逻辑,默认 'AND'
|
|
81457
|
+
*/
|
|
81458
|
+
getFilterLogic() {
|
|
81459
|
+
return this.config.filterLogic ?? "AND";
|
|
81460
|
+
}
|
|
81461
|
+
/**
|
|
81462
|
+
* 根据过滤组合逻辑计算布尔结果
|
|
81463
|
+
* @param results 单个过滤条件的判定结果数组
|
|
81464
|
+
*/
|
|
81465
|
+
combineByLogic(results) {
|
|
81466
|
+
const logic = this.getFilterLogic();
|
|
81467
|
+
if (logic === "OR") {
|
|
81468
|
+
return results.some(Boolean);
|
|
81469
|
+
}
|
|
81470
|
+
return results.every(Boolean);
|
|
81471
|
+
}
|
|
81440
81472
|
/**
|
|
81441
81473
|
* 处理图层配置,包括透明度转换等通用逻辑
|
|
81442
81474
|
*/
|
|
@@ -81520,6 +81552,21 @@ let BaseLayer$2 = class BaseLayer2 {
|
|
|
81520
81552
|
this.layer.setOpacity(normalizedOpacity);
|
|
81521
81553
|
}
|
|
81522
81554
|
}
|
|
81555
|
+
/**
|
|
81556
|
+
* 设置图层层级
|
|
81557
|
+
*/
|
|
81558
|
+
setZIndex(zIndex2) {
|
|
81559
|
+
if (this.layer) {
|
|
81560
|
+
this.layer.setZIndex(zIndex2);
|
|
81561
|
+
}
|
|
81562
|
+
}
|
|
81563
|
+
/**
|
|
81564
|
+
* 获取当前图层层级
|
|
81565
|
+
*/
|
|
81566
|
+
getZIndex() {
|
|
81567
|
+
var _a3;
|
|
81568
|
+
return (_a3 = this.layer) == null ? void 0 : _a3.getZIndex();
|
|
81569
|
+
}
|
|
81523
81570
|
/**
|
|
81524
81571
|
* 设置图层可见性
|
|
81525
81572
|
*/
|
|
@@ -81804,7 +81851,8 @@ let BaseLayer$2 = class BaseLayer2 {
|
|
|
81804
81851
|
this.addFilter(filter2);
|
|
81805
81852
|
}
|
|
81806
81853
|
};
|
|
81807
|
-
var LayerType$1
|
|
81854
|
+
var LayerType$1;
|
|
81855
|
+
(function(LayerType2) {
|
|
81808
81856
|
LayerType2["TILE"] = "tile";
|
|
81809
81857
|
LayerType2["WMS"] = "wms";
|
|
81810
81858
|
LayerType2["WMTS"] = "wmts";
|
|
@@ -81819,8 +81867,7 @@ var LayerType$1 = /* @__PURE__ */ ((LayerType2) => {
|
|
|
81819
81867
|
LayerType2["CANVAS"] = "canvas";
|
|
81820
81868
|
LayerType2["IMAGE_VECTOR"] = "image_vector";
|
|
81821
81869
|
LayerType2["VECTOR_TILE"] = "vector_tile";
|
|
81822
|
-
|
|
81823
|
-
})(LayerType$1 || {});
|
|
81870
|
+
})(LayerType$1 || (LayerType$1 = {}));
|
|
81824
81871
|
class TileLayerHandler extends BaseLayer$2 {
|
|
81825
81872
|
constructor() {
|
|
81826
81873
|
super(...arguments);
|
|
@@ -81983,9 +82030,8 @@ class TileLayerHandler extends BaseLayer$2 {
|
|
|
81983
82030
|
}
|
|
81984
82031
|
/**
|
|
81985
82032
|
* 应用过滤器(瓦片图层不支持过滤)
|
|
81986
|
-
* @param filters 过滤器数组
|
|
81987
82033
|
*/
|
|
81988
|
-
applyFilters(
|
|
82034
|
+
applyFilters() {
|
|
81989
82035
|
console.warn("TileLayerHandler: 瓦片图层不支持客户端过滤功能。瓦片图层使用预渲染的图像瓦片,无法进行动态过滤。");
|
|
81990
82036
|
console.info("TileLayerHandler: 如需过滤功能,请考虑:");
|
|
81991
82037
|
console.info("1. 使用矢量图层(GeoJSON、WFS等)替代瓦片图层");
|
|
@@ -81993,38 +82039,6 @@ class TileLayerHandler extends BaseLayer$2 {
|
|
|
81993
82039
|
console.info("3. 使用WMS图层并配置服务端过滤参数");
|
|
81994
82040
|
}
|
|
81995
82041
|
}
|
|
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 || {});
|
|
82028
82042
|
class WMSLayerHandler extends BaseLayer$2 {
|
|
82029
82043
|
createLayer() {
|
|
82030
82044
|
const source = this.createWMSSource();
|
|
@@ -82096,27 +82110,17 @@ class WMSLayerHandler extends BaseLayer$2 {
|
|
|
82096
82110
|
const source = layer2.getSource();
|
|
82097
82111
|
if (!source)
|
|
82098
82112
|
return void 0;
|
|
82099
|
-
return source.getFeatureInfoUrl(
|
|
82100
|
-
|
|
82101
|
-
|
|
82102
|
-
|
|
82103
|
-
|
|
82104
|
-
"INFO_FORMAT": "application/json",
|
|
82105
|
-
"FEATURE_COUNT": 10,
|
|
82106
|
-
...params2
|
|
82107
|
-
}
|
|
82108
|
-
);
|
|
82113
|
+
return source.getFeatureInfoUrl(coordinate, resolution, projection2, {
|
|
82114
|
+
"INFO_FORMAT": "application/json",
|
|
82115
|
+
"FEATURE_COUNT": 10,
|
|
82116
|
+
...params2
|
|
82117
|
+
});
|
|
82109
82118
|
}
|
|
82110
82119
|
/**
|
|
82111
82120
|
* 通过坐标获取要素信息
|
|
82112
82121
|
*/
|
|
82113
82122
|
async getFeatureInfoAtCoordinate(coordinate, options = {}) {
|
|
82114
|
-
const {
|
|
82115
|
-
infoFormat = "application/json",
|
|
82116
|
-
featureCount = 10,
|
|
82117
|
-
resolution,
|
|
82118
|
-
projection: projection2 = "EPSG:3857"
|
|
82119
|
-
} = options;
|
|
82123
|
+
const { infoFormat = "application/json", featureCount = 10, resolution, projection: projection2 = "EPSG:3857" } = options;
|
|
82120
82124
|
try {
|
|
82121
82125
|
const map2 = this.map;
|
|
82122
82126
|
if (!map2) {
|
|
@@ -82130,15 +82134,10 @@ class WMSLayerHandler extends BaseLayer$2 {
|
|
|
82130
82134
|
console.warn("无法获取地图分辨率");
|
|
82131
82135
|
return [];
|
|
82132
82136
|
}
|
|
82133
|
-
const url = this.getFeatureInfoUrl(
|
|
82134
|
-
|
|
82135
|
-
|
|
82136
|
-
|
|
82137
|
-
{
|
|
82138
|
-
"INFO_FORMAT": infoFormat,
|
|
82139
|
-
"FEATURE_COUNT": featureCount
|
|
82140
|
-
}
|
|
82141
|
-
);
|
|
82137
|
+
const url = this.getFeatureInfoUrl(coordinate, currentResolution, currentProjection, {
|
|
82138
|
+
"INFO_FORMAT": infoFormat,
|
|
82139
|
+
"FEATURE_COUNT": featureCount
|
|
82140
|
+
});
|
|
82142
82141
|
if (!url) {
|
|
82143
82142
|
console.warn("无法构建GetFeatureInfo请求URL");
|
|
82144
82143
|
return [];
|
|
@@ -82215,8 +82214,8 @@ class WMSLayerHandler extends BaseLayer$2 {
|
|
|
82215
82214
|
*/
|
|
82216
82215
|
applyFilters() {
|
|
82217
82216
|
const enabledFilters = this.getEnabledFilters();
|
|
82218
|
-
const attributeFilters = enabledFilters.filter((filter2) => filter2.type === FilterType
|
|
82219
|
-
const cqlFilters = enabledFilters.filter((filter2) => filter2.type === FilterType
|
|
82217
|
+
const attributeFilters = enabledFilters.filter((filter2) => filter2.type === FilterType.ATTRIBUTE);
|
|
82218
|
+
const cqlFilters = enabledFilters.filter((filter2) => filter2.type === FilterType.CQL);
|
|
82220
82219
|
const allCQLExpressions = [];
|
|
82221
82220
|
attributeFilters.forEach((filter2) => {
|
|
82222
82221
|
const config = filter2;
|
|
@@ -82230,9 +82229,11 @@ class WMSLayerHandler extends BaseLayer$2 {
|
|
|
82230
82229
|
allCQLExpressions.push(`(${config.cqlExpression})`);
|
|
82231
82230
|
});
|
|
82232
82231
|
if (allCQLExpressions.length > 0) {
|
|
82233
|
-
const
|
|
82232
|
+
const logic = this.getFilterLogic();
|
|
82233
|
+
const separator = logic === "OR" ? " OR " : " AND ";
|
|
82234
|
+
const combinedCQL = allCQLExpressions.join(separator);
|
|
82234
82235
|
this.updateParams({ "CQL_FILTER": combinedCQL });
|
|
82235
|
-
console.log(
|
|
82236
|
+
console.log(`WMS图层应用CQL过滤器 (${logic}):`, combinedCQL);
|
|
82236
82237
|
} else {
|
|
82237
82238
|
this.updateParams({ "CQL_FILTER": void 0 });
|
|
82238
82239
|
console.log("WMS图层清除CQL过滤器");
|
|
@@ -82247,34 +82248,34 @@ class WMSLayerHandler extends BaseLayer$2 {
|
|
|
82247
82248
|
return null;
|
|
82248
82249
|
}
|
|
82249
82250
|
switch (operator) {
|
|
82250
|
-
case FilterOperator
|
|
82251
|
+
case FilterOperator.EQUAL:
|
|
82251
82252
|
return typeof value === "string" ? `${property} = '${value}'` : `${property} = ${value}`;
|
|
82252
|
-
case FilterOperator
|
|
82253
|
+
case FilterOperator.NOT_EQUAL:
|
|
82253
82254
|
return typeof value === "string" ? `${property} <> '${value}'` : `${property} <> ${value}`;
|
|
82254
|
-
case FilterOperator
|
|
82255
|
+
case FilterOperator.GREATER_THAN:
|
|
82255
82256
|
return `${property} > ${value}`;
|
|
82256
|
-
case FilterOperator
|
|
82257
|
+
case FilterOperator.GREATER_EQUAL:
|
|
82257
82258
|
return `${property} >= ${value}`;
|
|
82258
|
-
case FilterOperator
|
|
82259
|
+
case FilterOperator.LESS_THAN:
|
|
82259
82260
|
return `${property} < ${value}`;
|
|
82260
|
-
case FilterOperator
|
|
82261
|
+
case FilterOperator.LESS_EQUAL:
|
|
82261
82262
|
return `${property} <= ${value}`;
|
|
82262
|
-
case FilterOperator
|
|
82263
|
+
case FilterOperator.LIKE:
|
|
82263
82264
|
return `${property} LIKE '%${value}%'`;
|
|
82264
|
-
case FilterOperator
|
|
82265
|
+
case FilterOperator.IN:
|
|
82265
82266
|
if (Array.isArray(value)) {
|
|
82266
82267
|
const valueList = value.map((v5) => typeof v5 === "string" ? `'${v5}'` : v5).join(",");
|
|
82267
82268
|
return `${property} IN (${valueList})`;
|
|
82268
82269
|
}
|
|
82269
82270
|
return null;
|
|
82270
|
-
case FilterOperator
|
|
82271
|
+
case FilterOperator.BETWEEN:
|
|
82271
82272
|
if (Array.isArray(value) && value.length === 2) {
|
|
82272
82273
|
return `${property} BETWEEN ${value[0]} AND ${value[1]}`;
|
|
82273
82274
|
}
|
|
82274
82275
|
return null;
|
|
82275
|
-
case FilterOperator
|
|
82276
|
+
case FilterOperator.IS_NULL:
|
|
82276
82277
|
return `${property} IS NULL`;
|
|
82277
|
-
case FilterOperator
|
|
82278
|
+
case FilterOperator.IS_NOT_NULL:
|
|
82278
82279
|
return `${property} IS NOT NULL`;
|
|
82279
82280
|
default:
|
|
82280
82281
|
console.warn(`WMS图层不支持的过滤器操作符: ${operator}`);
|
|
@@ -82297,7 +82298,7 @@ class WMSLayerHandler extends BaseLayer$2 {
|
|
|
82297
82298
|
if (filterId) {
|
|
82298
82299
|
this.removeFilter(filterId);
|
|
82299
82300
|
} else {
|
|
82300
|
-
const cqlFilters = this.getAllFilters().filter((filter2) => filter2.type === FilterType
|
|
82301
|
+
const cqlFilters = this.getAllFilters().filter((filter2) => filter2.type === FilterType.CQL);
|
|
82301
82302
|
cqlFilters.forEach((filter2) => this.removeFilter(filter2.id));
|
|
82302
82303
|
}
|
|
82303
82304
|
}
|
|
@@ -82435,9 +82436,8 @@ class WMTSLayerHandler extends BaseLayer$2 {
|
|
|
82435
82436
|
}
|
|
82436
82437
|
/**
|
|
82437
82438
|
* 应用过滤器(WMTS图层不支持过滤)
|
|
82438
|
-
* @param filters 过滤器数组
|
|
82439
82439
|
*/
|
|
82440
|
-
applyFilters(
|
|
82440
|
+
applyFilters() {
|
|
82441
82441
|
console.warn("WMTSLayerHandler: WMTS图层不支持客户端过滤功能。WMTS是预渲染的瓦片服务,无法进行动态过滤。");
|
|
82442
82442
|
console.info("WMTSLayerHandler: 如需过滤功能,请考虑:");
|
|
82443
82443
|
console.info("1. 使用WFS图层替代WMTS图层");
|
|
@@ -82601,11 +82601,22 @@ class WFSLayerHandler extends BaseLayer$2 {
|
|
|
82601
82601
|
if (!this.config.wfsConfig.filters) {
|
|
82602
82602
|
this.config.wfsConfig.filters = [];
|
|
82603
82603
|
}
|
|
82604
|
-
if (filter2.type === FilterType
|
|
82604
|
+
if (filter2.type === FilterType.ATTRIBUTE) {
|
|
82605
82605
|
const config = filter2;
|
|
82606
|
+
let wfsOperator = "equalTo";
|
|
82607
|
+
switch (config.operator) {
|
|
82608
|
+
case FilterOperator.EQUAL:
|
|
82609
|
+
wfsOperator = "equalTo";
|
|
82610
|
+
break;
|
|
82611
|
+
case FilterOperator.LIKE:
|
|
82612
|
+
wfsOperator = "like";
|
|
82613
|
+
break;
|
|
82614
|
+
default:
|
|
82615
|
+
console.warn(`WFS暂不支持操作符 ${String(config.operator)},已回退为 equalTo`);
|
|
82616
|
+
wfsOperator = "equalTo";
|
|
82617
|
+
}
|
|
82606
82618
|
const wfsFilter = {
|
|
82607
|
-
type:
|
|
82608
|
-
// 默认使用equalTo,可以根据需要扩展
|
|
82619
|
+
type: wfsOperator,
|
|
82609
82620
|
property: config.property,
|
|
82610
82621
|
value: config.value
|
|
82611
82622
|
};
|
|
@@ -82633,11 +82644,22 @@ class WFSLayerHandler extends BaseLayer$2 {
|
|
|
82633
82644
|
}
|
|
82634
82645
|
this.config.wfsConfig.filters = [];
|
|
82635
82646
|
enabledFilters.forEach((filter2) => {
|
|
82636
|
-
if (filter2.type === FilterType
|
|
82647
|
+
if (filter2.type === FilterType.ATTRIBUTE) {
|
|
82637
82648
|
const config = filter2;
|
|
82649
|
+
let wfsOperator = "equalTo";
|
|
82650
|
+
switch (config.operator) {
|
|
82651
|
+
case FilterOperator.EQUAL:
|
|
82652
|
+
wfsOperator = "equalTo";
|
|
82653
|
+
break;
|
|
82654
|
+
case FilterOperator.LIKE:
|
|
82655
|
+
wfsOperator = "like";
|
|
82656
|
+
break;
|
|
82657
|
+
default:
|
|
82658
|
+
console.warn(`WFS暂不支持操作符 ${String(config.operator)},已回退为 equalTo`);
|
|
82659
|
+
wfsOperator = "equalTo";
|
|
82660
|
+
}
|
|
82638
82661
|
const wfsFilter = {
|
|
82639
|
-
type:
|
|
82640
|
-
// 默认使用equalTo,可以根据需要扩展
|
|
82662
|
+
type: wfsOperator,
|
|
82641
82663
|
property: config.property,
|
|
82642
82664
|
value: config.value
|
|
82643
82665
|
};
|
|
@@ -82650,7 +82672,7 @@ class WFSLayerHandler extends BaseLayer$2 {
|
|
|
82650
82672
|
* 便捷方法:添加WFS属性过滤器
|
|
82651
82673
|
*/
|
|
82652
82674
|
addWFSAttributeFilter(id, property, value, operator = "equalTo", description) {
|
|
82653
|
-
this.addAttributeFilter(id, property, value, operator === "equalTo" ?
|
|
82675
|
+
this.addAttributeFilter(id, property, value, operator === "equalTo" ? FilterOperator.EQUAL : FilterOperator.LIKE, description);
|
|
82654
82676
|
}
|
|
82655
82677
|
/**
|
|
82656
82678
|
* 便捷方法:移除WFS过滤器
|
|
@@ -82718,7 +82740,8 @@ class WFSLayerHandler extends BaseLayer$2 {
|
|
|
82718
82740
|
}
|
|
82719
82741
|
}
|
|
82720
82742
|
}
|
|
82721
|
-
var GeometryType$2
|
|
82743
|
+
var GeometryType$2;
|
|
82744
|
+
(function(GeometryType2) {
|
|
82722
82745
|
GeometryType2["POINT"] = "Point";
|
|
82723
82746
|
GeometryType2["LINE_STRING"] = "LineString";
|
|
82724
82747
|
GeometryType2["POLYGON"] = "Polygon";
|
|
@@ -82727,8 +82750,7 @@ var GeometryType$2 = /* @__PURE__ */ ((GeometryType2) => {
|
|
|
82727
82750
|
GeometryType2["MULTI_POLYGON"] = "MultiPolygon";
|
|
82728
82751
|
GeometryType2["GEOMETRY_COLLECTION"] = "GeometryCollection";
|
|
82729
82752
|
GeometryType2["CIRCLE"] = "Circle";
|
|
82730
|
-
|
|
82731
|
-
})(GeometryType$2 || {});
|
|
82753
|
+
})(GeometryType$2 || (GeometryType$2 = {}));
|
|
82732
82754
|
class StyleFactory {
|
|
82733
82755
|
/**
|
|
82734
82756
|
* 创建填充样式
|
|
@@ -82765,7 +82787,7 @@ class StyleFactory {
|
|
|
82765
82787
|
static createText(config) {
|
|
82766
82788
|
if (!config)
|
|
82767
82789
|
return void 0;
|
|
82768
|
-
const textStyle = new Text$
|
|
82790
|
+
const textStyle = new Text$5({
|
|
82769
82791
|
text: config.text,
|
|
82770
82792
|
font: config.font || `${config.fontSize || 12}px ${config.fontFamily || "Arial"}`,
|
|
82771
82793
|
fill: this.createFill(config.fill),
|
|
@@ -83538,27 +83560,24 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83538
83560
|
});
|
|
83539
83561
|
return;
|
|
83540
83562
|
}
|
|
83563
|
+
const logic = this.getFilterLogic();
|
|
83541
83564
|
features2.forEach((feature2) => {
|
|
83542
|
-
|
|
83543
|
-
|
|
83544
|
-
if (!this.checkFeatureAgainstFilter(feature2, filter2)) {
|
|
83545
|
-
visible = false;
|
|
83546
|
-
break;
|
|
83547
|
-
}
|
|
83548
|
-
}
|
|
83565
|
+
const results = enabledFilters.map((filter2) => this.checkFeatureAgainstFilter(feature2, filter2));
|
|
83566
|
+
const visible = this.combineByLogic(results);
|
|
83549
83567
|
feature2.setStyle(visible ? void 0 : new Style$3({}));
|
|
83550
83568
|
});
|
|
83569
|
+
console.log(`GeoJSON图层应用 ${enabledFilters.length} 个过滤器,组合逻辑为 ${logic}`);
|
|
83551
83570
|
}
|
|
83552
83571
|
/**
|
|
83553
83572
|
* 检查要素是否符合过滤器条件
|
|
83554
83573
|
*/
|
|
83555
83574
|
checkFeatureAgainstFilter(feature2, filter2) {
|
|
83556
83575
|
switch (filter2.type) {
|
|
83557
|
-
case FilterType
|
|
83576
|
+
case FilterType.ATTRIBUTE:
|
|
83558
83577
|
return this.checkAttributeFilter(feature2, filter2);
|
|
83559
|
-
case FilterType
|
|
83578
|
+
case FilterType.CQL:
|
|
83560
83579
|
return this.checkCQLFilter(feature2, filter2);
|
|
83561
|
-
case FilterType
|
|
83580
|
+
case FilterType.CUSTOM:
|
|
83562
83581
|
const customConfig = filter2;
|
|
83563
83582
|
return customConfig.filterFunction(feature2);
|
|
83564
83583
|
default:
|
|
@@ -83591,7 +83610,30 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83591
83610
|
*/
|
|
83592
83611
|
parseCQLExpression(cqlExpression) {
|
|
83593
83612
|
const filters = [];
|
|
83594
|
-
let expression = cqlExpression.
|
|
83613
|
+
let expression = cqlExpression.trim();
|
|
83614
|
+
if (expression.startsWith("(") && expression.endsWith(")")) {
|
|
83615
|
+
let depth = 0;
|
|
83616
|
+
let wrapsWhole = true;
|
|
83617
|
+
for (let i = 0; i < expression.length; i++) {
|
|
83618
|
+
const ch = expression[i];
|
|
83619
|
+
if (ch === "(")
|
|
83620
|
+
depth++;
|
|
83621
|
+
else if (ch === ")") {
|
|
83622
|
+
depth--;
|
|
83623
|
+
if (depth === 0 && i < expression.length - 1) {
|
|
83624
|
+
wrapsWhole = false;
|
|
83625
|
+
break;
|
|
83626
|
+
}
|
|
83627
|
+
if (depth < 0) {
|
|
83628
|
+
wrapsWhole = false;
|
|
83629
|
+
break;
|
|
83630
|
+
}
|
|
83631
|
+
}
|
|
83632
|
+
}
|
|
83633
|
+
if (wrapsWhole && depth === 0) {
|
|
83634
|
+
expression = expression.slice(1, -1).trim();
|
|
83635
|
+
}
|
|
83636
|
+
}
|
|
83595
83637
|
const conditions = expression.split(/\s+AND\s+/i);
|
|
83596
83638
|
for (let i = 0; i < conditions.length; i++) {
|
|
83597
83639
|
const condition = conditions[i].trim();
|
|
@@ -83608,36 +83650,48 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83608
83650
|
parseSingleCQLCondition(condition, index2) {
|
|
83609
83651
|
const patterns = [
|
|
83610
83652
|
// property = 'value' 或 property = value
|
|
83611
|
-
{ regex: /^(\w+)\s*=\s*'([^']*)'$/, operator: FilterOperator
|
|
83612
|
-
{ regex: /^(\w+)\s*=\s*([^'\s]+)$/, operator: FilterOperator
|
|
83653
|
+
{ regex: /^(\w+)\s*=\s*'([^']*)'$/, operator: FilterOperator.EQUAL },
|
|
83654
|
+
{ regex: /^(\w+)\s*=\s*([^'\s]+)$/, operator: FilterOperator.EQUAL },
|
|
83613
83655
|
// property != 'value' 或 property <> 'value'
|
|
83614
|
-
{ regex: /^(\w+)\s*(?:!=|<>)\s*'([^']*)'$/, operator: FilterOperator
|
|
83615
|
-
{ regex: /^(\w+)\s*(?:!=|<>)\s*([^'\s]+)$/, operator: FilterOperator
|
|
83656
|
+
{ regex: /^(\w+)\s*(?:!=|<>)\s*'([^']*)'$/, operator: FilterOperator.NOT_EQUAL },
|
|
83657
|
+
{ regex: /^(\w+)\s*(?:!=|<>)\s*([^'\s]+)$/, operator: FilterOperator.NOT_EQUAL },
|
|
83616
83658
|
// property > value
|
|
83617
|
-
{ regex: /^(\w+)\s*>\s*([^'\s]+)$/, operator: FilterOperator
|
|
83659
|
+
{ regex: /^(\w+)\s*>\s*([^'\s]+)$/, operator: FilterOperator.GREATER_THAN },
|
|
83618
83660
|
// property >= value
|
|
83619
|
-
{ regex: /^(\w+)\s*>=\s*([^'\s]+)$/, operator: FilterOperator
|
|
83661
|
+
{ regex: /^(\w+)\s*>=\s*([^'\s]+)$/, operator: FilterOperator.GREATER_EQUAL },
|
|
83620
83662
|
// property < value
|
|
83621
|
-
{ regex: /^(\w+)\s*<\s*([^'\s]+)$/, operator: FilterOperator
|
|
83663
|
+
{ regex: /^(\w+)\s*<\s*([^'\s]+)$/, operator: FilterOperator.LESS_THAN },
|
|
83622
83664
|
// property <= value
|
|
83623
|
-
{ regex: /^(\w+)\s*<=\s*([^'\s]+)$/, operator: FilterOperator
|
|
83665
|
+
{ regex: /^(\w+)\s*<=\s*([^'\s]+)$/, operator: FilterOperator.LESS_EQUAL },
|
|
83624
83666
|
// property LIKE 'pattern'
|
|
83625
|
-
{ regex: /^(\w+)\s+LIKE\s+'([^']*)'$/i, operator: FilterOperator
|
|
83667
|
+
{ regex: /^(\w+)\s+LIKE\s+'([^']*)'$/i, operator: FilterOperator.LIKE },
|
|
83668
|
+
// property IN ('a','b',...) 或 property IN (1,2,...)
|
|
83669
|
+
{ regex: /^(\w+)\s+IN\s*\(\s*([^)]+)\s*\)$/i, operator: FilterOperator.IN }
|
|
83626
83670
|
];
|
|
83627
83671
|
for (const pattern of patterns) {
|
|
83628
83672
|
const match2 = condition.match(pattern.regex);
|
|
83629
83673
|
if (match2) {
|
|
83630
83674
|
const property = match2[1];
|
|
83631
83675
|
let value = match2[2];
|
|
83632
|
-
if (pattern.operator
|
|
83633
|
-
const
|
|
83634
|
-
|
|
83635
|
-
|
|
83676
|
+
if (pattern.operator === FilterOperator.IN) {
|
|
83677
|
+
const items = String(value).split(",").map((s2) => s2.trim()).map((s2) => {
|
|
83678
|
+
const m2 = s2.match(/^'(.*)'$/);
|
|
83679
|
+
const v5 = m2 ? m2[1] : s2;
|
|
83680
|
+
const numValue = Number(v5);
|
|
83681
|
+
return isNaN(numValue) ? v5 : numValue;
|
|
83682
|
+
});
|
|
83683
|
+
value = items;
|
|
83684
|
+
} else {
|
|
83685
|
+
if (pattern.operator !== FilterOperator.LIKE && pattern.operator !== FilterOperator.EQUAL) {
|
|
83686
|
+
const numValue = Number(value);
|
|
83687
|
+
if (!isNaN(numValue)) {
|
|
83688
|
+
value = numValue;
|
|
83689
|
+
}
|
|
83636
83690
|
}
|
|
83637
83691
|
}
|
|
83638
83692
|
return {
|
|
83639
83693
|
id: `cql_parsed_${index2}`,
|
|
83640
|
-
type: FilterType
|
|
83694
|
+
type: FilterType.ATTRIBUTE,
|
|
83641
83695
|
enabled: true,
|
|
83642
83696
|
name: `CQL: ${condition}`,
|
|
83643
83697
|
property,
|
|
@@ -83661,25 +83715,25 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83661
83715
|
return false;
|
|
83662
83716
|
}
|
|
83663
83717
|
switch (operator) {
|
|
83664
|
-
case FilterOperator
|
|
83718
|
+
case FilterOperator.EQUAL:
|
|
83665
83719
|
return featureValue === filterValue;
|
|
83666
|
-
case FilterOperator
|
|
83720
|
+
case FilterOperator.NOT_EQUAL:
|
|
83667
83721
|
return featureValue !== filterValue;
|
|
83668
|
-
case FilterOperator
|
|
83722
|
+
case FilterOperator.GREATER_THAN:
|
|
83669
83723
|
return Number(featureValue) > Number(filterValue);
|
|
83670
|
-
case FilterOperator
|
|
83724
|
+
case FilterOperator.GREATER_EQUAL:
|
|
83671
83725
|
return Number(featureValue) >= Number(filterValue);
|
|
83672
|
-
case FilterOperator
|
|
83726
|
+
case FilterOperator.LESS_THAN:
|
|
83673
83727
|
return Number(featureValue) < Number(filterValue);
|
|
83674
|
-
case FilterOperator
|
|
83728
|
+
case FilterOperator.LESS_EQUAL:
|
|
83675
83729
|
return Number(featureValue) <= Number(filterValue);
|
|
83676
|
-
case FilterOperator
|
|
83730
|
+
case FilterOperator.LIKE:
|
|
83677
83731
|
const searchValue = config.caseSensitive ? filterValue : filterValue.toLowerCase();
|
|
83678
83732
|
const targetValue = config.caseSensitive ? String(featureValue) : String(featureValue).toLowerCase();
|
|
83679
83733
|
return targetValue.includes(searchValue);
|
|
83680
|
-
case FilterOperator
|
|
83734
|
+
case FilterOperator.IN:
|
|
83681
83735
|
return Array.isArray(filterValue) && filterValue.includes(featureValue);
|
|
83682
|
-
case FilterOperator
|
|
83736
|
+
case FilterOperator.BETWEEN:
|
|
83683
83737
|
if (Array.isArray(filterValue) && filterValue.length === 2) {
|
|
83684
83738
|
const numValue = Number(featureValue);
|
|
83685
83739
|
return numValue >= Number(filterValue[0]) && numValue <= Number(filterValue[1]);
|
|
@@ -83694,7 +83748,7 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83694
83748
|
* 便捷方法:按属性值过滤
|
|
83695
83749
|
*/
|
|
83696
83750
|
filterFeaturesByProperty(property, value) {
|
|
83697
|
-
this.addAttributeFilter("legacy", property, value,
|
|
83751
|
+
this.addAttributeFilter("legacy", property, value, FilterOperator.EQUAL, `${property} = ${value}`);
|
|
83698
83752
|
}
|
|
83699
83753
|
/**
|
|
83700
83754
|
* 便捷方法:清除所有过滤器
|
|
@@ -83717,7 +83771,6 @@ class KMLLayerHandler extends BaseLayer$2 {
|
|
|
83717
83771
|
this.kmlFormat = new KML$1({
|
|
83718
83772
|
className: this.config.className,
|
|
83719
83773
|
extractStyles: true,
|
|
83720
|
-
// 提取KML中的样式
|
|
83721
83774
|
showPointNames: false
|
|
83722
83775
|
// 不显示点名称
|
|
83723
83776
|
});
|
|
@@ -83762,7 +83815,7 @@ class KMLLayerHandler extends BaseLayer$2 {
|
|
|
83762
83815
|
width: ((_j = (_i2 = styleConfig.circle) == null ? void 0 : _i2.stroke) == null ? void 0 : _j.width) || 1
|
|
83763
83816
|
})
|
|
83764
83817
|
}),
|
|
83765
|
-
text: styleConfig.text ? new Text$
|
|
83818
|
+
text: styleConfig.text ? new Text$5({
|
|
83766
83819
|
font: styleConfig.text.font || "12px Calibri,sans-serif",
|
|
83767
83820
|
fill: new Fill$2({
|
|
83768
83821
|
color: ((_k = styleConfig.text.fill) == null ? void 0 : _k.color) || "#000"
|
|
@@ -83890,25 +83943,22 @@ class KMLLayerHandler extends BaseLayer$2 {
|
|
|
83890
83943
|
});
|
|
83891
83944
|
return;
|
|
83892
83945
|
}
|
|
83946
|
+
const logic = this.getFilterLogic();
|
|
83893
83947
|
features2.forEach((feature2) => {
|
|
83894
|
-
|
|
83895
|
-
|
|
83896
|
-
if (!this.checkFeatureAgainstFilter(feature2, filter2)) {
|
|
83897
|
-
visible = false;
|
|
83898
|
-
break;
|
|
83899
|
-
}
|
|
83900
|
-
}
|
|
83948
|
+
const results = enabledFilters.map((filter2) => this.checkFeatureAgainstFilter(feature2, filter2));
|
|
83949
|
+
const visible = this.combineByLogic(results);
|
|
83901
83950
|
feature2.setStyle(visible ? void 0 : new Style$3({}));
|
|
83902
83951
|
});
|
|
83952
|
+
console.log(`KML图层应用 ${enabledFilters.length} 个过滤器,组合逻辑为 ${logic}`);
|
|
83903
83953
|
}
|
|
83904
83954
|
/**
|
|
83905
83955
|
* 检查要素是否符合过滤器条件
|
|
83906
83956
|
*/
|
|
83907
83957
|
checkFeatureAgainstFilter(feature2, filter2) {
|
|
83908
83958
|
switch (filter2.type) {
|
|
83909
|
-
case FilterType
|
|
83959
|
+
case FilterType.ATTRIBUTE:
|
|
83910
83960
|
return this.checkAttributeFilter(feature2, filter2);
|
|
83911
|
-
case FilterType
|
|
83961
|
+
case FilterType.CUSTOM:
|
|
83912
83962
|
const customConfig = filter2;
|
|
83913
83963
|
return customConfig.filterFunction(feature2);
|
|
83914
83964
|
default:
|
|
@@ -83922,30 +83972,30 @@ class KMLLayerHandler extends BaseLayer$2 {
|
|
|
83922
83972
|
checkAttributeFilter(feature2, config) {
|
|
83923
83973
|
const featureValue = feature2.get(config.property);
|
|
83924
83974
|
const filterValue = config.value;
|
|
83925
|
-
const operator = config.operator ||
|
|
83975
|
+
const operator = config.operator || FilterOperator.EQUAL;
|
|
83926
83976
|
if (featureValue === void 0 || featureValue === null) {
|
|
83927
83977
|
return false;
|
|
83928
83978
|
}
|
|
83929
83979
|
switch (operator) {
|
|
83930
|
-
case
|
|
83980
|
+
case FilterOperator.EQUAL:
|
|
83931
83981
|
return featureValue === filterValue;
|
|
83932
|
-
case
|
|
83982
|
+
case FilterOperator.NOT_EQUAL:
|
|
83933
83983
|
return featureValue !== filterValue;
|
|
83934
|
-
case
|
|
83984
|
+
case FilterOperator.GREATER_THAN:
|
|
83935
83985
|
return Number(featureValue) > Number(filterValue);
|
|
83936
|
-
case
|
|
83986
|
+
case FilterOperator.GREATER_EQUAL:
|
|
83937
83987
|
return Number(featureValue) >= Number(filterValue);
|
|
83938
|
-
case
|
|
83988
|
+
case FilterOperator.LESS_THAN:
|
|
83939
83989
|
return Number(featureValue) < Number(filterValue);
|
|
83940
|
-
case
|
|
83990
|
+
case FilterOperator.LESS_EQUAL:
|
|
83941
83991
|
return Number(featureValue) <= Number(filterValue);
|
|
83942
|
-
case
|
|
83992
|
+
case FilterOperator.LIKE:
|
|
83943
83993
|
const searchValue = config.caseSensitive ? filterValue : filterValue.toLowerCase();
|
|
83944
83994
|
const targetValue = config.caseSensitive ? String(featureValue) : String(featureValue).toLowerCase();
|
|
83945
83995
|
return targetValue.includes(searchValue);
|
|
83946
|
-
case
|
|
83996
|
+
case FilterOperator.IN:
|
|
83947
83997
|
return Array.isArray(filterValue) && filterValue.includes(featureValue);
|
|
83948
|
-
case
|
|
83998
|
+
case FilterOperator.BETWEEN:
|
|
83949
83999
|
if (Array.isArray(filterValue) && filterValue.length === 2) {
|
|
83950
84000
|
const numValue = Number(featureValue);
|
|
83951
84001
|
return numValue >= Number(filterValue[0]) && numValue <= Number(filterValue[1]);
|
|
@@ -83961,7 +84011,7 @@ class KMLLayerHandler extends BaseLayer$2 {
|
|
|
83961
84011
|
* @deprecated 建议使用 addAttributeFilter 方法
|
|
83962
84012
|
*/
|
|
83963
84013
|
filterFeaturesByProperty(property, value) {
|
|
83964
|
-
this.addAttributeFilter("legacy", property, value,
|
|
84014
|
+
this.addAttributeFilter("legacy", property, value, FilterOperator.EQUAL, `${property} = ${value}`);
|
|
83965
84015
|
}
|
|
83966
84016
|
/**
|
|
83967
84017
|
* 便捷方法:清除所有过滤器(保持向后兼容)
|
|
@@ -84049,7 +84099,7 @@ class GMLLayerHandler extends BaseLayer$2 {
|
|
|
84049
84099
|
width: ((_j = (_i2 = styleConfig.circle) == null ? void 0 : _i2.stroke) == null ? void 0 : _j.width) || 1
|
|
84050
84100
|
})
|
|
84051
84101
|
}),
|
|
84052
|
-
text: styleConfig.text ? new Text({
|
|
84102
|
+
text: styleConfig.text ? new Text$5({
|
|
84053
84103
|
font: styleConfig.text.font || "12px Calibri,sans-serif",
|
|
84054
84104
|
fill: new Fill$2({
|
|
84055
84105
|
color: ((_k = styleConfig.text.fill) == null ? void 0 : _k.color) || "#000"
|
|
@@ -84217,25 +84267,22 @@ class GMLLayerHandler extends BaseLayer$2 {
|
|
|
84217
84267
|
});
|
|
84218
84268
|
return;
|
|
84219
84269
|
}
|
|
84270
|
+
const logic = this.getFilterLogic();
|
|
84220
84271
|
features2.forEach((feature2) => {
|
|
84221
|
-
|
|
84222
|
-
|
|
84223
|
-
if (!this.checkFeatureAgainstFilter(feature2, filter2)) {
|
|
84224
|
-
visible = false;
|
|
84225
|
-
break;
|
|
84226
|
-
}
|
|
84227
|
-
}
|
|
84272
|
+
const results = enabledFilters.map((filter2) => this.checkFeatureAgainstFilter(feature2, filter2));
|
|
84273
|
+
const visible = this.combineByLogic(results);
|
|
84228
84274
|
feature2.setStyle(visible ? void 0 : new Style$3({}));
|
|
84229
84275
|
});
|
|
84276
|
+
console.log(`GML图层应用 ${enabledFilters.length} 个过滤器,组合逻辑为 ${logic}`);
|
|
84230
84277
|
}
|
|
84231
84278
|
/**
|
|
84232
84279
|
* 检查要素是否符合过滤器条件
|
|
84233
84280
|
*/
|
|
84234
84281
|
checkFeatureAgainstFilter(feature2, filter2) {
|
|
84235
84282
|
switch (filter2.type) {
|
|
84236
|
-
case FilterType
|
|
84283
|
+
case FilterType.ATTRIBUTE:
|
|
84237
84284
|
return this.checkAttributeFilter(feature2, filter2);
|
|
84238
|
-
case FilterType
|
|
84285
|
+
case FilterType.CUSTOM:
|
|
84239
84286
|
const customConfig = filter2;
|
|
84240
84287
|
return customConfig.filterFunction(feature2);
|
|
84241
84288
|
default:
|
|
@@ -84249,30 +84296,30 @@ class GMLLayerHandler extends BaseLayer$2 {
|
|
|
84249
84296
|
checkAttributeFilter(feature2, config) {
|
|
84250
84297
|
const featureValue = feature2.get(config.property);
|
|
84251
84298
|
const filterValue = config.value;
|
|
84252
|
-
const operator = config.operator ||
|
|
84299
|
+
const operator = config.operator || FilterOperator.EQUAL;
|
|
84253
84300
|
if (featureValue === void 0 || featureValue === null) {
|
|
84254
84301
|
return false;
|
|
84255
84302
|
}
|
|
84256
84303
|
switch (operator) {
|
|
84257
|
-
case
|
|
84304
|
+
case FilterOperator.EQUAL:
|
|
84258
84305
|
return featureValue === filterValue;
|
|
84259
|
-
case
|
|
84306
|
+
case FilterOperator.NOT_EQUAL:
|
|
84260
84307
|
return featureValue !== filterValue;
|
|
84261
|
-
case
|
|
84308
|
+
case FilterOperator.GREATER_THAN:
|
|
84262
84309
|
return Number(featureValue) > Number(filterValue);
|
|
84263
|
-
case
|
|
84310
|
+
case FilterOperator.GREATER_EQUAL:
|
|
84264
84311
|
return Number(featureValue) >= Number(filterValue);
|
|
84265
|
-
case
|
|
84312
|
+
case FilterOperator.LESS_THAN:
|
|
84266
84313
|
return Number(featureValue) < Number(filterValue);
|
|
84267
|
-
case
|
|
84314
|
+
case FilterOperator.LESS_EQUAL:
|
|
84268
84315
|
return Number(featureValue) <= Number(filterValue);
|
|
84269
|
-
case
|
|
84316
|
+
case FilterOperator.LIKE:
|
|
84270
84317
|
const searchValue = config.caseSensitive ? filterValue : filterValue.toLowerCase();
|
|
84271
84318
|
const targetValue = config.caseSensitive ? String(featureValue) : String(featureValue).toLowerCase();
|
|
84272
84319
|
return targetValue.includes(searchValue);
|
|
84273
|
-
case
|
|
84320
|
+
case FilterOperator.IN:
|
|
84274
84321
|
return Array.isArray(filterValue) && filterValue.includes(featureValue);
|
|
84275
|
-
case
|
|
84322
|
+
case FilterOperator.BETWEEN:
|
|
84276
84323
|
if (Array.isArray(filterValue) && filterValue.length === 2) {
|
|
84277
84324
|
const numValue = Number(featureValue);
|
|
84278
84325
|
return numValue >= Number(filterValue[0]) && numValue <= Number(filterValue[1]);
|
|
@@ -84288,7 +84335,7 @@ class GMLLayerHandler extends BaseLayer$2 {
|
|
|
84288
84335
|
* @deprecated 建议使用 addAttributeFilter 方法
|
|
84289
84336
|
*/
|
|
84290
84337
|
filterFeaturesByProperty(property, value) {
|
|
84291
|
-
this.addAttributeFilter("legacy", property, value,
|
|
84338
|
+
this.addAttributeFilter("legacy", property, value, FilterOperator.EQUAL, `${property} = ${value}`);
|
|
84292
84339
|
}
|
|
84293
84340
|
/**
|
|
84294
84341
|
* 便捷方法:清除所有过滤器(保持向后兼容)
|
|
@@ -84431,7 +84478,7 @@ class WKTLayerHandler extends BaseLayer$2 {
|
|
|
84431
84478
|
width: ((_j = (_i2 = styleConfig.circle) == null ? void 0 : _i2.stroke) == null ? void 0 : _j.width) || 2
|
|
84432
84479
|
})
|
|
84433
84480
|
}),
|
|
84434
|
-
text: styleConfig.text ? new Text$
|
|
84481
|
+
text: styleConfig.text ? new Text$5({
|
|
84435
84482
|
font: styleConfig.text.font || "12px Calibri,sans-serif",
|
|
84436
84483
|
fill: new Fill$2({
|
|
84437
84484
|
color: ((_k = styleConfig.text.fill) == null ? void 0 : _k.color) || "#000"
|
|
@@ -84613,25 +84660,22 @@ class WKTLayerHandler extends BaseLayer$2 {
|
|
|
84613
84660
|
});
|
|
84614
84661
|
return;
|
|
84615
84662
|
}
|
|
84663
|
+
const logic = this.getFilterLogic();
|
|
84616
84664
|
features2.forEach((feature2) => {
|
|
84617
|
-
|
|
84618
|
-
|
|
84619
|
-
if (!this.checkFeatureAgainstFilter(feature2, filter2)) {
|
|
84620
|
-
visible = false;
|
|
84621
|
-
break;
|
|
84622
|
-
}
|
|
84623
|
-
}
|
|
84665
|
+
const results = enabledFilters.map((filter2) => this.checkFeatureAgainstFilter(feature2, filter2));
|
|
84666
|
+
const visible = this.combineByLogic(results);
|
|
84624
84667
|
feature2.setStyle(visible ? void 0 : new Style$3({}));
|
|
84625
84668
|
});
|
|
84669
|
+
console.log(`WKT图层应用 ${enabledFilters.length} 个过滤器,组合逻辑为 ${logic}`);
|
|
84626
84670
|
}
|
|
84627
84671
|
/**
|
|
84628
84672
|
* 检查要素是否符合过滤器条件
|
|
84629
84673
|
*/
|
|
84630
84674
|
checkFeatureAgainstFilter(feature2, filter2) {
|
|
84631
84675
|
switch (filter2.type) {
|
|
84632
|
-
case FilterType
|
|
84676
|
+
case FilterType.ATTRIBUTE:
|
|
84633
84677
|
return this.checkAttributeFilter(feature2, filter2);
|
|
84634
|
-
case FilterType
|
|
84678
|
+
case FilterType.CUSTOM:
|
|
84635
84679
|
const customConfig = filter2;
|
|
84636
84680
|
return customConfig.filterFunction(feature2);
|
|
84637
84681
|
default:
|
|
@@ -84645,30 +84689,30 @@ class WKTLayerHandler extends BaseLayer$2 {
|
|
|
84645
84689
|
checkAttributeFilter(feature2, config) {
|
|
84646
84690
|
const featureValue = feature2.get(config.property);
|
|
84647
84691
|
const filterValue = config.value;
|
|
84648
|
-
const operator = config.operator ||
|
|
84692
|
+
const operator = config.operator || FilterOperator.EQUAL;
|
|
84649
84693
|
if (featureValue === void 0 || featureValue === null) {
|
|
84650
84694
|
return false;
|
|
84651
84695
|
}
|
|
84652
84696
|
switch (operator) {
|
|
84653
|
-
case
|
|
84697
|
+
case FilterOperator.EQUAL:
|
|
84654
84698
|
return featureValue === filterValue;
|
|
84655
|
-
case
|
|
84699
|
+
case FilterOperator.NOT_EQUAL:
|
|
84656
84700
|
return featureValue !== filterValue;
|
|
84657
|
-
case
|
|
84701
|
+
case FilterOperator.GREATER_THAN:
|
|
84658
84702
|
return Number(featureValue) > Number(filterValue);
|
|
84659
|
-
case
|
|
84703
|
+
case FilterOperator.GREATER_EQUAL:
|
|
84660
84704
|
return Number(featureValue) >= Number(filterValue);
|
|
84661
|
-
case
|
|
84705
|
+
case FilterOperator.LESS_THAN:
|
|
84662
84706
|
return Number(featureValue) < Number(filterValue);
|
|
84663
|
-
case
|
|
84707
|
+
case FilterOperator.LESS_EQUAL:
|
|
84664
84708
|
return Number(featureValue) <= Number(filterValue);
|
|
84665
|
-
case
|
|
84709
|
+
case FilterOperator.LIKE:
|
|
84666
84710
|
const searchValue = config.caseSensitive ? filterValue : filterValue.toLowerCase();
|
|
84667
84711
|
const targetValue = config.caseSensitive ? String(featureValue) : String(featureValue).toLowerCase();
|
|
84668
84712
|
return targetValue.includes(searchValue);
|
|
84669
|
-
case
|
|
84713
|
+
case FilterOperator.IN:
|
|
84670
84714
|
return Array.isArray(filterValue) && filterValue.includes(featureValue);
|
|
84671
|
-
case
|
|
84715
|
+
case FilterOperator.BETWEEN:
|
|
84672
84716
|
if (Array.isArray(filterValue) && filterValue.length === 2) {
|
|
84673
84717
|
const numValue = Number(featureValue);
|
|
84674
84718
|
return numValue >= Number(filterValue[0]) && numValue <= Number(filterValue[1]);
|
|
@@ -84684,7 +84728,7 @@ class WKTLayerHandler extends BaseLayer$2 {
|
|
|
84684
84728
|
* @deprecated 建议使用 addAttributeFilter 方法
|
|
84685
84729
|
*/
|
|
84686
84730
|
filterFeaturesByProperty(property, value) {
|
|
84687
|
-
this.addAttributeFilter("legacy", property, value,
|
|
84731
|
+
this.addAttributeFilter("legacy", property, value, FilterOperator.EQUAL, `${property} = ${value}`);
|
|
84688
84732
|
}
|
|
84689
84733
|
/**
|
|
84690
84734
|
* 便捷方法:清除所有过滤器(保持向后兼容)
|
|
@@ -84776,29 +84820,32 @@ class HeatmapLayerHandler extends BaseLayer$2 {
|
|
|
84776
84820
|
}
|
|
84777
84821
|
}
|
|
84778
84822
|
/**
|
|
84779
|
-
*
|
|
84823
|
+
* 应用过滤器(实现基类的抽象方法)
|
|
84780
84824
|
*/
|
|
84781
|
-
applyFilters(
|
|
84782
|
-
|
|
84783
|
-
|
|
84825
|
+
applyFilters() {
|
|
84826
|
+
const enabledFilters = this.getEnabledFilters();
|
|
84827
|
+
console.log("HeatmapLayerHandler: 应用过滤器", enabledFilters);
|
|
84828
|
+
this.currentFilters = [...enabledFilters];
|
|
84784
84829
|
const layer2 = this.getLayer();
|
|
84785
84830
|
const source = layer2.getSource();
|
|
84786
84831
|
if (!source || this.originalFeatures.length === 0) {
|
|
84787
84832
|
console.warn("HeatmapLayerHandler: 无法应用过滤器 - 数据源或原始要素为空");
|
|
84788
84833
|
return;
|
|
84789
84834
|
}
|
|
84790
|
-
if (
|
|
84835
|
+
if (enabledFilters.length === 0) {
|
|
84791
84836
|
source.clear();
|
|
84792
84837
|
source.addFeatures(this.originalFeatures);
|
|
84793
84838
|
console.log("HeatmapLayerHandler: 清除所有过滤器,显示所有要素");
|
|
84794
84839
|
return;
|
|
84795
84840
|
}
|
|
84841
|
+
const logic = this.getFilterLogic();
|
|
84796
84842
|
const filteredFeatures = this.originalFeatures.filter((feature2) => {
|
|
84797
|
-
|
|
84843
|
+
const results = enabledFilters.map((f2) => this.checkFeatureAgainstFilter(feature2, f2));
|
|
84844
|
+
return this.combineByLogic(results);
|
|
84798
84845
|
});
|
|
84799
84846
|
source.clear();
|
|
84800
84847
|
source.addFeatures(filteredFeatures);
|
|
84801
|
-
console.log(`HeatmapLayerHandler:
|
|
84848
|
+
console.log(`HeatmapLayerHandler: 过滤完成(${logic}),显示 ${filteredFeatures.length}/${this.originalFeatures.length} 个要素`);
|
|
84802
84849
|
}
|
|
84803
84850
|
/**
|
|
84804
84851
|
* 检查要素是否符合过滤条件
|
|
@@ -84833,9 +84880,9 @@ class HeatmapLayerHandler extends BaseLayer$2 {
|
|
|
84833
84880
|
return Number(value) > Number(config.value);
|
|
84834
84881
|
case FilterOperator.LESS_THAN:
|
|
84835
84882
|
return Number(value) < Number(config.value);
|
|
84836
|
-
case FilterOperator.
|
|
84883
|
+
case FilterOperator.GREATER_EQUAL:
|
|
84837
84884
|
return Number(value) >= Number(config.value);
|
|
84838
|
-
case FilterOperator.
|
|
84885
|
+
case FilterOperator.LESS_EQUAL:
|
|
84839
84886
|
return Number(value) <= Number(config.value);
|
|
84840
84887
|
case FilterOperator.LIKE:
|
|
84841
84888
|
const pattern = String(config.value).replace(/%/g, ".*");
|
|
@@ -84865,27 +84912,20 @@ class HeatmapLayerHandler extends BaseLayer$2 {
|
|
|
84865
84912
|
* 根据属性过滤要素(便捷方法)
|
|
84866
84913
|
*/
|
|
84867
84914
|
filterFeaturesByProperty(property, value, operator = FilterOperator.EQUAL) {
|
|
84868
|
-
const
|
|
84869
|
-
|
|
84870
|
-
config: {
|
|
84871
|
-
property,
|
|
84872
|
-
operator,
|
|
84873
|
-
value
|
|
84874
|
-
}
|
|
84875
|
-
};
|
|
84876
|
-
this.applyFilters([filter2]);
|
|
84915
|
+
const id = `heatmap-attr-${property}-${Date.now()}`;
|
|
84916
|
+
this.addAttributeFilter(id, property, value, operator);
|
|
84877
84917
|
}
|
|
84878
84918
|
/**
|
|
84879
84919
|
* 清除所有过滤器
|
|
84880
84920
|
*/
|
|
84881
84921
|
clearAllFeatureFilters() {
|
|
84882
|
-
this.
|
|
84922
|
+
this.clearAllFilters();
|
|
84883
84923
|
}
|
|
84884
84924
|
/**
|
|
84885
84925
|
* 获取当前应用的过滤器
|
|
84886
84926
|
*/
|
|
84887
84927
|
getCurrentFilters() {
|
|
84888
|
-
return
|
|
84928
|
+
return this.getEnabledFilters();
|
|
84889
84929
|
}
|
|
84890
84930
|
/**
|
|
84891
84931
|
* 获取原始要素数量(未过滤的)
|
|
@@ -84955,7 +84995,7 @@ class HeatmapLayerHandler extends BaseLayer$2 {
|
|
|
84955
84995
|
this.originalFeatures.push(...features2);
|
|
84956
84996
|
source.addFeatures(features2);
|
|
84957
84997
|
if (this.currentFilters.length > 0) {
|
|
84958
|
-
this.applyFilters(
|
|
84998
|
+
this.applyFilters();
|
|
84959
84999
|
}
|
|
84960
85000
|
}
|
|
84961
85001
|
}
|
|
@@ -85026,28 +85066,31 @@ class ClusterLayerHandler extends BaseLayer$2 {
|
|
|
85026
85066
|
}
|
|
85027
85067
|
}
|
|
85028
85068
|
/**
|
|
85029
|
-
*
|
|
85069
|
+
* 应用过滤器(实现基类的抽象方法)
|
|
85030
85070
|
*/
|
|
85031
|
-
applyFilters(
|
|
85032
|
-
|
|
85033
|
-
|
|
85071
|
+
applyFilters() {
|
|
85072
|
+
const enabledFilters = this.getEnabledFilters();
|
|
85073
|
+
console.log("ClusterLayerHandler: 应用过滤器", enabledFilters);
|
|
85074
|
+
this.currentFilters = [...enabledFilters];
|
|
85034
85075
|
const vectorSource = this.getVectorSource();
|
|
85035
85076
|
if (!vectorSource || this.originalFeatures.length === 0) {
|
|
85036
85077
|
console.warn("ClusterLayerHandler: 无法应用过滤器 - 数据源或原始要素为空");
|
|
85037
85078
|
return;
|
|
85038
85079
|
}
|
|
85039
|
-
if (
|
|
85080
|
+
if (enabledFilters.length === 0) {
|
|
85040
85081
|
vectorSource.clear();
|
|
85041
85082
|
vectorSource.addFeatures(this.originalFeatures);
|
|
85042
85083
|
console.log("ClusterLayerHandler: 清除所有过滤器,显示所有要素");
|
|
85043
85084
|
return;
|
|
85044
85085
|
}
|
|
85086
|
+
const logic = this.getFilterLogic();
|
|
85045
85087
|
const filteredFeatures = this.originalFeatures.filter((feature2) => {
|
|
85046
|
-
|
|
85088
|
+
const results = enabledFilters.map((f2) => this.checkFeatureAgainstFilter(feature2, f2));
|
|
85089
|
+
return this.combineByLogic(results);
|
|
85047
85090
|
});
|
|
85048
85091
|
vectorSource.clear();
|
|
85049
85092
|
vectorSource.addFeatures(filteredFeatures);
|
|
85050
|
-
console.log(`ClusterLayerHandler:
|
|
85093
|
+
console.log(`ClusterLayerHandler: 过滤完成(${logic}),显示 ${filteredFeatures.length}/${this.originalFeatures.length} 个要素`);
|
|
85051
85094
|
}
|
|
85052
85095
|
/**
|
|
85053
85096
|
* 检查要素是否符合过滤条件
|
|
@@ -85082,9 +85125,9 @@ class ClusterLayerHandler extends BaseLayer$2 {
|
|
|
85082
85125
|
return Number(value) > Number(config.value);
|
|
85083
85126
|
case FilterOperator.LESS_THAN:
|
|
85084
85127
|
return Number(value) < Number(config.value);
|
|
85085
|
-
case FilterOperator.
|
|
85128
|
+
case FilterOperator.GREATER_EQUAL:
|
|
85086
85129
|
return Number(value) >= Number(config.value);
|
|
85087
|
-
case FilterOperator.
|
|
85130
|
+
case FilterOperator.LESS_EQUAL:
|
|
85088
85131
|
return Number(value) <= Number(config.value);
|
|
85089
85132
|
case FilterOperator.LIKE:
|
|
85090
85133
|
const pattern = String(config.value).replace(/%/g, ".*");
|
|
@@ -85114,27 +85157,20 @@ class ClusterLayerHandler extends BaseLayer$2 {
|
|
|
85114
85157
|
* 根据属性过滤要素(便捷方法)
|
|
85115
85158
|
*/
|
|
85116
85159
|
filterFeaturesByProperty(property, value, operator = FilterOperator.EQUAL) {
|
|
85117
|
-
const
|
|
85118
|
-
|
|
85119
|
-
config: {
|
|
85120
|
-
property,
|
|
85121
|
-
operator,
|
|
85122
|
-
value
|
|
85123
|
-
}
|
|
85124
|
-
};
|
|
85125
|
-
this.applyFilters([filter2]);
|
|
85160
|
+
const id = `cluster-attr-${property}-${Date.now()}`;
|
|
85161
|
+
this.addAttributeFilter(id, property, value, operator);
|
|
85126
85162
|
}
|
|
85127
85163
|
/**
|
|
85128
85164
|
* 清除所有过滤器
|
|
85129
85165
|
*/
|
|
85130
85166
|
clearAllFeatureFilters() {
|
|
85131
|
-
this.
|
|
85167
|
+
this.clearAllFilters();
|
|
85132
85168
|
}
|
|
85133
85169
|
/**
|
|
85134
85170
|
* 获取当前应用的过滤器
|
|
85135
85171
|
*/
|
|
85136
85172
|
getCurrentFilters() {
|
|
85137
|
-
return
|
|
85173
|
+
return this.getEnabledFilters();
|
|
85138
85174
|
}
|
|
85139
85175
|
/**
|
|
85140
85176
|
* 获取原始要素数量(未过滤的)
|
|
@@ -85154,10 +85190,7 @@ class ClusterLayerHandler extends BaseLayer$2 {
|
|
|
85154
85190
|
*/
|
|
85155
85191
|
createClusterStyleFunction() {
|
|
85156
85192
|
this.parseStyleConfig();
|
|
85157
|
-
return styleManager.createClusterStyleFunction(
|
|
85158
|
-
this.clusterStyleConfig,
|
|
85159
|
-
this.singleFeatureStyleConfig
|
|
85160
|
-
);
|
|
85193
|
+
return styleManager.createClusterStyleFunction(this.clusterStyleConfig, this.singleFeatureStyleConfig);
|
|
85161
85194
|
}
|
|
85162
85195
|
/**
|
|
85163
85196
|
* 解析样式配置
|
|
@@ -85177,7 +85210,6 @@ class ClusterLayerHandler extends BaseLayer$2 {
|
|
|
85177
85210
|
return {
|
|
85178
85211
|
circle: {
|
|
85179
85212
|
radius: 15,
|
|
85180
|
-
// 动态半径将在样式管理器中处理
|
|
85181
85213
|
fill: { color: legacyStyle.clusterFillColor || "rgba(255, 153, 0, 0.8)" },
|
|
85182
85214
|
stroke: {
|
|
85183
85215
|
color: legacyStyle.clusterStrokeColor || "#fff",
|
|
@@ -85251,7 +85283,7 @@ class ClusterLayerHandler extends BaseLayer$2 {
|
|
|
85251
85283
|
this.originalFeatures.push(...olFeatures);
|
|
85252
85284
|
vectorSource.addFeatures(olFeatures);
|
|
85253
85285
|
if (this.currentFilters.length > 0) {
|
|
85254
|
-
this.applyFilters(
|
|
85286
|
+
this.applyFilters();
|
|
85255
85287
|
}
|
|
85256
85288
|
}
|
|
85257
85289
|
}
|
|
@@ -85352,13 +85384,9 @@ class ImageVectorLayerHandler extends BaseLayer$2 {
|
|
|
85352
85384
|
style: this.createStyleFunction(),
|
|
85353
85385
|
// ImageVector图层特有的配置
|
|
85354
85386
|
imageRatio: this.config.imageRatio || 1,
|
|
85355
|
-
// 图像比率,用于高分辨率显示
|
|
85356
85387
|
renderBuffer: this.config.renderBuffer || 100,
|
|
85357
|
-
// 渲染缓冲区
|
|
85358
85388
|
renderOrder: this.config.renderOrder,
|
|
85359
|
-
// 渲染顺序
|
|
85360
85389
|
background: this.config.background,
|
|
85361
|
-
// 背景色
|
|
85362
85390
|
declutter: this.config.declutter || false
|
|
85363
85391
|
// 是否启用标注避让
|
|
85364
85392
|
});
|
|
@@ -85467,11 +85495,7 @@ class ImageVectorLayerHandler extends BaseLayer$2 {
|
|
|
85467
85495
|
* 设置基于属性的样式
|
|
85468
85496
|
*/
|
|
85469
85497
|
setPropertyBasedStyle(propertyName, styleMapping, defaultStyleConfig) {
|
|
85470
|
-
const styleFunction = styleManager.createPropertyBasedStyleFunction(
|
|
85471
|
-
propertyName,
|
|
85472
|
-
styleMapping,
|
|
85473
|
-
defaultStyleConfig
|
|
85474
|
-
);
|
|
85498
|
+
const styleFunction = styleManager.createPropertyBasedStyleFunction(propertyName, styleMapping, defaultStyleConfig);
|
|
85475
85499
|
const layer2 = this.getLayer();
|
|
85476
85500
|
layer2.setStyle(styleFunction);
|
|
85477
85501
|
}
|
|
@@ -85596,7 +85620,6 @@ class SuperMapTiledMapServiceHandler extends BaseLayer$2 {
|
|
|
85596
85620
|
xyzOptions.tileGrid = new TileGrid$3({
|
|
85597
85621
|
extent: extent3,
|
|
85598
85622
|
origin: [-180, 90],
|
|
85599
|
-
// 左上角原点
|
|
85600
85623
|
resolutions: this.generateResolutions(),
|
|
85601
85624
|
tileSize: [256, 256]
|
|
85602
85625
|
});
|
|
@@ -280883,38 +280906,38 @@ var Rect$1 = (
|
|
|
280883
280906
|
return Rect2;
|
|
280884
280907
|
}(ShapeBase$1)
|
|
280885
280908
|
);
|
|
280886
|
-
var Text$
|
|
280909
|
+
var Text$3 = (
|
|
280887
280910
|
/** @class */
|
|
280888
280911
|
function(_super) {
|
|
280889
|
-
__extends$B(
|
|
280890
|
-
function
|
|
280912
|
+
__extends$B(Text3, _super);
|
|
280913
|
+
function Text3() {
|
|
280891
280914
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
280892
280915
|
}
|
|
280893
|
-
|
|
280916
|
+
Text3.prototype.getDefaultAttrs = function() {
|
|
280894
280917
|
var attrs = _super.prototype.getDefaultAttrs.call(this);
|
|
280895
280918
|
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" });
|
|
280896
280919
|
};
|
|
280897
|
-
|
|
280920
|
+
Text3.prototype.isOnlyHitBox = function() {
|
|
280898
280921
|
return true;
|
|
280899
280922
|
};
|
|
280900
|
-
|
|
280923
|
+
Text3.prototype.initAttrs = function(attrs) {
|
|
280901
280924
|
this._assembleFont();
|
|
280902
280925
|
if (attrs.text) {
|
|
280903
280926
|
this._setText(attrs.text);
|
|
280904
280927
|
}
|
|
280905
280928
|
};
|
|
280906
|
-
|
|
280929
|
+
Text3.prototype._assembleFont = function() {
|
|
280907
280930
|
var attrs = this.attrs;
|
|
280908
280931
|
attrs.font = assembleFont(attrs);
|
|
280909
280932
|
};
|
|
280910
|
-
|
|
280933
|
+
Text3.prototype._setText = function(text2) {
|
|
280911
280934
|
var textArr = null;
|
|
280912
280935
|
if (isString$2(text2) && text2.indexOf("\n") !== -1) {
|
|
280913
280936
|
textArr = text2.split("\n");
|
|
280914
280937
|
}
|
|
280915
280938
|
this.set("textArr", textArr);
|
|
280916
280939
|
};
|
|
280917
|
-
|
|
280940
|
+
Text3.prototype.onAttrChange = function(name, value, originValue) {
|
|
280918
280941
|
_super.prototype.onAttrChange.call(this, name, value, originValue);
|
|
280919
280942
|
if (name.startsWith("font")) {
|
|
280920
280943
|
this._assembleFont();
|
|
@@ -280923,13 +280946,13 @@ var Text$4 = (
|
|
|
280923
280946
|
this._setText(value);
|
|
280924
280947
|
}
|
|
280925
280948
|
};
|
|
280926
|
-
|
|
280949
|
+
Text3.prototype._getSpaceingY = function() {
|
|
280927
280950
|
var attrs = this.attrs;
|
|
280928
280951
|
var lineHeight2 = attrs.lineHeight;
|
|
280929
280952
|
var fontSize2 = attrs.fontSize * 1;
|
|
280930
280953
|
return lineHeight2 ? lineHeight2 - fontSize2 : fontSize2 * 0.14;
|
|
280931
280954
|
};
|
|
280932
|
-
|
|
280955
|
+
Text3.prototype._drawTextArr = function(context, textArr, isFill) {
|
|
280933
280956
|
var attrs = this.attrs;
|
|
280934
280957
|
var textBaseline = attrs.textBaseline;
|
|
280935
280958
|
var x2 = attrs.x;
|
|
@@ -280953,7 +280976,7 @@ var Text$4 = (
|
|
|
280953
280976
|
}
|
|
280954
280977
|
});
|
|
280955
280978
|
};
|
|
280956
|
-
|
|
280979
|
+
Text3.prototype._drawText = function(context, isFill) {
|
|
280957
280980
|
var attrs = this.attr();
|
|
280958
280981
|
var x2 = attrs.x;
|
|
280959
280982
|
var y2 = attrs.y;
|
|
@@ -280971,7 +280994,7 @@ var Text$4 = (
|
|
|
280971
280994
|
}
|
|
280972
280995
|
}
|
|
280973
280996
|
};
|
|
280974
|
-
|
|
280997
|
+
Text3.prototype.strokeAndFill = function(context) {
|
|
280975
280998
|
var _a3 = this.attrs, lineWidth = _a3.lineWidth, opacity2 = _a3.opacity, strokeOpacity = _a3.strokeOpacity, fillOpacity = _a3.fillOpacity;
|
|
280976
280999
|
if (this.isStroke()) {
|
|
280977
281000
|
if (lineWidth > 0) {
|
|
@@ -280992,13 +281015,13 @@ var Text$4 = (
|
|
|
280992
281015
|
}
|
|
280993
281016
|
this.afterDrawPath(context);
|
|
280994
281017
|
};
|
|
280995
|
-
|
|
281018
|
+
Text3.prototype.fill = function(context) {
|
|
280996
281019
|
this._drawText(context, true);
|
|
280997
281020
|
};
|
|
280998
|
-
|
|
281021
|
+
Text3.prototype.stroke = function(context) {
|
|
280999
281022
|
this._drawText(context, false);
|
|
281000
281023
|
};
|
|
281001
|
-
return
|
|
281024
|
+
return Text3;
|
|
281002
281025
|
}(ShapeBase$1)
|
|
281003
281026
|
);
|
|
281004
281027
|
function invertFromMatrix(v5, matrix2) {
|
|
@@ -282367,22 +282390,22 @@ var ANCHOR_MAP = {
|
|
|
282367
282390
|
right: "end",
|
|
282368
282391
|
end: "end"
|
|
282369
282392
|
};
|
|
282370
|
-
var Text$
|
|
282393
|
+
var Text$2 = (
|
|
282371
282394
|
/** @class */
|
|
282372
282395
|
function(_super) {
|
|
282373
|
-
__extends$A(
|
|
282374
|
-
function
|
|
282396
|
+
__extends$A(Text3, _super);
|
|
282397
|
+
function Text3() {
|
|
282375
282398
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
282376
282399
|
_this.type = "text";
|
|
282377
282400
|
_this.canFill = true;
|
|
282378
282401
|
_this.canStroke = true;
|
|
282379
282402
|
return _this;
|
|
282380
282403
|
}
|
|
282381
|
-
|
|
282404
|
+
Text3.prototype.getDefaultAttrs = function() {
|
|
282382
282405
|
var attrs = _super.prototype.getDefaultAttrs.call(this);
|
|
282383
282406
|
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" });
|
|
282384
282407
|
};
|
|
282385
|
-
|
|
282408
|
+
Text3.prototype.createPath = function(context, targetAttrs) {
|
|
282386
282409
|
var _this = this;
|
|
282387
282410
|
var attrs = this.attr();
|
|
282388
282411
|
var el = this.get("el");
|
|
@@ -282399,7 +282422,7 @@ var Text$3 = (
|
|
|
282399
282422
|
el.setAttribute("paint-order", "stroke");
|
|
282400
282423
|
el.setAttribute("style", "stroke-linecap:butt; stroke-linejoin:miter;");
|
|
282401
282424
|
};
|
|
282402
|
-
|
|
282425
|
+
Text3.prototype._setFont = function() {
|
|
282403
282426
|
var el = this.get("el");
|
|
282404
282427
|
var _a3 = this.attr(), textBaseline = _a3.textBaseline, textAlign2 = _a3.textAlign;
|
|
282405
282428
|
var browser2 = detect();
|
|
@@ -282410,7 +282433,7 @@ var Text$3 = (
|
|
|
282410
282433
|
}
|
|
282411
282434
|
el.setAttribute("text-anchor", ANCHOR_MAP[textAlign2] || "left");
|
|
282412
282435
|
};
|
|
282413
|
-
|
|
282436
|
+
Text3.prototype._setText = function(text2) {
|
|
282414
282437
|
var el = this.get("el");
|
|
282415
282438
|
var _a3 = this.attr(), x2 = _a3.x, _b3 = _a3.textBaseline, baseline = _b3 === void 0 ? "bottom" : _b3;
|
|
282416
282439
|
if (!text2) {
|
|
@@ -282441,7 +282464,7 @@ var Text$3 = (
|
|
|
282441
282464
|
el.innerHTML = text2;
|
|
282442
282465
|
}
|
|
282443
282466
|
};
|
|
282444
|
-
return
|
|
282467
|
+
return Text3;
|
|
282445
282468
|
}(ShapeBase)
|
|
282446
282469
|
);
|
|
282447
282470
|
var regexLG$1 = /^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i;
|
|
@@ -365748,7 +365771,7 @@ function defaultGeometryFunction(feature2) {
|
|
|
365748
365771
|
}
|
|
365749
365772
|
const Style$1 = Style2;
|
|
365750
365773
|
const DEFAULT_FILL_COLOR = "#333";
|
|
365751
|
-
|
|
365774
|
+
class Text2 {
|
|
365752
365775
|
/**
|
|
365753
365776
|
* @param {Options} [options] Options.
|
|
365754
365777
|
*/
|
|
@@ -365784,7 +365807,7 @@ let Text$1 = class Text3 {
|
|
|
365784
365807
|
*/
|
|
365785
365808
|
clone() {
|
|
365786
365809
|
const scale3 = this.getScale();
|
|
365787
|
-
return new
|
|
365810
|
+
return new Text2({
|
|
365788
365811
|
font: this.getFont(),
|
|
365789
365812
|
placement: this.getPlacement(),
|
|
365790
365813
|
repeat: this.getRepeat(),
|
|
@@ -366163,8 +366186,8 @@ let Text$1 = class Text3 {
|
|
|
366163
366186
|
setPadding(padding2) {
|
|
366164
366187
|
this.padding_ = padding2;
|
|
366165
366188
|
}
|
|
366166
|
-
}
|
|
366167
|
-
const Text$
|
|
366189
|
+
}
|
|
366190
|
+
const Text$1 = Text2;
|
|
366168
366191
|
const HIT_DETECT_RESOLUTION = 0.5;
|
|
366169
366192
|
function createHitDetectionImageData(size2, transforms2, features2, styleFunction, extent3, resolution, rotation, squaredTolerance, projection2) {
|
|
366170
366193
|
const userExtent = projection2 ? toUserExtent(extent3) : extent3;
|
|
@@ -368828,7 +368851,7 @@ function buildText(flatStyle, context) {
|
|
|
368828
368851
|
flatStyle,
|
|
368829
368852
|
prefix + "declutter-mode"
|
|
368830
368853
|
);
|
|
368831
|
-
const text2 = new Text$
|
|
368854
|
+
const text2 = new Text$1({ declutterMode });
|
|
368832
368855
|
return function(context2) {
|
|
368833
368856
|
text2.setText(evaluateValue(context2));
|
|
368834
368857
|
if (evaluateFill) {
|
|
@@ -378681,7 +378704,7 @@ class StyleUtils {
|
|
|
378681
378704
|
*/
|
|
378682
378705
|
static toOLTextStyle(style, text2) {
|
|
378683
378706
|
return new Style$1({
|
|
378684
|
-
text: new Text$
|
|
378707
|
+
text: new Text$1({
|
|
378685
378708
|
font: (style.fontStyle || "") + " " + (style.fontWeight || "") + " " + (style.fontSize || "") + " " + style.fontFamily,
|
|
378686
378709
|
text: text2,
|
|
378687
378710
|
textAlign: style.textAlign,
|
|
@@ -379326,7 +379349,7 @@ class StyleUtils {
|
|
|
379326
379349
|
const { offsetX, offsetY, rotation = 0 } = parameters;
|
|
379327
379350
|
const offset = StyleUtils.getTextOffset(fontSize2, offsetX, offsetY);
|
|
379328
379351
|
return new Style$1({
|
|
379329
|
-
text: new Text$
|
|
379352
|
+
text: new Text$1({
|
|
379330
379353
|
text: text2,
|
|
379331
379354
|
font: fontSize2 + " supermapol-icons",
|
|
379332
379355
|
placement: "point",
|
|
@@ -438926,7 +438949,7 @@ class VectorTileStyles extends Observable$1 {
|
|
|
438926
438949
|
}
|
|
438927
438950
|
function getDefaultSelectedTextStyle() {
|
|
438928
438951
|
return new Style$1({
|
|
438929
|
-
text: new Text$
|
|
438952
|
+
text: new Text$1({
|
|
438930
438953
|
font: "15px Microsoft YaHei",
|
|
438931
438954
|
fill: new FillStyle({
|
|
438932
438955
|
color: "blue"
|
|
@@ -445042,7 +445065,7 @@ class MapboxStyles extends Observable$1 {
|
|
|
445042
445065
|
color: "rgba(255, 0, 0, 1)",
|
|
445043
445066
|
width: 10
|
|
445044
445067
|
}),
|
|
445045
|
-
text: new Text$
|
|
445068
|
+
text: new Text$1({
|
|
445046
445069
|
font: 'normal 400 11.19px "Microsoft YaHei"',
|
|
445047
445070
|
placement: "point",
|
|
445048
445071
|
fill: new FillStyle({
|
|
@@ -449326,7 +449349,7 @@ class Graticule extends VectorLayer$1 {
|
|
|
449326
449349
|
this.lonLabelPosition_ = options.lonLabelPosition == void 0 ? 0 : options.lonLabelPosition;
|
|
449327
449350
|
this.latLabelPosition_ = options.latLabelPosition == void 0 ? 1 : options.latLabelPosition;
|
|
449328
449351
|
this.lonLabelStyleBase_ = new Style$1({
|
|
449329
|
-
text: options.lonLabelStyle !== void 0 ? options.lonLabelStyle.clone() : new Text$
|
|
449352
|
+
text: options.lonLabelStyle !== void 0 ? options.lonLabelStyle.clone() : new Text$1({
|
|
449330
449353
|
font: "12px Calibri,sans-serif",
|
|
449331
449354
|
textBaseline: "bottom",
|
|
449332
449355
|
fill: new FillStyle({
|
|
@@ -449344,7 +449367,7 @@ class Graticule extends VectorLayer$1 {
|
|
|
449344
449367
|
return this.lonLabelStyleBase_;
|
|
449345
449368
|
};
|
|
449346
449369
|
this.latLabelStyleBase_ = new Style$1({
|
|
449347
|
-
text: options.latLabelStyle !== void 0 ? options.latLabelStyle.clone() : new Text$
|
|
449370
|
+
text: options.latLabelStyle !== void 0 ? options.latLabelStyle.clone() : new Text$1({
|
|
449348
449371
|
font: "12px Calibri,sans-serif",
|
|
449349
449372
|
textAlign: "right",
|
|
449350
449373
|
fill: new FillStyle({
|
|
@@ -462004,7 +462027,7 @@ class WebMap extends Observable$1 {
|
|
|
462004
462027
|
});
|
|
462005
462028
|
}
|
|
462006
462029
|
return new Style$1({
|
|
462007
|
-
text: new Text$
|
|
462030
|
+
text: new Text$1(option)
|
|
462008
462031
|
});
|
|
462009
462032
|
}
|
|
462010
462033
|
/**
|
|
@@ -463822,7 +463845,7 @@ class WebMap extends Observable$1 {
|
|
|
463822
463845
|
wrapX: false,
|
|
463823
463846
|
targetSize: 0
|
|
463824
463847
|
};
|
|
463825
|
-
lonLabelStyle && (graticuleOptions.lonLabelStyle = new Text$
|
|
463848
|
+
lonLabelStyle && (graticuleOptions.lonLabelStyle = new Text$1({
|
|
463826
463849
|
font: `${lonLabelStyle.fontSize} ${lonLabelStyle.fontFamily}`,
|
|
463827
463850
|
textBaseline: lonLabelStyle.textBaseline,
|
|
463828
463851
|
fill: new FillStyle({
|
|
@@ -463833,7 +463856,7 @@ class WebMap extends Observable$1 {
|
|
|
463833
463856
|
width: lonLabelStyle.outlineWidth
|
|
463834
463857
|
})
|
|
463835
463858
|
}));
|
|
463836
|
-
latLabelStyle && (graticuleOptions.latLabelStyle = new Text$
|
|
463859
|
+
latLabelStyle && (graticuleOptions.latLabelStyle = new Text$1({
|
|
463837
463860
|
font: `${latLabelStyle.fontSize} ${latLabelStyle.fontFamily}`,
|
|
463838
463861
|
textBaseline: latLabelStyle.textBaseline,
|
|
463839
463862
|
fill: new FillStyle({
|
|
@@ -464438,13 +464461,9 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464438
464461
|
if (config.center && config.center.length >= 2) {
|
|
464439
464462
|
const layerCenter = config.center;
|
|
464440
464463
|
const isInView = layerCenter[0] >= mapExtent[0] && layerCenter[0] <= mapExtent[2] && layerCenter[1] >= mapExtent[1] && layerCenter[1] <= mapExtent[3];
|
|
464441
|
-
console.log(
|
|
464442
|
-
`图层中心点 [${layerCenter[0]}, ${layerCenter[1]}] 是否在当前视图内: ${isInView}`
|
|
464443
|
-
);
|
|
464464
|
+
console.log(`图层中心点 [${layerCenter[0]}, ${layerCenter[1]}] 是否在当前视图内: ${isInView}`);
|
|
464444
464465
|
if (!isInView) {
|
|
464445
|
-
console.warn(
|
|
464446
|
-
`⚠️ 图层 ${config.name} 的中心点不在当前地图视图范围内,可能需要缩放到图层位置`
|
|
464447
|
-
);
|
|
464466
|
+
console.warn(`⚠️ 图层 ${config.name} 的中心点不在当前地图视图范围内,可能需要缩放到图层位置`);
|
|
464448
464467
|
}
|
|
464449
464468
|
}
|
|
464450
464469
|
}
|
|
@@ -464456,9 +464475,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464456
464475
|
if (this.styleApplied || this.styleApplyAttempts >= this.maxStyleApplyAttempts)
|
|
464457
464476
|
return;
|
|
464458
464477
|
this.styleApplyAttempts++;
|
|
464459
|
-
console.log(
|
|
464460
|
-
`尝试应用样式到SuperMap图层 ${this.config.name},第 ${this.styleApplyAttempts} 次`
|
|
464461
|
-
);
|
|
464478
|
+
console.log(`尝试应用样式到SuperMap图层 ${this.config.name},第 ${this.styleApplyAttempts} 次`);
|
|
464462
464479
|
setTimeout(() => {
|
|
464463
464480
|
if (this.layer && this.config.style) {
|
|
464464
464481
|
try {
|
|
@@ -464466,10 +464483,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464466
464483
|
this.styleApplied = true;
|
|
464467
464484
|
console.log(`成功应用样式到SuperMap图层 ${this.config.name}`);
|
|
464468
464485
|
} catch (error2) {
|
|
464469
|
-
console.warn(
|
|
464470
|
-
`应用样式到SuperMap图层 ${this.config.name} 失败:`,
|
|
464471
|
-
error2
|
|
464472
|
-
);
|
|
464486
|
+
console.warn(`应用样式到SuperMap图层 ${this.config.name} 失败:`, error2);
|
|
464473
464487
|
if (this.styleApplyAttempts < this.maxStyleApplyAttempts) {
|
|
464474
464488
|
setTimeout(() => this.tryApplyStyles(), 500);
|
|
464475
464489
|
}
|
|
@@ -464522,7 +464536,6 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464522
464536
|
const sourceOptions = {
|
|
464523
464537
|
url: config.url,
|
|
464524
464538
|
wrapX: true,
|
|
464525
|
-
// SuperMap服务通常不需要wrapX
|
|
464526
464539
|
format: config.format || "webp"
|
|
464527
464540
|
};
|
|
464528
464541
|
try {
|
|
@@ -464563,19 +464576,13 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464563
464576
|
console.log("📏 瓦片大小:", tileSize);
|
|
464564
464577
|
} else {
|
|
464565
464578
|
console.warn("map.json中没有bounds信息,使用默认配置");
|
|
464566
|
-
const tileGrid = await this.createTileGrid(
|
|
464567
|
-
projection2.getCode(),
|
|
464568
|
-
config
|
|
464569
|
-
);
|
|
464579
|
+
const tileGrid = await this.createTileGrid(projection2.getCode(), config);
|
|
464570
464580
|
if (tileGrid)
|
|
464571
464581
|
sourceOptions.tileGrid = tileGrid;
|
|
464572
464582
|
}
|
|
464573
464583
|
} else {
|
|
464574
464584
|
console.warn(`无法获取map.json (${response.status}), 使用默认配置`);
|
|
464575
|
-
const tileGrid = await this.createTileGrid(
|
|
464576
|
-
projection2.getCode(),
|
|
464577
|
-
config
|
|
464578
|
-
);
|
|
464585
|
+
const tileGrid = await this.createTileGrid(projection2.getCode(), config);
|
|
464579
464586
|
if (tileGrid)
|
|
464580
464587
|
sourceOptions.tileGrid = tileGrid;
|
|
464581
464588
|
}
|
|
@@ -464612,7 +464619,6 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464612
464619
|
origin,
|
|
464613
464620
|
extent: extent3,
|
|
464614
464621
|
resolutions,
|
|
464615
|
-
// 只显示前5个分辨率
|
|
464616
464622
|
tileSize,
|
|
464617
464623
|
configOrigin: config.origin,
|
|
464618
464624
|
calculatedOrigin: [extent3[0], extent3[3]]
|
|
@@ -464759,12 +464765,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464759
464765
|
* @returns Promise<any[]> 查询到的要素数组
|
|
464760
464766
|
*/
|
|
464761
464767
|
async queryFeatureByPointOL(lon2, lat2, options = {}) {
|
|
464762
|
-
const {
|
|
464763
|
-
datasetNames = ["hms:Football_field"],
|
|
464764
|
-
serviceUrl = "http://172.16.201.151/iserver/services/data-hms-public/rest/data",
|
|
464765
|
-
tolerance: tolerance2 = 0.027,
|
|
464766
|
-
vectorLayer = null
|
|
464767
|
-
} = options;
|
|
464768
|
+
const { datasetNames = ["hms:Football_field"], serviceUrl = "http://172.16.201.151/iserver/services/data-hms-public/rest/data", tolerance: tolerance2 = 0.027, vectorLayer = null } = options;
|
|
464768
464769
|
const point2 = new Point$b([lon2, lat2]);
|
|
464769
464770
|
let smGeom = Util2.toSuperMapGeometry(point2);
|
|
464770
464771
|
if (!smGeom) {
|
|
@@ -464784,39 +464785,36 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464784
464785
|
// tolerance 参数在此版本中不支持,已移除
|
|
464785
464786
|
});
|
|
464786
464787
|
return new Promise((resolve, reject2) => {
|
|
464787
|
-
new FeatureService2(serviceUrl).getFeaturesByGeometry(
|
|
464788
|
-
|
|
464789
|
-
(result)
|
|
464790
|
-
|
|
464791
|
-
|
|
464792
|
-
|
|
464793
|
-
|
|
464794
|
-
|
|
464795
|
-
|
|
464796
|
-
|
|
464797
|
-
|
|
464798
|
-
console.log("
|
|
464799
|
-
|
|
464800
|
-
|
|
464801
|
-
|
|
464802
|
-
|
|
464803
|
-
|
|
464804
|
-
|
|
464805
|
-
|
|
464806
|
-
|
|
464788
|
+
new FeatureService2(serviceUrl).getFeaturesByGeometry(queryParams, (result) => {
|
|
464789
|
+
var _a3, _b3, _c2;
|
|
464790
|
+
if (result.error) {
|
|
464791
|
+
console.error("iServer 错误:", result.error);
|
|
464792
|
+
reject2(result.error);
|
|
464793
|
+
return;
|
|
464794
|
+
}
|
|
464795
|
+
const rawFeatures = ((_b3 = (_a3 = result.result) == null ? void 0 : _a3.features) == null ? void 0 : _b3.features) || [];
|
|
464796
|
+
console.log("SuperMap查询结果:", result);
|
|
464797
|
+
console.log("原始要素数组:", rawFeatures);
|
|
464798
|
+
const features2 = rawFeatures.map((feature2) => {
|
|
464799
|
+
console.log("转换前的SuperMap要素:", feature2);
|
|
464800
|
+
console.log("要素的fieldNames:", feature2.fieldNames);
|
|
464801
|
+
console.log("要素的fieldValues:", feature2.fieldValues);
|
|
464802
|
+
const transformedFeature = this.transformSupermapFeature(feature2);
|
|
464803
|
+
console.log("转换后的标准要素:", transformedFeature);
|
|
464804
|
+
console.log("转换后的properties:", transformedFeature.properties);
|
|
464805
|
+
return transformedFeature;
|
|
464806
|
+
});
|
|
464807
|
+
if (vectorLayer) {
|
|
464808
|
+
(_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
|
|
464809
|
+
features2.forEach((f2) => {
|
|
464810
|
+
var _a4;
|
|
464811
|
+
const olFeat = new Feature$6(Util2.toSuperMapGeometry(f2.geometry));
|
|
464812
|
+
olFeat.setProperties(f2.properties || {});
|
|
464813
|
+
(_a4 = vectorLayer.getSource()) == null ? void 0 : _a4.addFeature(olFeat);
|
|
464807
464814
|
});
|
|
464808
|
-
if (vectorLayer) {
|
|
464809
|
-
(_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
|
|
464810
|
-
features2.forEach((f2) => {
|
|
464811
|
-
var _a4;
|
|
464812
|
-
const olFeat = new Feature$6(Util2.toSuperMapGeometry(f2.geometry));
|
|
464813
|
-
olFeat.setProperties(f2.properties || {});
|
|
464814
|
-
(_a4 = vectorLayer.getSource()) == null ? void 0 : _a4.addFeature(olFeat);
|
|
464815
|
-
});
|
|
464816
|
-
}
|
|
464817
|
-
resolve(features2);
|
|
464818
464815
|
}
|
|
464819
|
-
|
|
464816
|
+
resolve(features2);
|
|
464817
|
+
});
|
|
464820
464818
|
});
|
|
464821
464819
|
}
|
|
464822
464820
|
/**
|
|
@@ -464828,12 +464826,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464828
464826
|
*/
|
|
464829
464827
|
async getFeaturesByBuffer(lon2 = 93.53179023100006, lat2 = 42.81598224900006, options = {}) {
|
|
464830
464828
|
try {
|
|
464831
|
-
const {
|
|
464832
|
-
bufferDistance = 0.027,
|
|
464833
|
-
datasetNames = ["hms:Football_field"],
|
|
464834
|
-
serviceUrl = "http://172.16.201.151/iserver/services/data-hms-public/rest/data",
|
|
464835
|
-
vectorLayer = null
|
|
464836
|
-
} = options;
|
|
464829
|
+
const { bufferDistance = 0.027, datasetNames = ["hms:Football_field"], serviceUrl = "http://172.16.201.151/iserver/services/data-hms-public/rest/data", vectorLayer = null } = options;
|
|
464837
464830
|
const olPoint = new Point$b([lon2, lat2]);
|
|
464838
464831
|
let smGeom = Util2.toSuperMapGeometry(olPoint);
|
|
464839
464832
|
console.log("Util.toSuperMapGeometry ->", smGeom);
|
|
@@ -464843,54 +464836,46 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464843
464836
|
smGeom = new SuperMap2.Geometry.Point(lon2, lat2);
|
|
464844
464837
|
console.log("使用全局 SuperMap.Geometry.Point 构建 smGeom:", smGeom);
|
|
464845
464838
|
} else {
|
|
464846
|
-
console.warn(
|
|
464847
|
-
"无法取得全局 SuperMap,无法构造 SuperMap.Geometry.Point。建议使用方案A的 REST 调用绕开。"
|
|
464848
|
-
);
|
|
464839
|
+
console.warn("无法取得全局 SuperMap,无法构造 SuperMap.Geometry.Point。建议使用方案A的 REST 调用绕开。");
|
|
464849
464840
|
}
|
|
464850
464841
|
}
|
|
464851
464842
|
if (!smGeom) {
|
|
464852
|
-
console.error(
|
|
464853
|
-
"无法构建 SuperMap Geometry(smGeom 为 null)。请使用方案A 或检查 iClient 的引入方式。"
|
|
464854
|
-
);
|
|
464843
|
+
console.error("无法构建 SuperMap Geometry(smGeom 为 null)。请使用方案A 或检查 iClient 的引入方式。");
|
|
464855
464844
|
return [];
|
|
464856
464845
|
}
|
|
464857
464846
|
const bufferParams = new GetFeaturesByBufferParameters({
|
|
464858
464847
|
datasetNames,
|
|
464859
464848
|
bufferDistance,
|
|
464860
|
-
// 举例(300m ≈ 0.0027°),注意单位和坐标系一致
|
|
464861
464849
|
geometry: smGeom,
|
|
464862
464850
|
spatialQueryMode: "INTERSECT"
|
|
464863
464851
|
});
|
|
464864
464852
|
return new Promise((resolve, reject2) => {
|
|
464865
|
-
new FeatureService2(serviceUrl).getFeaturesByBuffer(
|
|
464866
|
-
|
|
464867
|
-
(serviceResult)
|
|
464868
|
-
|
|
464869
|
-
console.
|
|
464870
|
-
|
|
464871
|
-
|
|
464872
|
-
|
|
464873
|
-
|
|
464874
|
-
|
|
464875
|
-
const
|
|
464876
|
-
|
|
464877
|
-
|
|
464878
|
-
|
|
464879
|
-
|
|
464880
|
-
|
|
464881
|
-
|
|
464882
|
-
|
|
464883
|
-
|
|
464884
|
-
if (
|
|
464885
|
-
(
|
|
464886
|
-
if (feats.length) {
|
|
464887
|
-
(_d = vectorLayer.getSource()) == null ? void 0 : _d.addFeatures(feats);
|
|
464888
|
-
}
|
|
464853
|
+
new FeatureService2(serviceUrl).getFeaturesByBuffer(bufferParams, (serviceResult) => {
|
|
464854
|
+
var _a3, _b3, _c2, _d;
|
|
464855
|
+
console.log("serviceResult:", serviceResult);
|
|
464856
|
+
if (serviceResult.error) {
|
|
464857
|
+
console.error("iServer error:", serviceResult.error);
|
|
464858
|
+
reject2(new Error("iServer 返回错误,详见控制台"));
|
|
464859
|
+
return;
|
|
464860
|
+
}
|
|
464861
|
+
const rawFeatures = ((_b3 = (_a3 = serviceResult.result) == null ? void 0 : _a3.features) == null ? void 0 : _b3.features) || [];
|
|
464862
|
+
const feats = rawFeatures.map((f2) => {
|
|
464863
|
+
const transformedFeature = this.transformSupermapFeature(f2);
|
|
464864
|
+
console.log("Buffer查询 - 转换前的SuperMap数据:", f2);
|
|
464865
|
+
console.log("Buffer查询 - 转换后的标准数据:", transformedFeature);
|
|
464866
|
+
const olFeat = new Feature$6(Util2.toSuperMapGeometry(f2.geometry));
|
|
464867
|
+
olFeat.setProperties(transformedFeature.properties || {});
|
|
464868
|
+
return olFeat;
|
|
464869
|
+
});
|
|
464870
|
+
if (vectorLayer) {
|
|
464871
|
+
(_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
|
|
464872
|
+
if (feats.length) {
|
|
464873
|
+
(_d = vectorLayer.getSource()) == null ? void 0 : _d.addFeatures(feats);
|
|
464889
464874
|
}
|
|
464890
|
-
console.log("查询并绘制完成,count:", feats.length);
|
|
464891
|
-
resolve(feats);
|
|
464892
464875
|
}
|
|
464893
|
-
|
|
464876
|
+
console.log("查询并绘制完成,count:", feats.length);
|
|
464877
|
+
resolve(feats);
|
|
464878
|
+
});
|
|
464894
464879
|
});
|
|
464895
464880
|
} catch (err2) {
|
|
464896
464881
|
console.error("queryBuffer 捕获异常:", err2);
|
|
@@ -464923,27 +464908,14 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464923
464908
|
console.warn("SuperMap图层缺少服务URL,无法进行要素查询");
|
|
464924
464909
|
return [];
|
|
464925
464910
|
}
|
|
464926
|
-
const {
|
|
464927
|
-
maxFeatures = 100,
|
|
464928
|
-
datasetNames,
|
|
464929
|
-
returnContent = true,
|
|
464930
|
-
targetProjection
|
|
464931
|
-
} = options;
|
|
464911
|
+
const { maxFeatures = 100, datasetNames, returnContent = true, targetProjection } = options;
|
|
464932
464912
|
try {
|
|
464933
464913
|
const mapProjection = (_a3 = this.map) == null ? void 0 : _a3.getView().getProjection();
|
|
464934
464914
|
const projectionCode = targetProjection || (mapProjection == null ? void 0 : mapProjection.getCode()) || "EPSG:4326";
|
|
464935
464915
|
let transformedBounds = bounds2;
|
|
464936
464916
|
if (mapProjection && targetProjection && mapProjection.getCode() !== targetProjection) {
|
|
464937
|
-
const bottomLeft = transform$l(
|
|
464938
|
-
|
|
464939
|
-
mapProjection.getCode(),
|
|
464940
|
-
targetProjection
|
|
464941
|
-
);
|
|
464942
|
-
const topRight = transform$l(
|
|
464943
|
-
[bounds2[2], bounds2[3]],
|
|
464944
|
-
mapProjection.getCode(),
|
|
464945
|
-
targetProjection
|
|
464946
|
-
);
|
|
464917
|
+
const bottomLeft = transform$l([bounds2[0], bounds2[1]], mapProjection.getCode(), targetProjection);
|
|
464918
|
+
const topRight = transform$l([bounds2[2], bounds2[3]], mapProjection.getCode(), targetProjection);
|
|
464947
464919
|
transformedBounds = [
|
|
464948
464920
|
bottomLeft[0],
|
|
464949
464921
|
bottomLeft[1],
|
|
@@ -464965,29 +464937,22 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464965
464937
|
});
|
|
464966
464938
|
const boundsService = new GetFeaturesByBoundsService(serviceUrl);
|
|
464967
464939
|
return new Promise((resolve, reject2) => {
|
|
464968
|
-
boundsService.getFeaturesByBounds(
|
|
464969
|
-
|
|
464970
|
-
(serviceResult)
|
|
464971
|
-
|
|
464972
|
-
if (
|
|
464973
|
-
|
|
464974
|
-
|
|
464975
|
-
console.log(
|
|
464976
|
-
`SuperMap边界查询成功,找到 ${result.features.length} 个要素`
|
|
464977
|
-
);
|
|
464978
|
-
resolve(result.features);
|
|
464979
|
-
} else {
|
|
464980
|
-
console.log("SuperMap边界查询完成,但未找到要素");
|
|
464981
|
-
resolve([]);
|
|
464982
|
-
}
|
|
464940
|
+
boundsService.getFeaturesByBounds(boundsParams, (serviceResult) => {
|
|
464941
|
+
var _a4;
|
|
464942
|
+
if (serviceResult.type === "processCompleted") {
|
|
464943
|
+
const result = serviceResult.result;
|
|
464944
|
+
if (result && result.features) {
|
|
464945
|
+
console.log(`SuperMap边界查询成功,找到 ${result.features.length} 个要素`);
|
|
464946
|
+
resolve(result.features);
|
|
464983
464947
|
} else {
|
|
464984
|
-
console.
|
|
464985
|
-
|
|
464986
|
-
new Error(((_a4 = serviceResult.error) == null ? void 0 : _a4.errorMsg) || "边界查询失败")
|
|
464987
|
-
);
|
|
464948
|
+
console.log("SuperMap边界查询完成,但未找到要素");
|
|
464949
|
+
resolve([]);
|
|
464988
464950
|
}
|
|
464951
|
+
} else {
|
|
464952
|
+
console.error("SuperMap边界查询失败:", serviceResult.error);
|
|
464953
|
+
reject2(new Error(((_a4 = serviceResult.error) == null ? void 0 : _a4.errorMsg) || "边界查询失败"));
|
|
464989
464954
|
}
|
|
464990
|
-
);
|
|
464955
|
+
});
|
|
464991
464956
|
});
|
|
464992
464957
|
} catch (error2) {
|
|
464993
464958
|
console.error("SuperMap边界查询异常:", error2);
|
|
@@ -465006,13 +464971,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465006
464971
|
console.warn("SuperMap图层缺少服务URL,无法进行要素查询");
|
|
465007
464972
|
return [];
|
|
465008
464973
|
}
|
|
465009
|
-
const {
|
|
465010
|
-
maxFeatures = 100,
|
|
465011
|
-
datasetNames,
|
|
465012
|
-
returnContent = true,
|
|
465013
|
-
spatialQueryMode = "INTERSECT",
|
|
465014
|
-
targetProjection
|
|
465015
|
-
} = options;
|
|
464974
|
+
const { maxFeatures = 100, datasetNames, returnContent = true, spatialQueryMode = "INTERSECT", targetProjection } = options;
|
|
465016
464975
|
try {
|
|
465017
464976
|
const serviceUrl = this.buildDataServiceUrl(config.url);
|
|
465018
464977
|
console.log(`开始SuperMap几何查询:`, {
|
|
@@ -465029,29 +464988,22 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465029
464988
|
});
|
|
465030
464989
|
const geometryService = new GetFeaturesByGeometryService(serviceUrl);
|
|
465031
464990
|
return new Promise((resolve, reject2) => {
|
|
465032
|
-
geometryService.getFeaturesByGeometry(
|
|
465033
|
-
|
|
465034
|
-
(serviceResult)
|
|
465035
|
-
|
|
465036
|
-
if (
|
|
465037
|
-
|
|
465038
|
-
|
|
465039
|
-
console.log(
|
|
465040
|
-
`SuperMap几何查询成功,找到 ${result.features.length} 个要素`
|
|
465041
|
-
);
|
|
465042
|
-
resolve(result.features);
|
|
465043
|
-
} else {
|
|
465044
|
-
console.log("SuperMap几何查询完成,但未找到要素");
|
|
465045
|
-
resolve([]);
|
|
465046
|
-
}
|
|
464991
|
+
geometryService.getFeaturesByGeometry(geometryParams, (serviceResult) => {
|
|
464992
|
+
var _a3;
|
|
464993
|
+
if (serviceResult.type === "processCompleted") {
|
|
464994
|
+
const result = serviceResult.result;
|
|
464995
|
+
if (result && result.features) {
|
|
464996
|
+
console.log(`SuperMap几何查询成功,找到 ${result.features.length} 个要素`);
|
|
464997
|
+
resolve(result.features);
|
|
465047
464998
|
} else {
|
|
465048
|
-
console.
|
|
465049
|
-
|
|
465050
|
-
new Error(((_a3 = serviceResult.error) == null ? void 0 : _a3.errorMsg) || "几何查询失败")
|
|
465051
|
-
);
|
|
464999
|
+
console.log("SuperMap几何查询完成,但未找到要素");
|
|
465000
|
+
resolve([]);
|
|
465052
465001
|
}
|
|
465002
|
+
} else {
|
|
465003
|
+
console.error("SuperMap几何查询失败:", serviceResult.error);
|
|
465004
|
+
reject2(new Error(((_a3 = serviceResult.error) == null ? void 0 : _a3.errorMsg) || "几何查询失败"));
|
|
465053
465005
|
}
|
|
465054
|
-
);
|
|
465006
|
+
});
|
|
465055
465007
|
});
|
|
465056
465008
|
} catch (error2) {
|
|
465057
465009
|
console.error("SuperMap几何查询异常:", error2);
|
|
@@ -465070,12 +465022,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465070
465022
|
console.warn("SuperMap图层缺少服务URL,无法进行要素查询");
|
|
465071
465023
|
return [];
|
|
465072
465024
|
}
|
|
465073
|
-
const {
|
|
465074
|
-
maxFeatures = 100,
|
|
465075
|
-
datasetNames,
|
|
465076
|
-
returnContent = true,
|
|
465077
|
-
targetProjection
|
|
465078
|
-
} = options;
|
|
465025
|
+
const { maxFeatures = 100, datasetNames, returnContent = true, targetProjection } = options;
|
|
465079
465026
|
try {
|
|
465080
465027
|
const serviceUrl = this.buildDataServiceUrl(config.url);
|
|
465081
465028
|
console.log(`开始SuperMap SQL查询:`, {
|
|
@@ -465098,9 +465045,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465098
465045
|
if (serviceResult.type === "processCompleted") {
|
|
465099
465046
|
const result = serviceResult.result;
|
|
465100
465047
|
if (result && result.features) {
|
|
465101
|
-
console.log(
|
|
465102
|
-
`SuperMap SQL查询成功,找到 ${result.features.length} 个要素`
|
|
465103
|
-
);
|
|
465048
|
+
console.log(`SuperMap SQL查询成功,找到 ${result.features.length} 个要素`);
|
|
465104
465049
|
resolve(result.features);
|
|
465105
465050
|
} else {
|
|
465106
465051
|
console.log("SuperMap SQL查询完成,但未找到要素");
|
|
@@ -465148,9 +465093,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465148
465093
|
if (serviceResult.type === "processCompleted") {
|
|
465149
465094
|
const result = serviceResult.result;
|
|
465150
465095
|
if (result && result.features) {
|
|
465151
|
-
console.log(
|
|
465152
|
-
`SuperMap ID查询成功,找到 ${result.features.length} 个要素`
|
|
465153
|
-
);
|
|
465096
|
+
console.log(`SuperMap ID查询成功,找到 ${result.features.length} 个要素`);
|
|
465154
465097
|
resolve(result.features);
|
|
465155
465098
|
} else {
|
|
465156
465099
|
console.log("SuperMap ID查询完成,但未找到要素");
|
|
@@ -465180,10 +465123,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465180
465123
|
return mapUrl;
|
|
465181
465124
|
}
|
|
465182
465125
|
if (url.pathname.includes("/rest/maps/")) {
|
|
465183
|
-
const dataServiceUrl = mapUrl.replace(
|
|
465184
|
-
/\/rest\/maps\/.*$/,
|
|
465185
|
-
"/rest/data"
|
|
465186
|
-
);
|
|
465126
|
+
const dataServiceUrl = mapUrl.replace(/\/rest\/maps\/.*$/, "/rest/data");
|
|
465187
465127
|
console.log(`构建数据服务URL: ${mapUrl} -> ${dataServiceUrl}`);
|
|
465188
465128
|
return dataServiceUrl;
|
|
465189
465129
|
}
|
|
@@ -465193,9 +465133,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465193
465133
|
const serviceName = pathParts[servicesIndex + 1];
|
|
465194
465134
|
const basePath = pathParts.slice(0, servicesIndex + 2).join("/");
|
|
465195
465135
|
const dataServiceUrl = `${url.protocol}//${url.host}/${basePath}/rest/data`;
|
|
465196
|
-
console.log(
|
|
465197
|
-
`从服务名称构建数据服务URL: ${mapUrl} -> ${dataServiceUrl}`
|
|
465198
|
-
);
|
|
465136
|
+
console.log(`从服务名称构建数据服务URL: ${mapUrl} -> ${dataServiceUrl}`);
|
|
465199
465137
|
return dataServiceUrl;
|
|
465200
465138
|
}
|
|
465201
465139
|
throw new Error(`无法解析SuperMap服务URL格式: ${mapUrl}`);
|
|
@@ -465239,37 +465177,24 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465239
465177
|
*/
|
|
465240
465178
|
async getFeatureInfoAtCoordinate(coordinate, options = {}) {
|
|
465241
465179
|
var _a3, _b3, _c2, _d, _e2, _f;
|
|
465242
|
-
const {
|
|
465243
|
-
bufferDistance = 100,
|
|
465244
|
-
maxFeatures = options.featureCount || 10,
|
|
465245
|
-
queryMethod
|
|
465246
|
-
} = options;
|
|
465180
|
+
const { bufferDistance = 100, maxFeatures = options.featureCount || 10, queryMethod } = options;
|
|
465247
465181
|
try {
|
|
465248
465182
|
let features2 = [];
|
|
465249
465183
|
const finalQueryMethod = queryMethod || ((_a3 = this.config.supermapConfig) == null ? void 0 : _a3.queryMethod) || "point";
|
|
465250
465184
|
console.log(`使用查询方式: ${finalQueryMethod}`);
|
|
465251
465185
|
if (finalQueryMethod === "buffer") {
|
|
465252
465186
|
const configuredBufferDistance = ((_b3 = this.config.supermapConfig) == null ? void 0 : _b3.bufferDistance) || bufferDistance;
|
|
465253
|
-
features2 = await this.getFeaturesByBuffer(
|
|
465254
|
-
|
|
465255
|
-
|
|
465256
|
-
|
|
465257
|
-
|
|
465258
|
-
// 转换为度数单位
|
|
465259
|
-
datasetNames: (_c2 = this.config.supermapConfig) == null ? void 0 : _c2.datasetNames,
|
|
465260
|
-
serviceUrl: (_d = this.config.supermapConfig) == null ? void 0 : _d.featureServiceUrl
|
|
465261
|
-
}
|
|
465262
|
-
);
|
|
465187
|
+
features2 = await this.getFeaturesByBuffer(coordinate[0], coordinate[1], {
|
|
465188
|
+
bufferDistance: configuredBufferDistance / 1e3,
|
|
465189
|
+
datasetNames: (_c2 = this.config.supermapConfig) == null ? void 0 : _c2.datasetNames,
|
|
465190
|
+
serviceUrl: (_d = this.config.supermapConfig) == null ? void 0 : _d.featureServiceUrl
|
|
465191
|
+
});
|
|
465263
465192
|
} else {
|
|
465264
|
-
features2 = await this.queryFeatureByPointOL(
|
|
465265
|
-
|
|
465266
|
-
|
|
465267
|
-
|
|
465268
|
-
|
|
465269
|
-
serviceUrl: (_f = this.config.supermapConfig) == null ? void 0 : _f.featureServiceUrl
|
|
465270
|
-
// tolerance 参数已移除,使用默认值
|
|
465271
|
-
}
|
|
465272
|
-
);
|
|
465193
|
+
features2 = await this.queryFeatureByPointOL(coordinate[0], coordinate[1], {
|
|
465194
|
+
datasetNames: (_e2 = this.config.supermapConfig) == null ? void 0 : _e2.datasetNames,
|
|
465195
|
+
serviceUrl: (_f = this.config.supermapConfig) == null ? void 0 : _f.featureServiceUrl
|
|
465196
|
+
// tolerance 参数已移除,使用默认值
|
|
465197
|
+
});
|
|
465273
465198
|
}
|
|
465274
465199
|
return features2.slice(0, maxFeatures).map((feature2) => {
|
|
465275
465200
|
if (feature2 && typeof feature2.getProperties === "function") {
|
|
@@ -465347,9 +465272,7 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
|
|
|
465347
465272
|
* 检查是否是天地图URL
|
|
465348
465273
|
*/
|
|
465349
465274
|
isTiandituUrl(url) {
|
|
465350
|
-
return _TiandituLayerHandler.TIANDITU_DOMAINS.some(
|
|
465351
|
-
(domain) => url.includes(domain)
|
|
465352
|
-
);
|
|
465275
|
+
return _TiandituLayerHandler.TIANDITU_DOMAINS.some((domain) => url.includes(domain));
|
|
465353
465276
|
}
|
|
465354
465277
|
/**
|
|
465355
465278
|
* 检查是否是开发模式
|
|
@@ -465363,9 +465286,7 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
|
|
|
465363
465286
|
convertToProxyUrl(originalUrl) {
|
|
465364
465287
|
const urlObj = new URL(originalUrl);
|
|
465365
465288
|
const pathParts = urlObj.pathname.split("/");
|
|
465366
|
-
const serviceType = pathParts.find(
|
|
465367
|
-
(part) => Object.values(_TiandituLayerHandler.TIANDITU_SERVICES).includes(part)
|
|
465368
|
-
);
|
|
465289
|
+
const serviceType = pathParts.find((part) => Object.values(_TiandituLayerHandler.TIANDITU_SERVICES).includes(part));
|
|
465369
465290
|
if (!serviceType) {
|
|
465370
465291
|
console.warn("无法识别天地图服务类型,使用默认代理路径");
|
|
465371
465292
|
return `/api/tianditu${urlObj.pathname}${urlObj.search}`;
|
|
@@ -465382,9 +465303,7 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
|
|
|
465382
465303
|
return null;
|
|
465383
465304
|
const urlObj = new URL(this.config.url);
|
|
465384
465305
|
const pathParts = urlObj.pathname.split("/");
|
|
465385
|
-
return pathParts.find(
|
|
465386
|
-
(part) => Object.values(_TiandituLayerHandler.TIANDITU_SERVICES).includes(part)
|
|
465387
|
-
) || null;
|
|
465306
|
+
return pathParts.find((part) => Object.values(_TiandituLayerHandler.TIANDITU_SERVICES).includes(part)) || null;
|
|
465388
465307
|
}
|
|
465389
465308
|
/**
|
|
465390
465309
|
* 设置天地图密钥
|
|
@@ -465444,12 +465363,7 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
|
|
|
465444
465363
|
* 创建标准天地图URL
|
|
465445
465364
|
*/
|
|
465446
465365
|
static createTiandituUrl(serviceType, options = {}) {
|
|
465447
|
-
const {
|
|
465448
|
-
tk = "YOUR_TIANDITU_KEY",
|
|
465449
|
-
domain = "t{0-7}.tianditu.gov.cn",
|
|
465450
|
-
format: format2 = "tiles",
|
|
465451
|
-
style = "default"
|
|
465452
|
-
} = options;
|
|
465366
|
+
const { tk = "YOUR_TIANDITU_KEY", domain = "t{0-7}.tianditu.gov.cn", format: format2 = "tiles", style = "default" } = options;
|
|
465453
465367
|
const service = _TiandituLayerHandler.TIANDITU_SERVICES[serviceType];
|
|
465454
465368
|
if (!service) {
|
|
465455
465369
|
throw new Error(`不支持的天地图服务类型: ${serviceType}`);
|
|
@@ -465458,9 +465372,8 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
|
|
|
465458
465372
|
}
|
|
465459
465373
|
/**
|
|
465460
465374
|
* 应用过滤器(天地图图层不支持过滤)
|
|
465461
|
-
* @param filters 过滤器数组
|
|
465462
465375
|
*/
|
|
465463
|
-
applyFilters(
|
|
465376
|
+
applyFilters() {
|
|
465464
465377
|
console.warn("TiandituLayerHandler: 天地图图层不支持客户端过滤功能。天地图是预渲染的瓦片服务,无法进行动态过滤。");
|
|
465465
465378
|
console.info("TiandituLayerHandler: 如需过滤功能,请考虑:");
|
|
465466
465379
|
console.info("1. 使用矢量图层(GeoJSON、WFS等)叠加在天地图上");
|
|
@@ -465480,15 +465393,10 @@ __publicField(_TiandituLayerHandler, "TIANDITU_DOMAINS", [
|
|
|
465480
465393
|
]);
|
|
465481
465394
|
__publicField(_TiandituLayerHandler, "TIANDITU_SERVICES", {
|
|
465482
465395
|
"img": "img_w",
|
|
465483
|
-
// 卫星影像
|
|
465484
465396
|
"vec": "vec_w",
|
|
465485
|
-
// 矢量地图
|
|
465486
465397
|
"cva": "cva_w",
|
|
465487
|
-
// 矢量注记
|
|
465488
465398
|
"cia": "cia_w",
|
|
465489
|
-
// 影像注记
|
|
465490
465399
|
"ter": "ter_w",
|
|
465491
|
-
// 地形图
|
|
465492
465400
|
"cta": "cta_w"
|
|
465493
465401
|
// 地形注记
|
|
465494
465402
|
});
|
|
@@ -465504,7 +465412,6 @@ class CanvasLayerHandler extends BaseLayer$2 {
|
|
|
465504
465412
|
className: this.config.className,
|
|
465505
465413
|
canvasFunction: this.getCanvasFunction(),
|
|
465506
465414
|
projection: "EPSG:4326",
|
|
465507
|
-
// 默认投影
|
|
465508
465415
|
ratio: 1
|
|
465509
465416
|
});
|
|
465510
465417
|
const imageLayer = new ImageLayer$3({
|
|
@@ -465528,13 +465435,7 @@ class CanvasLayerHandler extends BaseLayer$2 {
|
|
|
465528
465435
|
canvas.width = size2[0];
|
|
465529
465436
|
canvas.height = size2[1];
|
|
465530
465437
|
const canvasConfig = this.config.canvasConfig || {};
|
|
465531
|
-
const {
|
|
465532
|
-
backgroundColor: backgroundColor2 = "transparent",
|
|
465533
|
-
gridSize = 50,
|
|
465534
|
-
gridColor = "#cccccc",
|
|
465535
|
-
showGrid = false,
|
|
465536
|
-
customDrawFunction
|
|
465537
|
-
} = canvasConfig;
|
|
465438
|
+
const { backgroundColor: backgroundColor2 = "transparent", gridSize = 50, gridColor = "#cccccc", showGrid = false, customDrawFunction } = canvasConfig;
|
|
465538
465439
|
if (backgroundColor2 !== "transparent") {
|
|
465539
465440
|
context.fillStyle = backgroundColor2;
|
|
465540
465441
|
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
@@ -465667,9 +465568,8 @@ class CanvasLayerHandler extends BaseLayer$2 {
|
|
|
465667
465568
|
}
|
|
465668
465569
|
/**
|
|
465669
465570
|
* 应用过滤器(Canvas图层不支持过滤)
|
|
465670
|
-
* @param filters 过滤器数组
|
|
465671
465571
|
*/
|
|
465672
|
-
applyFilters(
|
|
465572
|
+
applyFilters() {
|
|
465673
465573
|
console.warn("CanvasLayerHandler: Canvas图层不支持客户端过滤功能。Canvas图层是基于自定义绘制函数的图像图层,无法进行要素级别的过滤。");
|
|
465674
465574
|
console.info("CanvasLayerHandler: 如需过滤功能,请考虑:");
|
|
465675
465575
|
console.info("1. 在Canvas绘制函数中实现自定义的过滤逻辑");
|
|
@@ -465690,17 +465590,11 @@ class VectorTileLayerHandler extends BaseLayer$2 {
|
|
|
465690
465590
|
style: this.createStyleFunction(),
|
|
465691
465591
|
// VectorTile图层特有的配置
|
|
465692
465592
|
renderBuffer: this.config.renderBuffer || 100,
|
|
465693
|
-
// 渲染缓冲区
|
|
465694
465593
|
renderOrder: this.config.renderOrder,
|
|
465695
|
-
// 渲染顺序
|
|
465696
465594
|
renderMode: this.config.renderMode || "hybrid",
|
|
465697
|
-
// 渲染模式:'hybrid' | 'vector'
|
|
465698
465595
|
declutter: this.config.declutter || false,
|
|
465699
|
-
// 是否启用标注避让
|
|
465700
465596
|
background: this.config.background,
|
|
465701
|
-
// 背景色
|
|
465702
465597
|
preload: this.config.preload || 0,
|
|
465703
|
-
// 预加载级别
|
|
465704
465598
|
useInterimTilesOnError: this.config.useInterimTilesOnError !== false
|
|
465705
465599
|
// 错误时使用临时瓦片
|
|
465706
465600
|
});
|
|
@@ -465720,7 +465614,6 @@ class VectorTileLayerHandler extends BaseLayer$2 {
|
|
|
465720
465614
|
minZoom: config.minZoom || 0,
|
|
465721
465615
|
tileSize: config.tileSize || 512,
|
|
465722
465616
|
overlaps: config.overlaps !== false,
|
|
465723
|
-
// 默认允许重叠
|
|
465724
465617
|
projection: config.projection || "EPSG:4326"
|
|
465725
465618
|
};
|
|
465726
465619
|
if (config.tileGrid) {
|
|
@@ -465919,14 +465812,10 @@ class VectorTileLayerHandler extends BaseLayer$2 {
|
|
|
465919
465812
|
return;
|
|
465920
465813
|
}
|
|
465921
465814
|
const originalStyleFunction = this.createStyleFunction();
|
|
465815
|
+
const logic = this.getFilterLogic();
|
|
465922
465816
|
const filteredStyleFunction = (feature2, resolution) => {
|
|
465923
|
-
|
|
465924
|
-
|
|
465925
|
-
if (!this.checkFeatureAgainstFilter(feature2, filter2)) {
|
|
465926
|
-
visible = false;
|
|
465927
|
-
break;
|
|
465928
|
-
}
|
|
465929
|
-
}
|
|
465817
|
+
const results = enabledFilters.map((filter2) => this.checkFeatureAgainstFilter(feature2, filter2));
|
|
465818
|
+
const visible = this.combineByLogic(results);
|
|
465930
465819
|
if (!visible) {
|
|
465931
465820
|
return new Style$3({});
|
|
465932
465821
|
}
|
|
@@ -465937,7 +465826,7 @@ class VectorTileLayerHandler extends BaseLayer$2 {
|
|
|
465937
465826
|
}
|
|
465938
465827
|
};
|
|
465939
465828
|
layer2.setStyle(filteredStyleFunction);
|
|
465940
|
-
console.log(`VectorTile图层应用 ${enabledFilters.length}
|
|
465829
|
+
console.log(`VectorTile图层应用 ${enabledFilters.length} 个过滤器,组合逻辑为 ${logic}`);
|
|
465941
465830
|
}
|
|
465942
465831
|
/**
|
|
465943
465832
|
* 检查要素是否符合过滤器条件
|
|
@@ -465967,11 +465856,11 @@ class VectorTileLayerHandler extends BaseLayer$2 {
|
|
|
465967
465856
|
return featureValue !== filterValue;
|
|
465968
465857
|
case FilterOperator.GREATER_THAN:
|
|
465969
465858
|
return Number(featureValue) > Number(filterValue);
|
|
465970
|
-
case FilterOperator.
|
|
465859
|
+
case FilterOperator.GREATER_EQUAL:
|
|
465971
465860
|
return Number(featureValue) >= Number(filterValue);
|
|
465972
465861
|
case FilterOperator.LESS_THAN:
|
|
465973
465862
|
return Number(featureValue) < Number(filterValue);
|
|
465974
|
-
case FilterOperator.
|
|
465863
|
+
case FilterOperator.LESS_EQUAL:
|
|
465975
465864
|
return Number(featureValue) <= Number(filterValue);
|
|
465976
465865
|
case FilterOperator.LIKE:
|
|
465977
465866
|
const pattern = filterValue.toString().replace(/%/g, ".*");
|
|
@@ -466027,15 +465916,11 @@ class VectorTileLayerHandler extends BaseLayer$2 {
|
|
|
466027
465916
|
const extent3 = view.calculateExtent();
|
|
466028
465917
|
const resolution = view.getResolution();
|
|
466029
465918
|
try {
|
|
466030
|
-
source.forEachFeatureAtCoordinateAndResolution(
|
|
466031
|
-
|
|
466032
|
-
|
|
466033
|
-
(
|
|
466034
|
-
|
|
466035
|
-
const { geometry: geometry2, ...dataProps } = props;
|
|
466036
|
-
properties.push(dataProps);
|
|
466037
|
-
}
|
|
466038
|
-
);
|
|
465919
|
+
source.forEachFeatureAtCoordinateAndResolution(extent3, resolution || 1, (feature2) => {
|
|
465920
|
+
const props = feature2.getProperties();
|
|
465921
|
+
const { geometry: geometry2, ...dataProps } = props;
|
|
465922
|
+
properties.push(dataProps);
|
|
465923
|
+
});
|
|
466039
465924
|
} catch (error2) {
|
|
466040
465925
|
console.warn("获取VectorTile要素属性时出错:", error2);
|
|
466041
465926
|
}
|
|
@@ -466201,28 +466086,6 @@ const _LayerFactory = class _LayerFactory {
|
|
|
466201
466086
|
__publicField(_LayerFactory, "instance");
|
|
466202
466087
|
let LayerFactory = _LayerFactory;
|
|
466203
466088
|
const layerFactory = LayerFactory.getInstance();
|
|
466204
|
-
class LayerEventBus {
|
|
466205
|
-
constructor() {
|
|
466206
|
-
__publicField(this, "emitter");
|
|
466207
|
-
this.emitter = mitt();
|
|
466208
|
-
}
|
|
466209
|
-
emit(type, event) {
|
|
466210
|
-
this.emitter.emit(type, event);
|
|
466211
|
-
}
|
|
466212
|
-
on(type, handler) {
|
|
466213
|
-
this.emitter.on(type, handler);
|
|
466214
|
-
}
|
|
466215
|
-
off(type, handler) {
|
|
466216
|
-
this.emitter.off(type, handler);
|
|
466217
|
-
}
|
|
466218
|
-
clear() {
|
|
466219
|
-
this.emitter.all.clear();
|
|
466220
|
-
}
|
|
466221
|
-
}
|
|
466222
|
-
function createLayerEventBus() {
|
|
466223
|
-
return new LayerEventBus();
|
|
466224
|
-
}
|
|
466225
|
-
const layerEventBus = mitt();
|
|
466226
466089
|
class LayerManager {
|
|
466227
466090
|
constructor(map2, eventBus, storage2) {
|
|
466228
466091
|
__publicField(this, "map");
|
|
@@ -466253,7 +466116,6 @@ class LayerManager {
|
|
|
466253
466116
|
...config,
|
|
466254
466117
|
id: layerId,
|
|
466255
466118
|
visible: config.visible ?? false,
|
|
466256
|
-
// 默认设置为false,避免意外激活图层
|
|
466257
466119
|
opacity: config.opacity ?? 1,
|
|
466258
466120
|
zIndex: config.zIndex ?? 0
|
|
466259
466121
|
};
|
|
@@ -466430,7 +466292,6 @@ class LayerManager {
|
|
|
466430
466292
|
...childConfig,
|
|
466431
466293
|
id: childLayerId,
|
|
466432
466294
|
visible: groupConfig.visible ?? false,
|
|
466433
|
-
// 子图层的可见性完全跟随组图层
|
|
466434
466295
|
opacity: childConfig.opacity ?? groupConfig.opacity
|
|
466435
466296
|
};
|
|
466436
466297
|
if (this.addLayer(childFullConfig)) {
|
|
@@ -466634,9 +466495,7 @@ class LayerManager {
|
|
|
466634
466495
|
async hideOtherBasemaps(currentBasemapId) {
|
|
466635
466496
|
try {
|
|
466636
466497
|
const allConfigs = [...this.layerConfigs.values(), ...this.pendingLayerConfigs.values()];
|
|
466637
|
-
const basemapConfigs = allConfigs.filter(
|
|
466638
|
-
(config) => this.isBasemapLayer(config.id) && config.id !== currentBasemapId
|
|
466639
|
-
);
|
|
466498
|
+
const basemapConfigs = allConfigs.filter((config) => this.isBasemapLayer(config.id) && config.id !== currentBasemapId);
|
|
466640
466499
|
for (const config of basemapConfigs) {
|
|
466641
466500
|
if (config.visible) {
|
|
466642
466501
|
const handler = this.layerHandlers.get(config.id);
|
|
@@ -466661,9 +466520,7 @@ class LayerManager {
|
|
|
466661
466520
|
async hideOtherBasemapsOnInit(currentBasemapId) {
|
|
466662
466521
|
try {
|
|
466663
466522
|
const allConfigs = [...this.layerConfigs.values(), ...this.pendingLayerConfigs.values()];
|
|
466664
|
-
const basemapConfigs = allConfigs.filter(
|
|
466665
|
-
(config) => this.isBasemapLayer(config.id) && config.id !== currentBasemapId && config.visible
|
|
466666
|
-
);
|
|
466523
|
+
const basemapConfigs = allConfigs.filter((config) => this.isBasemapLayer(config.id) && config.id !== currentBasemapId && config.visible);
|
|
466667
466524
|
for (const config of basemapConfigs) {
|
|
466668
466525
|
const handler = this.layerHandlers.get(config.id);
|
|
466669
466526
|
if (handler) {
|
|
@@ -466949,15 +466806,11 @@ class LayerManager {
|
|
|
466949
466806
|
try {
|
|
466950
466807
|
if (config.type === "TileSuperMapRest" || config.type === "tilesupermaprest" || config.type === "TILESUPERMAPREST") {
|
|
466951
466808
|
if ("getFeatureInfoAtCoordinate" in handler) {
|
|
466952
|
-
const features2 = await handler.getFeatureInfoAtCoordinate(
|
|
466953
|
-
|
|
466954
|
-
|
|
466955
|
-
|
|
466956
|
-
|
|
466957
|
-
maxFeatures: (options == null ? void 0 : options.featureCount) || 10,
|
|
466958
|
-
returnContent: true
|
|
466959
|
-
}
|
|
466960
|
-
);
|
|
466809
|
+
const features2 = await handler.getFeatureInfoAtCoordinate(coordinate, {
|
|
466810
|
+
bufferDistance: 80,
|
|
466811
|
+
maxFeatures: (options == null ? void 0 : options.featureCount) || 10,
|
|
466812
|
+
returnContent: true
|
|
466813
|
+
});
|
|
466961
466814
|
if (features2 && features2.length > 0) {
|
|
466962
466815
|
results.push({
|
|
466963
466816
|
layerId,
|
|
@@ -466969,13 +466822,10 @@ class LayerManager {
|
|
|
466969
466822
|
}
|
|
466970
466823
|
} else if (config.type === "wms" || config.type === "WMS") {
|
|
466971
466824
|
if ("getFeatureInfoAtCoordinate" in handler) {
|
|
466972
|
-
const features2 = await handler.getFeatureInfoAtCoordinate(
|
|
466973
|
-
|
|
466974
|
-
|
|
466975
|
-
|
|
466976
|
-
featureCount: (options == null ? void 0 : options.featureCount) || 10
|
|
466977
|
-
}
|
|
466978
|
-
);
|
|
466825
|
+
const features2 = await handler.getFeatureInfoAtCoordinate(coordinate, {
|
|
466826
|
+
infoFormat: (options == null ? void 0 : options.infoFormat) || "application/json",
|
|
466827
|
+
featureCount: (options == null ? void 0 : options.featureCount) || 10
|
|
466828
|
+
});
|
|
466979
466829
|
if (features2 && features2.length > 0) {
|
|
466980
466830
|
results.push({
|
|
466981
466831
|
layerId,
|
|
@@ -467040,6 +466890,28 @@ class LayerManager {
|
|
|
467040
466890
|
this.layerConfigs.clear();
|
|
467041
466891
|
}
|
|
467042
466892
|
}
|
|
466893
|
+
class LayerEventBus {
|
|
466894
|
+
constructor() {
|
|
466895
|
+
__publicField(this, "emitter");
|
|
466896
|
+
this.emitter = mitt();
|
|
466897
|
+
}
|
|
466898
|
+
emit(type, event) {
|
|
466899
|
+
this.emitter.emit(type, event);
|
|
466900
|
+
}
|
|
466901
|
+
on(type, handler) {
|
|
466902
|
+
this.emitter.on(type, handler);
|
|
466903
|
+
}
|
|
466904
|
+
off(type, handler) {
|
|
466905
|
+
this.emitter.off(type, handler);
|
|
466906
|
+
}
|
|
466907
|
+
clear() {
|
|
466908
|
+
this.emitter.all.clear();
|
|
466909
|
+
}
|
|
466910
|
+
}
|
|
466911
|
+
function createLayerEventBus() {
|
|
466912
|
+
return new LayerEventBus();
|
|
466913
|
+
}
|
|
466914
|
+
const layerEventBus = mitt();
|
|
467043
466915
|
const DEFAULT_HIGHLIGHT_STYLE = {
|
|
467044
466916
|
fill: {
|
|
467045
466917
|
color: "rgba(255, 255, 0, 0.3)",
|
|
@@ -467142,7 +467014,7 @@ class FeatureHighlightManager {
|
|
|
467142
467014
|
if (this.styleConfig.text) {
|
|
467143
467015
|
const properties = feature2.getProperties();
|
|
467144
467016
|
const labelText = properties.name || properties.label || "高亮要素";
|
|
467145
|
-
styleOptions.text = new Text$
|
|
467017
|
+
styleOptions.text = new Text$5({
|
|
467146
467018
|
text: labelText,
|
|
467147
467019
|
font: this.styleConfig.text.font || "12px Arial",
|
|
467148
467020
|
fill: new Fill$2({
|
|
@@ -467196,7 +467068,7 @@ class FeatureHighlightManager {
|
|
|
467196
467068
|
if (customStyleConfig == null ? void 0 : customStyleConfig.text) {
|
|
467197
467069
|
const properties = feature2.getProperties();
|
|
467198
467070
|
const labelText = properties.name || properties.label || "高亮要素";
|
|
467199
|
-
styleOptions.text = new Text$
|
|
467071
|
+
styleOptions.text = new Text$5({
|
|
467200
467072
|
text: labelText,
|
|
467201
467073
|
font: customStyleConfig.text.font || "12px Arial",
|
|
467202
467074
|
fill: new Fill$2({
|
|
@@ -472969,7 +472841,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
472969
472841
|
};
|
|
472970
472842
|
}
|
|
472971
472843
|
});
|
|
472972
|
-
const RegionNavigationDialog = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-
|
|
472844
|
+
const RegionNavigationDialog = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-e968a62a"]]);
|
|
472973
472845
|
const _hoisted_1$e = { class: "markers-content" };
|
|
472974
472846
|
const _hoisted_2$d = { class: "toolbar" };
|
|
472975
472847
|
const _hoisted_3$d = { class: "search-filter" };
|
|
@@ -477366,9 +477238,11 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
477366
477238
|
});
|
|
477367
477239
|
watch(
|
|
477368
477240
|
() => props.config,
|
|
477369
|
-
() => {
|
|
477241
|
+
(newConfig) => {
|
|
477242
|
+
searchService.updateConfig(newConfig);
|
|
477370
477243
|
searchResults.value = [];
|
|
477371
477244
|
selectedIndex.value = -1;
|
|
477245
|
+
console.log("MapSearch配置已更新:", newConfig);
|
|
477372
477246
|
},
|
|
477373
477247
|
{ deep: true }
|
|
477374
477248
|
);
|
|
@@ -490259,7 +490133,7 @@ function(t3) {
|
|
|
490259
490133
|
*/
|
|
490260
490134
|
function(t3) {
|
|
490261
490135
|
function e8() {
|
|
490262
|
-
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-
|
|
490136
|
+
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-a3c51163.mjs")).catch(function(t4) {
|
|
490263
490137
|
return Promise.reject(new Error("Could not load canvg: " + t4));
|
|
490264
490138
|
}).then(function(t4) {
|
|
490265
490139
|
return t4.default ? t4.default : t4;
|
|
@@ -499180,8 +499054,8 @@ export {
|
|
|
499180
499054
|
DrawingManagerFactory as a3,
|
|
499181
499055
|
MapOperationTool as a4,
|
|
499182
499056
|
htmlToPDF as a5,
|
|
499183
|
-
FilterType
|
|
499184
|
-
FilterOperator
|
|
499057
|
+
FilterType as a6,
|
|
499058
|
+
FilterOperator as a7,
|
|
499185
499059
|
SpatialFilterType as a8,
|
|
499186
499060
|
_defineProperty as b,
|
|
499187
499061
|
commonjsGlobal as c,
|