vue-openlayers-plugin 1.0.58 → 1.0.60
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-72fbf19d.mjs → index-45512f1d.mjs} +1033 -531
- package/lib/{index.es-8f4cfae0.mjs → index.es-471711b2.mjs} +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.umd.js +1194 -689
- package/lib/style.css +137 -137
- package/package.json +1 -1
- package/types/src/components/CustomOpenlayer/components/dialogs/LayerPanel.vue.d.ts +4 -3
- package/types/src/components/CustomOpenlayer/components/dialogs/LayerPanel.vue.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/components/dialogs/LayerTreeNode.vue.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/LayerTreeManager.d.ts +11 -0
- package/types/src/components/CustomOpenlayer/utils/LayerTreeManager.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layerManager.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/storage.d.ts.map +1 -1
|
@@ -69141,17 +69141,27 @@ function getUnitOptions(type) {
|
|
|
69141
69141
|
}
|
|
69142
69142
|
const STORAGE_CONFIG = {
|
|
69143
69143
|
ENABLED: false,
|
|
69144
|
+
// 默认禁用本地存储
|
|
69144
69145
|
MAX_MEASUREMENTS: 100,
|
|
69146
|
+
// 减少到100条,避免过多累积
|
|
69145
69147
|
MAX_LAYER_CONFIGS: 30,
|
|
69148
|
+
// 减少到30个,够用即可
|
|
69146
69149
|
MAX_SEARCH_HISTORY: 20,
|
|
69150
|
+
// 新增:搜索历史限制
|
|
69147
69151
|
QUOTA_WARNING_THRESHOLD: 0.6,
|
|
69152
|
+
// 配额警告阈值(60%)
|
|
69148
69153
|
AUTO_CLEANUP_THRESHOLD: 0.7,
|
|
69154
|
+
// 自动清理阈值(70%)
|
|
69149
69155
|
COMPRESSION_ENABLED: true,
|
|
69156
|
+
// 是否启用压缩
|
|
69150
69157
|
BATCH_CLEANUP_SIZE: 10,
|
|
69158
|
+
// 减少批量清理数量
|
|
69151
69159
|
// 新增:数据过期时间配置(毫秒)
|
|
69152
69160
|
DATA_EXPIRY: {
|
|
69153
69161
|
MEASUREMENTS: 30 * 24 * 60 * 60 * 1e3,
|
|
69162
|
+
// 30天
|
|
69154
69163
|
MAP_STATE: 7 * 24 * 60 * 60 * 1e3,
|
|
69164
|
+
// 7天
|
|
69155
69165
|
SEARCH_HISTORY: 7 * 24 * 60 * 60 * 1e3
|
|
69156
69166
|
// 7天
|
|
69157
69167
|
}
|
|
@@ -69206,7 +69216,9 @@ class MapStorage {
|
|
|
69206
69216
|
cleanupExpiredData() {
|
|
69207
69217
|
try {
|
|
69208
69218
|
const measurements = this.getMeasurements();
|
|
69209
|
-
const validMeasurements = measurements.filter(
|
|
69219
|
+
const validMeasurements = measurements.filter(
|
|
69220
|
+
(m2) => !m2.timestamp || !this.isDataExpired(m2.timestamp, "MEASUREMENTS")
|
|
69221
|
+
);
|
|
69210
69222
|
if (validMeasurements.length !== measurements.length) {
|
|
69211
69223
|
this.saveMeasurements(validMeasurements);
|
|
69212
69224
|
console.log(`清理过期测量结果:${measurements.length} -> ${validMeasurements.length}`);
|
|
@@ -69325,7 +69337,6 @@ class MapStorage {
|
|
|
69325
69337
|
*/
|
|
69326
69338
|
safeSetItem(key, value) {
|
|
69327
69339
|
if (!this.storageEnabled) {
|
|
69328
|
-
console.log("存储功能已禁用,跳过存储操作");
|
|
69329
69340
|
return false;
|
|
69330
69341
|
}
|
|
69331
69342
|
try {
|
|
@@ -69392,7 +69403,7 @@ class MapStorage {
|
|
|
69392
69403
|
timestamp: m2.timestamp || Date.now()
|
|
69393
69404
|
}));
|
|
69394
69405
|
const success = this.safeSetItem(this.storageKeys.MEASUREMENTS, JSON.stringify(limitedMeasurements));
|
|
69395
|
-
if (!success) {
|
|
69406
|
+
if (!success && this.storageEnabled) {
|
|
69396
69407
|
console.error("保存测量结果失败: 存储空间不足");
|
|
69397
69408
|
}
|
|
69398
69409
|
} catch (error2) {
|
|
@@ -69485,7 +69496,7 @@ class MapStorage {
|
|
|
69485
69496
|
return optimizedConfig;
|
|
69486
69497
|
});
|
|
69487
69498
|
const success = this.safeSetItem(this.storageKeys.LAYER_CONFIGS, JSON.stringify(configsToSave));
|
|
69488
|
-
if (!success) {
|
|
69499
|
+
if (!success && this.storageEnabled) {
|
|
69489
69500
|
console.error("保存图层配置失败: 存储空间不足");
|
|
69490
69501
|
}
|
|
69491
69502
|
} catch (error2) {
|
|
@@ -69511,7 +69522,7 @@ class MapStorage {
|
|
|
69511
69522
|
try {
|
|
69512
69523
|
const state = { center: center2, zoom, rotation, timestamp: Date.now() };
|
|
69513
69524
|
const success = this.safeSetItem(this.storageKeys.MAP_STATE, JSON.stringify(state));
|
|
69514
|
-
if (!success) {
|
|
69525
|
+
if (!success && this.storageEnabled) {
|
|
69515
69526
|
console.error("保存地图状态失败: 存储空间不足");
|
|
69516
69527
|
}
|
|
69517
69528
|
} catch (error2) {
|
|
@@ -69588,7 +69599,12 @@ class MapStorage {
|
|
|
69588
69599
|
* 手动清理存储
|
|
69589
69600
|
*/
|
|
69590
69601
|
manualCleanup(options = {}) {
|
|
69591
|
-
const {
|
|
69602
|
+
const {
|
|
69603
|
+
clearMeasurements = false,
|
|
69604
|
+
clearLayerConfigs = false,
|
|
69605
|
+
clearMapState = false,
|
|
69606
|
+
keepRecentCount = 50
|
|
69607
|
+
} = options;
|
|
69592
69608
|
if (clearMeasurements) {
|
|
69593
69609
|
if (keepRecentCount > 0) {
|
|
69594
69610
|
const measurements = this.getMeasurements();
|
|
@@ -81406,15 +81422,14 @@ class GeoJSONLocationTool {
|
|
|
81406
81422
|
this.map = map2;
|
|
81407
81423
|
}
|
|
81408
81424
|
}
|
|
81409
|
-
var FilterType
|
|
81410
|
-
(function(FilterType2) {
|
|
81425
|
+
var FilterType = /* @__PURE__ */ ((FilterType2) => {
|
|
81411
81426
|
FilterType2["ATTRIBUTE"] = "attribute";
|
|
81412
81427
|
FilterType2["SPATIAL"] = "spatial";
|
|
81413
81428
|
FilterType2["CQL"] = "cql";
|
|
81414
81429
|
FilterType2["CUSTOM"] = "custom";
|
|
81415
|
-
|
|
81416
|
-
|
|
81417
|
-
(
|
|
81430
|
+
return FilterType2;
|
|
81431
|
+
})(FilterType || {});
|
|
81432
|
+
var FilterOperator = /* @__PURE__ */ ((FilterOperator2) => {
|
|
81418
81433
|
FilterOperator2["EQUAL"] = "equal";
|
|
81419
81434
|
FilterOperator2["NOT_EQUAL"] = "not_equal";
|
|
81420
81435
|
FilterOperator2["GREATER_THAN"] = "greater_than";
|
|
@@ -81427,9 +81442,9 @@ var FilterOperator;
|
|
|
81427
81442
|
FilterOperator2["BETWEEN"] = "between";
|
|
81428
81443
|
FilterOperator2["IS_NULL"] = "is_null";
|
|
81429
81444
|
FilterOperator2["IS_NOT_NULL"] = "is_not_null";
|
|
81430
|
-
|
|
81431
|
-
|
|
81432
|
-
(
|
|
81445
|
+
return FilterOperator2;
|
|
81446
|
+
})(FilterOperator || {});
|
|
81447
|
+
var SpatialFilterType = /* @__PURE__ */ ((SpatialFilterType2) => {
|
|
81433
81448
|
SpatialFilterType2["INTERSECTS"] = "intersects";
|
|
81434
81449
|
SpatialFilterType2["CONTAINS"] = "contains";
|
|
81435
81450
|
SpatialFilterType2["WITHIN"] = "within";
|
|
@@ -81437,7 +81452,8 @@ var SpatialFilterType;
|
|
|
81437
81452
|
SpatialFilterType2["CROSSES"] = "crosses";
|
|
81438
81453
|
SpatialFilterType2["OVERLAPS"] = "overlaps";
|
|
81439
81454
|
SpatialFilterType2["DISJOINT"] = "disjoint";
|
|
81440
|
-
|
|
81455
|
+
return SpatialFilterType2;
|
|
81456
|
+
})(SpatialFilterType || {});
|
|
81441
81457
|
let BaseLayer$2 = class BaseLayer2 {
|
|
81442
81458
|
constructor(config) {
|
|
81443
81459
|
__publicField(this, "config");
|
|
@@ -81847,8 +81863,7 @@ let BaseLayer$2 = class BaseLayer2 {
|
|
|
81847
81863
|
this.addFilter(filter2);
|
|
81848
81864
|
}
|
|
81849
81865
|
};
|
|
81850
|
-
var LayerType$1
|
|
81851
|
-
(function(LayerType2) {
|
|
81866
|
+
var LayerType$1 = /* @__PURE__ */ ((LayerType2) => {
|
|
81852
81867
|
LayerType2["TILE"] = "tile";
|
|
81853
81868
|
LayerType2["WMS"] = "wms";
|
|
81854
81869
|
LayerType2["WMTS"] = "wmts";
|
|
@@ -81863,7 +81878,8 @@ var LayerType$1;
|
|
|
81863
81878
|
LayerType2["CANVAS"] = "canvas";
|
|
81864
81879
|
LayerType2["IMAGE_VECTOR"] = "image_vector";
|
|
81865
81880
|
LayerType2["VECTOR_TILE"] = "vector_tile";
|
|
81866
|
-
|
|
81881
|
+
return LayerType2;
|
|
81882
|
+
})(LayerType$1 || {});
|
|
81867
81883
|
class TileLayerHandler extends BaseLayer$2 {
|
|
81868
81884
|
constructor() {
|
|
81869
81885
|
super(...arguments);
|
|
@@ -82106,17 +82122,27 @@ class WMSLayerHandler extends BaseLayer$2 {
|
|
|
82106
82122
|
const source = layer2.getSource();
|
|
82107
82123
|
if (!source)
|
|
82108
82124
|
return void 0;
|
|
82109
|
-
return source.getFeatureInfoUrl(
|
|
82110
|
-
|
|
82111
|
-
|
|
82112
|
-
|
|
82113
|
-
|
|
82125
|
+
return source.getFeatureInfoUrl(
|
|
82126
|
+
coordinate,
|
|
82127
|
+
resolution,
|
|
82128
|
+
projection2,
|
|
82129
|
+
{
|
|
82130
|
+
"INFO_FORMAT": "application/json",
|
|
82131
|
+
"FEATURE_COUNT": 10,
|
|
82132
|
+
...params2
|
|
82133
|
+
}
|
|
82134
|
+
);
|
|
82114
82135
|
}
|
|
82115
82136
|
/**
|
|
82116
82137
|
* 通过坐标获取要素信息
|
|
82117
82138
|
*/
|
|
82118
82139
|
async getFeatureInfoAtCoordinate(coordinate, options = {}) {
|
|
82119
|
-
const {
|
|
82140
|
+
const {
|
|
82141
|
+
infoFormat = "application/json",
|
|
82142
|
+
featureCount = 10,
|
|
82143
|
+
resolution,
|
|
82144
|
+
projection: projection2 = "EPSG:3857"
|
|
82145
|
+
} = options;
|
|
82120
82146
|
try {
|
|
82121
82147
|
const map2 = this.map;
|
|
82122
82148
|
if (!map2) {
|
|
@@ -82130,10 +82156,15 @@ class WMSLayerHandler extends BaseLayer$2 {
|
|
|
82130
82156
|
console.warn("无法获取地图分辨率");
|
|
82131
82157
|
return [];
|
|
82132
82158
|
}
|
|
82133
|
-
const url = this.getFeatureInfoUrl(
|
|
82134
|
-
|
|
82135
|
-
|
|
82136
|
-
|
|
82159
|
+
const url = this.getFeatureInfoUrl(
|
|
82160
|
+
coordinate,
|
|
82161
|
+
currentResolution,
|
|
82162
|
+
currentProjection,
|
|
82163
|
+
{
|
|
82164
|
+
"INFO_FORMAT": infoFormat,
|
|
82165
|
+
"FEATURE_COUNT": featureCount
|
|
82166
|
+
}
|
|
82167
|
+
);
|
|
82137
82168
|
if (!url) {
|
|
82138
82169
|
console.warn("无法构建GetFeatureInfo请求URL");
|
|
82139
82170
|
return [];
|
|
@@ -82668,7 +82699,13 @@ class WFSLayerHandler extends BaseLayer$2 {
|
|
|
82668
82699
|
* 便捷方法:添加WFS属性过滤器
|
|
82669
82700
|
*/
|
|
82670
82701
|
addWFSAttributeFilter(id, property, value, operator = "equalTo", description) {
|
|
82671
|
-
this.addAttributeFilter(
|
|
82702
|
+
this.addAttributeFilter(
|
|
82703
|
+
id,
|
|
82704
|
+
property,
|
|
82705
|
+
value,
|
|
82706
|
+
operator === "equalTo" ? FilterOperator.EQUAL : FilterOperator.LIKE,
|
|
82707
|
+
description
|
|
82708
|
+
);
|
|
82672
82709
|
}
|
|
82673
82710
|
/**
|
|
82674
82711
|
* 便捷方法:移除WFS过滤器
|
|
@@ -82736,8 +82773,7 @@ class WFSLayerHandler extends BaseLayer$2 {
|
|
|
82736
82773
|
}
|
|
82737
82774
|
}
|
|
82738
82775
|
}
|
|
82739
|
-
var GeometryType$2
|
|
82740
|
-
(function(GeometryType2) {
|
|
82776
|
+
var GeometryType$2 = /* @__PURE__ */ ((GeometryType2) => {
|
|
82741
82777
|
GeometryType2["POINT"] = "Point";
|
|
82742
82778
|
GeometryType2["LINE_STRING"] = "LineString";
|
|
82743
82779
|
GeometryType2["POLYGON"] = "Polygon";
|
|
@@ -82746,7 +82782,8 @@ var GeometryType$2;
|
|
|
82746
82782
|
GeometryType2["MULTI_POLYGON"] = "MultiPolygon";
|
|
82747
82783
|
GeometryType2["GEOMETRY_COLLECTION"] = "GeometryCollection";
|
|
82748
82784
|
GeometryType2["CIRCLE"] = "Circle";
|
|
82749
|
-
|
|
82785
|
+
return GeometryType2;
|
|
82786
|
+
})(GeometryType$2 || {});
|
|
82750
82787
|
class StyleFactory {
|
|
82751
82788
|
/**
|
|
82752
82789
|
* 创建填充样式
|
|
@@ -82786,7 +82823,6 @@ class StyleFactory {
|
|
|
82786
82823
|
const textStyle = new Text$5({
|
|
82787
82824
|
text: config.text,
|
|
82788
82825
|
font: config.font || `${config.fontSize || 12}px ${config.fontFamily || "Arial"}`,
|
|
82789
|
-
scale: config.scale,
|
|
82790
82826
|
fill: this.createFill(config.fill),
|
|
82791
82827
|
stroke: this.createStroke(config.stroke),
|
|
82792
82828
|
offsetX: config.offsetX,
|
|
@@ -82794,10 +82830,6 @@ class StyleFactory {
|
|
|
82794
82830
|
textAlign: config.textAlign,
|
|
82795
82831
|
textBaseline: config.textBaseline,
|
|
82796
82832
|
rotation: config.rotation,
|
|
82797
|
-
rotateWithView: config.rotateWithView,
|
|
82798
|
-
maxAngle: config.maxAngle,
|
|
82799
|
-
placement: config.placement,
|
|
82800
|
-
overflow: config.overflow,
|
|
82801
82833
|
backgroundFill: this.createFill(config.backgroundFill),
|
|
82802
82834
|
backgroundStroke: this.createStroke(config.backgroundStroke),
|
|
82803
82835
|
padding: config.padding
|
|
@@ -82897,8 +82929,7 @@ class StyleFactory {
|
|
|
82897
82929
|
});
|
|
82898
82930
|
}
|
|
82899
82931
|
if (config == null ? void 0 : config.text) {
|
|
82900
|
-
|
|
82901
|
-
styleOptions.text = this.createText(textCfg);
|
|
82932
|
+
styleOptions.text = this.createText(config.text);
|
|
82902
82933
|
}
|
|
82903
82934
|
return new Style$3(styleOptions);
|
|
82904
82935
|
}
|
|
@@ -83106,7 +83137,7 @@ const _StyleManager = class _StyleManager {
|
|
|
83106
83137
|
*/
|
|
83107
83138
|
createStyleFunction(styleConfig) {
|
|
83108
83139
|
return (feature2, resolution) => {
|
|
83109
|
-
var _a3
|
|
83140
|
+
var _a3;
|
|
83110
83141
|
const geometryType = StyleFactory.getFeatureGeometryType(feature2);
|
|
83111
83142
|
const defaultConfig = this.getDefaultStyle(geometryType);
|
|
83112
83143
|
const customConfig = styleConfig == null ? void 0 : styleConfig[geometryType];
|
|
@@ -83115,11 +83146,11 @@ const _StyleManager = class _StyleManager {
|
|
|
83115
83146
|
const textCfg = { ...finalConfig.text };
|
|
83116
83147
|
let content2 = textCfg.text;
|
|
83117
83148
|
if (!content2 && typeof textCfg.field === "string") {
|
|
83118
|
-
const v5 =
|
|
83149
|
+
const v5 = feature2.get(textCfg.field);
|
|
83119
83150
|
content2 = v5 !== void 0 && v5 !== null ? String(v5) : "";
|
|
83120
83151
|
}
|
|
83121
83152
|
if (typeof textCfg.template === "string" && textCfg.template.length > 0) {
|
|
83122
|
-
const props = ((
|
|
83153
|
+
const props = ((_a3 = feature2.getProperties) == null ? void 0 : _a3.call(feature2)) || {};
|
|
83123
83154
|
content2 = textCfg.template.replace(/\{([^}]+)\}/g, (_m, key) => {
|
|
83124
83155
|
const v5 = props[key];
|
|
83125
83156
|
return v5 !== void 0 && v5 !== null ? String(v5) : "";
|
|
@@ -83210,6 +83241,7 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83210
83241
|
constructor(config, map2) {
|
|
83211
83242
|
super(config, map2);
|
|
83212
83243
|
__publicField(this, "styleConfig");
|
|
83244
|
+
// 新增:缓存启用的过滤器和原始要素集合
|
|
83213
83245
|
__publicField(this, "currentFilters", []);
|
|
83214
83246
|
__publicField(this, "originalFeatures", []);
|
|
83215
83247
|
}
|
|
@@ -83242,23 +83274,8 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83242
83274
|
} else if (this.config.url) {
|
|
83243
83275
|
const source = new VectorSource$2({
|
|
83244
83276
|
url: this.config.url,
|
|
83245
|
-
format: new GeoJSON$4({
|
|
83246
|
-
featureProjection: mapProjection
|
|
83247
|
-
})
|
|
83277
|
+
format: new GeoJSON$4({ featureProjection: mapProjection })
|
|
83248
83278
|
});
|
|
83249
|
-
try {
|
|
83250
|
-
const logOnce = (e8) => {
|
|
83251
|
-
var _a4, _b3;
|
|
83252
|
-
try {
|
|
83253
|
-
const props = ((_b3 = (_a4 = e8.feature) == null ? void 0 : _a4.getProperties) == null ? void 0 : _b3.call(_a4)) || {};
|
|
83254
|
-
console.log("[GeoJSONLayerHandler] addfeature 属性示例:", props);
|
|
83255
|
-
} catch (_2) {
|
|
83256
|
-
}
|
|
83257
|
-
source.un("addfeature", logOnce);
|
|
83258
|
-
};
|
|
83259
|
-
source.on("addfeature", logOnce);
|
|
83260
|
-
} catch (e8) {
|
|
83261
|
-
}
|
|
83262
83279
|
source.on("featuresloadend", () => {
|
|
83263
83280
|
this.originalFeatures = source.getFeatures();
|
|
83264
83281
|
});
|
|
@@ -83272,39 +83289,16 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83272
83289
|
*/
|
|
83273
83290
|
createStyleFunction() {
|
|
83274
83291
|
this.parseStyleConfig();
|
|
83275
|
-
|
|
83276
|
-
return (feature2, resolution) => {
|
|
83277
|
-
var _a3, _b3, _c2, _d, _e2, _f;
|
|
83278
|
-
const style = baseStyleFn(feature2, resolution);
|
|
83279
|
-
try {
|
|
83280
|
-
const geometry2 = (_a3 = feature2 == null ? void 0 : feature2.getGeometry) == null ? void 0 : _a3.call(feature2);
|
|
83281
|
-
const geometryType = ((_b3 = geometry2 == null ? void 0 : geometry2.getType) == null ? void 0 : _b3.call(geometry2)) || "Point";
|
|
83282
|
-
const textCfg = (_d = (_c2 = this.styleConfig) == null ? void 0 : _c2[geometryType]) == null ? void 0 : _d.text;
|
|
83283
|
-
if (textCfg && this.map && typeof this.map.getView === "function") {
|
|
83284
|
-
const z2 = (_f = (_e2 = this.map.getView()).getZoom) == null ? void 0 : _f.call(_e2);
|
|
83285
|
-
if (typeof z2 === "number") {
|
|
83286
|
-
const minZ = textCfg.minZoom;
|
|
83287
|
-
const maxZ = textCfg.maxZoom;
|
|
83288
|
-
const outOfRange = minZ != null && z2 < minZ || maxZ != null && z2 > maxZ;
|
|
83289
|
-
if (outOfRange && typeof style.setText === "function") {
|
|
83290
|
-
style.setText(null);
|
|
83291
|
-
}
|
|
83292
|
-
}
|
|
83293
|
-
}
|
|
83294
|
-
} catch (_2) {
|
|
83295
|
-
}
|
|
83296
|
-
return style;
|
|
83297
|
-
};
|
|
83292
|
+
return styleManager.createStyleFunction(this.styleConfig);
|
|
83298
83293
|
}
|
|
83299
83294
|
/**
|
|
83300
83295
|
* 解析样式配置
|
|
83301
83296
|
*/
|
|
83302
83297
|
parseStyleConfig() {
|
|
83303
|
-
var _a3;
|
|
83304
83298
|
if (!this.styleConfig) {
|
|
83305
83299
|
this.styleConfig = {};
|
|
83306
83300
|
}
|
|
83307
|
-
const style =
|
|
83301
|
+
const style = this.config.style;
|
|
83308
83302
|
if (style && typeof style === "object") {
|
|
83309
83303
|
const polygonStyle2 = {};
|
|
83310
83304
|
if (style.fill)
|
|
@@ -83314,12 +83308,12 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83314
83308
|
if (style.text)
|
|
83315
83309
|
polygonStyle2.text = style.text;
|
|
83316
83310
|
if (Object.keys(polygonStyle2).length > 0) {
|
|
83317
|
-
this.styleConfig.
|
|
83318
|
-
...this.styleConfig.
|
|
83311
|
+
this.styleConfig[GeometryType$2.POLYGON] = {
|
|
83312
|
+
...this.styleConfig[GeometryType$2.POLYGON] || {},
|
|
83319
83313
|
...polygonStyle2
|
|
83320
83314
|
};
|
|
83321
|
-
this.styleConfig.
|
|
83322
|
-
...this.styleConfig.
|
|
83315
|
+
this.styleConfig[GeometryType$2.MULTI_POLYGON] = {
|
|
83316
|
+
...this.styleConfig[GeometryType$2.MULTI_POLYGON] || {},
|
|
83323
83317
|
...polygonStyle2
|
|
83324
83318
|
};
|
|
83325
83319
|
}
|
|
@@ -83329,12 +83323,12 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83329
83323
|
if (style.text)
|
|
83330
83324
|
lineStyle2.text = style.text;
|
|
83331
83325
|
if (Object.keys(lineStyle2).length > 0) {
|
|
83332
|
-
this.styleConfig.
|
|
83333
|
-
...this.styleConfig.
|
|
83326
|
+
this.styleConfig[GeometryType$2.LINE_STRING] = {
|
|
83327
|
+
...this.styleConfig[GeometryType$2.LINE_STRING] || {},
|
|
83334
83328
|
...lineStyle2
|
|
83335
83329
|
};
|
|
83336
|
-
this.styleConfig.
|
|
83337
|
-
...this.styleConfig.
|
|
83330
|
+
this.styleConfig[GeometryType$2.MULTI_LINE_STRING] = {
|
|
83331
|
+
...this.styleConfig[GeometryType$2.MULTI_LINE_STRING] || {},
|
|
83338
83332
|
...lineStyle2
|
|
83339
83333
|
};
|
|
83340
83334
|
}
|
|
@@ -83348,12 +83342,12 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83348
83342
|
if (style.text)
|
|
83349
83343
|
pointStyle2.text = style.text;
|
|
83350
83344
|
if (Object.keys(pointStyle2).length > 0) {
|
|
83351
|
-
this.styleConfig.
|
|
83352
|
-
...this.styleConfig.
|
|
83345
|
+
this.styleConfig[GeometryType$2.POINT] = {
|
|
83346
|
+
...this.styleConfig[GeometryType$2.POINT] || {},
|
|
83353
83347
|
...pointStyle2
|
|
83354
83348
|
};
|
|
83355
|
-
this.styleConfig.
|
|
83356
|
-
...this.styleConfig.
|
|
83349
|
+
this.styleConfig[GeometryType$2.MULTI_POINT] = {
|
|
83350
|
+
...this.styleConfig[GeometryType$2.MULTI_POINT] || {},
|
|
83357
83351
|
...pointStyle2
|
|
83358
83352
|
};
|
|
83359
83353
|
}
|
|
@@ -83484,13 +83478,11 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83484
83478
|
* 设置基于属性的样式
|
|
83485
83479
|
*/
|
|
83486
83480
|
setPropertyBasedStyle(propertyName, styleMapping, defaultStyleConfig) {
|
|
83487
|
-
|
|
83488
|
-
|
|
83489
|
-
|
|
83490
|
-
defaultStyleConfig
|
|
83491
|
-
);
|
|
83481
|
+
if (defaultStyleConfig) {
|
|
83482
|
+
this.styleConfig = defaultStyleConfig;
|
|
83483
|
+
}
|
|
83492
83484
|
const layer2 = this.getLayer();
|
|
83493
|
-
layer2.setStyle(
|
|
83485
|
+
layer2.setStyle(this.createStyleFunction());
|
|
83494
83486
|
}
|
|
83495
83487
|
/**
|
|
83496
83488
|
* 定位到图层中的所有要素
|
|
@@ -83675,7 +83667,6 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83675
83667
|
* 应用过滤器(实现基类的抽象方法)
|
|
83676
83668
|
*/
|
|
83677
83669
|
applyFilters() {
|
|
83678
|
-
debugger;
|
|
83679
83670
|
const layer2 = this.getLayer();
|
|
83680
83671
|
const source = layer2.getSource();
|
|
83681
83672
|
if (!source)
|
|
@@ -83805,7 +83796,7 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83805
83796
|
{ regex: /^(\w+)\s*<=\s*([^'\s]+)$/, operator: FilterOperator.LESS_EQUAL },
|
|
83806
83797
|
// property LIKE 'pattern'
|
|
83807
83798
|
{ regex: /^(\w+)\s+LIKE\s+'([^']*)'$/i, operator: FilterOperator.LIKE },
|
|
83808
|
-
// property IN ('a','b',...) 或 property IN (1,2,...)
|
|
83799
|
+
// property IN ('a','b',...) 或 property IN (1,2,...),支持半角/全角括号
|
|
83809
83800
|
{ regex: /^(\w+)\s+IN\s*[\((]\s*([\s\S]+?)\s*[\))]\s*$/i, operator: FilterOperator.IN }
|
|
83810
83801
|
];
|
|
83811
83802
|
for (const pattern of patterns) {
|
|
@@ -83872,7 +83863,9 @@ class GeoJSONLayerHandler extends BaseLayer$2 {
|
|
|
83872
83863
|
const targetValue = config.caseSensitive ? String(featureValue) : String(featureValue).toLowerCase();
|
|
83873
83864
|
return targetValue.includes(searchValue);
|
|
83874
83865
|
case FilterOperator.IN:
|
|
83875
|
-
|
|
83866
|
+
if (!Array.isArray(filterValue))
|
|
83867
|
+
return false;
|
|
83868
|
+
return filterValue.some((v5) => String(v5) === String(featureValue));
|
|
83876
83869
|
case FilterOperator.BETWEEN:
|
|
83877
83870
|
if (Array.isArray(filterValue) && filterValue.length === 2) {
|
|
83878
83871
|
const numValue = Number(featureValue);
|
|
@@ -83911,6 +83904,7 @@ class KMLLayerHandler extends BaseLayer$2 {
|
|
|
83911
83904
|
this.kmlFormat = new KML$1({
|
|
83912
83905
|
className: this.config.className,
|
|
83913
83906
|
extractStyles: true,
|
|
83907
|
+
// 提取KML中的样式
|
|
83914
83908
|
showPointNames: false
|
|
83915
83909
|
// 不显示点名称
|
|
83916
83910
|
});
|
|
@@ -85330,7 +85324,10 @@ class ClusterLayerHandler extends BaseLayer$2 {
|
|
|
85330
85324
|
*/
|
|
85331
85325
|
createClusterStyleFunction() {
|
|
85332
85326
|
this.parseStyleConfig();
|
|
85333
|
-
return styleManager.createClusterStyleFunction(
|
|
85327
|
+
return styleManager.createClusterStyleFunction(
|
|
85328
|
+
this.clusterStyleConfig,
|
|
85329
|
+
this.singleFeatureStyleConfig
|
|
85330
|
+
);
|
|
85334
85331
|
}
|
|
85335
85332
|
/**
|
|
85336
85333
|
* 解析样式配置
|
|
@@ -85350,6 +85347,7 @@ class ClusterLayerHandler extends BaseLayer$2 {
|
|
|
85350
85347
|
return {
|
|
85351
85348
|
circle: {
|
|
85352
85349
|
radius: 15,
|
|
85350
|
+
// 动态半径将在样式管理器中处理
|
|
85353
85351
|
fill: { color: legacyStyle.clusterFillColor || "rgba(255, 153, 0, 0.8)" },
|
|
85354
85352
|
stroke: {
|
|
85355
85353
|
color: legacyStyle.clusterStrokeColor || "#fff",
|
|
@@ -85524,9 +85522,13 @@ class ImageVectorLayerHandler extends BaseLayer$2 {
|
|
|
85524
85522
|
style: this.createStyleFunction(),
|
|
85525
85523
|
// ImageVector图层特有的配置
|
|
85526
85524
|
imageRatio: this.config.imageRatio || 1,
|
|
85525
|
+
// 图像比率,用于高分辨率显示
|
|
85527
85526
|
renderBuffer: this.config.renderBuffer || 100,
|
|
85527
|
+
// 渲染缓冲区
|
|
85528
85528
|
renderOrder: this.config.renderOrder,
|
|
85529
|
+
// 渲染顺序
|
|
85529
85530
|
background: this.config.background,
|
|
85531
|
+
// 背景色
|
|
85530
85532
|
declutter: this.config.declutter || false
|
|
85531
85533
|
// 是否启用标注避让
|
|
85532
85534
|
});
|
|
@@ -85635,7 +85637,11 @@ class ImageVectorLayerHandler extends BaseLayer$2 {
|
|
|
85635
85637
|
* 设置基于属性的样式
|
|
85636
85638
|
*/
|
|
85637
85639
|
setPropertyBasedStyle(propertyName, styleMapping, defaultStyleConfig) {
|
|
85638
|
-
const styleFunction = styleManager.createPropertyBasedStyleFunction(
|
|
85640
|
+
const styleFunction = styleManager.createPropertyBasedStyleFunction(
|
|
85641
|
+
propertyName,
|
|
85642
|
+
styleMapping,
|
|
85643
|
+
defaultStyleConfig
|
|
85644
|
+
);
|
|
85639
85645
|
const layer2 = this.getLayer();
|
|
85640
85646
|
layer2.setStyle(styleFunction);
|
|
85641
85647
|
}
|
|
@@ -85760,6 +85766,7 @@ class SuperMapTiledMapServiceHandler extends BaseLayer$2 {
|
|
|
85760
85766
|
xyzOptions.tileGrid = new TileGrid$3({
|
|
85761
85767
|
extent: extent3,
|
|
85762
85768
|
origin: [-180, 90],
|
|
85769
|
+
// 左上角原点
|
|
85763
85770
|
resolutions: this.generateResolutions(),
|
|
85764
85771
|
tileSize: [256, 256]
|
|
85765
85772
|
});
|
|
@@ -464601,9 +464608,13 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464601
464608
|
if (config.center && config.center.length >= 2) {
|
|
464602
464609
|
const layerCenter = config.center;
|
|
464603
464610
|
const isInView = layerCenter[0] >= mapExtent[0] && layerCenter[0] <= mapExtent[2] && layerCenter[1] >= mapExtent[1] && layerCenter[1] <= mapExtent[3];
|
|
464604
|
-
console.log(
|
|
464611
|
+
console.log(
|
|
464612
|
+
`图层中心点 [${layerCenter[0]}, ${layerCenter[1]}] 是否在当前视图内: ${isInView}`
|
|
464613
|
+
);
|
|
464605
464614
|
if (!isInView) {
|
|
464606
|
-
console.warn(
|
|
464615
|
+
console.warn(
|
|
464616
|
+
`⚠️ 图层 ${config.name} 的中心点不在当前地图视图范围内,可能需要缩放到图层位置`
|
|
464617
|
+
);
|
|
464607
464618
|
}
|
|
464608
464619
|
}
|
|
464609
464620
|
}
|
|
@@ -464615,7 +464626,9 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464615
464626
|
if (this.styleApplied || this.styleApplyAttempts >= this.maxStyleApplyAttempts)
|
|
464616
464627
|
return;
|
|
464617
464628
|
this.styleApplyAttempts++;
|
|
464618
|
-
console.log(
|
|
464629
|
+
console.log(
|
|
464630
|
+
`尝试应用样式到SuperMap图层 ${this.config.name},第 ${this.styleApplyAttempts} 次`
|
|
464631
|
+
);
|
|
464619
464632
|
setTimeout(() => {
|
|
464620
464633
|
if (this.layer && this.config.style) {
|
|
464621
464634
|
try {
|
|
@@ -464623,7 +464636,10 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464623
464636
|
this.styleApplied = true;
|
|
464624
464637
|
console.log(`成功应用样式到SuperMap图层 ${this.config.name}`);
|
|
464625
464638
|
} catch (error2) {
|
|
464626
|
-
console.warn(
|
|
464639
|
+
console.warn(
|
|
464640
|
+
`应用样式到SuperMap图层 ${this.config.name} 失败:`,
|
|
464641
|
+
error2
|
|
464642
|
+
);
|
|
464627
464643
|
if (this.styleApplyAttempts < this.maxStyleApplyAttempts) {
|
|
464628
464644
|
setTimeout(() => this.tryApplyStyles(), 500);
|
|
464629
464645
|
}
|
|
@@ -464676,6 +464692,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464676
464692
|
const sourceOptions = {
|
|
464677
464693
|
url: config.url,
|
|
464678
464694
|
wrapX: true,
|
|
464695
|
+
// SuperMap服务通常不需要wrapX
|
|
464679
464696
|
format: config.format || "webp"
|
|
464680
464697
|
};
|
|
464681
464698
|
try {
|
|
@@ -464716,13 +464733,19 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464716
464733
|
console.log("📏 瓦片大小:", tileSize);
|
|
464717
464734
|
} else {
|
|
464718
464735
|
console.warn("map.json中没有bounds信息,使用默认配置");
|
|
464719
|
-
const tileGrid = await this.createTileGrid(
|
|
464736
|
+
const tileGrid = await this.createTileGrid(
|
|
464737
|
+
projection2.getCode(),
|
|
464738
|
+
config
|
|
464739
|
+
);
|
|
464720
464740
|
if (tileGrid)
|
|
464721
464741
|
sourceOptions.tileGrid = tileGrid;
|
|
464722
464742
|
}
|
|
464723
464743
|
} else {
|
|
464724
464744
|
console.warn(`无法获取map.json (${response.status}), 使用默认配置`);
|
|
464725
|
-
const tileGrid = await this.createTileGrid(
|
|
464745
|
+
const tileGrid = await this.createTileGrid(
|
|
464746
|
+
projection2.getCode(),
|
|
464747
|
+
config
|
|
464748
|
+
);
|
|
464726
464749
|
if (tileGrid)
|
|
464727
464750
|
sourceOptions.tileGrid = tileGrid;
|
|
464728
464751
|
}
|
|
@@ -464759,6 +464782,7 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464759
464782
|
origin,
|
|
464760
464783
|
extent: extent3,
|
|
464761
464784
|
resolutions,
|
|
464785
|
+
// 只显示前5个分辨率
|
|
464762
464786
|
tileSize,
|
|
464763
464787
|
configOrigin: config.origin,
|
|
464764
464788
|
calculatedOrigin: [extent3[0], extent3[3]]
|
|
@@ -464905,7 +464929,12 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464905
464929
|
* @returns Promise<any[]> 查询到的要素数组
|
|
464906
464930
|
*/
|
|
464907
464931
|
async queryFeatureByPointOL(lon2, lat2, options = {}) {
|
|
464908
|
-
const {
|
|
464932
|
+
const {
|
|
464933
|
+
datasetNames = ["hms:Football_field"],
|
|
464934
|
+
serviceUrl = "http://172.16.201.151/iserver/services/data-hms-public/rest/data",
|
|
464935
|
+
tolerance: tolerance2 = 0.027,
|
|
464936
|
+
vectorLayer = null
|
|
464937
|
+
} = options;
|
|
464909
464938
|
const point2 = new Point$b([lon2, lat2]);
|
|
464910
464939
|
let smGeom = Util2.toSuperMapGeometry(point2);
|
|
464911
464940
|
if (!smGeom) {
|
|
@@ -464925,36 +464954,39 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464925
464954
|
// tolerance 参数在此版本中不支持,已移除
|
|
464926
464955
|
});
|
|
464927
464956
|
return new Promise((resolve, reject2) => {
|
|
464928
|
-
new FeatureService2(serviceUrl).getFeaturesByGeometry(
|
|
464929
|
-
|
|
464930
|
-
|
|
464931
|
-
|
|
464932
|
-
|
|
464933
|
-
|
|
464934
|
-
|
|
464935
|
-
|
|
464936
|
-
|
|
464937
|
-
|
|
464938
|
-
|
|
464939
|
-
console.log("
|
|
464940
|
-
|
|
464941
|
-
|
|
464942
|
-
|
|
464943
|
-
|
|
464944
|
-
|
|
464945
|
-
|
|
464946
|
-
|
|
464947
|
-
|
|
464948
|
-
(_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
|
|
464949
|
-
features2.forEach((f2) => {
|
|
464950
|
-
var _a4;
|
|
464951
|
-
const olFeat = new Feature$6(Util2.toSuperMapGeometry(f2.geometry));
|
|
464952
|
-
olFeat.setProperties(f2.properties || {});
|
|
464953
|
-
(_a4 = vectorLayer.getSource()) == null ? void 0 : _a4.addFeature(olFeat);
|
|
464957
|
+
new FeatureService2(serviceUrl).getFeaturesByGeometry(
|
|
464958
|
+
queryParams,
|
|
464959
|
+
(result) => {
|
|
464960
|
+
var _a3, _b3, _c2;
|
|
464961
|
+
if (result.error) {
|
|
464962
|
+
console.error("iServer 错误:", result.error);
|
|
464963
|
+
reject2(result.error);
|
|
464964
|
+
return;
|
|
464965
|
+
}
|
|
464966
|
+
const rawFeatures = ((_b3 = (_a3 = result.result) == null ? void 0 : _a3.features) == null ? void 0 : _b3.features) || [];
|
|
464967
|
+
console.log("SuperMap查询结果:", result);
|
|
464968
|
+
console.log("原始要素数组:", rawFeatures);
|
|
464969
|
+
const features2 = rawFeatures.map((feature2) => {
|
|
464970
|
+
console.log("转换前的SuperMap要素:", feature2);
|
|
464971
|
+
console.log("要素的fieldNames:", feature2.fieldNames);
|
|
464972
|
+
console.log("要素的fieldValues:", feature2.fieldValues);
|
|
464973
|
+
const transformedFeature = this.transformSupermapFeature(feature2);
|
|
464974
|
+
console.log("转换后的标准要素:", transformedFeature);
|
|
464975
|
+
console.log("转换后的properties:", transformedFeature.properties);
|
|
464976
|
+
return transformedFeature;
|
|
464954
464977
|
});
|
|
464978
|
+
if (vectorLayer) {
|
|
464979
|
+
(_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
|
|
464980
|
+
features2.forEach((f2) => {
|
|
464981
|
+
var _a4;
|
|
464982
|
+
const olFeat = new Feature$6(Util2.toSuperMapGeometry(f2.geometry));
|
|
464983
|
+
olFeat.setProperties(f2.properties || {});
|
|
464984
|
+
(_a4 = vectorLayer.getSource()) == null ? void 0 : _a4.addFeature(olFeat);
|
|
464985
|
+
});
|
|
464986
|
+
}
|
|
464987
|
+
resolve(features2);
|
|
464955
464988
|
}
|
|
464956
|
-
|
|
464957
|
-
});
|
|
464989
|
+
);
|
|
464958
464990
|
});
|
|
464959
464991
|
}
|
|
464960
464992
|
/**
|
|
@@ -464966,7 +464998,12 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464966
464998
|
*/
|
|
464967
464999
|
async getFeaturesByBuffer(lon2 = 93.53179023100006, lat2 = 42.81598224900006, options = {}) {
|
|
464968
465000
|
try {
|
|
464969
|
-
const {
|
|
465001
|
+
const {
|
|
465002
|
+
bufferDistance = 0.027,
|
|
465003
|
+
datasetNames = ["hms:Football_field"],
|
|
465004
|
+
serviceUrl = "http://172.16.201.151/iserver/services/data-hms-public/rest/data",
|
|
465005
|
+
vectorLayer = null
|
|
465006
|
+
} = options;
|
|
464970
465007
|
const olPoint = new Point$b([lon2, lat2]);
|
|
464971
465008
|
let smGeom = Util2.toSuperMapGeometry(olPoint);
|
|
464972
465009
|
console.log("Util.toSuperMapGeometry ->", smGeom);
|
|
@@ -464976,46 +465013,54 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464976
465013
|
smGeom = new SuperMap2.Geometry.Point(lon2, lat2);
|
|
464977
465014
|
console.log("使用全局 SuperMap.Geometry.Point 构建 smGeom:", smGeom);
|
|
464978
465015
|
} else {
|
|
464979
|
-
console.warn(
|
|
465016
|
+
console.warn(
|
|
465017
|
+
"无法取得全局 SuperMap,无法构造 SuperMap.Geometry.Point。建议使用方案A的 REST 调用绕开。"
|
|
465018
|
+
);
|
|
464980
465019
|
}
|
|
464981
465020
|
}
|
|
464982
465021
|
if (!smGeom) {
|
|
464983
|
-
console.error(
|
|
465022
|
+
console.error(
|
|
465023
|
+
"无法构建 SuperMap Geometry(smGeom 为 null)。请使用方案A 或检查 iClient 的引入方式。"
|
|
465024
|
+
);
|
|
464984
465025
|
return [];
|
|
464985
465026
|
}
|
|
464986
465027
|
const bufferParams = new GetFeaturesByBufferParameters({
|
|
464987
465028
|
datasetNames,
|
|
464988
465029
|
bufferDistance,
|
|
465030
|
+
// 举例(300m ≈ 0.0027°),注意单位和坐标系一致
|
|
464989
465031
|
geometry: smGeom,
|
|
464990
465032
|
spatialQueryMode: "INTERSECT"
|
|
464991
465033
|
});
|
|
464992
465034
|
return new Promise((resolve, reject2) => {
|
|
464993
|
-
new FeatureService2(serviceUrl).getFeaturesByBuffer(
|
|
464994
|
-
|
|
464995
|
-
|
|
464996
|
-
|
|
464997
|
-
console.
|
|
464998
|
-
|
|
464999
|
-
|
|
465000
|
-
|
|
465001
|
-
|
|
465002
|
-
const feats = rawFeatures.map((f2) => {
|
|
465003
|
-
const transformedFeature = this.transformSupermapFeature(f2);
|
|
465004
|
-
console.log("Buffer查询 - 转换前的SuperMap数据:", f2);
|
|
465005
|
-
console.log("Buffer查询 - 转换后的标准数据:", transformedFeature);
|
|
465006
|
-
const olFeat = new Feature$6(Util2.toSuperMapGeometry(f2.geometry));
|
|
465007
|
-
olFeat.setProperties(transformedFeature.properties || {});
|
|
465008
|
-
return olFeat;
|
|
465009
|
-
});
|
|
465010
|
-
if (vectorLayer) {
|
|
465011
|
-
(_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
|
|
465012
|
-
if (feats.length) {
|
|
465013
|
-
(_d = vectorLayer.getSource()) == null ? void 0 : _d.addFeatures(feats);
|
|
465035
|
+
new FeatureService2(serviceUrl).getFeaturesByBuffer(
|
|
465036
|
+
bufferParams,
|
|
465037
|
+
(serviceResult) => {
|
|
465038
|
+
var _a3, _b3, _c2, _d;
|
|
465039
|
+
console.log("serviceResult:", serviceResult);
|
|
465040
|
+
if (serviceResult.error) {
|
|
465041
|
+
console.error("iServer error:", serviceResult.error);
|
|
465042
|
+
reject2(new Error("iServer 返回错误,详见控制台"));
|
|
465043
|
+
return;
|
|
465014
465044
|
}
|
|
465045
|
+
const rawFeatures = ((_b3 = (_a3 = serviceResult.result) == null ? void 0 : _a3.features) == null ? void 0 : _b3.features) || [];
|
|
465046
|
+
const feats = rawFeatures.map((f2) => {
|
|
465047
|
+
const transformedFeature = this.transformSupermapFeature(f2);
|
|
465048
|
+
console.log("Buffer查询 - 转换前的SuperMap数据:", f2);
|
|
465049
|
+
console.log("Buffer查询 - 转换后的标准数据:", transformedFeature);
|
|
465050
|
+
const olFeat = new Feature$6(Util2.toSuperMapGeometry(f2.geometry));
|
|
465051
|
+
olFeat.setProperties(transformedFeature.properties || {});
|
|
465052
|
+
return olFeat;
|
|
465053
|
+
});
|
|
465054
|
+
if (vectorLayer) {
|
|
465055
|
+
(_c2 = vectorLayer.getSource()) == null ? void 0 : _c2.clear();
|
|
465056
|
+
if (feats.length) {
|
|
465057
|
+
(_d = vectorLayer.getSource()) == null ? void 0 : _d.addFeatures(feats);
|
|
465058
|
+
}
|
|
465059
|
+
}
|
|
465060
|
+
console.log("查询并绘制完成,count:", feats.length);
|
|
465061
|
+
resolve(feats);
|
|
465015
465062
|
}
|
|
465016
|
-
|
|
465017
|
-
resolve(feats);
|
|
465018
|
-
});
|
|
465063
|
+
);
|
|
465019
465064
|
});
|
|
465020
465065
|
} catch (err2) {
|
|
465021
465066
|
console.error("queryBuffer 捕获异常:", err2);
|
|
@@ -465048,14 +465093,27 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465048
465093
|
console.warn("SuperMap图层缺少服务URL,无法进行要素查询");
|
|
465049
465094
|
return [];
|
|
465050
465095
|
}
|
|
465051
|
-
const {
|
|
465096
|
+
const {
|
|
465097
|
+
maxFeatures = 100,
|
|
465098
|
+
datasetNames,
|
|
465099
|
+
returnContent = true,
|
|
465100
|
+
targetProjection
|
|
465101
|
+
} = options;
|
|
465052
465102
|
try {
|
|
465053
465103
|
const mapProjection = (_a3 = this.map) == null ? void 0 : _a3.getView().getProjection();
|
|
465054
465104
|
const projectionCode = targetProjection || (mapProjection == null ? void 0 : mapProjection.getCode()) || "EPSG:4326";
|
|
465055
465105
|
let transformedBounds = bounds2;
|
|
465056
465106
|
if (mapProjection && targetProjection && mapProjection.getCode() !== targetProjection) {
|
|
465057
|
-
const bottomLeft = transform$l(
|
|
465058
|
-
|
|
465107
|
+
const bottomLeft = transform$l(
|
|
465108
|
+
[bounds2[0], bounds2[1]],
|
|
465109
|
+
mapProjection.getCode(),
|
|
465110
|
+
targetProjection
|
|
465111
|
+
);
|
|
465112
|
+
const topRight = transform$l(
|
|
465113
|
+
[bounds2[2], bounds2[3]],
|
|
465114
|
+
mapProjection.getCode(),
|
|
465115
|
+
targetProjection
|
|
465116
|
+
);
|
|
465059
465117
|
transformedBounds = [
|
|
465060
465118
|
bottomLeft[0],
|
|
465061
465119
|
bottomLeft[1],
|
|
@@ -465077,22 +465135,29 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465077
465135
|
});
|
|
465078
465136
|
const boundsService = new GetFeaturesByBoundsService(serviceUrl);
|
|
465079
465137
|
return new Promise((resolve, reject2) => {
|
|
465080
|
-
boundsService.getFeaturesByBounds(
|
|
465081
|
-
|
|
465082
|
-
|
|
465083
|
-
|
|
465084
|
-
if (
|
|
465085
|
-
|
|
465086
|
-
|
|
465138
|
+
boundsService.getFeaturesByBounds(
|
|
465139
|
+
boundsParams,
|
|
465140
|
+
(serviceResult) => {
|
|
465141
|
+
var _a4;
|
|
465142
|
+
if (serviceResult.type === "processCompleted") {
|
|
465143
|
+
const result = serviceResult.result;
|
|
465144
|
+
if (result && result.features) {
|
|
465145
|
+
console.log(
|
|
465146
|
+
`SuperMap边界查询成功,找到 ${result.features.length} 个要素`
|
|
465147
|
+
);
|
|
465148
|
+
resolve(result.features);
|
|
465149
|
+
} else {
|
|
465150
|
+
console.log("SuperMap边界查询完成,但未找到要素");
|
|
465151
|
+
resolve([]);
|
|
465152
|
+
}
|
|
465087
465153
|
} else {
|
|
465088
|
-
console.
|
|
465089
|
-
|
|
465154
|
+
console.error("SuperMap边界查询失败:", serviceResult.error);
|
|
465155
|
+
reject2(
|
|
465156
|
+
new Error(((_a4 = serviceResult.error) == null ? void 0 : _a4.errorMsg) || "边界查询失败")
|
|
465157
|
+
);
|
|
465090
465158
|
}
|
|
465091
|
-
} else {
|
|
465092
|
-
console.error("SuperMap边界查询失败:", serviceResult.error);
|
|
465093
|
-
reject2(new Error(((_a4 = serviceResult.error) == null ? void 0 : _a4.errorMsg) || "边界查询失败"));
|
|
465094
465159
|
}
|
|
465095
|
-
|
|
465160
|
+
);
|
|
465096
465161
|
});
|
|
465097
465162
|
} catch (error2) {
|
|
465098
465163
|
console.error("SuperMap边界查询异常:", error2);
|
|
@@ -465111,7 +465176,13 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465111
465176
|
console.warn("SuperMap图层缺少服务URL,无法进行要素查询");
|
|
465112
465177
|
return [];
|
|
465113
465178
|
}
|
|
465114
|
-
const {
|
|
465179
|
+
const {
|
|
465180
|
+
maxFeatures = 100,
|
|
465181
|
+
datasetNames,
|
|
465182
|
+
returnContent = true,
|
|
465183
|
+
spatialQueryMode = "INTERSECT",
|
|
465184
|
+
targetProjection
|
|
465185
|
+
} = options;
|
|
465115
465186
|
try {
|
|
465116
465187
|
const serviceUrl = this.buildDataServiceUrl(config.url);
|
|
465117
465188
|
console.log(`开始SuperMap几何查询:`, {
|
|
@@ -465128,22 +465199,29 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465128
465199
|
});
|
|
465129
465200
|
const geometryService = new GetFeaturesByGeometryService(serviceUrl);
|
|
465130
465201
|
return new Promise((resolve, reject2) => {
|
|
465131
|
-
geometryService.getFeaturesByGeometry(
|
|
465132
|
-
|
|
465133
|
-
|
|
465134
|
-
|
|
465135
|
-
if (
|
|
465136
|
-
|
|
465137
|
-
|
|
465202
|
+
geometryService.getFeaturesByGeometry(
|
|
465203
|
+
geometryParams,
|
|
465204
|
+
(serviceResult) => {
|
|
465205
|
+
var _a3;
|
|
465206
|
+
if (serviceResult.type === "processCompleted") {
|
|
465207
|
+
const result = serviceResult.result;
|
|
465208
|
+
if (result && result.features) {
|
|
465209
|
+
console.log(
|
|
465210
|
+
`SuperMap几何查询成功,找到 ${result.features.length} 个要素`
|
|
465211
|
+
);
|
|
465212
|
+
resolve(result.features);
|
|
465213
|
+
} else {
|
|
465214
|
+
console.log("SuperMap几何查询完成,但未找到要素");
|
|
465215
|
+
resolve([]);
|
|
465216
|
+
}
|
|
465138
465217
|
} else {
|
|
465139
|
-
console.
|
|
465140
|
-
|
|
465218
|
+
console.error("SuperMap几何查询失败:", serviceResult.error);
|
|
465219
|
+
reject2(
|
|
465220
|
+
new Error(((_a3 = serviceResult.error) == null ? void 0 : _a3.errorMsg) || "几何查询失败")
|
|
465221
|
+
);
|
|
465141
465222
|
}
|
|
465142
|
-
} else {
|
|
465143
|
-
console.error("SuperMap几何查询失败:", serviceResult.error);
|
|
465144
|
-
reject2(new Error(((_a3 = serviceResult.error) == null ? void 0 : _a3.errorMsg) || "几何查询失败"));
|
|
465145
465223
|
}
|
|
465146
|
-
|
|
465224
|
+
);
|
|
465147
465225
|
});
|
|
465148
465226
|
} catch (error2) {
|
|
465149
465227
|
console.error("SuperMap几何查询异常:", error2);
|
|
@@ -465162,7 +465240,12 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465162
465240
|
console.warn("SuperMap图层缺少服务URL,无法进行要素查询");
|
|
465163
465241
|
return [];
|
|
465164
465242
|
}
|
|
465165
|
-
const {
|
|
465243
|
+
const {
|
|
465244
|
+
maxFeatures = 100,
|
|
465245
|
+
datasetNames,
|
|
465246
|
+
returnContent = true,
|
|
465247
|
+
targetProjection
|
|
465248
|
+
} = options;
|
|
465166
465249
|
try {
|
|
465167
465250
|
const serviceUrl = this.buildDataServiceUrl(config.url);
|
|
465168
465251
|
console.log(`开始SuperMap SQL查询:`, {
|
|
@@ -465185,7 +465268,9 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465185
465268
|
if (serviceResult.type === "processCompleted") {
|
|
465186
465269
|
const result = serviceResult.result;
|
|
465187
465270
|
if (result && result.features) {
|
|
465188
|
-
console.log(
|
|
465271
|
+
console.log(
|
|
465272
|
+
`SuperMap SQL查询成功,找到 ${result.features.length} 个要素`
|
|
465273
|
+
);
|
|
465189
465274
|
resolve(result.features);
|
|
465190
465275
|
} else {
|
|
465191
465276
|
console.log("SuperMap SQL查询完成,但未找到要素");
|
|
@@ -465233,7 +465318,9 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465233
465318
|
if (serviceResult.type === "processCompleted") {
|
|
465234
465319
|
const result = serviceResult.result;
|
|
465235
465320
|
if (result && result.features) {
|
|
465236
|
-
console.log(
|
|
465321
|
+
console.log(
|
|
465322
|
+
`SuperMap ID查询成功,找到 ${result.features.length} 个要素`
|
|
465323
|
+
);
|
|
465237
465324
|
resolve(result.features);
|
|
465238
465325
|
} else {
|
|
465239
465326
|
console.log("SuperMap ID查询完成,但未找到要素");
|
|
@@ -465263,7 +465350,10 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465263
465350
|
return mapUrl;
|
|
465264
465351
|
}
|
|
465265
465352
|
if (url.pathname.includes("/rest/maps/")) {
|
|
465266
|
-
const dataServiceUrl = mapUrl.replace(
|
|
465353
|
+
const dataServiceUrl = mapUrl.replace(
|
|
465354
|
+
/\/rest\/maps\/.*$/,
|
|
465355
|
+
"/rest/data"
|
|
465356
|
+
);
|
|
465267
465357
|
console.log(`构建数据服务URL: ${mapUrl} -> ${dataServiceUrl}`);
|
|
465268
465358
|
return dataServiceUrl;
|
|
465269
465359
|
}
|
|
@@ -465273,7 +465363,9 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465273
465363
|
const serviceName = pathParts[servicesIndex + 1];
|
|
465274
465364
|
const basePath = pathParts.slice(0, servicesIndex + 2).join("/");
|
|
465275
465365
|
const dataServiceUrl = `${url.protocol}//${url.host}/${basePath}/rest/data`;
|
|
465276
|
-
console.log(
|
|
465366
|
+
console.log(
|
|
465367
|
+
`从服务名称构建数据服务URL: ${mapUrl} -> ${dataServiceUrl}`
|
|
465368
|
+
);
|
|
465277
465369
|
return dataServiceUrl;
|
|
465278
465370
|
}
|
|
465279
465371
|
throw new Error(`无法解析SuperMap服务URL格式: ${mapUrl}`);
|
|
@@ -465317,24 +465409,37 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
465317
465409
|
*/
|
|
465318
465410
|
async getFeatureInfoAtCoordinate(coordinate, options = {}) {
|
|
465319
465411
|
var _a3, _b3, _c2, _d, _e2, _f;
|
|
465320
|
-
const {
|
|
465412
|
+
const {
|
|
465413
|
+
bufferDistance = 100,
|
|
465414
|
+
maxFeatures = options.featureCount || 10,
|
|
465415
|
+
queryMethod
|
|
465416
|
+
} = options;
|
|
465321
465417
|
try {
|
|
465322
465418
|
let features2 = [];
|
|
465323
465419
|
const finalQueryMethod = queryMethod || ((_a3 = this.config.supermapConfig) == null ? void 0 : _a3.queryMethod) || "point";
|
|
465324
465420
|
console.log(`使用查询方式: ${finalQueryMethod}`);
|
|
465325
465421
|
if (finalQueryMethod === "buffer") {
|
|
465326
465422
|
const configuredBufferDistance = ((_b3 = this.config.supermapConfig) == null ? void 0 : _b3.bufferDistance) || bufferDistance;
|
|
465327
|
-
features2 = await this.getFeaturesByBuffer(
|
|
465328
|
-
|
|
465329
|
-
|
|
465330
|
-
|
|
465331
|
-
|
|
465423
|
+
features2 = await this.getFeaturesByBuffer(
|
|
465424
|
+
coordinate[0],
|
|
465425
|
+
coordinate[1],
|
|
465426
|
+
{
|
|
465427
|
+
bufferDistance: configuredBufferDistance / 1e3,
|
|
465428
|
+
// 转换为度数单位
|
|
465429
|
+
datasetNames: (_c2 = this.config.supermapConfig) == null ? void 0 : _c2.datasetNames,
|
|
465430
|
+
serviceUrl: (_d = this.config.supermapConfig) == null ? void 0 : _d.featureServiceUrl
|
|
465431
|
+
}
|
|
465432
|
+
);
|
|
465332
465433
|
} else {
|
|
465333
|
-
features2 = await this.queryFeatureByPointOL(
|
|
465334
|
-
|
|
465335
|
-
|
|
465336
|
-
|
|
465337
|
-
|
|
465434
|
+
features2 = await this.queryFeatureByPointOL(
|
|
465435
|
+
coordinate[0],
|
|
465436
|
+
coordinate[1],
|
|
465437
|
+
{
|
|
465438
|
+
datasetNames: (_e2 = this.config.supermapConfig) == null ? void 0 : _e2.datasetNames,
|
|
465439
|
+
serviceUrl: (_f = this.config.supermapConfig) == null ? void 0 : _f.featureServiceUrl
|
|
465440
|
+
// tolerance 参数已移除,使用默认值
|
|
465441
|
+
}
|
|
465442
|
+
);
|
|
465338
465443
|
}
|
|
465339
465444
|
return features2.slice(0, maxFeatures).map((feature2) => {
|
|
465340
465445
|
if (feature2 && typeof feature2.getProperties === "function") {
|
|
@@ -465412,7 +465517,9 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
|
|
|
465412
465517
|
* 检查是否是天地图URL
|
|
465413
465518
|
*/
|
|
465414
465519
|
isTiandituUrl(url) {
|
|
465415
|
-
return _TiandituLayerHandler.TIANDITU_DOMAINS.some(
|
|
465520
|
+
return _TiandituLayerHandler.TIANDITU_DOMAINS.some(
|
|
465521
|
+
(domain) => url.includes(domain)
|
|
465522
|
+
);
|
|
465416
465523
|
}
|
|
465417
465524
|
/**
|
|
465418
465525
|
* 检查是否是开发模式
|
|
@@ -465426,7 +465533,9 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
|
|
|
465426
465533
|
convertToProxyUrl(originalUrl) {
|
|
465427
465534
|
const urlObj = new URL(originalUrl);
|
|
465428
465535
|
const pathParts = urlObj.pathname.split("/");
|
|
465429
|
-
const serviceType = pathParts.find(
|
|
465536
|
+
const serviceType = pathParts.find(
|
|
465537
|
+
(part) => Object.values(_TiandituLayerHandler.TIANDITU_SERVICES).includes(part)
|
|
465538
|
+
);
|
|
465430
465539
|
if (!serviceType) {
|
|
465431
465540
|
console.warn("无法识别天地图服务类型,使用默认代理路径");
|
|
465432
465541
|
return `/api/tianditu${urlObj.pathname}${urlObj.search}`;
|
|
@@ -465443,7 +465552,9 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
|
|
|
465443
465552
|
return null;
|
|
465444
465553
|
const urlObj = new URL(this.config.url);
|
|
465445
465554
|
const pathParts = urlObj.pathname.split("/");
|
|
465446
|
-
return pathParts.find(
|
|
465555
|
+
return pathParts.find(
|
|
465556
|
+
(part) => Object.values(_TiandituLayerHandler.TIANDITU_SERVICES).includes(part)
|
|
465557
|
+
) || null;
|
|
465447
465558
|
}
|
|
465448
465559
|
/**
|
|
465449
465560
|
* 设置天地图密钥
|
|
@@ -465503,7 +465614,12 @@ const _TiandituLayerHandler = class _TiandituLayerHandler extends BaseLayer$2 {
|
|
|
465503
465614
|
* 创建标准天地图URL
|
|
465504
465615
|
*/
|
|
465505
465616
|
static createTiandituUrl(serviceType, options = {}) {
|
|
465506
|
-
const {
|
|
465617
|
+
const {
|
|
465618
|
+
tk = "YOUR_TIANDITU_KEY",
|
|
465619
|
+
domain = "t{0-7}.tianditu.gov.cn",
|
|
465620
|
+
format: format2 = "tiles",
|
|
465621
|
+
style = "default"
|
|
465622
|
+
} = options;
|
|
465507
465623
|
const service = _TiandituLayerHandler.TIANDITU_SERVICES[serviceType];
|
|
465508
465624
|
if (!service) {
|
|
465509
465625
|
throw new Error(`不支持的天地图服务类型: ${serviceType}`);
|
|
@@ -465533,10 +465649,15 @@ __publicField(_TiandituLayerHandler, "TIANDITU_DOMAINS", [
|
|
|
465533
465649
|
]);
|
|
465534
465650
|
__publicField(_TiandituLayerHandler, "TIANDITU_SERVICES", {
|
|
465535
465651
|
"img": "img_w",
|
|
465652
|
+
// 卫星影像
|
|
465536
465653
|
"vec": "vec_w",
|
|
465654
|
+
// 矢量地图
|
|
465537
465655
|
"cva": "cva_w",
|
|
465656
|
+
// 矢量注记
|
|
465538
465657
|
"cia": "cia_w",
|
|
465658
|
+
// 影像注记
|
|
465539
465659
|
"ter": "ter_w",
|
|
465660
|
+
// 地形图
|
|
465540
465661
|
"cta": "cta_w"
|
|
465541
465662
|
// 地形注记
|
|
465542
465663
|
});
|
|
@@ -465552,6 +465673,7 @@ class CanvasLayerHandler extends BaseLayer$2 {
|
|
|
465552
465673
|
className: this.config.className,
|
|
465553
465674
|
canvasFunction: this.getCanvasFunction(),
|
|
465554
465675
|
projection: "EPSG:4326",
|
|
465676
|
+
// 默认投影
|
|
465555
465677
|
ratio: 1
|
|
465556
465678
|
});
|
|
465557
465679
|
const imageLayer = new ImageLayer$3({
|
|
@@ -465575,7 +465697,13 @@ class CanvasLayerHandler extends BaseLayer$2 {
|
|
|
465575
465697
|
canvas.width = size2[0];
|
|
465576
465698
|
canvas.height = size2[1];
|
|
465577
465699
|
const canvasConfig = this.config.canvasConfig || {};
|
|
465578
|
-
const {
|
|
465700
|
+
const {
|
|
465701
|
+
backgroundColor: backgroundColor2 = "transparent",
|
|
465702
|
+
gridSize = 50,
|
|
465703
|
+
gridColor = "#cccccc",
|
|
465704
|
+
showGrid = false,
|
|
465705
|
+
customDrawFunction
|
|
465706
|
+
} = canvasConfig;
|
|
465579
465707
|
if (backgroundColor2 !== "transparent") {
|
|
465580
465708
|
context.fillStyle = backgroundColor2;
|
|
465581
465709
|
context.fillRect(0, 0, canvas.width, canvas.height);
|
|
@@ -465730,11 +465858,17 @@ class VectorTileLayerHandler extends BaseLayer$2 {
|
|
|
465730
465858
|
style: this.createStyleFunction(),
|
|
465731
465859
|
// VectorTile图层特有的配置
|
|
465732
465860
|
renderBuffer: this.config.renderBuffer || 100,
|
|
465861
|
+
// 渲染缓冲区
|
|
465733
465862
|
renderOrder: this.config.renderOrder,
|
|
465863
|
+
// 渲染顺序
|
|
465734
465864
|
renderMode: this.config.renderMode || "hybrid",
|
|
465865
|
+
// 渲染模式:'hybrid' | 'vector'
|
|
465735
465866
|
declutter: this.config.declutter || false,
|
|
465867
|
+
// 是否启用标注避让
|
|
465736
465868
|
background: this.config.background,
|
|
465869
|
+
// 背景色
|
|
465737
465870
|
preload: this.config.preload || 0,
|
|
465871
|
+
// 预加载级别
|
|
465738
465872
|
useInterimTilesOnError: this.config.useInterimTilesOnError !== false
|
|
465739
465873
|
// 错误时使用临时瓦片
|
|
465740
465874
|
});
|
|
@@ -465754,6 +465888,7 @@ class VectorTileLayerHandler extends BaseLayer$2 {
|
|
|
465754
465888
|
minZoom: config.minZoom || 0,
|
|
465755
465889
|
tileSize: config.tileSize || 512,
|
|
465756
465890
|
overlaps: config.overlaps !== false,
|
|
465891
|
+
// 默认允许重叠
|
|
465757
465892
|
projection: config.projection || "EPSG:4326"
|
|
465758
465893
|
};
|
|
465759
465894
|
if (config.tileGrid) {
|
|
@@ -466056,11 +466191,15 @@ class VectorTileLayerHandler extends BaseLayer$2 {
|
|
|
466056
466191
|
const extent3 = view.calculateExtent();
|
|
466057
466192
|
const resolution = view.getResolution();
|
|
466058
466193
|
try {
|
|
466059
|
-
source.forEachFeatureAtCoordinateAndResolution(
|
|
466060
|
-
|
|
466061
|
-
|
|
466062
|
-
|
|
466063
|
-
|
|
466194
|
+
source.forEachFeatureAtCoordinateAndResolution(
|
|
466195
|
+
extent3,
|
|
466196
|
+
resolution || 1,
|
|
466197
|
+
(feature2) => {
|
|
466198
|
+
const props = feature2.getProperties();
|
|
466199
|
+
const { geometry: geometry2, ...dataProps } = props;
|
|
466200
|
+
properties.push(dataProps);
|
|
466201
|
+
}
|
|
466202
|
+
);
|
|
466064
466203
|
} catch (error2) {
|
|
466065
466204
|
console.warn("获取VectorTile要素属性时出错:", error2);
|
|
466066
466205
|
}
|
|
@@ -466226,6 +466365,28 @@ const _LayerFactory = class _LayerFactory {
|
|
|
466226
466365
|
__publicField(_LayerFactory, "instance");
|
|
466227
466366
|
let LayerFactory = _LayerFactory;
|
|
466228
466367
|
const layerFactory = LayerFactory.getInstance();
|
|
466368
|
+
class LayerEventBus {
|
|
466369
|
+
constructor() {
|
|
466370
|
+
__publicField(this, "emitter");
|
|
466371
|
+
this.emitter = mitt();
|
|
466372
|
+
}
|
|
466373
|
+
emit(type, event) {
|
|
466374
|
+
this.emitter.emit(type, event);
|
|
466375
|
+
}
|
|
466376
|
+
on(type, handler) {
|
|
466377
|
+
this.emitter.on(type, handler);
|
|
466378
|
+
}
|
|
466379
|
+
off(type, handler) {
|
|
466380
|
+
this.emitter.off(type, handler);
|
|
466381
|
+
}
|
|
466382
|
+
clear() {
|
|
466383
|
+
this.emitter.all.clear();
|
|
466384
|
+
}
|
|
466385
|
+
}
|
|
466386
|
+
function createLayerEventBus() {
|
|
466387
|
+
return new LayerEventBus();
|
|
466388
|
+
}
|
|
466389
|
+
const layerEventBus = mitt();
|
|
466229
466390
|
class LayerManager {
|
|
466230
466391
|
constructor(map2, eventBus, storage2) {
|
|
466231
466392
|
__publicField(this, "map");
|
|
@@ -466256,6 +466417,7 @@ class LayerManager {
|
|
|
466256
466417
|
...config,
|
|
466257
466418
|
id: layerId,
|
|
466258
466419
|
visible: config.visible ?? false,
|
|
466420
|
+
// 默认设置为false,避免意外激活图层
|
|
466259
466421
|
opacity: config.opacity ?? 1,
|
|
466260
466422
|
zIndex: config.zIndex ?? 0
|
|
466261
466423
|
};
|
|
@@ -466416,6 +466578,15 @@ class LayerManager {
|
|
|
466416
466578
|
return true;
|
|
466417
466579
|
} catch (error2) {
|
|
466418
466580
|
console.error("添加图层失败:", error2);
|
|
466581
|
+
this.pendingLayerConfigs.set(fullConfig.id, fullConfig);
|
|
466582
|
+
this.saveLayerConfigs();
|
|
466583
|
+
this.eventBus.emit("layer-added", {
|
|
466584
|
+
layerId: fullConfig.id,
|
|
466585
|
+
layerName: fullConfig.name,
|
|
466586
|
+
layerType: fullConfig.type,
|
|
466587
|
+
visible: fullConfig.visible ?? false,
|
|
466588
|
+
layerConfig: fullConfig
|
|
466589
|
+
});
|
|
466419
466590
|
return false;
|
|
466420
466591
|
}
|
|
466421
466592
|
}
|
|
@@ -466432,6 +466603,7 @@ class LayerManager {
|
|
|
466432
466603
|
...childConfig,
|
|
466433
466604
|
id: childLayerId,
|
|
466434
466605
|
visible: groupConfig.visible ?? false,
|
|
466606
|
+
// 子图层的可见性完全跟随组图层
|
|
466435
466607
|
opacity: childConfig.opacity ?? groupConfig.opacity
|
|
466436
466608
|
};
|
|
466437
466609
|
if (this.addLayer(childFullConfig)) {
|
|
@@ -466446,6 +466618,7 @@ class LayerManager {
|
|
|
466446
466618
|
...layerConfig,
|
|
466447
466619
|
id: layerLayerId,
|
|
466448
466620
|
visible: groupConfig.visible ?? false,
|
|
466621
|
+
// 子图层的可见性完全跟随组图层
|
|
466449
466622
|
opacity: layerConfig.opacity ?? groupConfig.opacity
|
|
466450
466623
|
};
|
|
466451
466624
|
if (this.addLayer(layerFullConfig)) {
|
|
@@ -466659,7 +466832,9 @@ class LayerManager {
|
|
|
466659
466832
|
async hideOtherBasemaps(currentBasemapId) {
|
|
466660
466833
|
try {
|
|
466661
466834
|
const allConfigs = [...this.layerConfigs.values(), ...this.pendingLayerConfigs.values()];
|
|
466662
|
-
const basemapConfigs = allConfigs.filter(
|
|
466835
|
+
const basemapConfigs = allConfigs.filter(
|
|
466836
|
+
(config) => this.isBasemapLayer(config.id) && config.id !== currentBasemapId
|
|
466837
|
+
);
|
|
466663
466838
|
for (const config of basemapConfigs) {
|
|
466664
466839
|
if (config.visible) {
|
|
466665
466840
|
const handler = this.layerHandlers.get(config.id);
|
|
@@ -466684,7 +466859,9 @@ class LayerManager {
|
|
|
466684
466859
|
async hideOtherBasemapsOnInit(currentBasemapId) {
|
|
466685
466860
|
try {
|
|
466686
466861
|
const allConfigs = [...this.layerConfigs.values(), ...this.pendingLayerConfigs.values()];
|
|
466687
|
-
const basemapConfigs = allConfigs.filter(
|
|
466862
|
+
const basemapConfigs = allConfigs.filter(
|
|
466863
|
+
(config) => this.isBasemapLayer(config.id) && config.id !== currentBasemapId && config.visible
|
|
466864
|
+
);
|
|
466688
466865
|
for (const config of basemapConfigs) {
|
|
466689
466866
|
const handler = this.layerHandlers.get(config.id);
|
|
466690
466867
|
if (handler) {
|
|
@@ -466970,11 +467147,15 @@ class LayerManager {
|
|
|
466970
467147
|
try {
|
|
466971
467148
|
if (config.type === "TileSuperMapRest" || config.type === "tilesupermaprest" || config.type === "TILESUPERMAPREST") {
|
|
466972
467149
|
if ("getFeatureInfoAtCoordinate" in handler) {
|
|
466973
|
-
const features2 = await handler.getFeatureInfoAtCoordinate(
|
|
466974
|
-
|
|
466975
|
-
|
|
466976
|
-
|
|
466977
|
-
|
|
467150
|
+
const features2 = await handler.getFeatureInfoAtCoordinate(
|
|
467151
|
+
coordinate,
|
|
467152
|
+
{
|
|
467153
|
+
bufferDistance: 80,
|
|
467154
|
+
// 默认5米缓冲区
|
|
467155
|
+
maxFeatures: (options == null ? void 0 : options.featureCount) || 10,
|
|
467156
|
+
returnContent: true
|
|
467157
|
+
}
|
|
467158
|
+
);
|
|
466978
467159
|
if (features2 && features2.length > 0) {
|
|
466979
467160
|
results.push({
|
|
466980
467161
|
layerId,
|
|
@@ -466986,10 +467167,13 @@ class LayerManager {
|
|
|
466986
467167
|
}
|
|
466987
467168
|
} else if (config.type === "wms" || config.type === "WMS") {
|
|
466988
467169
|
if ("getFeatureInfoAtCoordinate" in handler) {
|
|
466989
|
-
const features2 = await handler.getFeatureInfoAtCoordinate(
|
|
466990
|
-
|
|
466991
|
-
|
|
466992
|
-
|
|
467170
|
+
const features2 = await handler.getFeatureInfoAtCoordinate(
|
|
467171
|
+
coordinate,
|
|
467172
|
+
{
|
|
467173
|
+
infoFormat: (options == null ? void 0 : options.infoFormat) || "application/json",
|
|
467174
|
+
featureCount: (options == null ? void 0 : options.featureCount) || 10
|
|
467175
|
+
}
|
|
467176
|
+
);
|
|
466993
467177
|
if (features2 && features2.length > 0) {
|
|
466994
467178
|
results.push({
|
|
466995
467179
|
layerId,
|
|
@@ -467054,28 +467238,6 @@ class LayerManager {
|
|
|
467054
467238
|
this.layerConfigs.clear();
|
|
467055
467239
|
}
|
|
467056
467240
|
}
|
|
467057
|
-
class LayerEventBus {
|
|
467058
|
-
constructor() {
|
|
467059
|
-
__publicField(this, "emitter");
|
|
467060
|
-
this.emitter = mitt();
|
|
467061
|
-
}
|
|
467062
|
-
emit(type, event) {
|
|
467063
|
-
this.emitter.emit(type, event);
|
|
467064
|
-
}
|
|
467065
|
-
on(type, handler) {
|
|
467066
|
-
this.emitter.on(type, handler);
|
|
467067
|
-
}
|
|
467068
|
-
off(type, handler) {
|
|
467069
|
-
this.emitter.off(type, handler);
|
|
467070
|
-
}
|
|
467071
|
-
clear() {
|
|
467072
|
-
this.emitter.all.clear();
|
|
467073
|
-
}
|
|
467074
|
-
}
|
|
467075
|
-
function createLayerEventBus() {
|
|
467076
|
-
return new LayerEventBus();
|
|
467077
|
-
}
|
|
467078
|
-
const layerEventBus = mitt();
|
|
467079
467241
|
const DEFAULT_HIGHLIGHT_STYLE = {
|
|
467080
467242
|
fill: {
|
|
467081
467243
|
color: "rgba(255, 255, 0, 0.3)",
|
|
@@ -467594,12 +467756,12 @@ const _hoisted_3$k = {
|
|
|
467594
467756
|
};
|
|
467595
467757
|
const _hoisted_4$k = { class: "image-popup-main" };
|
|
467596
467758
|
const _hoisted_5$k = { class: "image-container" };
|
|
467597
|
-
const _hoisted_6$
|
|
467598
|
-
const _hoisted_7$
|
|
467759
|
+
const _hoisted_6$h = ["src", "alt"];
|
|
467760
|
+
const _hoisted_7$f = {
|
|
467599
467761
|
key: 0,
|
|
467600
467762
|
class: "image-loading"
|
|
467601
467763
|
};
|
|
467602
|
-
const _hoisted_8$
|
|
467764
|
+
const _hoisted_8$c = {
|
|
467603
467765
|
key: 1,
|
|
467604
467766
|
class: "image-error"
|
|
467605
467767
|
};
|
|
@@ -467777,12 +467939,12 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
467777
467939
|
onLoad: handleImageLoad,
|
|
467778
467940
|
onError: handleImageError,
|
|
467779
467941
|
onClick: handleImageClick
|
|
467780
|
-
}, null, 40, _hoisted_6$
|
|
467781
|
-
imageLoading.value ? (openBlock(), createElementBlock("div", _hoisted_7$
|
|
467942
|
+
}, null, 40, _hoisted_6$h),
|
|
467943
|
+
imageLoading.value ? (openBlock(), createElementBlock("div", _hoisted_7$f, [..._cache[4] || (_cache[4] = [
|
|
467782
467944
|
createElementVNode("div", { class: "loading-spinner" }, null, -1),
|
|
467783
467945
|
createElementVNode("span", null, "加载中...", -1)
|
|
467784
467946
|
])])) : createCommentVNode("", true),
|
|
467785
|
-
imageError.value ? (openBlock(), createElementBlock("div", _hoisted_8$
|
|
467947
|
+
imageError.value ? (openBlock(), createElementBlock("div", _hoisted_8$c, [..._cache[5] || (_cache[5] = [
|
|
467786
467948
|
createElementVNode("span", null, "图片加载失败", -1)
|
|
467787
467949
|
])])) : createCommentVNode("", true),
|
|
467788
467950
|
imageList.value.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_9$a, [
|
|
@@ -467893,12 +468055,12 @@ const _hoisted_5$j = {
|
|
|
467893
468055
|
key: 3,
|
|
467894
468056
|
class: "search-container"
|
|
467895
468057
|
};
|
|
467896
|
-
const _hoisted_6$
|
|
468058
|
+
const _hoisted_6$g = {
|
|
467897
468059
|
key: 4,
|
|
467898
468060
|
class: "data-stats"
|
|
467899
468061
|
};
|
|
467900
|
-
const _hoisted_7$
|
|
467901
|
-
const _hoisted_8$
|
|
468062
|
+
const _hoisted_7$e = { key: 0 };
|
|
468063
|
+
const _hoisted_8$b = {
|
|
467902
468064
|
key: 5,
|
|
467903
468065
|
class: "table-view"
|
|
467904
468066
|
};
|
|
@@ -468155,11 +468317,11 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
468155
468317
|
clearable: ""
|
|
468156
468318
|
}, null, 8, ["modelValue"])
|
|
468157
468319
|
])) : createCommentVNode("", true),
|
|
468158
|
-
_ctx.config.showStats ? (openBlock(), createElementBlock("div", _hoisted_6$
|
|
468320
|
+
_ctx.config.showStats ? (openBlock(), createElementBlock("div", _hoisted_6$g, [
|
|
468159
468321
|
createElementVNode("span", null, "共 " + toDisplayString(filteredData.value.length) + " 条记录", 1),
|
|
468160
|
-
searchQuery.value ? (openBlock(), createElementBlock("span", _hoisted_7$
|
|
468322
|
+
searchQuery.value ? (openBlock(), createElementBlock("span", _hoisted_7$e, "(已过滤 " + toDisplayString(arrayData.value.length - filteredData.value.length) + " 条)", 1)) : createCommentVNode("", true)
|
|
468161
468323
|
])) : createCommentVNode("", true),
|
|
468162
|
-
currentView.value === "table" ? (openBlock(), createElementBlock("div", _hoisted_8$
|
|
468324
|
+
currentView.value === "table" ? (openBlock(), createElementBlock("div", _hoisted_8$b, [
|
|
468163
468325
|
createElementVNode("div", _hoisted_9$9, [
|
|
468164
468326
|
createElementVNode("table", _hoisted_10$9, [
|
|
468165
468327
|
createElementVNode("thead", null, [
|
|
@@ -470019,9 +470181,9 @@ const _hoisted_4$i = {
|
|
|
470019
470181
|
class: "px-5 py-4 border-t border-gray-200 bg-gray-50 flex justify-end gap-3"
|
|
470020
470182
|
};
|
|
470021
470183
|
const _hoisted_5$i = ["onMousedown"];
|
|
470022
|
-
const _hoisted_6$
|
|
470023
|
-
const _hoisted_7$
|
|
470024
|
-
const _hoisted_8$
|
|
470184
|
+
const _hoisted_6$f = { class: "text-base font-semibold text-gray-800 flex-1 overflow-hidden text-ellipsis whitespace-nowrap" };
|
|
470185
|
+
const _hoisted_7$d = { class: "flex items-center gap-2" };
|
|
470186
|
+
const _hoisted_8$a = { class: "flex-1 overflow-auto min-h-0 h-0" };
|
|
470025
470187
|
const _hoisted_9$8 = {
|
|
470026
470188
|
key: 0,
|
|
470027
470189
|
class: "px-5 py-4 border-t border-gray-200 bg-gray-50 flex justify-end gap-3"
|
|
@@ -470535,12 +470697,12 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
470535
470697
|
class: normalizeClass(["flex items-center justify-between px-5 py-4 border-b border-gray-200 bg-gray-50", { "cursor-move": _ctx.draggable && !isFullscreen.value }]),
|
|
470536
470698
|
onMousedown: startDrag
|
|
470537
470699
|
}, [
|
|
470538
|
-
createElementVNode("div", _hoisted_6$
|
|
470700
|
+
createElementVNode("div", _hoisted_6$f, [
|
|
470539
470701
|
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
470540
470702
|
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
470541
470703
|
], true)
|
|
470542
470704
|
]),
|
|
470543
|
-
createElementVNode("div", _hoisted_7$
|
|
470705
|
+
createElementVNode("div", _hoisted_7$d, [
|
|
470544
470706
|
_ctx.showFullscreen ? (openBlock(), createBlock(unref(ElButton), {
|
|
470545
470707
|
key: 0,
|
|
470546
470708
|
class: "w-6 h-6 border-none bg-transparent cursor-pointer flex items-center justify-center rounded text-gray-500 transition-all duration-200 hover:bg-gray-200 hover:text-gray-600",
|
|
@@ -470567,7 +470729,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
470567
470729
|
})) : createCommentVNode("", true)
|
|
470568
470730
|
])
|
|
470569
470731
|
], 34),
|
|
470570
|
-
createElementVNode("div", _hoisted_8$
|
|
470732
|
+
createElementVNode("div", _hoisted_8$a, [
|
|
470571
470733
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
470572
470734
|
]),
|
|
470573
470735
|
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_9$8, [
|
|
@@ -470628,7 +470790,7 @@ const _hoisted_2$h = { class: "basemap-grid" };
|
|
|
470628
470790
|
const _hoisted_3$h = ["onClick"];
|
|
470629
470791
|
const _hoisted_4$h = { class: "basemap-preview" };
|
|
470630
470792
|
const _hoisted_5$h = ["src", "alt"];
|
|
470631
|
-
const _hoisted_6$
|
|
470793
|
+
const _hoisted_6$e = { class: "basemap-name" };
|
|
470632
470794
|
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
470633
470795
|
__name: "BasemapPanel",
|
|
470634
470796
|
props: {
|
|
@@ -470875,7 +471037,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
470875
471037
|
loading: "lazy"
|
|
470876
471038
|
}, null, 8, _hoisted_5$h)
|
|
470877
471039
|
]),
|
|
470878
|
-
createElementVNode("div", _hoisted_6$
|
|
471040
|
+
createElementVNode("div", _hoisted_6$e, toDisplayString(basemap.name), 1)
|
|
470879
471041
|
], 10, _hoisted_3$h);
|
|
470880
471042
|
}), 128))
|
|
470881
471043
|
])
|
|
@@ -471223,9 +471385,9 @@ const _hoisted_2$g = { class: "measurement-header flex justify-between items-cen
|
|
|
471223
471385
|
const _hoisted_3$g = { class: "measurement-result py-8 text-center" };
|
|
471224
471386
|
const _hoisted_4$g = { class: "result-value" };
|
|
471225
471387
|
const _hoisted_5$g = { class: "tool-grid flex-1 py-5" };
|
|
471226
|
-
const _hoisted_6$
|
|
471227
|
-
const _hoisted_7$
|
|
471228
|
-
const _hoisted_8$
|
|
471388
|
+
const _hoisted_6$d = ["onClick"];
|
|
471389
|
+
const _hoisted_7$c = ["src", "alt"];
|
|
471390
|
+
const _hoisted_8$9 = { class: "tool-label" };
|
|
471229
471391
|
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
471230
471392
|
__name: "MeasurementDialog",
|
|
471231
471393
|
props: {
|
|
@@ -471551,9 +471713,9 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
471551
471713
|
src: tool.icon,
|
|
471552
471714
|
alt: tool.label,
|
|
471553
471715
|
class: "tool-icon"
|
|
471554
|
-
}, null, 8, _hoisted_7$
|
|
471555
|
-
createElementVNode("span", _hoisted_8$
|
|
471556
|
-
], 10, _hoisted_6$
|
|
471716
|
+
}, null, 8, _hoisted_7$c),
|
|
471717
|
+
createElementVNode("span", _hoisted_8$9, toDisplayString(tool.label), 1)
|
|
471718
|
+
], 10, _hoisted_6$d);
|
|
471557
471719
|
}), 64))
|
|
471558
471720
|
])
|
|
471559
471721
|
])
|
|
@@ -471829,9 +471991,9 @@ const _hoisted_2$e = {
|
|
|
471829
471991
|
const _hoisted_3$e = { class: "region-group" };
|
|
471830
471992
|
const _hoisted_4$e = { class: "region-items" };
|
|
471831
471993
|
const _hoisted_5$e = { class: "region-group" };
|
|
471832
|
-
const _hoisted_6$
|
|
471833
|
-
const _hoisted_7$
|
|
471834
|
-
const _hoisted_8$
|
|
471994
|
+
const _hoisted_6$c = { class: "region-items" };
|
|
471995
|
+
const _hoisted_7$b = { class: "region-group" };
|
|
471996
|
+
const _hoisted_8$8 = { class: "region-items" };
|
|
471835
471997
|
const _hoisted_9$7 = { class: "region-group" };
|
|
471836
471998
|
const _hoisted_10$7 = { class: "region-items" };
|
|
471837
471999
|
const _hoisted_11$7 = { class: "region-group" };
|
|
@@ -472982,7 +473144,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
472982
473144
|
]),
|
|
472983
473145
|
createElementVNode("div", _hoisted_5$e, [
|
|
472984
473146
|
_cache[3] || (_cache[3] = createElementVNode("div", { class: "group-title" }, "东北", -1)),
|
|
472985
|
-
createElementVNode("div", _hoisted_6$
|
|
473147
|
+
createElementVNode("div", _hoisted_6$c, [
|
|
472986
473148
|
(openBlock(true), createElementBlock(Fragment, null, renderList(regions.northeast, (region) => {
|
|
472987
473149
|
return openBlock(), createBlock(_component_el_button, {
|
|
472988
473150
|
key: region.code,
|
|
@@ -472998,9 +473160,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
472998
473160
|
}), 128))
|
|
472999
473161
|
])
|
|
473000
473162
|
]),
|
|
473001
|
-
createElementVNode("div", _hoisted_7$
|
|
473163
|
+
createElementVNode("div", _hoisted_7$b, [
|
|
473002
473164
|
_cache[4] || (_cache[4] = createElementVNode("div", { class: "group-title" }, "华东", -1)),
|
|
473003
|
-
createElementVNode("div", _hoisted_8$
|
|
473165
|
+
createElementVNode("div", _hoisted_8$8, [
|
|
473004
473166
|
(openBlock(true), createElementBlock(Fragment, null, renderList(regions.east, (region) => {
|
|
473005
473167
|
return openBlock(), createBlock(_component_el_button, {
|
|
473006
473168
|
key: region.code,
|
|
@@ -473719,9 +473881,9 @@ const _hoisted_2$c = { class: "toolbar" };
|
|
|
473719
473881
|
const _hoisted_3$c = { class: "search-filter" };
|
|
473720
473882
|
const _hoisted_4$c = { class: "bookmarks-grid" };
|
|
473721
473883
|
const _hoisted_5$c = ["onClick"];
|
|
473722
|
-
const _hoisted_6$
|
|
473723
|
-
const _hoisted_7$
|
|
473724
|
-
const _hoisted_8$
|
|
473884
|
+
const _hoisted_6$b = { class: "bookmark-thumbnail" };
|
|
473885
|
+
const _hoisted_7$a = { class: "thumbnail-placeholder" };
|
|
473886
|
+
const _hoisted_8$7 = { class: "bookmark-overlay" };
|
|
473725
473887
|
const _hoisted_9$6 = { class: "bookmark-info" };
|
|
473726
473888
|
const _hoisted_10$6 = { class: "bookmark-title" };
|
|
473727
473889
|
const _hoisted_11$6 = { class: "bookmark-meta" };
|
|
@@ -474123,8 +474285,8 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
474123
474285
|
class: "bookmark-card",
|
|
474124
474286
|
onClick: ($event) => applyBookmark(bookmark)
|
|
474125
474287
|
}, [
|
|
474126
|
-
createElementVNode("div", _hoisted_6$
|
|
474127
|
-
createElementVNode("div", _hoisted_7$
|
|
474288
|
+
createElementVNode("div", _hoisted_6$b, [
|
|
474289
|
+
createElementVNode("div", _hoisted_7$a, [
|
|
474128
474290
|
createVNode$1(_component_el_icon, {
|
|
474129
474291
|
size: "40",
|
|
474130
474292
|
color: "#409eff"
|
|
@@ -474135,7 +474297,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
474135
474297
|
_: 1
|
|
474136
474298
|
})
|
|
474137
474299
|
]),
|
|
474138
|
-
createElementVNode("div", _hoisted_8$
|
|
474300
|
+
createElementVNode("div", _hoisted_8$7, [
|
|
474139
474301
|
createVNode$1(_component_el_button_group, null, {
|
|
474140
474302
|
default: withCtx(() => [
|
|
474141
474303
|
createVNode$1(_component_el_button, {
|
|
@@ -474435,12 +474597,12 @@ const _hoisted_2$b = { class: "h-150 overflow-y-auto" };
|
|
|
474435
474597
|
const _hoisted_3$b = { class: "flex items-center justify-between" };
|
|
474436
474598
|
const _hoisted_4$b = { class: "mb-5" };
|
|
474437
474599
|
const _hoisted_5$b = { class: "mb-3" };
|
|
474438
|
-
const _hoisted_6$
|
|
474600
|
+
const _hoisted_6$a = {
|
|
474439
474601
|
key: 0,
|
|
474440
474602
|
class: "mb-3"
|
|
474441
474603
|
};
|
|
474442
|
-
const _hoisted_7$
|
|
474443
|
-
const _hoisted_8$
|
|
474604
|
+
const _hoisted_7$9 = { class: "flex gap-2" };
|
|
474605
|
+
const _hoisted_8$6 = { class: "mb-5" };
|
|
474444
474606
|
const _hoisted_9$5 = { class: "mb-3" };
|
|
474445
474607
|
const _hoisted_10$5 = { class: "mb-3" };
|
|
474446
474608
|
const _hoisted_11$5 = { key: 0 };
|
|
@@ -475010,8 +475172,8 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
475010
475172
|
_: 1
|
|
475011
475173
|
}, 8, ["modelValue"])
|
|
475012
475174
|
]),
|
|
475013
|
-
printSettings.paperSize === "Custom" ? (openBlock(), createElementBlock("div", _hoisted_6$
|
|
475014
|
-
createElementVNode("div", _hoisted_7$
|
|
475175
|
+
printSettings.paperSize === "Custom" ? (openBlock(), createElementBlock("div", _hoisted_6$a, [
|
|
475176
|
+
createElementVNode("div", _hoisted_7$9, [
|
|
475015
475177
|
createVNode$1(_component_el_input, {
|
|
475016
475178
|
modelValue: printSettings.customWidth,
|
|
475017
475179
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => printSettings.customWidth = $event),
|
|
@@ -475051,7 +475213,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
475051
475213
|
}, 8, ["modelValue"])
|
|
475052
475214
|
])
|
|
475053
475215
|
]),
|
|
475054
|
-
createElementVNode("div", _hoisted_8$
|
|
475216
|
+
createElementVNode("div", _hoisted_8$6, [
|
|
475055
475217
|
_cache[23] || (_cache[23] = createElementVNode("label", { class: "block text-sm font-medium text-gray-700 mb-2" }, "地图设置", -1)),
|
|
475056
475218
|
createElementVNode("div", _hoisted_9$5, [
|
|
475057
475219
|
createVNode$1(_component_el_select, {
|
|
@@ -475511,8 +475673,8 @@ const _hoisted_2$a = { class: "continuous-switch" };
|
|
|
475511
475673
|
const _hoisted_3$a = { class: "tools-grid" };
|
|
475512
475674
|
const _hoisted_4$a = ["onClick"];
|
|
475513
475675
|
const _hoisted_5$a = ["src"];
|
|
475514
|
-
const _hoisted_6$
|
|
475515
|
-
const _hoisted_7$
|
|
475676
|
+
const _hoisted_6$9 = { class: "tool-label" };
|
|
475677
|
+
const _hoisted_7$8 = {
|
|
475516
475678
|
key: 0,
|
|
475517
475679
|
class: "stop-drawing-section"
|
|
475518
475680
|
};
|
|
@@ -476081,11 +476243,11 @@ const _sfc_main$c = {
|
|
|
476081
476243
|
key: 1,
|
|
476082
476244
|
class: normalizeClass([tool.icon, "tool-icon-large"])
|
|
476083
476245
|
}, null, 2)),
|
|
476084
|
-
createElementVNode("span", _hoisted_6$
|
|
476246
|
+
createElementVNode("span", _hoisted_6$9, toDisplayString(tool.label), 1)
|
|
476085
476247
|
], 8, _hoisted_4$a);
|
|
476086
476248
|
}), 128))
|
|
476087
476249
|
]),
|
|
476088
|
-
activeDrawingTool.value && continuousDrawing.value ? (openBlock(), createElementBlock("div", _hoisted_7$
|
|
476250
|
+
activeDrawingTool.value && continuousDrawing.value ? (openBlock(), createElementBlock("div", _hoisted_7$8, [
|
|
476089
476251
|
createVNode$1(_component_el_button, {
|
|
476090
476252
|
type: "danger",
|
|
476091
476253
|
size: "small",
|
|
@@ -476108,8 +476270,8 @@ const _hoisted_2$9 = { class: "toolbar" };
|
|
|
476108
476270
|
const _hoisted_3$9 = { class: "toolbar-left" };
|
|
476109
476271
|
const _hoisted_4$9 = { class: "data-count" };
|
|
476110
476272
|
const _hoisted_5$9 = { class: "list-content" };
|
|
476111
|
-
const _hoisted_6$
|
|
476112
|
-
const _hoisted_7$
|
|
476273
|
+
const _hoisted_6$8 = { class: "tree-node" };
|
|
476274
|
+
const _hoisted_7$7 = {
|
|
476113
476275
|
key: 1,
|
|
476114
476276
|
class: "empty-state"
|
|
476115
476277
|
};
|
|
@@ -476172,13 +476334,13 @@ const _sfc_main$b = {
|
|
|
476172
476334
|
class: "tree-component"
|
|
476173
476335
|
}, {
|
|
476174
476336
|
default: withCtx(({ data }) => [
|
|
476175
|
-
createElementVNode("div", _hoisted_6$
|
|
476337
|
+
createElementVNode("div", _hoisted_6$8, [
|
|
476176
476338
|
_cache[3] || (_cache[3] = createElementVNode("i", { class: "i-carbon-folder node-icon" }, null, -1)),
|
|
476177
476339
|
createElementVNode("span", null, toDisplayString(data.label), 1)
|
|
476178
476340
|
])
|
|
476179
476341
|
]),
|
|
476180
476342
|
_: 1
|
|
476181
|
-
}, 8, ["data"])) : (openBlock(), createElementBlock("div", _hoisted_7$
|
|
476343
|
+
}, 8, ["data"])) : (openBlock(), createElementBlock("div", _hoisted_7$7, "暂无数据"))
|
|
476182
476344
|
])
|
|
476183
476345
|
]);
|
|
476184
476346
|
};
|
|
@@ -476190,8 +476352,8 @@ const _hoisted_2$8 = { class: "toolbar" };
|
|
|
476190
476352
|
const _hoisted_3$8 = { class: "toolbar-left" };
|
|
476191
476353
|
const _hoisted_4$8 = ["onClick"];
|
|
476192
476354
|
const _hoisted_5$8 = { class: "toolbar-right" };
|
|
476193
|
-
const _hoisted_6$
|
|
476194
|
-
const _hoisted_7$
|
|
476355
|
+
const _hoisted_6$7 = ["onClick"];
|
|
476356
|
+
const _hoisted_7$6 = { class: "content-area" };
|
|
476195
476357
|
const _sfc_main$a = {
|
|
476196
476358
|
__name: "index",
|
|
476197
476359
|
setup(__props) {
|
|
@@ -476286,14 +476448,14 @@ const _sfc_main$a = {
|
|
|
476286
476448
|
createElementVNode("i", {
|
|
476287
476449
|
class: normalizeClass([tool.icon, "tool-icon"]),
|
|
476288
476450
|
onClick: ($event) => handleToolClick(tool, "right", idx)
|
|
476289
|
-
}, null, 10, _hoisted_6$
|
|
476451
|
+
}, null, 10, _hoisted_6$7)
|
|
476290
476452
|
]),
|
|
476291
476453
|
_: 2
|
|
476292
476454
|
}, 1032, ["content"]);
|
|
476293
476455
|
}), 64))
|
|
476294
476456
|
])
|
|
476295
476457
|
]),
|
|
476296
|
-
createElementVNode("div", _hoisted_7$
|
|
476458
|
+
createElementVNode("div", _hoisted_7$6, [
|
|
476297
476459
|
createVNode$1(_component_el_tabs, {
|
|
476298
476460
|
modelValue: activeTab.value,
|
|
476299
476461
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTab.value = $event),
|
|
@@ -477414,9 +477576,9 @@ const _hoisted_3$7 = {
|
|
|
477414
477576
|
};
|
|
477415
477577
|
const _hoisted_4$7 = { class: "section-title" };
|
|
477416
477578
|
const _hoisted_5$7 = ["onClick"];
|
|
477417
|
-
const _hoisted_6$
|
|
477418
|
-
const _hoisted_7$
|
|
477419
|
-
const _hoisted_8$
|
|
477579
|
+
const _hoisted_6$6 = { class: "item-content" };
|
|
477580
|
+
const _hoisted_7$5 = { class: "item-name" };
|
|
477581
|
+
const _hoisted_8$5 = { class: "item-address" };
|
|
477420
477582
|
const _hoisted_9$4 = {
|
|
477421
477583
|
key: 1,
|
|
477422
477584
|
class: "search-section"
|
|
@@ -477789,9 +477951,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
477789
477951
|
]),
|
|
477790
477952
|
_: 1
|
|
477791
477953
|
}),
|
|
477792
|
-
createElementVNode("div", _hoisted_6$
|
|
477793
|
-
createElementVNode("div", _hoisted_7$
|
|
477794
|
-
createElementVNode("div", _hoisted_8$
|
|
477954
|
+
createElementVNode("div", _hoisted_6$6, [
|
|
477955
|
+
createElementVNode("div", _hoisted_7$5, toDisplayString(item.name), 1),
|
|
477956
|
+
createElementVNode("div", _hoisted_8$5, toDisplayString(item.address), 1)
|
|
477795
477957
|
])
|
|
477796
477958
|
], 10, _hoisted_5$7)
|
|
477797
477959
|
]);
|
|
@@ -478419,9 +478581,9 @@ const _hoisted_2$6 = { class: "panel-actions" };
|
|
|
478419
478581
|
const _hoisted_3$6 = { class: "panel-content max-h-125 overflow-y-auto" };
|
|
478420
478582
|
const _hoisted_4$6 = { class: "p-2" };
|
|
478421
478583
|
const _hoisted_5$6 = { class: "legend-content p-2" };
|
|
478422
|
-
const _hoisted_6$
|
|
478423
|
-
const _hoisted_7$
|
|
478424
|
-
const _hoisted_8$
|
|
478584
|
+
const _hoisted_6$5 = { key: 0 };
|
|
478585
|
+
const _hoisted_7$4 = { class: "text-xs text-gray-600" };
|
|
478586
|
+
const _hoisted_8$4 = { key: 1 };
|
|
478425
478587
|
const _hoisted_9$3 = { class: "text-xs text-gray-600" };
|
|
478426
478588
|
const _hoisted_10$3 = { key: 2 };
|
|
478427
478589
|
const _hoisted_11$3 = { class: "relative mb-2" };
|
|
@@ -478688,7 +478850,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
478688
478850
|
}, {
|
|
478689
478851
|
default: withCtx(() => [
|
|
478690
478852
|
createElementVNode("div", _hoisted_5$6, [
|
|
478691
|
-
legend.type === "symbol" ? (openBlock(), createElementBlock("div", _hoisted_6$
|
|
478853
|
+
legend.type === "symbol" ? (openBlock(), createElementBlock("div", _hoisted_6$5, [
|
|
478692
478854
|
(openBlock(true), createElementBlock(Fragment, null, renderList(legend.items, (item) => {
|
|
478693
478855
|
return openBlock(), createElementBlock("div", {
|
|
478694
478856
|
key: item.value,
|
|
@@ -478698,10 +478860,10 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
478698
478860
|
class: "w-4 h-4 mr-2 border border-gray-300",
|
|
478699
478861
|
style: normalizeStyle$1(getSymbolStyle(item))
|
|
478700
478862
|
}, null, 4),
|
|
478701
|
-
createElementVNode("span", _hoisted_7$
|
|
478863
|
+
createElementVNode("span", _hoisted_7$4, toDisplayString(item.label), 1)
|
|
478702
478864
|
]);
|
|
478703
478865
|
}), 128))
|
|
478704
|
-
])) : legend.type === "color" ? (openBlock(), createElementBlock("div", _hoisted_8$
|
|
478866
|
+
])) : legend.type === "color" ? (openBlock(), createElementBlock("div", _hoisted_8$4, [
|
|
478705
478867
|
(openBlock(true), createElementBlock(Fragment, null, renderList(legend.items, (item) => {
|
|
478706
478868
|
return openBlock(), createElementBlock("div", {
|
|
478707
478869
|
key: item.value,
|
|
@@ -479187,15 +479349,22 @@ class LayerTreeManager {
|
|
|
479187
479349
|
__publicField(this, "layerGroups", ref([]));
|
|
479188
479350
|
// 默认展开的节点
|
|
479189
479351
|
__publicField(this, "defaultExpandedKeys", ref([]));
|
|
479190
|
-
//
|
|
479352
|
+
// 默认选中的节点(基于图层及其children的可见性)
|
|
479191
479353
|
__publicField(this, "defaultCheckedKeys", computed(() => {
|
|
479192
479354
|
const checkedKeys = [];
|
|
479355
|
+
const collectVisibleIds = (layer2) => {
|
|
479356
|
+
if (layer2.visible && layer2.type !== "group") {
|
|
479357
|
+
checkedKeys.push(layer2.id);
|
|
479358
|
+
}
|
|
479359
|
+
if (layer2.children && Array.isArray(layer2.children)) {
|
|
479360
|
+
layer2.children.forEach((child) => collectVisibleIds(child));
|
|
479361
|
+
}
|
|
479362
|
+
};
|
|
479193
479363
|
this.layerGroups.value.forEach((group2) => {
|
|
479194
479364
|
let allVisible = true;
|
|
479195
479365
|
group2.layers.forEach((layer2) => {
|
|
479196
|
-
|
|
479197
|
-
|
|
479198
|
-
} else {
|
|
479366
|
+
collectVisibleIds(layer2);
|
|
479367
|
+
if (!layer2.visible) {
|
|
479199
479368
|
allVisible = false;
|
|
479200
479369
|
}
|
|
479201
479370
|
});
|
|
@@ -479266,6 +479435,10 @@ class LayerTreeManager {
|
|
|
479266
479435
|
* @param data 树节点数据
|
|
479267
479436
|
*/
|
|
479268
479437
|
handleLayerDoubleClick(data) {
|
|
479438
|
+
if (data.type === "group") {
|
|
479439
|
+
this.handleGroupDoubleClick(data);
|
|
479440
|
+
return;
|
|
479441
|
+
}
|
|
479269
479442
|
if (data.type !== "layer" || !data.layerData) {
|
|
479270
479443
|
return;
|
|
479271
479444
|
}
|
|
@@ -479343,6 +479516,96 @@ class LayerTreeManager {
|
|
|
479343
479516
|
ElMessage.error(`定位到图层失败: ${data.layerData.name}`);
|
|
479344
479517
|
}
|
|
479345
479518
|
}
|
|
479519
|
+
/**
|
|
479520
|
+
* 处理分组双击事件 - 聚合定位到分组范围
|
|
479521
|
+
* @param data 分组树节点数据
|
|
479522
|
+
*/
|
|
479523
|
+
handleGroupDoubleClick(data) {
|
|
479524
|
+
var _a3;
|
|
479525
|
+
if (!this.layerManager || !this.map) {
|
|
479526
|
+
ElMessage.warning("地图或图层管理器未初始化");
|
|
479527
|
+
return;
|
|
479528
|
+
}
|
|
479529
|
+
const collectLayerConfigs = (node, acc) => {
|
|
479530
|
+
if (node.type === "layer" && node.layerData) {
|
|
479531
|
+
acc.push(node.layerData);
|
|
479532
|
+
if (node.children && node.children.length > 0) {
|
|
479533
|
+
node.children.forEach((child) => collectLayerConfigs(child, acc));
|
|
479534
|
+
}
|
|
479535
|
+
} else if (node.type === "group" && node.children && node.children.length > 0) {
|
|
479536
|
+
node.children.forEach((child) => collectLayerConfigs(child, acc));
|
|
479537
|
+
}
|
|
479538
|
+
};
|
|
479539
|
+
const allConfigs = [];
|
|
479540
|
+
collectLayerConfigs(data, allConfigs);
|
|
479541
|
+
if (allConfigs.length === 0) {
|
|
479542
|
+
ElMessage.info("分组下没有图层");
|
|
479543
|
+
return;
|
|
479544
|
+
}
|
|
479545
|
+
const extent3 = createEmpty$1();
|
|
479546
|
+
let hasValidExtent = false;
|
|
479547
|
+
for (const cfg of allConfigs) {
|
|
479548
|
+
if (cfg.visible === false)
|
|
479549
|
+
continue;
|
|
479550
|
+
const handler = this.layerManager.getLayerHandler(cfg.id);
|
|
479551
|
+
if (!handler)
|
|
479552
|
+
continue;
|
|
479553
|
+
const layer2 = handler.getLayer();
|
|
479554
|
+
if (!layer2)
|
|
479555
|
+
continue;
|
|
479556
|
+
const source = (_a3 = layer2.getSource) == null ? void 0 : _a3.call(layer2);
|
|
479557
|
+
let layerExtent = null;
|
|
479558
|
+
if (source && typeof source.getExtent === "function") {
|
|
479559
|
+
layerExtent = source.getExtent();
|
|
479560
|
+
} else if (source && source.getTileGrid && typeof source.getTileGrid === "function") {
|
|
479561
|
+
const tileGrid = source.getTileGrid();
|
|
479562
|
+
if (tileGrid && typeof tileGrid.getExtent === "function") {
|
|
479563
|
+
layerExtent = tileGrid.getExtent();
|
|
479564
|
+
}
|
|
479565
|
+
}
|
|
479566
|
+
if (layerExtent && Array.isArray(layerExtent) && layerExtent.every((v5) => isFinite(v5))) {
|
|
479567
|
+
extend$e(extent3, layerExtent);
|
|
479568
|
+
hasValidExtent = true;
|
|
479569
|
+
}
|
|
479570
|
+
}
|
|
479571
|
+
const view = this.map.getView();
|
|
479572
|
+
const defaultAnimationConfig = {
|
|
479573
|
+
enabled: true,
|
|
479574
|
+
duration: 1e3,
|
|
479575
|
+
easing: "ease-out",
|
|
479576
|
+
maxZoom: 16,
|
|
479577
|
+
padding: [50, 50, 50, 50]
|
|
479578
|
+
};
|
|
479579
|
+
if (!hasValidExtent || isEmpty$4(extent3)) {
|
|
479580
|
+
const centerCfg = allConfigs.find((c2) => Array.isArray(c2.center) && c2.center.length === 2);
|
|
479581
|
+
if (centerCfg && centerCfg.center) {
|
|
479582
|
+
const mapProjection = view.getProjection().getCode();
|
|
479583
|
+
const center2 = mapProjection === "EPSG:4326" || mapProjection === "EPSG:4490" ? centerCfg.center : fromLonLat$1(centerCfg.center);
|
|
479584
|
+
{
|
|
479585
|
+
view.animate({
|
|
479586
|
+
center: center2,
|
|
479587
|
+
zoom: 12,
|
|
479588
|
+
duration: defaultAnimationConfig.duration,
|
|
479589
|
+
easing: this.getEasingFunction(defaultAnimationConfig.easing)
|
|
479590
|
+
});
|
|
479591
|
+
}
|
|
479592
|
+
ElMessage.success(`已定位到图层组中心点: ${data.label}`);
|
|
479593
|
+
return;
|
|
479594
|
+
}
|
|
479595
|
+
ElMessage.info(`无法计算图层组范围: ${data.label}`);
|
|
479596
|
+
return;
|
|
479597
|
+
}
|
|
479598
|
+
const fitOptions = {
|
|
479599
|
+
padding: defaultAnimationConfig.padding,
|
|
479600
|
+
maxZoom: defaultAnimationConfig.maxZoom
|
|
479601
|
+
};
|
|
479602
|
+
{
|
|
479603
|
+
fitOptions.duration = defaultAnimationConfig.duration;
|
|
479604
|
+
fitOptions.easing = this.getEasingFunction(defaultAnimationConfig.easing);
|
|
479605
|
+
}
|
|
479606
|
+
view.fit(extent3, fitOptions);
|
|
479607
|
+
ElMessage.success(`已定位到图层组: ${data.label}`);
|
|
479608
|
+
}
|
|
479346
479609
|
/**
|
|
479347
479610
|
* 获取缓动函数
|
|
479348
479611
|
* @param easing 缓动类型
|
|
@@ -479380,13 +479643,13 @@ class LayerTreeManager {
|
|
|
479380
479643
|
* @returns 是否允许放置
|
|
479381
479644
|
*/
|
|
479382
479645
|
allowDrop(draggingNode, dropNode, type) {
|
|
479383
|
-
const
|
|
479384
|
-
const
|
|
479646
|
+
const draggingContainer = this.findParentContainerNode(draggingNode.data.id);
|
|
479647
|
+
const dropContainer = this.findParentContainerNode(dropNode.data.id);
|
|
479385
479648
|
if (dropNode.data.type === "group") {
|
|
479386
|
-
return type === "inner" && (
|
|
479649
|
+
return type === "inner" && (draggingContainer == null ? void 0 : draggingContainer.id) === dropNode.data.id;
|
|
479387
479650
|
}
|
|
479388
479651
|
if (dropNode.data.type === "layer") {
|
|
479389
|
-
return (type === "prev" || type === "next") &&
|
|
479652
|
+
return (type === "prev" || type === "next") && !!draggingContainer && !!dropContainer && draggingContainer.id === dropContainer.id;
|
|
479390
479653
|
}
|
|
479391
479654
|
return false;
|
|
479392
479655
|
}
|
|
@@ -479396,13 +479659,48 @@ class LayerTreeManager {
|
|
|
479396
479659
|
* @returns 父分组或null
|
|
479397
479660
|
*/
|
|
479398
479661
|
findParentGroup(nodeId) {
|
|
479662
|
+
const containsId = (layer2, targetId) => {
|
|
479663
|
+
if (layer2.id === targetId)
|
|
479664
|
+
return true;
|
|
479665
|
+
if (Array.isArray(layer2.children)) {
|
|
479666
|
+
return layer2.children.some((child) => containsId(child, targetId));
|
|
479667
|
+
}
|
|
479668
|
+
return false;
|
|
479669
|
+
};
|
|
479399
479670
|
for (const group2 of this.layerGroups.value) {
|
|
479400
|
-
if (group2.layers.some((layer2) => layer2
|
|
479671
|
+
if (group2.layers.some((layer2) => containsId(layer2, nodeId))) {
|
|
479401
479672
|
return group2;
|
|
479402
479673
|
}
|
|
479403
479674
|
}
|
|
479404
479675
|
return null;
|
|
479405
479676
|
}
|
|
479677
|
+
/**
|
|
479678
|
+
* 查找节点所属的父“容器”节点(分组或带children的图层)
|
|
479679
|
+
* @param nodeId 节点ID
|
|
479680
|
+
* @returns 父容器的树节点,或null
|
|
479681
|
+
*/
|
|
479682
|
+
findParentContainerNode(nodeId) {
|
|
479683
|
+
const search = (container) => {
|
|
479684
|
+
if (!container.children || container.children.length === 0)
|
|
479685
|
+
return null;
|
|
479686
|
+
for (const child of container.children) {
|
|
479687
|
+
if (child.id === nodeId)
|
|
479688
|
+
return container;
|
|
479689
|
+
if (child.children && child.children.length > 0) {
|
|
479690
|
+
const found = search(child);
|
|
479691
|
+
if (found)
|
|
479692
|
+
return found;
|
|
479693
|
+
}
|
|
479694
|
+
}
|
|
479695
|
+
return null;
|
|
479696
|
+
};
|
|
479697
|
+
for (const groupNode of this.treeData.value) {
|
|
479698
|
+
const found = search(groupNode);
|
|
479699
|
+
if (found)
|
|
479700
|
+
return found;
|
|
479701
|
+
}
|
|
479702
|
+
return null;
|
|
479703
|
+
}
|
|
479406
479704
|
/**
|
|
479407
479705
|
* 节点拖拽完成事件
|
|
479408
479706
|
* @param draggingNode 拖拽节点
|
|
@@ -479420,22 +479718,18 @@ class LayerTreeManager {
|
|
|
479420
479718
|
if (!draggingLayer || !this.layerManager) {
|
|
479421
479719
|
return;
|
|
479422
479720
|
}
|
|
479423
|
-
const
|
|
479424
|
-
if (!
|
|
479721
|
+
const parentContainer = this.findParentContainerNode(draggingLayer.id);
|
|
479722
|
+
if (!parentContainer || !parentContainer.children) {
|
|
479425
479723
|
return;
|
|
479426
479724
|
}
|
|
479427
|
-
parentGroup.layers;
|
|
479428
479725
|
const newOrder = [];
|
|
479429
|
-
|
|
479430
|
-
|
|
479431
|
-
|
|
479432
|
-
|
|
479433
|
-
|
|
479434
|
-
}
|
|
479435
|
-
});
|
|
479436
|
-
}
|
|
479726
|
+
parentContainer.children.forEach((child) => {
|
|
479727
|
+
if (child.layerData) {
|
|
479728
|
+
newOrder.push(child.layerData.id);
|
|
479729
|
+
}
|
|
479730
|
+
});
|
|
479437
479731
|
this.layerManager.reorderLayers(newOrder);
|
|
479438
|
-
ElMessage.success(
|
|
479732
|
+
ElMessage.success(`已在同一容器内重新排序:${draggingLayer.name}`);
|
|
479439
479733
|
}
|
|
479440
479734
|
/**
|
|
479441
479735
|
* 获取图层图标类名
|
|
@@ -479714,9 +480008,9 @@ const _hoisted_2$5 = { class: "config-section" };
|
|
|
479714
480008
|
const _hoisted_3$5 = { class: "config-item" };
|
|
479715
480009
|
const _hoisted_4$5 = { class: "value-text" };
|
|
479716
480010
|
const _hoisted_5$5 = { class: "config-item" };
|
|
479717
|
-
const _hoisted_6$
|
|
479718
|
-
const _hoisted_7$
|
|
479719
|
-
const _hoisted_8$
|
|
480011
|
+
const _hoisted_6$4 = { class: "value-text" };
|
|
480012
|
+
const _hoisted_7$3 = { class: "config-item" };
|
|
480013
|
+
const _hoisted_8$3 = { class: "value-text" };
|
|
479720
480014
|
const _hoisted_9$2 = { class: "config-item" };
|
|
479721
480015
|
const _hoisted_10$2 = { class: "value-text" };
|
|
479722
480016
|
const _hoisted_11$2 = { class: "config-section" };
|
|
@@ -479775,9 +480069,9 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
479775
480069
|
step: 1,
|
|
479776
480070
|
onInput: handleFilterChange
|
|
479777
480071
|
}, null, 8, ["modelValue"]),
|
|
479778
|
-
createElementVNode("span", _hoisted_6$
|
|
480072
|
+
createElementVNode("span", _hoisted_6$4, toDisplayString(_ctx.filters.saturate) + "%", 1)
|
|
479779
480073
|
]),
|
|
479780
|
-
createElementVNode("div", _hoisted_7$
|
|
480074
|
+
createElementVNode("div", _hoisted_7$3, [
|
|
479781
480075
|
_cache[13] || (_cache[13] = createElementVNode("label", null, "亮度:", -1)),
|
|
479782
480076
|
createVNode$1(_component_el_slider, {
|
|
479783
480077
|
modelValue: _ctx.filters.brightness,
|
|
@@ -479787,7 +480081,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
479787
480081
|
step: 1,
|
|
479788
480082
|
onInput: handleFilterChange
|
|
479789
480083
|
}, null, 8, ["modelValue"]),
|
|
479790
|
-
createElementVNode("span", _hoisted_8$
|
|
480084
|
+
createElementVNode("span", _hoisted_8$3, toDisplayString(_ctx.filters.brightness) + "%", 1)
|
|
479791
480085
|
]),
|
|
479792
480086
|
createElementVNode("div", _hoisted_9$2, [
|
|
479793
480087
|
_cache[14] || (_cache[14] = createElementVNode("label", null, "对比度:", -1)),
|
|
@@ -479909,9 +480203,9 @@ const _hoisted_3$4 = {
|
|
|
479909
480203
|
};
|
|
479910
480204
|
const _hoisted_4$4 = { class: "config-item" };
|
|
479911
480205
|
const _hoisted_5$4 = { class: "value-text" };
|
|
479912
|
-
const _hoisted_6$
|
|
479913
|
-
const _hoisted_7$
|
|
479914
|
-
const _hoisted_8$
|
|
480206
|
+
const _hoisted_6$3 = { class: "config-item" };
|
|
480207
|
+
const _hoisted_7$2 = { class: "value-text" };
|
|
480208
|
+
const _hoisted_8$2 = {
|
|
479915
480209
|
key: 1,
|
|
479916
480210
|
class: "config-section"
|
|
479917
480211
|
};
|
|
@@ -479967,7 +480261,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
479967
480261
|
}, null, 8, ["modelValue"]),
|
|
479968
480262
|
createElementVNode("span", _hoisted_5$4, toDisplayString(_ctx.layerData.clusterDistance) + "px", 1)
|
|
479969
480263
|
]),
|
|
479970
|
-
createElementVNode("div", _hoisted_6$
|
|
480264
|
+
createElementVNode("div", _hoisted_6$3, [
|
|
479971
480265
|
_cache[7] || (_cache[7] = createElementVNode("label", null, "最小距离:", -1)),
|
|
479972
480266
|
createVNode$1(_component_el_slider, {
|
|
479973
480267
|
modelValue: _ctx.layerData.minDistance,
|
|
@@ -479977,10 +480271,10 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
479977
480271
|
size: "small",
|
|
479978
480272
|
onInput: handleClusterDistanceChange
|
|
479979
480273
|
}, null, 8, ["modelValue"]),
|
|
479980
|
-
createElementVNode("span", _hoisted_7$
|
|
480274
|
+
createElementVNode("span", _hoisted_7$2, toDisplayString(_ctx.layerData.minDistance) + "px", 1)
|
|
479981
480275
|
])
|
|
479982
480276
|
])) : createCommentVNode("", true),
|
|
479983
|
-
isSuperMapLayer.value ? (openBlock(), createElementBlock("div", _hoisted_8$
|
|
480277
|
+
isSuperMapLayer.value ? (openBlock(), createElementBlock("div", _hoisted_8$2, [
|
|
479984
480278
|
_cache[13] || (_cache[13] = createElementVNode("h5", null, "SuperMap配置", -1)),
|
|
479985
480279
|
createElementVNode("div", _hoisted_9$1, [
|
|
479986
480280
|
_cache[9] || (_cache[9] = createElementVNode("label", null, "图片格式:", -1)),
|
|
@@ -480051,15 +480345,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
480051
480345
|
}
|
|
480052
480346
|
});
|
|
480053
480347
|
const LayerStyleConfig = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-21ab8d8c"]]);
|
|
480054
|
-
const _hoisted_1$3 = {
|
|
480055
|
-
|
|
480056
|
-
|
|
480057
|
-
};
|
|
480058
|
-
const
|
|
480059
|
-
const _hoisted_3$3 = { class: "layer-info" };
|
|
480060
|
-
const _hoisted_4$3 = { class: "layer-name" };
|
|
480061
|
-
const _hoisted_5$3 = { class: "opacity-control" };
|
|
480062
|
-
const _hoisted_6$3 = { class: "opacity-value" };
|
|
480348
|
+
const _hoisted_1$3 = { class: "font-medium" };
|
|
480349
|
+
const _hoisted_2$3 = { class: "layer-info" };
|
|
480350
|
+
const _hoisted_3$3 = { class: "layer-name" };
|
|
480351
|
+
const _hoisted_4$3 = { class: "opacity-control" };
|
|
480352
|
+
const _hoisted_5$3 = { class: "opacity-value" };
|
|
480063
480353
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
480064
480354
|
__name: "LayerTreeNode",
|
|
480065
480355
|
props: {
|
|
@@ -480076,6 +480366,9 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
480076
480366
|
const handleDoubleClick = () => {
|
|
480077
480367
|
emit("doubleClick", props.data);
|
|
480078
480368
|
};
|
|
480369
|
+
const handleGroupDoubleClick = () => {
|
|
480370
|
+
emit("doubleClick", props.data);
|
|
480371
|
+
};
|
|
480079
480372
|
const handleOpacityChange = () => {
|
|
480080
480373
|
emit("opacityChange", props.data.layerData);
|
|
480081
480374
|
};
|
|
@@ -480098,22 +480391,26 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
480098
480391
|
onDblclick: _cache[6] || (_cache[6] = withModifiers(() => {
|
|
480099
480392
|
}, ["stop"]))
|
|
480100
480393
|
}, [
|
|
480101
|
-
_ctx.data.type === "group" ? (openBlock(), createElementBlock("div",
|
|
480394
|
+
_ctx.data.type === "group" ? (openBlock(), createElementBlock("div", {
|
|
480395
|
+
key: 0,
|
|
480396
|
+
class: "group-node",
|
|
480397
|
+
onDblclick: withModifiers(handleGroupDoubleClick, ["stop", "prevent"])
|
|
480398
|
+
}, [
|
|
480102
480399
|
createVNode$1(_component_el_icon, { class: "mr-2" }, {
|
|
480103
480400
|
default: withCtx(() => [
|
|
480104
480401
|
createVNode$1(unref(folder_opened_default))
|
|
480105
480402
|
]),
|
|
480106
480403
|
_: 1
|
|
480107
480404
|
}),
|
|
480108
|
-
createElementVNode("span",
|
|
480109
|
-
])) : (openBlock(), createElementBlock("div", {
|
|
480405
|
+
createElementVNode("span", _hoisted_1$3, toDisplayString(_ctx.data.label), 1)
|
|
480406
|
+
], 32)) : (openBlock(), createElementBlock("div", {
|
|
480110
480407
|
key: 1,
|
|
480111
480408
|
class: "layer-item",
|
|
480112
480409
|
onDblclick: withModifiers(handleDoubleClick, ["stop", "prevent"]),
|
|
480113
480410
|
onClick: _cache[5] || (_cache[5] = withModifiers(() => {
|
|
480114
480411
|
}, ["stop"]))
|
|
480115
480412
|
}, [
|
|
480116
|
-
createElementVNode("div",
|
|
480413
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
480117
480414
|
createVNode$1(_component_el_icon, {
|
|
480118
480415
|
class: normalizeClass(["layer-icon", layerIconClass.value])
|
|
480119
480416
|
}, {
|
|
@@ -480122,7 +480419,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
480122
480419
|
]),
|
|
480123
480420
|
_: 1
|
|
480124
480421
|
}, 8, ["class"]),
|
|
480125
|
-
createElementVNode("span",
|
|
480422
|
+
createElementVNode("span", _hoisted_3$3, toDisplayString(_ctx.data.label), 1)
|
|
480126
480423
|
]),
|
|
480127
480424
|
createElementVNode("div", {
|
|
480128
480425
|
class: "layer-controls",
|
|
@@ -480133,7 +480430,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
480133
480430
|
onDblclick: _cache[4] || (_cache[4] = withModifiers(() => {
|
|
480134
480431
|
}, ["stop"]))
|
|
480135
480432
|
}, [
|
|
480136
|
-
createElementVNode("div",
|
|
480433
|
+
createElementVNode("div", _hoisted_4$3, [
|
|
480137
480434
|
createVNode$1(_component_el_slider, {
|
|
480138
480435
|
modelValue: _ctx.data.layerData.opacity,
|
|
480139
480436
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.data.layerData.opacity = $event),
|
|
@@ -480143,7 +480440,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
480143
480440
|
class: "opacity-slider",
|
|
480144
480441
|
onInput: handleOpacityChange
|
|
480145
480442
|
}, null, 8, ["modelValue"]),
|
|
480146
|
-
createElementVNode("span",
|
|
480443
|
+
createElementVNode("span", _hoisted_5$3, toDisplayString(_ctx.data.layerData.opacity) + "%", 1)
|
|
480147
480444
|
]),
|
|
480148
480445
|
createVNode$1(_component_el_popover, {
|
|
480149
480446
|
placement: "left",
|
|
@@ -480187,13 +480484,15 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
480187
480484
|
};
|
|
480188
480485
|
}
|
|
480189
480486
|
});
|
|
480190
|
-
const LayerTreeNode = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-
|
|
480487
|
+
const LayerTreeNode = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-0c99df63"]]);
|
|
480191
480488
|
const _hoisted_1$2 = { class: "flex-1 overflow-y-auto p-4" };
|
|
480192
|
-
const _hoisted_2$2 = { class: "
|
|
480193
|
-
const _hoisted_3$2 = { class: "
|
|
480194
|
-
const _hoisted_4$2 = { class: "
|
|
480195
|
-
const _hoisted_5$2 = { class: "
|
|
480196
|
-
const _hoisted_6$2 = { class: "
|
|
480489
|
+
const _hoisted_2$2 = { class: "pb-2 flex items-center justify-between" };
|
|
480490
|
+
const _hoisted_3$2 = { class: "text-xs font-semibold text-gray-700 px-1 py-1 border-b border-gray-200 mb-2" };
|
|
480491
|
+
const _hoisted_4$2 = { class: "global-style-panel" };
|
|
480492
|
+
const _hoisted_5$2 = { class: "config-section" };
|
|
480493
|
+
const _hoisted_6$2 = { class: "config-item" };
|
|
480494
|
+
const _hoisted_7$1 = { class: "current-style-display" };
|
|
480495
|
+
const _hoisted_8$1 = { class: "style-preview" };
|
|
480197
480496
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
480198
480497
|
__name: "LayerPanel",
|
|
480199
480498
|
props: {
|
|
@@ -480210,17 +480509,25 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480210
480509
|
const layerTreeManager = new LayerTreeManager();
|
|
480211
480510
|
const layerConfigManager = new LayerConfigManager();
|
|
480212
480511
|
const defaultExpandedKeys = computed(() => layerTreeManager.defaultExpandedKeys.value);
|
|
480213
|
-
const defaultCheckedKeys =
|
|
480214
|
-
|
|
480215
|
-
|
|
480216
|
-
|
|
480217
|
-
|
|
480218
|
-
|
|
480219
|
-
|
|
480220
|
-
|
|
480221
|
-
|
|
480222
|
-
|
|
480223
|
-
|
|
480512
|
+
const defaultCheckedKeys = computed(
|
|
480513
|
+
() => layerTreeManager.defaultCheckedKeys.value
|
|
480514
|
+
);
|
|
480515
|
+
const treeData = computed(() => layerTreeManager.treeData.value);
|
|
480516
|
+
const dialogProps = computed(() => {
|
|
480517
|
+
var _a3;
|
|
480518
|
+
const ui2 = ((_a3 = config == null ? void 0 : config.value) == null ? void 0 : _a3.ui) || {};
|
|
480519
|
+
return {
|
|
480520
|
+
title: ui2.title ?? "图层管理",
|
|
480521
|
+
width: ui2.width ?? "350px",
|
|
480522
|
+
height: ui2.height ?? "600px",
|
|
480523
|
+
modal: ui2.modal ?? false,
|
|
480524
|
+
draggable: ui2.draggable ?? true,
|
|
480525
|
+
resizable: ui2.resizable ?? true,
|
|
480526
|
+
showClose: ui2.showClose ?? true,
|
|
480527
|
+
position: ui2.position ?? "right",
|
|
480528
|
+
cacheId: ui2.cacheId ?? "layer-dialog",
|
|
480529
|
+
className: ui2.className ?? "layer-dialog"
|
|
480530
|
+
};
|
|
480224
480531
|
});
|
|
480225
480532
|
const handleLayerDoubleClick = (data) => {
|
|
480226
480533
|
layerTreeManager.handleLayerDoubleClick(data, layerManager.value, map2.value);
|
|
@@ -480234,8 +480541,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480234
480541
|
const onNodeDrop2 = (draggingNode, dropNode, dropType, ev) => {
|
|
480235
480542
|
layerTreeManager.onNodeDrop(draggingNode, dropNode, dropType, ev);
|
|
480236
480543
|
};
|
|
480237
|
-
const onTreeCheck = (data, { checkedKeys
|
|
480238
|
-
const allNodes = getAllTreeNodes(treeData.value);
|
|
480544
|
+
const onTreeCheck = (data, { checkedKeys }) => {
|
|
480239
480545
|
const group2 = layerGroups.value.find((g2) => g2.layers.some((l2) => l2.id === data.id));
|
|
480240
480546
|
if ((group2 == null ? void 0 : group2.id) === "baseLayers") {
|
|
480241
480547
|
isProcessingBasemap.value = true;
|
|
@@ -480282,36 +480588,32 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480282
480588
|
}
|
|
480283
480589
|
return;
|
|
480284
480590
|
}
|
|
480285
|
-
|
|
480286
|
-
|
|
480287
|
-
if (node.type === "layer" && node.layerData) {
|
|
480288
|
-
node.layerData.visible = false;
|
|
480289
|
-
handleLayerVisibilityChange(node.layerData);
|
|
480290
|
-
} else if (node.type === "group") {
|
|
480291
|
-
const group22 = layerGroups.value.find((g2) => g2.id === node.id);
|
|
480292
|
-
if (group22) {
|
|
480293
|
-
group22.layers.forEach((layer2) => {
|
|
480294
|
-
layer2.visible = false;
|
|
480295
|
-
handleLayerVisibilityChange(layer2);
|
|
480296
|
-
});
|
|
480297
|
-
}
|
|
480298
|
-
}
|
|
480299
|
-
}
|
|
480300
|
-
});
|
|
480301
|
-
checkedNodes.forEach((node) => {
|
|
480591
|
+
const isChecked = checkedKeys.includes(data.id);
|
|
480592
|
+
const toggleNodeAndChildren = (node, checked) => {
|
|
480302
480593
|
if (node.type === "layer" && node.layerData) {
|
|
480303
|
-
node.layerData.visible =
|
|
480594
|
+
node.layerData.visible = checked;
|
|
480304
480595
|
handleLayerVisibilityChange(node.layerData);
|
|
480305
|
-
|
|
480306
|
-
|
|
480307
|
-
if (group22) {
|
|
480308
|
-
group22.layers.forEach((layer2) => {
|
|
480309
|
-
layer2.visible = true;
|
|
480310
|
-
handleLayerVisibilityChange(layer2);
|
|
480311
|
-
});
|
|
480596
|
+
if (node.layerData.type === "group") {
|
|
480597
|
+
return;
|
|
480312
480598
|
}
|
|
480313
480599
|
}
|
|
480314
|
-
|
|
480600
|
+
if (node.children && node.children.length > 0) {
|
|
480601
|
+
node.children.forEach((child) => toggleNodeAndChildren(child, checked));
|
|
480602
|
+
}
|
|
480603
|
+
};
|
|
480604
|
+
if (data.type === "group") {
|
|
480605
|
+
const targetGroup = layerGroups.value.find((g2) => g2.id === data.id);
|
|
480606
|
+
if (targetGroup) {
|
|
480607
|
+
targetGroup.layers.forEach((layer2) => {
|
|
480608
|
+
layer2.visible = isChecked;
|
|
480609
|
+
handleLayerVisibilityChange(layer2);
|
|
480610
|
+
});
|
|
480611
|
+
} else {
|
|
480612
|
+
toggleNodeAndChildren(data, isChecked);
|
|
480613
|
+
}
|
|
480614
|
+
} else {
|
|
480615
|
+
toggleNodeAndChildren(data, isChecked);
|
|
480616
|
+
}
|
|
480315
480617
|
nextTick(() => {
|
|
480316
480618
|
syncTreeCheckedState();
|
|
480317
480619
|
});
|
|
@@ -480332,58 +480634,75 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480332
480634
|
inject("eventBus");
|
|
480333
480635
|
inject("storage");
|
|
480334
480636
|
const mapManager = inject("mapManager");
|
|
480335
|
-
|
|
480336
|
-
|
|
480337
|
-
|
|
480338
|
-
|
|
480339
|
-
|
|
480340
|
-
|
|
480341
|
-
|
|
480342
|
-
|
|
480343
|
-
|
|
480344
|
-
|
|
480345
|
-
|
|
480346
|
-
|
|
480347
|
-
|
|
480348
|
-
|
|
480349
|
-
|
|
480350
|
-
|
|
480351
|
-
|
|
480352
|
-
|
|
480353
|
-
|
|
480354
|
-
|
|
480355
|
-
|
|
480356
|
-
|
|
480357
|
-
|
|
480358
|
-
|
|
480359
|
-
console.log("🔍 [LayerPanel] overlayLayers详情:", newConfig.overlayLayers);
|
|
480637
|
+
watch(
|
|
480638
|
+
config,
|
|
480639
|
+
(newConfig) => {
|
|
480640
|
+
var _a3, _b3, _c2;
|
|
480641
|
+
console.log("🔍 [LayerPanel] config变化:", newConfig);
|
|
480642
|
+
if (newConfig) {
|
|
480643
|
+
console.log(
|
|
480644
|
+
"🔍 [LayerPanel] baseLayers数量:",
|
|
480645
|
+
((_a3 = newConfig.baseLayers) == null ? void 0 : _a3.length) || 0
|
|
480646
|
+
);
|
|
480647
|
+
console.log(
|
|
480648
|
+
"🔍 [LayerPanel] overlayLayers数量:",
|
|
480649
|
+
((_b3 = newConfig.overlayLayers) == null ? void 0 : _b3.length) || 0
|
|
480650
|
+
);
|
|
480651
|
+
console.log(
|
|
480652
|
+
"🔍 [LayerPanel] vectorLayers数量:",
|
|
480653
|
+
((_c2 = newConfig.vectorLayers) == null ? void 0 : _c2.length) || 0
|
|
480654
|
+
);
|
|
480655
|
+
if (newConfig.overlayLayers && newConfig.overlayLayers.length > 0) {
|
|
480656
|
+
console.log(
|
|
480657
|
+
"🔍 [LayerPanel] overlayLayers详情:",
|
|
480658
|
+
newConfig.overlayLayers
|
|
480659
|
+
);
|
|
480660
|
+
}
|
|
480360
480661
|
}
|
|
480361
|
-
}
|
|
480362
|
-
|
|
480662
|
+
},
|
|
480663
|
+
{ immediate: true, deep: true }
|
|
480664
|
+
);
|
|
480363
480665
|
const layers = ref([]);
|
|
480364
480666
|
ref(null);
|
|
480365
480667
|
const emit = __emit;
|
|
480366
480668
|
ref(false);
|
|
480367
480669
|
ref(null);
|
|
480368
|
-
const layerManager = computed(
|
|
480369
|
-
|
|
480370
|
-
|
|
480371
|
-
|
|
480670
|
+
const layerManager = computed(
|
|
480671
|
+
() => {
|
|
480672
|
+
var _a3;
|
|
480673
|
+
return ((_a3 = mapManager == null ? void 0 : mapManager.value) == null ? void 0 : _a3.getLayerManager()) || null;
|
|
480674
|
+
}
|
|
480675
|
+
);
|
|
480372
480676
|
const getAllConfigLayers = () => {
|
|
480373
480677
|
console.log("🔍 [LayerPanel] getAllConfigLayers被调用");
|
|
480374
480678
|
console.log("🔍 [LayerPanel] config.value:", config.value);
|
|
480375
480679
|
const allLayers = [];
|
|
480376
480680
|
if (config.value.baseLayers) {
|
|
480377
|
-
console.log(
|
|
480681
|
+
console.log(
|
|
480682
|
+
"🔍 [LayerPanel] 添加baseLayers:",
|
|
480683
|
+
config.value.baseLayers.length,
|
|
480684
|
+
"个"
|
|
480685
|
+
);
|
|
480378
480686
|
allLayers.push(...config.value.baseLayers);
|
|
480379
480687
|
}
|
|
480380
480688
|
if (config.value.overlayLayers) {
|
|
480381
|
-
console.log(
|
|
480382
|
-
|
|
480689
|
+
console.log(
|
|
480690
|
+
"🔍 [LayerPanel] 添加overlayLayers:",
|
|
480691
|
+
config.value.overlayLayers.length,
|
|
480692
|
+
"个"
|
|
480693
|
+
);
|
|
480694
|
+
console.log(
|
|
480695
|
+
"🔍 [LayerPanel] overlayLayers详情:",
|
|
480696
|
+
config.value.overlayLayers
|
|
480697
|
+
);
|
|
480383
480698
|
allLayers.push(...config.value.overlayLayers);
|
|
480384
480699
|
}
|
|
480385
480700
|
if (config.value.vectorLayers) {
|
|
480386
|
-
console.log(
|
|
480701
|
+
console.log(
|
|
480702
|
+
"🔍 [LayerPanel] 添加vectorLayers:",
|
|
480703
|
+
config.value.vectorLayers.length,
|
|
480704
|
+
"个"
|
|
480705
|
+
);
|
|
480387
480706
|
allLayers.push(...config.value.vectorLayers);
|
|
480388
480707
|
}
|
|
480389
480708
|
console.log("🔍 [LayerPanel] 总共获取到图层数量:", allLayers.length);
|
|
@@ -480415,7 +480734,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480415
480734
|
});
|
|
480416
480735
|
}
|
|
480417
480736
|
baseLayers.forEach((baseLayer) => {
|
|
480418
|
-
const originalLayer = configLayers.find(
|
|
480737
|
+
const originalLayer = configLayers.find(
|
|
480738
|
+
(layer2) => layer2.id === baseLayer.id
|
|
480739
|
+
);
|
|
480419
480740
|
if (originalLayer) {
|
|
480420
480741
|
originalLayer.visible = baseLayer.visible;
|
|
480421
480742
|
}
|
|
@@ -480423,21 +480744,43 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480423
480744
|
}
|
|
480424
480745
|
for (const layerConfig of configLayers) {
|
|
480425
480746
|
if (!layers.value.find((l2) => l2.id === layerConfig.id)) {
|
|
480426
|
-
console.log(
|
|
480747
|
+
console.log(
|
|
480748
|
+
"🔍 [LayerPanel] 注册图层配置:",
|
|
480749
|
+
layerConfig.id,
|
|
480750
|
+
"可见:",
|
|
480751
|
+
layerConfig.visible
|
|
480752
|
+
);
|
|
480427
480753
|
const success = await layerManager.value.addLayer(layerConfig);
|
|
480428
480754
|
if (success) {
|
|
480429
|
-
const addedLayerConfig = layerManager.value.getLayerConfig(
|
|
480755
|
+
const addedLayerConfig = layerManager.value.getLayerConfig(
|
|
480756
|
+
layerConfig.id
|
|
480757
|
+
);
|
|
480430
480758
|
if (addedLayerConfig) {
|
|
480431
480759
|
layers.value.push(addedLayerConfig);
|
|
480432
|
-
console.log(
|
|
480760
|
+
console.log(
|
|
480761
|
+
"🔍 [LayerPanel] 图层配置已注册:",
|
|
480762
|
+
layerConfig.id,
|
|
480763
|
+
"已加载:",
|
|
480764
|
+
layerManager.value.isLayerLoaded(layerConfig.id)
|
|
480765
|
+
);
|
|
480433
480766
|
}
|
|
480434
480767
|
} else {
|
|
480435
|
-
console.error(
|
|
480768
|
+
console.error(
|
|
480769
|
+
"🔍 [LayerPanel] 图层配置注册失败:",
|
|
480770
|
+
layerConfig.id,
|
|
480771
|
+
layerConfig.type
|
|
480772
|
+
);
|
|
480436
480773
|
}
|
|
480437
480774
|
}
|
|
480438
480775
|
}
|
|
480439
|
-
console.log(
|
|
480440
|
-
|
|
480776
|
+
console.log(
|
|
480777
|
+
"🔍 [LayerPanel] 配置应用完成,已加载图层数量:",
|
|
480778
|
+
layerManager.value.getAllLayerConfigs().filter((config2) => layerManager.value.isLayerLoaded(config2.id)).length
|
|
480779
|
+
);
|
|
480780
|
+
console.log(
|
|
480781
|
+
"🔍 [LayerPanel] 总图层配置数量:",
|
|
480782
|
+
layerManager.value.getAllLayerConfigs().length
|
|
480783
|
+
);
|
|
480441
480784
|
} catch (error2) {
|
|
480442
480785
|
console.error("Failed to apply config to map:", error2);
|
|
480443
480786
|
ElMessage.error(`配置应用失败: ${error2.message}`);
|
|
@@ -480493,6 +480836,23 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480493
480836
|
const handleClose = () => {
|
|
480494
480837
|
emit("update:modelValue", false);
|
|
480495
480838
|
};
|
|
480839
|
+
const expandedKeys = ref([]);
|
|
480840
|
+
const onNodeExpand = (data) => {
|
|
480841
|
+
debugger;
|
|
480842
|
+
const id = data == null ? void 0 : data.id;
|
|
480843
|
+
if (!id)
|
|
480844
|
+
return;
|
|
480845
|
+
if (!expandedKeys.value.includes(id))
|
|
480846
|
+
expandedKeys.value.push(id);
|
|
480847
|
+
initializeExpandedKeys();
|
|
480848
|
+
};
|
|
480849
|
+
const onNodeCollapse = (data) => {
|
|
480850
|
+
const id = data == null ? void 0 : data.id;
|
|
480851
|
+
if (!id)
|
|
480852
|
+
return;
|
|
480853
|
+
expandedKeys.value = expandedKeys.value.filter((k2) => k2 !== id);
|
|
480854
|
+
initializeExpandedKeys();
|
|
480855
|
+
};
|
|
480496
480856
|
const layerGroups = computed(() => {
|
|
480497
480857
|
var _a3, _b3, _c2, _d, _e2, _f;
|
|
480498
480858
|
const ensureFilterProperty = (layers2) => {
|
|
@@ -480527,18 +480887,24 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480527
480887
|
};
|
|
480528
480888
|
if (layers.value.length > 0) {
|
|
480529
480889
|
const groups2 = [];
|
|
480530
|
-
const baseLayerIds = new Set(
|
|
480531
|
-
|
|
480532
|
-
|
|
480533
|
-
const
|
|
480534
|
-
(
|
|
480535
|
-
)
|
|
480536
|
-
const
|
|
480537
|
-
(
|
|
480538
|
-
)
|
|
480539
|
-
const
|
|
480540
|
-
(layer2) =>
|
|
480541
|
-
)
|
|
480890
|
+
const baseLayerIds = new Set(
|
|
480891
|
+
(((_a3 = config == null ? void 0 : config.value) == null ? void 0 : _a3.baseLayers) || []).map((layer2) => layer2.id)
|
|
480892
|
+
);
|
|
480893
|
+
const overlayLayerIds = new Set(
|
|
480894
|
+
(((_b3 = config == null ? void 0 : config.value) == null ? void 0 : _b3.overlayLayers) || []).map((layer2) => layer2.id)
|
|
480895
|
+
);
|
|
480896
|
+
const vectorLayerIds = new Set(
|
|
480897
|
+
(((_c2 = config == null ? void 0 : config.value) == null ? void 0 : _c2.vectorLayers) || []).map((layer2) => layer2.id)
|
|
480898
|
+
);
|
|
480899
|
+
const baseLayersList = ensureFilterProperty(
|
|
480900
|
+
layers.value.filter((layer2) => baseLayerIds.has(layer2.id))
|
|
480901
|
+
);
|
|
480902
|
+
const overlayLayersList = ensureFilterProperty(
|
|
480903
|
+
layers.value.filter((layer2) => overlayLayerIds.has(layer2.id))
|
|
480904
|
+
);
|
|
480905
|
+
const vectorLayersList = ensureFilterProperty(
|
|
480906
|
+
layers.value.filter((layer2) => vectorLayerIds.has(layer2.id))
|
|
480907
|
+
);
|
|
480542
480908
|
if (baseLayersList.length > 0) {
|
|
480543
480909
|
groups2.push({
|
|
480544
480910
|
id: "baseLayers",
|
|
@@ -480594,49 +480960,90 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480594
480960
|
}
|
|
480595
480961
|
return groups;
|
|
480596
480962
|
});
|
|
480963
|
+
const activeTreeType = ref("classification");
|
|
480964
|
+
const classificationGroups = computed(() => {
|
|
480965
|
+
const vectorGroup = layerGroups.value.find((g2) => g2.id === "vectorLayers");
|
|
480966
|
+
if (!vectorGroup)
|
|
480967
|
+
return [];
|
|
480968
|
+
const buckets = /* @__PURE__ */ new Map();
|
|
480969
|
+
const getClassification = (layer2) => {
|
|
480970
|
+
const anyLayer = layer2;
|
|
480971
|
+
const meta = anyLayer.metadata || {};
|
|
480972
|
+
return anyLayer.classificationName ?? meta.classificationName ?? anyLayer.sslx ?? "未分类";
|
|
480973
|
+
};
|
|
480974
|
+
for (const layer2 of vectorGroup.layers) {
|
|
480975
|
+
const key = getClassification(layer2) || "未分类";
|
|
480976
|
+
const arr = buckets.get(key) ?? [];
|
|
480977
|
+
arr.push(layer2);
|
|
480978
|
+
buckets.set(key, arr);
|
|
480979
|
+
}
|
|
480980
|
+
const groups = [];
|
|
480981
|
+
buckets.forEach((arr, key) => {
|
|
480982
|
+
groups.push({
|
|
480983
|
+
id: `class:${key}`,
|
|
480984
|
+
name: key,
|
|
480985
|
+
layers: arr
|
|
480986
|
+
});
|
|
480987
|
+
});
|
|
480988
|
+
return groups;
|
|
480989
|
+
});
|
|
480990
|
+
const effectiveLayerGroups = computed(() => {
|
|
480991
|
+
return activeTreeType.value === "classification" ? classificationGroups.value : layerGroups.value;
|
|
480992
|
+
});
|
|
480993
|
+
const classificationTreeRefs = ref({});
|
|
480994
|
+
const buildLayerNodeLocal = (layer2) => {
|
|
480995
|
+
const node = {
|
|
480996
|
+
id: layer2.id,
|
|
480997
|
+
label: layer2.name,
|
|
480998
|
+
type: "layer",
|
|
480999
|
+
layerType: layer2.type,
|
|
481000
|
+
layerData: layer2
|
|
481001
|
+
};
|
|
481002
|
+
if (layer2.children && Array.isArray(layer2.children) && layer2.children.length > 0) {
|
|
481003
|
+
node.children = layer2.children.map((child) => buildLayerNodeLocal(child));
|
|
481004
|
+
}
|
|
481005
|
+
return node;
|
|
481006
|
+
};
|
|
481007
|
+
const getGroupTreeData = (group2) => {
|
|
481008
|
+
return group2.layers.map((layer2) => buildLayerNodeLocal(layer2));
|
|
481009
|
+
};
|
|
480597
481010
|
const initializeExpandedKeys = () => {
|
|
480598
|
-
|
|
481011
|
+
const groupIds = effectiveLayerGroups.value.map((group2) => group2.id);
|
|
481012
|
+
const union3 = Array.from(/* @__PURE__ */ new Set([...groupIds, ...expandedKeys.value]));
|
|
481013
|
+
layerTreeManager.setDefaultExpandedKeys(union3);
|
|
480599
481014
|
};
|
|
480600
481015
|
const syncTreeCheckedState = () => {
|
|
480601
|
-
|
|
480602
|
-
|
|
480603
|
-
|
|
481016
|
+
const checkedKeys = defaultCheckedKeys.value;
|
|
481017
|
+
if (activeTreeType.value === "classification") {
|
|
481018
|
+
Object.values(classificationTreeRefs.value).forEach((tree) => {
|
|
481019
|
+
try {
|
|
481020
|
+
tree == null ? void 0 : tree.setCheckedKeys(checkedKeys);
|
|
481021
|
+
} catch (e8) {
|
|
481022
|
+
}
|
|
481023
|
+
});
|
|
481024
|
+
} else {
|
|
481025
|
+
if (treeRef.value) {
|
|
481026
|
+
treeRef.value.setCheckedKeys(checkedKeys);
|
|
481027
|
+
}
|
|
480604
481028
|
}
|
|
480605
481029
|
};
|
|
480606
|
-
const hasTreeSnapshot = ref(false);
|
|
480607
|
-
const expectedLayerCount = computed(() => {
|
|
480608
|
-
var _a3, _b3, _c2;
|
|
480609
|
-
const c2 = (config == null ? void 0 : config.value) || {};
|
|
480610
|
-
const total = (((_a3 = c2.baseLayers) == null ? void 0 : _a3.length) || 0) + (((_b3 = c2.overlayLayers) == null ? void 0 : _b3.length) || 0) + (((_c2 = c2.vectorLayers) == null ? void 0 : _c2.length) || 0);
|
|
480611
|
-
return total;
|
|
480612
|
-
});
|
|
480613
481030
|
watchEffect(() => {
|
|
480614
|
-
if (
|
|
480615
|
-
layerTreeManager.setLayerGroups(
|
|
480616
|
-
|
|
481031
|
+
if (effectiveLayerGroups.value.length > 0) {
|
|
481032
|
+
layerTreeManager.setLayerGroups(effectiveLayerGroups.value);
|
|
481033
|
+
const groupIds = effectiveLayerGroups.value.map((group2) => group2.id);
|
|
481034
|
+
const union3 = Array.from(/* @__PURE__ */ new Set([...groupIds, ...expandedKeys.value]));
|
|
481035
|
+
layerTreeManager.setDefaultExpandedKeys(union3);
|
|
480617
481036
|
initializeExpandedKeys();
|
|
480618
|
-
if (!hasTreeSnapshot.value) {
|
|
480619
|
-
const isInitialRegistrationDone = layers.value.length >= expectedLayerCount.value || expectedLayerCount.value === 0;
|
|
480620
|
-
console.log("🔍 [LayerPanel] 快照准备检查: layers.length=", layers.value.length, " expected=", expectedLayerCount.value, " done=", isInitialRegistrationDone);
|
|
480621
|
-
if (isInitialRegistrationDone) {
|
|
480622
|
-
try {
|
|
480623
|
-
defaultCheckedKeys.value = Array.isArray(layerTreeManager.defaultCheckedKeys.value) ? [...layerTreeManager.defaultCheckedKeys.value] : [];
|
|
480624
|
-
const source = layerTreeManager.treeData.value;
|
|
480625
|
-
treeData.value = source ? JSON.parse(JSON.stringify(source)) : [];
|
|
480626
|
-
} catch (e8) {
|
|
480627
|
-
defaultCheckedKeys.value = layerTreeManager.defaultCheckedKeys.value || [];
|
|
480628
|
-
treeData.value = layerTreeManager.treeData.value || [];
|
|
480629
|
-
}
|
|
480630
|
-
hasTreeSnapshot.value = true;
|
|
480631
|
-
}
|
|
480632
|
-
}
|
|
480633
481037
|
nextTick(() => {
|
|
480634
481038
|
syncTreeCheckedState();
|
|
480635
481039
|
});
|
|
480636
481040
|
}
|
|
480637
481041
|
});
|
|
480638
481042
|
const layerVisibilityState = computed(() => {
|
|
480639
|
-
return layers.value.map((layer2) => ({
|
|
481043
|
+
return layers.value.map((layer2) => ({
|
|
481044
|
+
id: layer2.id,
|
|
481045
|
+
visible: layer2.visible
|
|
481046
|
+
}));
|
|
480640
481047
|
});
|
|
480641
481048
|
const isProcessingBasemap = ref(false);
|
|
480642
481049
|
const activeMainTab = ref("layers");
|
|
@@ -480686,7 +481093,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480686
481093
|
if (!layerConfigManager["layerManager"]) {
|
|
480687
481094
|
layerConfigManager.initialize(layerManager.value);
|
|
480688
481095
|
}
|
|
480689
|
-
layerConfigManager.updateClusterDistance(
|
|
481096
|
+
layerConfigManager.updateClusterDistance(
|
|
481097
|
+
layerData,
|
|
481098
|
+
layerManager.value,
|
|
481099
|
+
updateLayerConfig
|
|
481100
|
+
);
|
|
480690
481101
|
};
|
|
480691
481102
|
const updateSuperMapConfig = (layerData) => {
|
|
480692
481103
|
if (!layerManager.value) {
|
|
@@ -480696,7 +481107,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480696
481107
|
if (!layerConfigManager["layerManager"]) {
|
|
480697
481108
|
layerConfigManager.initialize(layerManager.value);
|
|
480698
481109
|
}
|
|
480699
|
-
layerConfigManager.updateSuperMapConfig(
|
|
481110
|
+
layerConfigManager.updateSuperMapConfig(
|
|
481111
|
+
layerData,
|
|
481112
|
+
layerManager.value,
|
|
481113
|
+
updateLayerConfig
|
|
481114
|
+
);
|
|
480700
481115
|
};
|
|
480701
481116
|
const resetLayerStyle = (layerData) => {
|
|
480702
481117
|
if (!layerManager.value) {
|
|
@@ -480706,7 +481121,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480706
481121
|
if (!layerConfigManager["layerManager"]) {
|
|
480707
481122
|
layerConfigManager.initialize(layerManager.value);
|
|
480708
481123
|
}
|
|
480709
|
-
layerConfigManager.resetLayerStyle(
|
|
481124
|
+
layerConfigManager.resetLayerStyle(
|
|
481125
|
+
layerData,
|
|
481126
|
+
updateClusterDistance,
|
|
481127
|
+
updateSuperMapConfig
|
|
481128
|
+
);
|
|
480710
481129
|
};
|
|
480711
481130
|
const handleLayerVisibilityChange = async (layer2) => {
|
|
480712
481131
|
if (layerManager.value) {
|
|
@@ -480715,9 +481134,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480715
481134
|
updateLayerConfig(layer2.id, {
|
|
480716
481135
|
visible: layer2.visible
|
|
480717
481136
|
});
|
|
480718
|
-
console.log("🔍 [LayerPanel] 图层可见性已更新:", layer2.id, "可见:", layer2.visible, "已加载:", layerManager.value.isLayerLoaded(layer2.id));
|
|
480719
481137
|
} catch (error2) {
|
|
480720
|
-
console.error("🔍 [LayerPanel] 更新图层可见性失败:", layer2.id, error2);
|
|
480721
481138
|
ElMessage.error(`图层 ${layer2.name} 可见性更新失败`);
|
|
480722
481139
|
return;
|
|
480723
481140
|
}
|
|
@@ -480747,7 +481164,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480747
481164
|
}
|
|
480748
481165
|
};
|
|
480749
481166
|
const handleBasemapChanged = (event) => {
|
|
480750
|
-
const baseLayersGroup = layerGroups.value.find(
|
|
481167
|
+
const baseLayersGroup = layerGroups.value.find(
|
|
481168
|
+
(group2) => group2.id === "baseLayers"
|
|
481169
|
+
);
|
|
480751
481170
|
if (!baseLayersGroup)
|
|
480752
481171
|
return;
|
|
480753
481172
|
baseLayersGroup.layers.forEach((layer2) => {
|
|
@@ -480765,34 +481184,46 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480765
481184
|
});
|
|
480766
481185
|
};
|
|
480767
481186
|
const handleBasemapSwitchRequest = (event) => {
|
|
480768
|
-
const baseLayersGroup = layerGroups.value.find(
|
|
481187
|
+
const baseLayersGroup = layerGroups.value.find(
|
|
481188
|
+
(group2) => group2.id === "baseLayers"
|
|
481189
|
+
);
|
|
480769
481190
|
if (!baseLayersGroup) {
|
|
480770
481191
|
console.warn("未找到底图分组");
|
|
480771
481192
|
return;
|
|
480772
481193
|
}
|
|
480773
481194
|
if (event.basemapConfig === null) {
|
|
480774
|
-
const targetLayer2 = baseLayersGroup.layers.find(
|
|
481195
|
+
const targetLayer2 = baseLayersGroup.layers.find(
|
|
481196
|
+
(layer2) => layer2.id === event.basemapId
|
|
481197
|
+
);
|
|
480775
481198
|
if (targetLayer2 && targetLayer2.visible) {
|
|
480776
481199
|
targetLayer2.visible = false;
|
|
480777
481200
|
handleLayerVisibilityChange(targetLayer2);
|
|
480778
481201
|
nextTick(() => {
|
|
480779
481202
|
if (treeRef.value) {
|
|
480780
481203
|
const currentCheckedKeys = treeRef.value.getCheckedKeys();
|
|
480781
|
-
const newCheckedKeys = currentCheckedKeys.filter(
|
|
481204
|
+
const newCheckedKeys = currentCheckedKeys.filter(
|
|
481205
|
+
(key) => key !== event.basemapId
|
|
481206
|
+
);
|
|
480782
481207
|
treeRef.value.setCheckedKeys(newCheckedKeys);
|
|
480783
481208
|
}
|
|
480784
481209
|
});
|
|
480785
481210
|
}
|
|
480786
481211
|
return;
|
|
480787
481212
|
}
|
|
480788
|
-
let targetLayer = baseLayersGroup.layers.find(
|
|
481213
|
+
let targetLayer = baseLayersGroup.layers.find(
|
|
481214
|
+
(layer2) => layer2.id === event.basemapId
|
|
481215
|
+
);
|
|
480789
481216
|
if (!targetLayer && layerManager.value && event.basemapConfig) {
|
|
480790
481217
|
const success = layerManager.value.addLayer(event.basemapConfig);
|
|
480791
481218
|
if (success) {
|
|
480792
481219
|
const allLayerConfigs = layerManager.value.getAllLayerConfigs();
|
|
480793
481220
|
layers.value = allLayerConfigs;
|
|
480794
|
-
const updatedBaseLayersGroup = layerGroups.value.find(
|
|
480795
|
-
|
|
481221
|
+
const updatedBaseLayersGroup = layerGroups.value.find(
|
|
481222
|
+
(group2) => group2.id === "baseLayers"
|
|
481223
|
+
);
|
|
481224
|
+
targetLayer = updatedBaseLayersGroup == null ? void 0 : updatedBaseLayersGroup.layers.find(
|
|
481225
|
+
(layer2) => layer2.id === event.basemapId
|
|
481226
|
+
);
|
|
480796
481227
|
}
|
|
480797
481228
|
}
|
|
480798
481229
|
if (!targetLayer) {
|
|
@@ -480821,12 +481252,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480821
481252
|
layerEventBus.off("basemap-switch-request", handleBasemapSwitchRequest);
|
|
480822
481253
|
});
|
|
480823
481254
|
return (_ctx, _cache) => {
|
|
481255
|
+
const _component_el_radio_button = resolveComponent("el-radio-button");
|
|
481256
|
+
const _component_el_radio_group = resolveComponent("el-radio-group");
|
|
480824
481257
|
const _component_el_tree = resolveComponent("el-tree");
|
|
480825
481258
|
const _component_el_tab_pane = resolveComponent("el-tab-pane");
|
|
480826
481259
|
const _component_el_tabs = resolveComponent("el-tabs");
|
|
480827
481260
|
return openBlock(), createBlock(CustomDialog, {
|
|
480828
481261
|
modelValue: visible.value,
|
|
480829
|
-
"onUpdate:modelValue": _cache[
|
|
481262
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => visible.value = $event),
|
|
480830
481263
|
title: dialogProps.value.title,
|
|
480831
481264
|
width: dialogProps.value.width,
|
|
480832
481265
|
height: dialogProps.value.height,
|
|
@@ -480859,11 +481292,12 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480859
481292
|
defaultExpandedKeys: defaultExpandedKeys.value,
|
|
480860
481293
|
defaultCheckedKeys: defaultCheckedKeys.value,
|
|
480861
481294
|
syncTreeCheckedState,
|
|
480862
|
-
getAllTreeNodes
|
|
481295
|
+
getAllTreeNodes,
|
|
481296
|
+
onNodeExpand
|
|
480863
481297
|
}, void 0, true) : (openBlock(), createBlock(_component_el_tabs, {
|
|
480864
481298
|
key: 1,
|
|
480865
481299
|
modelValue: activeMainTab.value,
|
|
480866
|
-
"onUpdate:modelValue": _cache[
|
|
481300
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => activeMainTab.value = $event),
|
|
480867
481301
|
class: "main-tabs"
|
|
480868
481302
|
}, {
|
|
480869
481303
|
default: withCtx(() => [
|
|
@@ -480873,7 +481307,32 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480873
481307
|
}, {
|
|
480874
481308
|
default: withCtx(() => [
|
|
480875
481309
|
createElementVNode("div", _hoisted_1$2, [
|
|
480876
|
-
|
|
481310
|
+
createElementVNode("div", _hoisted_2$2, [
|
|
481311
|
+
_cache[7] || (_cache[7] = createElementVNode("div", { class: "text-sm text-gray-600" }, "树形视图", -1)),
|
|
481312
|
+
createVNode$1(_component_el_radio_group, {
|
|
481313
|
+
modelValue: activeTreeType.value,
|
|
481314
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTreeType.value = $event),
|
|
481315
|
+
size: "small"
|
|
481316
|
+
}, {
|
|
481317
|
+
default: withCtx(() => [
|
|
481318
|
+
createVNode$1(_component_el_radio_button, { label: "default" }, {
|
|
481319
|
+
default: withCtx(() => [..._cache[5] || (_cache[5] = [
|
|
481320
|
+
createTextVNode("按配置分组", -1)
|
|
481321
|
+
])]),
|
|
481322
|
+
_: 1
|
|
481323
|
+
}),
|
|
481324
|
+
createVNode$1(_component_el_radio_button, { label: "classification" }, {
|
|
481325
|
+
default: withCtx(() => [..._cache[6] || (_cache[6] = [
|
|
481326
|
+
createTextVNode("按分类分组", -1)
|
|
481327
|
+
])]),
|
|
481328
|
+
_: 1
|
|
481329
|
+
})
|
|
481330
|
+
]),
|
|
481331
|
+
_: 1
|
|
481332
|
+
}, 8, ["modelValue"])
|
|
481333
|
+
]),
|
|
481334
|
+
activeTreeType.value === "default" ? (openBlock(), createBlock(_component_el_tree, {
|
|
481335
|
+
key: 0,
|
|
480877
481336
|
ref_key: "treeRef",
|
|
480878
481337
|
ref: treeRef,
|
|
480879
481338
|
data: treeData.value,
|
|
@@ -480883,11 +481342,14 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480883
481342
|
"default-checked-keys": defaultCheckedKeys.value,
|
|
480884
481343
|
"show-checkbox": true,
|
|
480885
481344
|
"check-strictly": false,
|
|
481345
|
+
"expand-on-click-node": false,
|
|
480886
481346
|
draggable: true,
|
|
480887
481347
|
"allow-drop": allowDrop,
|
|
480888
481348
|
"allow-drag": allowDrag3,
|
|
480889
481349
|
onCheck: onTreeCheck,
|
|
480890
481350
|
onNodeDrop: onNodeDrop2,
|
|
481351
|
+
onNodeExpand,
|
|
481352
|
+
onNodeCollapse,
|
|
480891
481353
|
class: "layer-tree"
|
|
480892
481354
|
}, {
|
|
480893
481355
|
default: withCtx(({ node, data }) => [
|
|
@@ -480902,7 +481364,47 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480902
481364
|
}, null, 8, ["data", "layer-tree-manager"])
|
|
480903
481365
|
]),
|
|
480904
481366
|
_: 1
|
|
480905
|
-
}, 8, ["data", "default-expanded-keys", "default-checked-keys"])
|
|
481367
|
+
}, 8, ["data", "default-expanded-keys", "default-checked-keys"])) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(classificationGroups.value, (group2) => {
|
|
481368
|
+
return openBlock(), createElementBlock("div", {
|
|
481369
|
+
key: group2.id,
|
|
481370
|
+
class: "mb-3"
|
|
481371
|
+
}, [
|
|
481372
|
+
createElementVNode("div", _hoisted_3$2, toDisplayString(group2.name), 1),
|
|
481373
|
+
createVNode$1(_component_el_tree, {
|
|
481374
|
+
ref_for: true,
|
|
481375
|
+
ref: (el) => classificationTreeRefs.value[group2.id] = el,
|
|
481376
|
+
data: getGroupTreeData(group2),
|
|
481377
|
+
props: treeProps,
|
|
481378
|
+
"node-key": "id",
|
|
481379
|
+
"default-expanded-keys": defaultExpandedKeys.value,
|
|
481380
|
+
"default-checked-keys": defaultCheckedKeys.value,
|
|
481381
|
+
"show-checkbox": true,
|
|
481382
|
+
"check-strictly": false,
|
|
481383
|
+
"expand-on-click-node": false,
|
|
481384
|
+
draggable: true,
|
|
481385
|
+
"allow-drop": allowDrop,
|
|
481386
|
+
"allow-drag": allowDrag3,
|
|
481387
|
+
onCheck: onTreeCheck,
|
|
481388
|
+
onNodeDrop: onNodeDrop2,
|
|
481389
|
+
onNodeExpand,
|
|
481390
|
+
onNodeCollapse,
|
|
481391
|
+
class: "layer-tree"
|
|
481392
|
+
}, {
|
|
481393
|
+
default: withCtx(({ node, data }) => [
|
|
481394
|
+
createVNode$1(LayerTreeNode, {
|
|
481395
|
+
data,
|
|
481396
|
+
"layer-tree-manager": unref(layerTreeManager),
|
|
481397
|
+
onDoubleClick: handleLayerDoubleClick,
|
|
481398
|
+
onOpacityChange: updateLayerOpacity,
|
|
481399
|
+
onClusterDistanceChange: updateClusterDistance,
|
|
481400
|
+
onSuperMapConfigChange: updateSuperMapConfig,
|
|
481401
|
+
onStyleReset: resetLayerStyle
|
|
481402
|
+
}, null, 8, ["data", "layer-tree-manager"])
|
|
481403
|
+
]),
|
|
481404
|
+
_: 2
|
|
481405
|
+
}, 1032, ["data", "default-expanded-keys", "default-checked-keys"])
|
|
481406
|
+
]);
|
|
481407
|
+
}), 128))
|
|
480906
481408
|
])
|
|
480907
481409
|
]),
|
|
480908
481410
|
_: 1
|
|
@@ -480912,10 +481414,10 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480912
481414
|
name: "style"
|
|
480913
481415
|
}, {
|
|
480914
481416
|
default: withCtx(() => [
|
|
480915
|
-
createElementVNode("div",
|
|
481417
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
480916
481418
|
createVNode$1(_component_el_tabs, {
|
|
480917
481419
|
modelValue: activeStyleTab.value,
|
|
480918
|
-
"onUpdate:modelValue": _cache[
|
|
481420
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => activeStyleTab.value = $event),
|
|
480919
481421
|
class: "style-tabs"
|
|
480920
481422
|
}, {
|
|
480921
481423
|
default: withCtx(() => [
|
|
@@ -480938,11 +481440,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480938
481440
|
name: "custom"
|
|
480939
481441
|
}, {
|
|
480940
481442
|
default: withCtx(() => [
|
|
480941
|
-
createElementVNode("div",
|
|
480942
|
-
createElementVNode("div",
|
|
481443
|
+
createElementVNode("div", _hoisted_5$2, [
|
|
481444
|
+
createElementVNode("div", _hoisted_6$2, [
|
|
480943
481445
|
createVNode$1(unref(ElInput), {
|
|
480944
481446
|
modelValue: unref(globalCustomCss),
|
|
480945
|
-
"onUpdate:modelValue": _cache[
|
|
481447
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(globalCustomCss) ? globalCustomCss.value = $event : null),
|
|
480946
481448
|
type: "textarea",
|
|
480947
481449
|
rows: 6,
|
|
480948
481450
|
class: "custom-css-input",
|
|
@@ -480950,9 +481452,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480950
481452
|
onInput: updateGlobalStyle
|
|
480951
481453
|
}, null, 8, ["modelValue"])
|
|
480952
481454
|
]),
|
|
480953
|
-
createElementVNode("div",
|
|
480954
|
-
_cache[
|
|
480955
|
-
createElementVNode("div",
|
|
481455
|
+
createElementVNode("div", _hoisted_7$1, [
|
|
481456
|
+
_cache[8] || (_cache[8] = createElementVNode("h6", null, "当前应用的样式:", -1)),
|
|
481457
|
+
createElementVNode("div", _hoisted_8$1, toDisplayString(currentAppliedStyle.value), 1)
|
|
480956
481458
|
])
|
|
480957
481459
|
])
|
|
480958
481460
|
]),
|
|
@@ -480974,7 +481476,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
480974
481476
|
};
|
|
480975
481477
|
}
|
|
480976
481478
|
});
|
|
480977
|
-
const LayerPanel = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-
|
|
481479
|
+
const LayerPanel = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-655d7f71"]]);
|
|
480978
481480
|
const _hoisted_1$1 = {
|
|
480979
481481
|
key: 2,
|
|
480980
481482
|
class: "tooltip-content"
|
|
@@ -482412,7 +482914,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
482412
482914
|
};
|
|
482413
482915
|
}
|
|
482414
482916
|
});
|
|
482415
|
-
const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
482917
|
+
const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-09347cf4"]]);
|
|
482416
482918
|
var u8 = Uint8Array;
|
|
482417
482919
|
var u16 = Uint16Array;
|
|
482418
482920
|
var i32 = Int32Array;
|
|
@@ -490684,7 +491186,7 @@ function(t3) {
|
|
|
490684
491186
|
*/
|
|
490685
491187
|
function(t3) {
|
|
490686
491188
|
function e8() {
|
|
490687
|
-
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-
|
|
491189
|
+
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-471711b2.mjs")).catch(function(t4) {
|
|
490688
491190
|
return Promise.reject(new Error("Could not load canvg: " + t4));
|
|
490689
491191
|
}).then(function(t4) {
|
|
490690
491192
|
return t4.default ? t4.default : t4;
|