vue-openlayers-plugin 1.0.33 → 1.0.34
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-ce768f90.mjs → index-d683decb.mjs} +130 -22
- package/lib/{index.es-3480a166.mjs → index.es-9e1aa406.mjs} +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.umd.js +131 -23
- package/lib/style.css +55 -55
- package/package.json +1 -1
- package/types/src/components/CustomOpenlayer/index.vue.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/TileSuperMapRestHandler.d.ts +7 -0
- package/types/src/components/CustomOpenlayer/utils/layers/TileSuperMapRestHandler.d.ts.map +1 -1
- package/types/tsconfig.tsbuildinfo +1 -1
|
@@ -463086,6 +463086,53 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
463086
463086
|
__publicField(this, "styleApplyAttempts", 0);
|
|
463087
463087
|
__publicField(this, "maxStyleApplyAttempts", 5);
|
|
463088
463088
|
}
|
|
463089
|
+
/**
|
|
463090
|
+
* 转换SuperMap返回的数据格式为标准格式
|
|
463091
|
+
* 将fieldNames和fieldValues转换为标准的key-value properties格式
|
|
463092
|
+
* @param feature SuperMap返回的要素数据
|
|
463093
|
+
* @returns 转换后的标准格式数据
|
|
463094
|
+
*/
|
|
463095
|
+
transformSupermapFeature(feature2) {
|
|
463096
|
+
console.log("transformSupermapFeature 输入:", feature2);
|
|
463097
|
+
console.log("输入类型:", typeof feature2);
|
|
463098
|
+
console.log("是否有fieldNames:", !!feature2.fieldNames);
|
|
463099
|
+
console.log("是否有fieldValues:", !!feature2.fieldValues);
|
|
463100
|
+
console.log("fieldNames类型:", Array.isArray(feature2.fieldNames) ? "array" : typeof feature2.fieldNames);
|
|
463101
|
+
console.log("fieldValues类型:", Array.isArray(feature2.fieldValues) ? "array" : typeof feature2.fieldValues);
|
|
463102
|
+
const hasFieldNames = feature2.fieldNames && (Array.isArray(feature2.fieldNames) || feature2.fieldNames.length !== void 0);
|
|
463103
|
+
const hasFieldValues = feature2.fieldValues && (Array.isArray(feature2.fieldValues) || feature2.fieldValues.length !== void 0);
|
|
463104
|
+
console.log("hasFieldNames:", hasFieldNames);
|
|
463105
|
+
console.log("hasFieldValues:", hasFieldValues);
|
|
463106
|
+
if (hasFieldNames && hasFieldValues) {
|
|
463107
|
+
const properties = {};
|
|
463108
|
+
console.log("开始转换 fieldNames:", feature2.fieldNames);
|
|
463109
|
+
console.log("开始转换 fieldValues:", feature2.fieldValues);
|
|
463110
|
+
const fieldNames2 = Array.isArray(feature2.fieldNames) ? feature2.fieldNames : Object.values(feature2.fieldNames || {});
|
|
463111
|
+
const fieldValues = Array.isArray(feature2.fieldValues) ? feature2.fieldValues : Object.values(feature2.fieldValues || {});
|
|
463112
|
+
console.log("转换后的fieldNames数组:", fieldNames2);
|
|
463113
|
+
console.log("转换后的fieldValues数组:", fieldValues);
|
|
463114
|
+
fieldNames2.forEach((fieldName, index2) => {
|
|
463115
|
+
if (index2 < fieldValues.length) {
|
|
463116
|
+
properties[fieldName] = fieldValues[index2];
|
|
463117
|
+
console.log(`转换字段: ${fieldName} = ${fieldValues[index2]}`);
|
|
463118
|
+
}
|
|
463119
|
+
});
|
|
463120
|
+
console.log("转换后的 properties:", properties);
|
|
463121
|
+
const result = {
|
|
463122
|
+
...feature2,
|
|
463123
|
+
properties,
|
|
463124
|
+
// 保留原始的fieldNames和fieldValues以备需要
|
|
463125
|
+
_original: {
|
|
463126
|
+
fieldNames: feature2.fieldNames,
|
|
463127
|
+
fieldValues: feature2.fieldValues
|
|
463128
|
+
}
|
|
463129
|
+
};
|
|
463130
|
+
console.log("transformSupermapFeature 输出:", result);
|
|
463131
|
+
return result;
|
|
463132
|
+
}
|
|
463133
|
+
console.log("不是SuperMap格式,直接返回:", feature2);
|
|
463134
|
+
return feature2;
|
|
463135
|
+
}
|
|
463089
463136
|
setupEPSG4490() {
|
|
463090
463137
|
(void 0)("EPSG:4490", "+proj=longlat +ellps=GRS80 +no_defs +type=crs");
|
|
463091
463138
|
register$3(proj4$2);
|
|
@@ -463495,7 +463542,18 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
463495
463542
|
reject2(result.error);
|
|
463496
463543
|
return;
|
|
463497
463544
|
}
|
|
463498
|
-
const
|
|
463545
|
+
const rawFeatures = ((_b3 = (_a3 = result.result) == null ? void 0 : _a3.features) == null ? void 0 : _b3.features) || [];
|
|
463546
|
+
console.log("SuperMap查询结果:", result);
|
|
463547
|
+
console.log("原始要素数组:", rawFeatures);
|
|
463548
|
+
const features2 = rawFeatures.map((feature2) => {
|
|
463549
|
+
console.log("转换前的SuperMap要素:", feature2);
|
|
463550
|
+
console.log("要素的fieldNames:", feature2.fieldNames);
|
|
463551
|
+
console.log("要素的fieldValues:", feature2.fieldValues);
|
|
463552
|
+
const transformedFeature = this.transformSupermapFeature(feature2);
|
|
463553
|
+
console.log("转换后的标准要素:", transformedFeature);
|
|
463554
|
+
console.log("转换后的properties:", transformedFeature.properties);
|
|
463555
|
+
return transformedFeature;
|
|
463556
|
+
});
|
|
463499
463557
|
if (vectorLayer) {
|
|
463500
463558
|
(_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
|
|
463501
463559
|
features2.forEach((f2) => {
|
|
@@ -463556,20 +463614,26 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
463556
463614
|
new FeatureService2(serviceUrl).getFeaturesByBuffer(
|
|
463557
463615
|
bufferParams,
|
|
463558
463616
|
(serviceResult) => {
|
|
463559
|
-
var _a3, _b3, _c2, _d
|
|
463617
|
+
var _a3, _b3, _c2, _d;
|
|
463560
463618
|
console.log("serviceResult:", serviceResult);
|
|
463561
463619
|
if (serviceResult.error) {
|
|
463562
463620
|
console.error("iServer error:", serviceResult.error);
|
|
463563
463621
|
reject2(new Error("iServer 返回错误,详见控制台"));
|
|
463564
463622
|
return;
|
|
463565
463623
|
}
|
|
463566
|
-
const
|
|
463567
|
-
|
|
463568
|
-
|
|
463624
|
+
const rawFeatures = ((_b3 = (_a3 = serviceResult.result) == null ? void 0 : _a3.features) == null ? void 0 : _b3.features) || [];
|
|
463625
|
+
const feats = rawFeatures.map((f2) => {
|
|
463626
|
+
const transformedFeature = this.transformSupermapFeature(f2);
|
|
463627
|
+
console.log("Buffer查询 - 转换前的SuperMap数据:", f2);
|
|
463628
|
+
console.log("Buffer查询 - 转换后的标准数据:", transformedFeature);
|
|
463629
|
+
const olFeat = new Feature$6(Util2.toSuperMapGeometry(f2.geometry));
|
|
463630
|
+
olFeat.setProperties(transformedFeature.properties || {});
|
|
463631
|
+
return olFeat;
|
|
463632
|
+
});
|
|
463569
463633
|
if (vectorLayer) {
|
|
463570
|
-
(
|
|
463634
|
+
(_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
|
|
463571
463635
|
if (feats.length) {
|
|
463572
|
-
(
|
|
463636
|
+
(_d = vectorLayer.getSource()) == null ? void 0 : _d.addFeatures(feats);
|
|
463573
463637
|
}
|
|
463574
463638
|
}
|
|
463575
463639
|
console.log("查询并绘制完成,count:", feats.length);
|
|
@@ -463957,14 +464021,26 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
463957
464021
|
);
|
|
463958
464022
|
}
|
|
463959
464023
|
return features2.slice(0, maxFeatures).map((feature2) => {
|
|
463960
|
-
|
|
463961
|
-
|
|
463962
|
-
|
|
463963
|
-
|
|
463964
|
-
|
|
463965
|
-
|
|
463966
|
-
|
|
463967
|
-
|
|
464024
|
+
if (feature2 && typeof feature2.getProperties === "function") {
|
|
464025
|
+
const properties = feature2.getProperties() || {};
|
|
464026
|
+
feature2.setProperties({
|
|
464027
|
+
...properties,
|
|
464028
|
+
layerId: this.config.id,
|
|
464029
|
+
layerName: this.config.name,
|
|
464030
|
+
layerType: "supermap-rest"
|
|
464031
|
+
});
|
|
464032
|
+
return feature2;
|
|
464033
|
+
} else {
|
|
464034
|
+
return {
|
|
464035
|
+
...feature2,
|
|
464036
|
+
properties: {
|
|
464037
|
+
...feature2.properties || {},
|
|
464038
|
+
layerId: this.config.id,
|
|
464039
|
+
layerName: this.config.name,
|
|
464040
|
+
layerType: "supermap-rest"
|
|
464041
|
+
}
|
|
464042
|
+
};
|
|
464043
|
+
}
|
|
463968
464044
|
});
|
|
463969
464045
|
} catch (error2) {
|
|
463970
464046
|
console.error("获取要素信息失败:", error2);
|
|
@@ -477582,7 +477658,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
477582
477658
|
setup(__props, { emit: __emit }) {
|
|
477583
477659
|
const props = __props;
|
|
477584
477660
|
const emit = __emit;
|
|
477585
|
-
const currentView = ref(props.config.defaultView || "
|
|
477661
|
+
const currentView = ref(props.config.defaultView || "list");
|
|
477586
477662
|
const searchQuery = ref("");
|
|
477587
477663
|
const sortField = ref("");
|
|
477588
477664
|
const sortOrder = ref("asc");
|
|
@@ -477928,7 +478004,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
477928
478004
|
};
|
|
477929
478005
|
}
|
|
477930
478006
|
});
|
|
477931
|
-
const ArrayPopup = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
478007
|
+
const ArrayPopup = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-140dd964"]]);
|
|
477932
478008
|
class PopupManager {
|
|
477933
478009
|
constructor(map2, config = {}) {
|
|
477934
478010
|
__publicField(this, "map");
|
|
@@ -478630,20 +478706,52 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
478630
478706
|
if (targetLayer && targetLayer.popup) {
|
|
478631
478707
|
const popupConfig = targetLayer.popup;
|
|
478632
478708
|
console.log("显示SuperMap图层popup:", { layerId, layerName, feature: feature2, coordinate });
|
|
478633
|
-
let properties
|
|
478709
|
+
let properties;
|
|
478710
|
+
if (feature2 && typeof feature2.getProperties === "function") {
|
|
478711
|
+
properties = feature2.getProperties();
|
|
478712
|
+
console.log("OpenLayers Feature属性:", properties);
|
|
478713
|
+
} else if (feature2 && feature2.properties) {
|
|
478714
|
+
properties = feature2.properties;
|
|
478715
|
+
console.log("GeoJSON Feature属性:", properties);
|
|
478716
|
+
} else {
|
|
478717
|
+
properties = feature2;
|
|
478718
|
+
console.log("其他格式属性:", properties);
|
|
478719
|
+
}
|
|
478720
|
+
console.log("SuperMap要素属性数据:", properties);
|
|
478721
|
+
console.log("popup配置字段:", popupConfig.fields);
|
|
478634
478722
|
let content2 = {};
|
|
478723
|
+
let hasValidFields = false;
|
|
478635
478724
|
if (popupConfig.fields && Array.isArray(popupConfig.fields)) {
|
|
478636
478725
|
popupConfig.fields.forEach((field) => {
|
|
478637
478726
|
if (typeof field === "string") {
|
|
478638
|
-
|
|
478727
|
+
const value = properties[field];
|
|
478728
|
+
console.log(`字段 ${field} 的值:`, value);
|
|
478729
|
+
if (value !== void 0 && value !== null) {
|
|
478730
|
+
content2[field] = value;
|
|
478731
|
+
hasValidFields = true;
|
|
478732
|
+
} else {
|
|
478733
|
+
content2[field] = "--";
|
|
478734
|
+
}
|
|
478639
478735
|
} else if (field.name) {
|
|
478640
478736
|
const displayName = field.label || field.name;
|
|
478641
|
-
|
|
478737
|
+
const value = properties[field.name];
|
|
478738
|
+
console.log(`字段 ${field.name} (${displayName}) 的值:`, value);
|
|
478739
|
+
if (value !== void 0 && value !== null) {
|
|
478740
|
+
content2[displayName] = value;
|
|
478741
|
+
hasValidFields = true;
|
|
478742
|
+
} else {
|
|
478743
|
+
content2[displayName] = "--";
|
|
478744
|
+
}
|
|
478642
478745
|
}
|
|
478643
478746
|
});
|
|
478747
|
+
if (!hasValidFields && properties && Object.keys(properties).length > 0) {
|
|
478748
|
+
console.log("配置的字段无效,显示所有属性:", properties);
|
|
478749
|
+
content2 = { ...properties };
|
|
478750
|
+
}
|
|
478644
478751
|
} else {
|
|
478645
478752
|
content2 = properties;
|
|
478646
478753
|
}
|
|
478754
|
+
console.log("最终popup内容:", content2);
|
|
478647
478755
|
const getPopupType = (config) => {
|
|
478648
478756
|
if (config.type) {
|
|
478649
478757
|
return config.type;
|
|
@@ -479518,7 +479626,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
479518
479626
|
};
|
|
479519
479627
|
}
|
|
479520
479628
|
});
|
|
479521
|
-
const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
479629
|
+
const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-02822978"]]);
|
|
479522
479630
|
var u8 = Uint8Array;
|
|
479523
479631
|
var u16 = Uint16Array;
|
|
479524
479632
|
var i32 = Int32Array;
|
|
@@ -487790,7 +487898,7 @@ function(t3) {
|
|
|
487790
487898
|
*/
|
|
487791
487899
|
function(t3) {
|
|
487792
487900
|
function e8() {
|
|
487793
|
-
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-
|
|
487901
|
+
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-9e1aa406.mjs")).catch(function(t4) {
|
|
487794
487902
|
return Promise.reject(new Error("Could not load canvg: " + t4));
|
|
487795
487903
|
}).then(function(t4) {
|
|
487796
487904
|
return t4.default ? t4.default : t4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as commonjsGlobal, R as RGBColor, r as requestAnimationFrame, _ as _asyncToGenerator, a as _, p as processCanvasRGBA, b as _defineProperty } from "./index-
|
|
1
|
+
import { c as commonjsGlobal, R as RGBColor, r as requestAnimationFrame, _ as _asyncToGenerator, a as _, p as processCanvasRGBA, b as _defineProperty } from "./index-d683decb.mjs";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "ol";
|
|
4
4
|
var check = function(it) {
|
package/lib/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z, B, d, C, D, a2, a3, u, y, I, H, Z, $, L, J, K, a4, h, M, a0, a1, X, Y, U, W, Q, S, P, A, F, G, N, O, e, T, E, V, x, j, o, t, f, k, g, w, q, m, n, a5, i, s, l, v } from "./index-
|
|
1
|
+
import { z, B, d, C, D, a2, a3, u, y, I, H, Z, $, L, J, K, a4, h, M, a0, a1, X, Y, U, W, Q, S, P, A, F, G, N, O, e, T, E, V, x, j, o, t, f, k, g, w, q, m, n, a5, i, s, l, v } from "./index-d683decb.mjs";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "ol";
|
|
4
4
|
export {
|
package/lib/index.umd.js
CHANGED
|
@@ -463862,6 +463862,53 @@ ${this.attributes_.map(
|
|
|
463862
463862
|
__publicField(this, "styleApplyAttempts", 0);
|
|
463863
463863
|
__publicField(this, "maxStyleApplyAttempts", 5);
|
|
463864
463864
|
}
|
|
463865
|
+
/**
|
|
463866
|
+
* 转换SuperMap返回的数据格式为标准格式
|
|
463867
|
+
* 将fieldNames和fieldValues转换为标准的key-value properties格式
|
|
463868
|
+
* @param feature SuperMap返回的要素数据
|
|
463869
|
+
* @returns 转换后的标准格式数据
|
|
463870
|
+
*/
|
|
463871
|
+
transformSupermapFeature(feature2) {
|
|
463872
|
+
console.log("transformSupermapFeature 输入:", feature2);
|
|
463873
|
+
console.log("输入类型:", typeof feature2);
|
|
463874
|
+
console.log("是否有fieldNames:", !!feature2.fieldNames);
|
|
463875
|
+
console.log("是否有fieldValues:", !!feature2.fieldValues);
|
|
463876
|
+
console.log("fieldNames类型:", Array.isArray(feature2.fieldNames) ? "array" : typeof feature2.fieldNames);
|
|
463877
|
+
console.log("fieldValues类型:", Array.isArray(feature2.fieldValues) ? "array" : typeof feature2.fieldValues);
|
|
463878
|
+
const hasFieldNames = feature2.fieldNames && (Array.isArray(feature2.fieldNames) || feature2.fieldNames.length !== void 0);
|
|
463879
|
+
const hasFieldValues = feature2.fieldValues && (Array.isArray(feature2.fieldValues) || feature2.fieldValues.length !== void 0);
|
|
463880
|
+
console.log("hasFieldNames:", hasFieldNames);
|
|
463881
|
+
console.log("hasFieldValues:", hasFieldValues);
|
|
463882
|
+
if (hasFieldNames && hasFieldValues) {
|
|
463883
|
+
const properties = {};
|
|
463884
|
+
console.log("开始转换 fieldNames:", feature2.fieldNames);
|
|
463885
|
+
console.log("开始转换 fieldValues:", feature2.fieldValues);
|
|
463886
|
+
const fieldNames2 = Array.isArray(feature2.fieldNames) ? feature2.fieldNames : Object.values(feature2.fieldNames || {});
|
|
463887
|
+
const fieldValues = Array.isArray(feature2.fieldValues) ? feature2.fieldValues : Object.values(feature2.fieldValues || {});
|
|
463888
|
+
console.log("转换后的fieldNames数组:", fieldNames2);
|
|
463889
|
+
console.log("转换后的fieldValues数组:", fieldValues);
|
|
463890
|
+
fieldNames2.forEach((fieldName, index2) => {
|
|
463891
|
+
if (index2 < fieldValues.length) {
|
|
463892
|
+
properties[fieldName] = fieldValues[index2];
|
|
463893
|
+
console.log(`转换字段: ${fieldName} = ${fieldValues[index2]}`);
|
|
463894
|
+
}
|
|
463895
|
+
});
|
|
463896
|
+
console.log("转换后的 properties:", properties);
|
|
463897
|
+
const result = {
|
|
463898
|
+
...feature2,
|
|
463899
|
+
properties,
|
|
463900
|
+
// 保留原始的fieldNames和fieldValues以备需要
|
|
463901
|
+
_original: {
|
|
463902
|
+
fieldNames: feature2.fieldNames,
|
|
463903
|
+
fieldValues: feature2.fieldValues
|
|
463904
|
+
}
|
|
463905
|
+
};
|
|
463906
|
+
console.log("transformSupermapFeature 输出:", result);
|
|
463907
|
+
return result;
|
|
463908
|
+
}
|
|
463909
|
+
console.log("不是SuperMap格式,直接返回:", feature2);
|
|
463910
|
+
return feature2;
|
|
463911
|
+
}
|
|
463865
463912
|
setupEPSG4490() {
|
|
463866
463913
|
(void 0)("EPSG:4490", "+proj=longlat +ellps=GRS80 +no_defs +type=crs");
|
|
463867
463914
|
register$3(proj4$2);
|
|
@@ -464271,7 +464318,18 @@ ${this.attributes_.map(
|
|
|
464271
464318
|
reject2(result.error);
|
|
464272
464319
|
return;
|
|
464273
464320
|
}
|
|
464274
|
-
const
|
|
464321
|
+
const rawFeatures = ((_b3 = (_a3 = result.result) == null ? void 0 : _a3.features) == null ? void 0 : _b3.features) || [];
|
|
464322
|
+
console.log("SuperMap查询结果:", result);
|
|
464323
|
+
console.log("原始要素数组:", rawFeatures);
|
|
464324
|
+
const features2 = rawFeatures.map((feature2) => {
|
|
464325
|
+
console.log("转换前的SuperMap要素:", feature2);
|
|
464326
|
+
console.log("要素的fieldNames:", feature2.fieldNames);
|
|
464327
|
+
console.log("要素的fieldValues:", feature2.fieldValues);
|
|
464328
|
+
const transformedFeature = this.transformSupermapFeature(feature2);
|
|
464329
|
+
console.log("转换后的标准要素:", transformedFeature);
|
|
464330
|
+
console.log("转换后的properties:", transformedFeature.properties);
|
|
464331
|
+
return transformedFeature;
|
|
464332
|
+
});
|
|
464275
464333
|
if (vectorLayer) {
|
|
464276
464334
|
(_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
|
|
464277
464335
|
features2.forEach((f2) => {
|
|
@@ -464332,20 +464390,26 @@ ${this.attributes_.map(
|
|
|
464332
464390
|
new FeatureService(serviceUrl).getFeaturesByBuffer(
|
|
464333
464391
|
bufferParams,
|
|
464334
464392
|
(serviceResult) => {
|
|
464335
|
-
var _a3, _b3, _c2, _d
|
|
464393
|
+
var _a3, _b3, _c2, _d;
|
|
464336
464394
|
console.log("serviceResult:", serviceResult);
|
|
464337
464395
|
if (serviceResult.error) {
|
|
464338
464396
|
console.error("iServer error:", serviceResult.error);
|
|
464339
464397
|
reject2(new Error("iServer 返回错误,详见控制台"));
|
|
464340
464398
|
return;
|
|
464341
464399
|
}
|
|
464342
|
-
const
|
|
464343
|
-
|
|
464344
|
-
|
|
464400
|
+
const rawFeatures = ((_b3 = (_a3 = serviceResult.result) == null ? void 0 : _a3.features) == null ? void 0 : _b3.features) || [];
|
|
464401
|
+
const feats = rawFeatures.map((f2) => {
|
|
464402
|
+
const transformedFeature = this.transformSupermapFeature(f2);
|
|
464403
|
+
console.log("Buffer查询 - 转换前的SuperMap数据:", f2);
|
|
464404
|
+
console.log("Buffer查询 - 转换后的标准数据:", transformedFeature);
|
|
464405
|
+
const olFeat = new ol$1.Feature(Util.toSuperMapGeometry(f2.geometry));
|
|
464406
|
+
olFeat.setProperties(transformedFeature.properties || {});
|
|
464407
|
+
return olFeat;
|
|
464408
|
+
});
|
|
464345
464409
|
if (vectorLayer) {
|
|
464346
|
-
(
|
|
464410
|
+
(_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
|
|
464347
464411
|
if (feats.length) {
|
|
464348
|
-
(
|
|
464412
|
+
(_d = vectorLayer.getSource()) == null ? void 0 : _d.addFeatures(feats);
|
|
464349
464413
|
}
|
|
464350
464414
|
}
|
|
464351
464415
|
console.log("查询并绘制完成,count:", feats.length);
|
|
@@ -464733,14 +464797,26 @@ ${this.attributes_.map(
|
|
|
464733
464797
|
);
|
|
464734
464798
|
}
|
|
464735
464799
|
return features2.slice(0, maxFeatures).map((feature2) => {
|
|
464736
|
-
|
|
464737
|
-
|
|
464738
|
-
|
|
464739
|
-
|
|
464740
|
-
|
|
464741
|
-
|
|
464742
|
-
|
|
464743
|
-
|
|
464800
|
+
if (feature2 && typeof feature2.getProperties === "function") {
|
|
464801
|
+
const properties = feature2.getProperties() || {};
|
|
464802
|
+
feature2.setProperties({
|
|
464803
|
+
...properties,
|
|
464804
|
+
layerId: this.config.id,
|
|
464805
|
+
layerName: this.config.name,
|
|
464806
|
+
layerType: "supermap-rest"
|
|
464807
|
+
});
|
|
464808
|
+
return feature2;
|
|
464809
|
+
} else {
|
|
464810
|
+
return {
|
|
464811
|
+
...feature2,
|
|
464812
|
+
properties: {
|
|
464813
|
+
...feature2.properties || {},
|
|
464814
|
+
layerId: this.config.id,
|
|
464815
|
+
layerName: this.config.name,
|
|
464816
|
+
layerType: "supermap-rest"
|
|
464817
|
+
}
|
|
464818
|
+
};
|
|
464819
|
+
}
|
|
464744
464820
|
});
|
|
464745
464821
|
} catch (error2) {
|
|
464746
464822
|
console.error("获取要素信息失败:", error2);
|
|
@@ -478382,7 +478458,7 @@ ${this.attributes_.map(
|
|
|
478382
478458
|
setup(__props, { emit: __emit }) {
|
|
478383
478459
|
const props = __props;
|
|
478384
478460
|
const emit = __emit;
|
|
478385
|
-
const currentView = vue.ref(props.config.defaultView || "
|
|
478461
|
+
const currentView = vue.ref(props.config.defaultView || "list");
|
|
478386
478462
|
const searchQuery = vue.ref("");
|
|
478387
478463
|
const sortField = vue.ref("");
|
|
478388
478464
|
const sortOrder = vue.ref("asc");
|
|
@@ -478728,8 +478804,8 @@ ${this.attributes_.map(
|
|
|
478728
478804
|
};
|
|
478729
478805
|
}
|
|
478730
478806
|
});
|
|
478731
|
-
const
|
|
478732
|
-
const ArrayPopup = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
478807
|
+
const ArrayPopup_vue_vue_type_style_index_0_scoped_140dd964_lang = "";
|
|
478808
|
+
const ArrayPopup = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-140dd964"]]);
|
|
478733
478809
|
class PopupManager {
|
|
478734
478810
|
constructor(map2, config = {}) {
|
|
478735
478811
|
__publicField(this, "map");
|
|
@@ -479431,20 +479507,52 @@ ${this.attributes_.map(
|
|
|
479431
479507
|
if (targetLayer && targetLayer.popup) {
|
|
479432
479508
|
const popupConfig = targetLayer.popup;
|
|
479433
479509
|
console.log("显示SuperMap图层popup:", { layerId, layerName, feature: feature2, coordinate });
|
|
479434
|
-
let properties
|
|
479510
|
+
let properties;
|
|
479511
|
+
if (feature2 && typeof feature2.getProperties === "function") {
|
|
479512
|
+
properties = feature2.getProperties();
|
|
479513
|
+
console.log("OpenLayers Feature属性:", properties);
|
|
479514
|
+
} else if (feature2 && feature2.properties) {
|
|
479515
|
+
properties = feature2.properties;
|
|
479516
|
+
console.log("GeoJSON Feature属性:", properties);
|
|
479517
|
+
} else {
|
|
479518
|
+
properties = feature2;
|
|
479519
|
+
console.log("其他格式属性:", properties);
|
|
479520
|
+
}
|
|
479521
|
+
console.log("SuperMap要素属性数据:", properties);
|
|
479522
|
+
console.log("popup配置字段:", popupConfig.fields);
|
|
479435
479523
|
let content2 = {};
|
|
479524
|
+
let hasValidFields = false;
|
|
479436
479525
|
if (popupConfig.fields && Array.isArray(popupConfig.fields)) {
|
|
479437
479526
|
popupConfig.fields.forEach((field) => {
|
|
479438
479527
|
if (typeof field === "string") {
|
|
479439
|
-
|
|
479528
|
+
const value = properties[field];
|
|
479529
|
+
console.log(`字段 ${field} 的值:`, value);
|
|
479530
|
+
if (value !== void 0 && value !== null) {
|
|
479531
|
+
content2[field] = value;
|
|
479532
|
+
hasValidFields = true;
|
|
479533
|
+
} else {
|
|
479534
|
+
content2[field] = "--";
|
|
479535
|
+
}
|
|
479440
479536
|
} else if (field.name) {
|
|
479441
479537
|
const displayName = field.label || field.name;
|
|
479442
|
-
|
|
479538
|
+
const value = properties[field.name];
|
|
479539
|
+
console.log(`字段 ${field.name} (${displayName}) 的值:`, value);
|
|
479540
|
+
if (value !== void 0 && value !== null) {
|
|
479541
|
+
content2[displayName] = value;
|
|
479542
|
+
hasValidFields = true;
|
|
479543
|
+
} else {
|
|
479544
|
+
content2[displayName] = "--";
|
|
479545
|
+
}
|
|
479443
479546
|
}
|
|
479444
479547
|
});
|
|
479548
|
+
if (!hasValidFields && properties && Object.keys(properties).length > 0) {
|
|
479549
|
+
console.log("配置的字段无效,显示所有属性:", properties);
|
|
479550
|
+
content2 = { ...properties };
|
|
479551
|
+
}
|
|
479445
479552
|
} else {
|
|
479446
479553
|
content2 = properties;
|
|
479447
479554
|
}
|
|
479555
|
+
console.log("最终popup内容:", content2);
|
|
479448
479556
|
const getPopupType = (config) => {
|
|
479449
479557
|
if (config.type) {
|
|
479450
479558
|
return config.type;
|
|
@@ -480319,8 +480427,8 @@ ${this.attributes_.map(
|
|
|
480319
480427
|
};
|
|
480320
480428
|
}
|
|
480321
480429
|
});
|
|
480322
|
-
const
|
|
480323
|
-
const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
480430
|
+
const index_vue_vue_type_style_index_0_scoped_02822978_lang = "";
|
|
480431
|
+
const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-02822978"]]);
|
|
480324
480432
|
const base = "";
|
|
480325
480433
|
var u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;
|
|
480326
480434
|
var fleb = new u8([
|