vue-openlayers-plugin 1.0.69 → 1.0.71
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/bundle_map.js +46 -0
- package/lib/{index-b61cd0bb.mjs → index-be67894d.mjs} +79 -79
- package/lib/{index.es-09c58559.mjs → index.es-77890a7c.mjs} +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.umd.js +78 -78
- package/lib/style.css +168 -168
- package/package.json +1 -1
- package/types/src/components/CustomOpenlayer/components/dialogs/LayerPanel.vue.d.ts +14 -84
- package/types/src/components/CustomOpenlayer/components/dialogs/LayerPanel.vue.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/types/index.d.ts +13 -2
- package/types/src/components/CustomOpenlayer/types/index.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/LayerManager.d.ts.map +1 -0
- package/types/src/components/CustomOpenlayer/utils/layers/TileSuperMapRestHandler.d.ts +1 -0
- package/types/src/components/CustomOpenlayer/utils/layers/TileSuperMapRestHandler.d.ts.map +1 -0
- package/types/src/components/CustomOpenlayer/utils/mapManager.d.ts.map +1 -0
- package/types/tsconfig.tsbuildinfo +1 -1
|
@@ -41751,7 +41751,7 @@ function checkProj$1(item) {
|
|
|
41751
41751
|
item
|
|
41752
41752
|
);
|
|
41753
41753
|
}
|
|
41754
|
-
function proj4$
|
|
41754
|
+
function proj4$2(fromProjOrToProj, toProjOrCoord, coord) {
|
|
41755
41755
|
var fromProj;
|
|
41756
41756
|
var toProj;
|
|
41757
41757
|
var single = false;
|
|
@@ -45755,7 +45755,7 @@ function includedProjections$1(proj42) {
|
|
|
45755
45755
|
proj42.Proj.projections.add(eqearth$1);
|
|
45756
45756
|
proj42.Proj.projections.add(bonne$1);
|
|
45757
45757
|
}
|
|
45758
|
-
const proj4$1 = Object.assign(proj4$
|
|
45758
|
+
const proj4$1 = Object.assign(proj4$2, {
|
|
45759
45759
|
defaultDatum: "WGS84",
|
|
45760
45760
|
Proj: Projection$3,
|
|
45761
45761
|
WGS84: new Projection$3("WGS84"),
|
|
@@ -45768,10 +45768,6 @@ const proj4$1 = Object.assign(proj4$3, {
|
|
|
45768
45768
|
version: "__VERSION__"
|
|
45769
45769
|
});
|
|
45770
45770
|
includedProjections$1(proj4$1);
|
|
45771
|
-
const proj4$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
45772
|
-
__proto__: null,
|
|
45773
|
-
default: proj4$1
|
|
45774
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
45775
45771
|
let registered$1 = null;
|
|
45776
45772
|
function register$3(proj42) {
|
|
45777
45773
|
registered$1 = proj42;
|
|
@@ -464555,12 +464551,13 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464555
464551
|
return feature2;
|
|
464556
464552
|
}
|
|
464557
464553
|
setupEPSG4490() {
|
|
464558
|
-
(
|
|
464559
|
-
register$3(proj4$
|
|
464554
|
+
proj4$1.defs("EPSG:4490", "+proj=longlat +ellps=GRS80 +no_defs +type=crs");
|
|
464555
|
+
register$3(proj4$1);
|
|
464560
464556
|
console.log("EPSG:4490投影已注册");
|
|
464561
464557
|
}
|
|
464562
464558
|
async createLayer() {
|
|
464563
464559
|
var _a3;
|
|
464560
|
+
debugger;
|
|
464564
464561
|
const projection2 = this.resolveProjection();
|
|
464565
464562
|
const config = this.config;
|
|
464566
464563
|
const sourceOptions = config.autoFetchMetadata === true ? await this.buildSourceOptionsWithMetadata(projection2) : await this.buildSourceOptions(projection2);
|
|
@@ -464571,19 +464568,12 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464571
464568
|
opacity: config.opacity
|
|
464572
464569
|
});
|
|
464573
464570
|
const source = new TileSuperMapRest(sourceOptions);
|
|
464574
|
-
source.on("tileloadstart", () => {
|
|
464575
|
-
console.log(`🔄 SuperMap图层 ${config.name} 开始加载瓦片`);
|
|
464576
|
-
});
|
|
464577
|
-
source.on("tileloadend", () => {
|
|
464578
|
-
console.log(`✅ SuperMap图层 ${config.name} 瓦片加载完成`);
|
|
464579
|
-
});
|
|
464580
464571
|
source.on("tileloaderror", (event) => {
|
|
464581
464572
|
var _a4, _b3;
|
|
464582
464573
|
const img = (_b3 = (_a4 = event == null ? void 0 : event.tile) == null ? void 0 : _a4.getImage) == null ? void 0 : _b3.call(_a4);
|
|
464583
464574
|
const src2 = img == null ? void 0 : img.src;
|
|
464584
|
-
console.error(`❌ SuperMap图层 ${config.name} 瓦片加载失败:`, event);
|
|
464585
464575
|
if (src2)
|
|
464586
|
-
console.error(
|
|
464576
|
+
console.error(`瓦片加载失败: ${src2}`);
|
|
464587
464577
|
});
|
|
464588
464578
|
const tileLayer = new TileLayer$2({
|
|
464589
464579
|
source,
|
|
@@ -464592,6 +464582,10 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464592
464582
|
// opacity: (config.opacity || 100) / 100,
|
|
464593
464583
|
});
|
|
464594
464584
|
this.layer = tileLayer;
|
|
464585
|
+
if (config.autoFetchMetadata === true) {
|
|
464586
|
+
this.fetchAndUpdateTileGrid(source).catch(() => {
|
|
464587
|
+
});
|
|
464588
|
+
}
|
|
464595
464589
|
console.log(`SuperMap图层 ${config.name} 创建完成:`, {
|
|
464596
464590
|
visible: tileLayer.getVisible(),
|
|
464597
464591
|
opacity: tileLayer.getOpacity(),
|
|
@@ -464610,23 +464604,17 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464610
464604
|
extent: mapExtent,
|
|
464611
464605
|
projection: mapView.getProjection().getCode()
|
|
464612
464606
|
});
|
|
464613
|
-
if (config.center && config.center.length >= 2) {
|
|
464614
|
-
|
|
464615
|
-
const isInView = layerCenter[0] >= mapExtent[0] && layerCenter[0] <= mapExtent[2] && layerCenter[1] >= mapExtent[1] && layerCenter[1] <= mapExtent[3];
|
|
464616
|
-
console.log(
|
|
464617
|
-
`图层中心点 [${layerCenter[0]}, ${layerCenter[1]}] 是否在当前视图内: ${isInView}`
|
|
464618
|
-
);
|
|
464619
|
-
if (!isInView) {
|
|
464620
|
-
console.warn(
|
|
464621
|
-
`⚠️ 图层 ${config.name} 的中心点不在当前地图视图范围内,可能需要缩放到图层位置`
|
|
464622
|
-
);
|
|
464623
|
-
}
|
|
464607
|
+
if (this.map && config.center && config.center.length >= 2) {
|
|
464608
|
+
this.map.getView().setCenter(config.center);
|
|
464624
464609
|
}
|
|
464625
464610
|
}
|
|
464626
464611
|
tileLayer.on("postrender", () => this.tryApplyStyles());
|
|
464627
464612
|
source.on("tileloadend", () => this.tryApplyStyles());
|
|
464628
464613
|
return tileLayer;
|
|
464629
464614
|
}
|
|
464615
|
+
applyFilters() {
|
|
464616
|
+
console.warn("TileSuperMapRestHandler a ");
|
|
464617
|
+
}
|
|
464630
464618
|
tryApplyStyles() {
|
|
464631
464619
|
if (this.styleApplied || this.styleApplyAttempts >= this.maxStyleApplyAttempts)
|
|
464632
464620
|
return;
|
|
@@ -464659,18 +464647,20 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464659
464647
|
}
|
|
464660
464648
|
}
|
|
464661
464649
|
resolveProjection() {
|
|
464662
|
-
var _a3;
|
|
464650
|
+
var _a3, _b3;
|
|
464663
464651
|
let projection2 = null;
|
|
464664
|
-
|
|
464665
|
-
|
|
464666
|
-
|
|
464652
|
+
const projectionCode = this.config.projection;
|
|
464653
|
+
if (projectionCode) {
|
|
464654
|
+
projection2 = get$b(projectionCode);
|
|
464655
|
+
if (!projection2 && projectionCode === "EPSG:4490") {
|
|
464667
464656
|
this.setupEPSG4490();
|
|
464668
464657
|
projection2 = get$b("EPSG:4490");
|
|
464669
464658
|
}
|
|
464670
464659
|
}
|
|
464671
464660
|
if (!projection2) {
|
|
464672
|
-
projection2 = ((_a3 = this.map) == null ? void 0 : _a3.getView().getProjection()) || get$b("EPSG:
|
|
464673
|
-
|
|
464661
|
+
projection2 = ((_a3 = this.map) == null ? void 0 : _a3.getView().getProjection()) || get$b("EPSG:3857");
|
|
464662
|
+
const code = ((_b3 = projection2 == null ? void 0 : projection2.getCode) == null ? void 0 : _b3.call(projection2)) || "EPSG:3857";
|
|
464663
|
+
console.log(`图层 '${this.config.name}' 未指定投影,回退到: ${code}`);
|
|
464674
464664
|
}
|
|
464675
464665
|
return projection2;
|
|
464676
464666
|
}
|
|
@@ -464678,14 +464668,11 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464678
464668
|
const config = this.config;
|
|
464679
464669
|
const sourceOptions = {
|
|
464680
464670
|
url: config.url,
|
|
464681
|
-
wrapX: config.wrapX ??
|
|
464682
|
-
format: config.format || "
|
|
464671
|
+
wrapX: config.wrapX ?? false,
|
|
464672
|
+
format: config.format || "png",
|
|
464683
464673
|
transparent: config.transparent ?? true,
|
|
464684
464674
|
crossOrigin: config.crossOrigin || "anonymous"
|
|
464685
464675
|
};
|
|
464686
|
-
const tileGrid = await this.createTileGrid(projection2.getCode(), config);
|
|
464687
|
-
if (tileGrid)
|
|
464688
|
-
sourceOptions.tileGrid = tileGrid;
|
|
464689
464676
|
if (config.serverType)
|
|
464690
464677
|
sourceOptions.serverType = config.serverType;
|
|
464691
464678
|
if (config.cacheEnabled !== void 0)
|
|
@@ -464696,55 +464683,51 @@ class TileSuperMapRestHandler extends BaseLayer$2 {
|
|
|
464696
464683
|
const config = this.config;
|
|
464697
464684
|
const sourceOptions = {
|
|
464698
464685
|
url: config.url,
|
|
464699
|
-
wrapX:
|
|
464686
|
+
wrapX: false,
|
|
464700
464687
|
format: config.format || "webp",
|
|
464701
464688
|
crossOrigin: config.crossOrigin || "anonymous",
|
|
464702
464689
|
transparent: config.transparent ?? true,
|
|
464703
464690
|
cacheEnabled: config.cacheEnabled ?? true
|
|
464704
464691
|
};
|
|
464705
|
-
|
|
464706
|
-
|
|
464707
|
-
|
|
464708
|
-
|
|
464709
|
-
|
|
464710
|
-
|
|
464711
|
-
|
|
464712
|
-
console.warn("无法从URL中提取map.json路径,跳过元数据获取");
|
|
464713
|
-
return sourceOptions;
|
|
464714
|
-
}
|
|
464692
|
+
let mapJsonUrl = config.url;
|
|
464693
|
+
let canFetchMetadata = false;
|
|
464694
|
+
if (mapJsonUrl.includes("/rest/maps/")) {
|
|
464695
|
+
const match2 = mapJsonUrl.match(/(.*\/rest\/maps\/[^/]+)/);
|
|
464696
|
+
if (match2 && match2.length > 1) {
|
|
464697
|
+
mapJsonUrl = match2[1] + ".json";
|
|
464698
|
+
canFetchMetadata = true;
|
|
464715
464699
|
}
|
|
464716
|
-
|
|
464717
|
-
|
|
464718
|
-
|
|
464719
|
-
|
|
464720
|
-
const
|
|
464721
|
-
|
|
464722
|
-
|
|
464723
|
-
|
|
464724
|
-
|
|
464725
|
-
|
|
464726
|
-
|
|
464727
|
-
|
|
464728
|
-
|
|
464729
|
-
|
|
464730
|
-
|
|
464731
|
-
|
|
464732
|
-
|
|
464700
|
+
}
|
|
464701
|
+
if (canFetchMetadata) {
|
|
464702
|
+
try {
|
|
464703
|
+
console.log(`正在获取SuperMap服务元数据: ${mapJsonUrl}`);
|
|
464704
|
+
const response = await fetch(mapJsonUrl);
|
|
464705
|
+
if (response.ok) {
|
|
464706
|
+
const mapJson = await response.json();
|
|
464707
|
+
console.log("获取到的map.json数据:", mapJson);
|
|
464708
|
+
const options = TileSuperMapRest.optionsFromMapJSON(
|
|
464709
|
+
config.url,
|
|
464710
|
+
mapJson
|
|
464711
|
+
);
|
|
464712
|
+
if (options == null ? void 0 : options.tileGrid) {
|
|
464713
|
+
sourceOptions.tileGrid = options.tileGrid;
|
|
464714
|
+
if (options.extent)
|
|
464715
|
+
sourceOptions.extent = options.extent;
|
|
464716
|
+
console.log("✅ 使用 optionsFromMapJSON 构建 tileGrid 成功");
|
|
464717
|
+
} else {
|
|
464718
|
+
console.warn("map.json 未提供有效 tileGrid,将回退到手动创建");
|
|
464719
|
+
}
|
|
464733
464720
|
}
|
|
464734
|
-
}
|
|
464735
|
-
console.
|
|
464736
|
-
const tileGrid = await this.createTileGrid(
|
|
464737
|
-
projection2.getCode(),
|
|
464738
|
-
config
|
|
464739
|
-
);
|
|
464740
|
-
if (tileGrid)
|
|
464741
|
-
sourceOptions.tileGrid = tileGrid;
|
|
464721
|
+
} catch (error2) {
|
|
464722
|
+
console.error("获取或解析map.json时出错,将回退到手动创建:", error2);
|
|
464742
464723
|
}
|
|
464743
|
-
}
|
|
464744
|
-
|
|
464724
|
+
}
|
|
464725
|
+
if (!sourceOptions.tileGrid) {
|
|
464726
|
+
console.warn("未能从元数据创建tileGrid,执行手动创建作为备用方案");
|
|
464745
464727
|
const tileGrid = await this.createTileGrid(projection2.getCode(), config);
|
|
464746
|
-
if (tileGrid)
|
|
464728
|
+
if (tileGrid) {
|
|
464747
464729
|
sourceOptions.tileGrid = tileGrid;
|
|
464730
|
+
}
|
|
464748
464731
|
}
|
|
464749
464732
|
if (config.serverType)
|
|
464750
464733
|
sourceOptions.serverType = config.serverType;
|
|
@@ -466760,6 +466743,22 @@ class LayerManager {
|
|
|
466760
466743
|
if (this.pendingLayerConfigs.has(layerId)) {
|
|
466761
466744
|
this.pendingLayerConfigs.set(layerId, config);
|
|
466762
466745
|
}
|
|
466746
|
+
if (visible) {
|
|
466747
|
+
const layer2 = handler.getLayer();
|
|
466748
|
+
const animCfg = config.locationAnimation;
|
|
466749
|
+
if (animCfg && animCfg.enabled) {
|
|
466750
|
+
this.handleLocationAnimation(layer2, config);
|
|
466751
|
+
} else if (config.fitToExtent) {
|
|
466752
|
+
const defaultAnim = {
|
|
466753
|
+
enabled: true,
|
|
466754
|
+
duration: 1e3,
|
|
466755
|
+
easing: "ease-out",
|
|
466756
|
+
maxZoom: 16,
|
|
466757
|
+
padding: [50, 50, 50, 50]
|
|
466758
|
+
};
|
|
466759
|
+
this.performLocationAnimation(layer2, config, defaultAnim);
|
|
466760
|
+
}
|
|
466761
|
+
}
|
|
466763
466762
|
this.eventBus.emit("layer-visibility-changed", {
|
|
466764
466763
|
layerId,
|
|
466765
466764
|
visible,
|
|
@@ -467170,6 +467169,7 @@ class LayerManager {
|
|
|
467170
467169
|
if (!handler || !config || !config.visible) {
|
|
467171
467170
|
continue;
|
|
467172
467171
|
}
|
|
467172
|
+
debugger;
|
|
467173
467173
|
try {
|
|
467174
467174
|
if (config.type === "TileSuperMapRest" || config.type === "tilesupermaprest" || config.type === "TILESUPERMAPREST") {
|
|
467175
467175
|
if ("getFeatureInfoAtCoordinate" in handler) {
|
|
@@ -481125,7 +481125,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
481125
481125
|
}
|
|
481126
481126
|
return groups;
|
|
481127
481127
|
});
|
|
481128
|
-
const activeTreeType = ref("
|
|
481128
|
+
const activeTreeType = ref("default");
|
|
481129
481129
|
const classificationGroups = computed(() => {
|
|
481130
481130
|
zIndexVersion.value;
|
|
481131
481131
|
const vectorGroup = layerGroups.value.find((g2) => g2.id === "vectorLayers");
|
|
@@ -491455,7 +491455,7 @@ function(t3) {
|
|
|
491455
491455
|
*/
|
|
491456
491456
|
function(t3) {
|
|
491457
491457
|
function e8() {
|
|
491458
|
-
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-
|
|
491458
|
+
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-77890a7c.mjs")).catch(function(t4) {
|
|
491459
491459
|
return Promise.reject(new Error("Could not load canvg: " + t4));
|
|
491460
491460
|
}).then(function(t4) {
|
|
491461
491461
|
return t4.default ? t4.default : t4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as commonjsGlobal, R as RGBColor, r as requestAnimationFrame, _ as _asyncToGenerator, a as _, p as processCanvasRGBA, b as _defineProperty } from "./index-
|
|
1
|
+
import { c as commonjsGlobal, R as RGBColor, r as requestAnimationFrame, _ as _asyncToGenerator, a as _, p as processCanvasRGBA, b as _defineProperty } from "./index-be67894d.mjs";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "ol";
|
|
4
4
|
var check = function(it) {
|
package/lib/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A, B, e, d, D, a2, a3, w, z, a7, a6, I, H, Z, $, L, J, K, a4, j, M, a0, a1, X, Y, U, W, Q, S, P, C, F, G, N, O, a8, f, T, E, V, y, k, q, u, g, m, h, x, s, n, o, a5, i, t, l, v } from "./index-
|
|
1
|
+
import { A, B, e, d, D, a2, a3, w, z, a7, a6, I, H, Z, $, L, J, K, a4, j, M, a0, a1, X, Y, U, W, Q, S, P, C, F, G, N, O, a8, f, T, E, V, y, k, q, u, g, m, h, x, s, n, o, a5, i, t, l, v } from "./index-be67894d.mjs";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "ol";
|
|
4
4
|
export {
|
package/lib/index.umd.js
CHANGED
|
@@ -41707,7 +41707,7 @@ var __publicField = (obj, key, value) => {
|
|
|
41707
41707
|
item
|
|
41708
41708
|
);
|
|
41709
41709
|
}
|
|
41710
|
-
function proj4$
|
|
41710
|
+
function proj4$2(fromProjOrToProj, toProjOrCoord, coord) {
|
|
41711
41711
|
var fromProj;
|
|
41712
41712
|
var toProj;
|
|
41713
41713
|
var single = false;
|
|
@@ -45707,7 +45707,7 @@ var __publicField = (obj, key, value) => {
|
|
|
45707
45707
|
proj42.Proj.projections.add(eqearth$1);
|
|
45708
45708
|
proj42.Proj.projections.add(bonne$1);
|
|
45709
45709
|
}
|
|
45710
|
-
const proj4$1 = Object.assign(proj4$
|
|
45710
|
+
const proj4$1 = Object.assign(proj4$2, {
|
|
45711
45711
|
defaultDatum: "WGS84",
|
|
45712
45712
|
Proj: Projection$3,
|
|
45713
45713
|
WGS84: new Projection$3("WGS84"),
|
|
@@ -45720,10 +45720,6 @@ var __publicField = (obj, key, value) => {
|
|
|
45720
45720
|
version: "__VERSION__"
|
|
45721
45721
|
});
|
|
45722
45722
|
includedProjections$1(proj4$1);
|
|
45723
|
-
const proj4$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
45724
|
-
__proto__: null,
|
|
45725
|
-
default: proj4$1
|
|
45726
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
45727
45723
|
let registered$1 = null;
|
|
45728
45724
|
function register$3(proj42) {
|
|
45729
45725
|
registered$1 = proj42;
|
|
@@ -465331,12 +465327,13 @@ ${this.attributes_.map(
|
|
|
465331
465327
|
return feature2;
|
|
465332
465328
|
}
|
|
465333
465329
|
setupEPSG4490() {
|
|
465334
|
-
(
|
|
465335
|
-
register$3(proj4$
|
|
465330
|
+
proj4$1.defs("EPSG:4490", "+proj=longlat +ellps=GRS80 +no_defs +type=crs");
|
|
465331
|
+
register$3(proj4$1);
|
|
465336
465332
|
console.log("EPSG:4490投影已注册");
|
|
465337
465333
|
}
|
|
465338
465334
|
async createLayer() {
|
|
465339
465335
|
var _a3;
|
|
465336
|
+
debugger;
|
|
465340
465337
|
const projection2 = this.resolveProjection();
|
|
465341
465338
|
const config = this.config;
|
|
465342
465339
|
const sourceOptions = config.autoFetchMetadata === true ? await this.buildSourceOptionsWithMetadata(projection2) : await this.buildSourceOptions(projection2);
|
|
@@ -465347,19 +465344,12 @@ ${this.attributes_.map(
|
|
|
465347
465344
|
opacity: config.opacity
|
|
465348
465345
|
});
|
|
465349
465346
|
const source = new TileSuperMapRest(sourceOptions);
|
|
465350
|
-
source.on("tileloadstart", () => {
|
|
465351
|
-
console.log(`🔄 SuperMap图层 ${config.name} 开始加载瓦片`);
|
|
465352
|
-
});
|
|
465353
|
-
source.on("tileloadend", () => {
|
|
465354
|
-
console.log(`✅ SuperMap图层 ${config.name} 瓦片加载完成`);
|
|
465355
|
-
});
|
|
465356
465347
|
source.on("tileloaderror", (event) => {
|
|
465357
465348
|
var _a4, _b3;
|
|
465358
465349
|
const img = (_b3 = (_a4 = event == null ? void 0 : event.tile) == null ? void 0 : _a4.getImage) == null ? void 0 : _b3.call(_a4);
|
|
465359
465350
|
const src2 = img == null ? void 0 : img.src;
|
|
465360
|
-
console.error(`❌ SuperMap图层 ${config.name} 瓦片加载失败:`, event);
|
|
465361
465351
|
if (src2)
|
|
465362
|
-
console.error(
|
|
465352
|
+
console.error(`瓦片加载失败: ${src2}`);
|
|
465363
465353
|
});
|
|
465364
465354
|
const tileLayer = new TileLayer$2({
|
|
465365
465355
|
source,
|
|
@@ -465368,6 +465358,10 @@ ${this.attributes_.map(
|
|
|
465368
465358
|
// opacity: (config.opacity || 100) / 100,
|
|
465369
465359
|
});
|
|
465370
465360
|
this.layer = tileLayer;
|
|
465361
|
+
if (config.autoFetchMetadata === true) {
|
|
465362
|
+
this.fetchAndUpdateTileGrid(source).catch(() => {
|
|
465363
|
+
});
|
|
465364
|
+
}
|
|
465371
465365
|
console.log(`SuperMap图层 ${config.name} 创建完成:`, {
|
|
465372
465366
|
visible: tileLayer.getVisible(),
|
|
465373
465367
|
opacity: tileLayer.getOpacity(),
|
|
@@ -465386,23 +465380,17 @@ ${this.attributes_.map(
|
|
|
465386
465380
|
extent: mapExtent,
|
|
465387
465381
|
projection: mapView.getProjection().getCode()
|
|
465388
465382
|
});
|
|
465389
|
-
if (config.center && config.center.length >= 2) {
|
|
465390
|
-
|
|
465391
|
-
const isInView = layerCenter[0] >= mapExtent[0] && layerCenter[0] <= mapExtent[2] && layerCenter[1] >= mapExtent[1] && layerCenter[1] <= mapExtent[3];
|
|
465392
|
-
console.log(
|
|
465393
|
-
`图层中心点 [${layerCenter[0]}, ${layerCenter[1]}] 是否在当前视图内: ${isInView}`
|
|
465394
|
-
);
|
|
465395
|
-
if (!isInView) {
|
|
465396
|
-
console.warn(
|
|
465397
|
-
`⚠️ 图层 ${config.name} 的中心点不在当前地图视图范围内,可能需要缩放到图层位置`
|
|
465398
|
-
);
|
|
465399
|
-
}
|
|
465383
|
+
if (this.map && config.center && config.center.length >= 2) {
|
|
465384
|
+
this.map.getView().setCenter(config.center);
|
|
465400
465385
|
}
|
|
465401
465386
|
}
|
|
465402
465387
|
tileLayer.on("postrender", () => this.tryApplyStyles());
|
|
465403
465388
|
source.on("tileloadend", () => this.tryApplyStyles());
|
|
465404
465389
|
return tileLayer;
|
|
465405
465390
|
}
|
|
465391
|
+
applyFilters() {
|
|
465392
|
+
console.warn("TileSuperMapRestHandler a ");
|
|
465393
|
+
}
|
|
465406
465394
|
tryApplyStyles() {
|
|
465407
465395
|
if (this.styleApplied || this.styleApplyAttempts >= this.maxStyleApplyAttempts)
|
|
465408
465396
|
return;
|
|
@@ -465435,18 +465423,20 @@ ${this.attributes_.map(
|
|
|
465435
465423
|
}
|
|
465436
465424
|
}
|
|
465437
465425
|
resolveProjection() {
|
|
465438
|
-
var _a3;
|
|
465426
|
+
var _a3, _b3;
|
|
465439
465427
|
let projection2 = null;
|
|
465440
|
-
|
|
465441
|
-
|
|
465442
|
-
|
|
465428
|
+
const projectionCode = this.config.projection;
|
|
465429
|
+
if (projectionCode) {
|
|
465430
|
+
projection2 = get$c(projectionCode);
|
|
465431
|
+
if (!projection2 && projectionCode === "EPSG:4490") {
|
|
465443
465432
|
this.setupEPSG4490();
|
|
465444
465433
|
projection2 = get$c("EPSG:4490");
|
|
465445
465434
|
}
|
|
465446
465435
|
}
|
|
465447
465436
|
if (!projection2) {
|
|
465448
|
-
projection2 = ((_a3 = this.map) == null ? void 0 : _a3.getView().getProjection()) || get$c("EPSG:
|
|
465449
|
-
|
|
465437
|
+
projection2 = ((_a3 = this.map) == null ? void 0 : _a3.getView().getProjection()) || get$c("EPSG:3857");
|
|
465438
|
+
const code = ((_b3 = projection2 == null ? void 0 : projection2.getCode) == null ? void 0 : _b3.call(projection2)) || "EPSG:3857";
|
|
465439
|
+
console.log(`图层 '${this.config.name}' 未指定投影,回退到: ${code}`);
|
|
465450
465440
|
}
|
|
465451
465441
|
return projection2;
|
|
465452
465442
|
}
|
|
@@ -465454,14 +465444,11 @@ ${this.attributes_.map(
|
|
|
465454
465444
|
const config = this.config;
|
|
465455
465445
|
const sourceOptions = {
|
|
465456
465446
|
url: config.url,
|
|
465457
|
-
wrapX: config.wrapX ??
|
|
465458
|
-
format: config.format || "
|
|
465447
|
+
wrapX: config.wrapX ?? false,
|
|
465448
|
+
format: config.format || "png",
|
|
465459
465449
|
transparent: config.transparent ?? true,
|
|
465460
465450
|
crossOrigin: config.crossOrigin || "anonymous"
|
|
465461
465451
|
};
|
|
465462
|
-
const tileGrid = await this.createTileGrid(projection2.getCode(), config);
|
|
465463
|
-
if (tileGrid)
|
|
465464
|
-
sourceOptions.tileGrid = tileGrid;
|
|
465465
465452
|
if (config.serverType)
|
|
465466
465453
|
sourceOptions.serverType = config.serverType;
|
|
465467
465454
|
if (config.cacheEnabled !== void 0)
|
|
@@ -465472,55 +465459,51 @@ ${this.attributes_.map(
|
|
|
465472
465459
|
const config = this.config;
|
|
465473
465460
|
const sourceOptions = {
|
|
465474
465461
|
url: config.url,
|
|
465475
|
-
wrapX:
|
|
465462
|
+
wrapX: false,
|
|
465476
465463
|
format: config.format || "webp",
|
|
465477
465464
|
crossOrigin: config.crossOrigin || "anonymous",
|
|
465478
465465
|
transparent: config.transparent ?? true,
|
|
465479
465466
|
cacheEnabled: config.cacheEnabled ?? true
|
|
465480
465467
|
};
|
|
465481
|
-
|
|
465482
|
-
|
|
465483
|
-
|
|
465484
|
-
|
|
465485
|
-
|
|
465486
|
-
|
|
465487
|
-
|
|
465488
|
-
console.warn("无法从URL中提取map.json路径,跳过元数据获取");
|
|
465489
|
-
return sourceOptions;
|
|
465490
|
-
}
|
|
465468
|
+
let mapJsonUrl = config.url;
|
|
465469
|
+
let canFetchMetadata = false;
|
|
465470
|
+
if (mapJsonUrl.includes("/rest/maps/")) {
|
|
465471
|
+
const match2 = mapJsonUrl.match(/(.*\/rest\/maps\/[^/]+)/);
|
|
465472
|
+
if (match2 && match2.length > 1) {
|
|
465473
|
+
mapJsonUrl = match2[1] + ".json";
|
|
465474
|
+
canFetchMetadata = true;
|
|
465491
465475
|
}
|
|
465492
|
-
|
|
465493
|
-
|
|
465494
|
-
|
|
465495
|
-
|
|
465496
|
-
const
|
|
465497
|
-
|
|
465498
|
-
|
|
465499
|
-
|
|
465500
|
-
|
|
465501
|
-
|
|
465502
|
-
|
|
465503
|
-
|
|
465504
|
-
|
|
465505
|
-
|
|
465506
|
-
|
|
465507
|
-
|
|
465508
|
-
|
|
465476
|
+
}
|
|
465477
|
+
if (canFetchMetadata) {
|
|
465478
|
+
try {
|
|
465479
|
+
console.log(`正在获取SuperMap服务元数据: ${mapJsonUrl}`);
|
|
465480
|
+
const response = await fetch(mapJsonUrl);
|
|
465481
|
+
if (response.ok) {
|
|
465482
|
+
const mapJson = await response.json();
|
|
465483
|
+
console.log("获取到的map.json数据:", mapJson);
|
|
465484
|
+
const options = TileSuperMapRest.optionsFromMapJSON(
|
|
465485
|
+
config.url,
|
|
465486
|
+
mapJson
|
|
465487
|
+
);
|
|
465488
|
+
if (options == null ? void 0 : options.tileGrid) {
|
|
465489
|
+
sourceOptions.tileGrid = options.tileGrid;
|
|
465490
|
+
if (options.extent)
|
|
465491
|
+
sourceOptions.extent = options.extent;
|
|
465492
|
+
console.log("✅ 使用 optionsFromMapJSON 构建 tileGrid 成功");
|
|
465493
|
+
} else {
|
|
465494
|
+
console.warn("map.json 未提供有效 tileGrid,将回退到手动创建");
|
|
465495
|
+
}
|
|
465509
465496
|
}
|
|
465510
|
-
}
|
|
465511
|
-
console.
|
|
465512
|
-
const tileGrid = await this.createTileGrid(
|
|
465513
|
-
projection2.getCode(),
|
|
465514
|
-
config
|
|
465515
|
-
);
|
|
465516
|
-
if (tileGrid)
|
|
465517
|
-
sourceOptions.tileGrid = tileGrid;
|
|
465497
|
+
} catch (error2) {
|
|
465498
|
+
console.error("获取或解析map.json时出错,将回退到手动创建:", error2);
|
|
465518
465499
|
}
|
|
465519
|
-
}
|
|
465520
|
-
|
|
465500
|
+
}
|
|
465501
|
+
if (!sourceOptions.tileGrid) {
|
|
465502
|
+
console.warn("未能从元数据创建tileGrid,执行手动创建作为备用方案");
|
|
465521
465503
|
const tileGrid = await this.createTileGrid(projection2.getCode(), config);
|
|
465522
|
-
if (tileGrid)
|
|
465504
|
+
if (tileGrid) {
|
|
465523
465505
|
sourceOptions.tileGrid = tileGrid;
|
|
465506
|
+
}
|
|
465524
465507
|
}
|
|
465525
465508
|
if (config.serverType)
|
|
465526
465509
|
sourceOptions.serverType = config.serverType;
|
|
@@ -467536,6 +467519,22 @@ ${this.attributes_.map(
|
|
|
467536
467519
|
if (this.pendingLayerConfigs.has(layerId)) {
|
|
467537
467520
|
this.pendingLayerConfigs.set(layerId, config);
|
|
467538
467521
|
}
|
|
467522
|
+
if (visible) {
|
|
467523
|
+
const layer2 = handler.getLayer();
|
|
467524
|
+
const animCfg = config.locationAnimation;
|
|
467525
|
+
if (animCfg && animCfg.enabled) {
|
|
467526
|
+
this.handleLocationAnimation(layer2, config);
|
|
467527
|
+
} else if (config.fitToExtent) {
|
|
467528
|
+
const defaultAnim = {
|
|
467529
|
+
enabled: true,
|
|
467530
|
+
duration: 1e3,
|
|
467531
|
+
easing: "ease-out",
|
|
467532
|
+
maxZoom: 16,
|
|
467533
|
+
padding: [50, 50, 50, 50]
|
|
467534
|
+
};
|
|
467535
|
+
this.performLocationAnimation(layer2, config, defaultAnim);
|
|
467536
|
+
}
|
|
467537
|
+
}
|
|
467539
467538
|
this.eventBus.emit("layer-visibility-changed", {
|
|
467540
467539
|
layerId,
|
|
467541
467540
|
visible,
|
|
@@ -467946,6 +467945,7 @@ ${this.attributes_.map(
|
|
|
467946
467945
|
if (!handler || !config || !config.visible) {
|
|
467947
467946
|
continue;
|
|
467948
467947
|
}
|
|
467948
|
+
debugger;
|
|
467949
467949
|
try {
|
|
467950
467950
|
if (config.type === "TileSuperMapRest" || config.type === "tilesupermaprest" || config.type === "TILESUPERMAPREST") {
|
|
467951
467951
|
if ("getFeatureInfoAtCoordinate" in handler) {
|
|
@@ -481925,7 +481925,7 @@ ${this.attributes_.map(
|
|
|
481925
481925
|
}
|
|
481926
481926
|
return groups;
|
|
481927
481927
|
});
|
|
481928
|
-
const activeTreeType = vue.ref("
|
|
481928
|
+
const activeTreeType = vue.ref("default");
|
|
481929
481929
|
const classificationGroups = vue.computed(() => {
|
|
481930
481930
|
zIndexVersion.value;
|
|
481931
481931
|
const vectorGroup = layerGroups.value.find((g2) => g2.id === "vectorLayers");
|