vue-openlayers-plugin 1.0.38 → 1.0.41
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-77255d64.mjs → index-e3f12e06.mjs} +119 -89
- package/lib/{index.es-420f18cd.mjs → index.es-a81be151.mjs} +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.umd.js +119 -89
- package/lib/style.css +4 -4
- package/package.json +100 -100
- package/types/src/components/CustomOpenlayer/index.vue.d.ts +2 -1
- package/types/src/components/CustomOpenlayer/index.vue.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/drawing/DrawingManager.d.ts +31 -0
- package/types/src/components/CustomOpenlayer/utils/drawing/DrawingManager.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/layers/WMSLayerHandler.d.ts +0 -4
- package/types/src/components/CustomOpenlayer/utils/layers/WMSLayerHandler.d.ts.map +1 -1
- package/types/src/components/CustomOpenlayer/utils/proxyHelper.d.ts +2 -47
- package/types/src/components/CustomOpenlayer/utils/proxyHelper.d.ts.map +1 -1
|
@@ -64518,6 +64518,9 @@ class DrawingManager {
|
|
|
64518
64518
|
__publicField(this, "_multiLineStringCoordinates", []);
|
|
64519
64519
|
__publicField(this, "_multiPolygonDrawing", null);
|
|
64520
64520
|
__publicField(this, "_multiPolygonCoordinates", []);
|
|
64521
|
+
// 地图事件监听器管理
|
|
64522
|
+
__publicField(this, "_originalMapEventListeners", /* @__PURE__ */ new Map());
|
|
64523
|
+
__publicField(this, "_mapEventsDisabled", false);
|
|
64521
64524
|
/**
|
|
64522
64525
|
* 创建星形几何函数
|
|
64523
64526
|
*/
|
|
@@ -64750,6 +64753,8 @@ class DrawingManager {
|
|
|
64750
64753
|
if ((options == null ? void 0 : options.allowContinuousDrawing) !== void 0) {
|
|
64751
64754
|
this._config.allowContinuousDrawing = options.allowContinuousDrawing;
|
|
64752
64755
|
}
|
|
64756
|
+
const disableMapInteractions = (options == null ? void 0 : options.disableMapInteractions) ?? true;
|
|
64757
|
+
this.toggleMapInteractions(!disableMapInteractions);
|
|
64753
64758
|
switch (mode2) {
|
|
64754
64759
|
case "point":
|
|
64755
64760
|
case "line":
|
|
@@ -64993,6 +64998,58 @@ class DrawingManager {
|
|
|
64993
64998
|
}
|
|
64994
64999
|
}
|
|
64995
65000
|
}
|
|
65001
|
+
/**
|
|
65002
|
+
* 控制地图其他交互功能的启用/禁用
|
|
65003
|
+
*/
|
|
65004
|
+
toggleMapInteractions(enable) {
|
|
65005
|
+
const interactions = this._map.getInteractions().getArray();
|
|
65006
|
+
interactions.forEach((interaction) => {
|
|
65007
|
+
if (interaction === this._drawInteraction || interaction === this._selectInteraction || interaction === this._modifyInteraction || interaction === this._snapInteraction) {
|
|
65008
|
+
return;
|
|
65009
|
+
}
|
|
65010
|
+
if (interaction.setActive) {
|
|
65011
|
+
interaction.setActive(enable);
|
|
65012
|
+
}
|
|
65013
|
+
});
|
|
65014
|
+
this.toggleMapEventListeners(enable);
|
|
65015
|
+
console.log(`地图其他交互已${enable ? "启用" : "禁用"}`);
|
|
65016
|
+
}
|
|
65017
|
+
/**
|
|
65018
|
+
* 控制地图事件监听器的启用/禁用
|
|
65019
|
+
*/
|
|
65020
|
+
toggleMapEventListeners(enable) {
|
|
65021
|
+
if (enable && this._mapEventsDisabled) {
|
|
65022
|
+
this._originalMapEventListeners.forEach((listeners, eventType) => {
|
|
65023
|
+
listeners.forEach((listener) => {
|
|
65024
|
+
this._map.on(eventType, listener);
|
|
65025
|
+
});
|
|
65026
|
+
});
|
|
65027
|
+
this._mapEventsDisabled = false;
|
|
65028
|
+
console.log("地图事件监听器已恢复");
|
|
65029
|
+
} else if (!enable && !this._mapEventsDisabled) {
|
|
65030
|
+
this.disableMapEventListeners();
|
|
65031
|
+
this._mapEventsDisabled = true;
|
|
65032
|
+
console.log("地图事件监听器已禁用");
|
|
65033
|
+
}
|
|
65034
|
+
}
|
|
65035
|
+
/**
|
|
65036
|
+
* 禁用地图事件监听器
|
|
65037
|
+
*/
|
|
65038
|
+
disableMapEventListeners() {
|
|
65039
|
+
const mapListeners = this._map.listeners_;
|
|
65040
|
+
if (!mapListeners)
|
|
65041
|
+
return;
|
|
65042
|
+
const eventsToDisable = ["singleclick", "click", "dblclick"];
|
|
65043
|
+
eventsToDisable.forEach((eventType) => {
|
|
65044
|
+
if (mapListeners[eventType]) {
|
|
65045
|
+
const listeners = [...mapListeners[eventType]];
|
|
65046
|
+
this._originalMapEventListeners.set(eventType, listeners);
|
|
65047
|
+
listeners.forEach((listener) => {
|
|
65048
|
+
this._map.un(eventType, listener);
|
|
65049
|
+
});
|
|
65050
|
+
}
|
|
65051
|
+
});
|
|
65052
|
+
}
|
|
64996
65053
|
/**
|
|
64997
65054
|
* 处理绘制开始
|
|
64998
65055
|
*/
|
|
@@ -65058,6 +65115,7 @@ class DrawingManager {
|
|
|
65058
65115
|
console.log("HandleDrawEnd: Setting mode to none");
|
|
65059
65116
|
this.setMode("none");
|
|
65060
65117
|
}
|
|
65118
|
+
this.toggleMapInteractions(true);
|
|
65061
65119
|
this.emit("drawing-end", drawing);
|
|
65062
65120
|
} catch (error2) {
|
|
65063
65121
|
console.error("Failed to create drawing:", error2);
|
|
@@ -65730,7 +65788,9 @@ class DrawingManager {
|
|
|
65730
65788
|
* @returns 删除的标绘对象数量
|
|
65731
65789
|
*/
|
|
65732
65790
|
removeDrawingsByCondition(predicate) {
|
|
65733
|
-
const drawingsToRemove = Array.from(this._drawings.values()).filter(
|
|
65791
|
+
const drawingsToRemove = Array.from(this._drawings.values()).filter(
|
|
65792
|
+
predicate
|
|
65793
|
+
);
|
|
65734
65794
|
let removedCount = 0;
|
|
65735
65795
|
drawingsToRemove.forEach((drawing) => {
|
|
65736
65796
|
if (this.removeDrawing(drawing)) {
|
|
@@ -66176,6 +66236,39 @@ class DrawingManager {
|
|
|
66176
66236
|
tooltipText += "\n双击结束当前多边形";
|
|
66177
66237
|
this._tooltipHelper.updateText(tooltipText);
|
|
66178
66238
|
}
|
|
66239
|
+
/**
|
|
66240
|
+
* 设置捕捉功能启用状态
|
|
66241
|
+
*/
|
|
66242
|
+
setSnapEnabled(enabled) {
|
|
66243
|
+
this._config.enableSnap = enabled;
|
|
66244
|
+
if (this._snapInteraction) {
|
|
66245
|
+
this._snapInteraction.setActive(enabled);
|
|
66246
|
+
}
|
|
66247
|
+
}
|
|
66248
|
+
/**
|
|
66249
|
+
* 设置修改功能启用状态
|
|
66250
|
+
*/
|
|
66251
|
+
setModifyEnabled(enabled) {
|
|
66252
|
+
this._config.enableModify = enabled;
|
|
66253
|
+
if (this._modifyInteraction) {
|
|
66254
|
+
this._modifyInteraction.setActive(enabled);
|
|
66255
|
+
}
|
|
66256
|
+
}
|
|
66257
|
+
/**
|
|
66258
|
+
* 设置选择功能启用状态
|
|
66259
|
+
*/
|
|
66260
|
+
setSelectEnabled(enabled) {
|
|
66261
|
+
this._config.enableSelect = enabled;
|
|
66262
|
+
if (this._selectInteraction) {
|
|
66263
|
+
this._selectInteraction.setActive(enabled);
|
|
66264
|
+
}
|
|
66265
|
+
}
|
|
66266
|
+
/**
|
|
66267
|
+
* 设置连续绘制功能
|
|
66268
|
+
*/
|
|
66269
|
+
setContinuousDrawing(enabled) {
|
|
66270
|
+
this._config.allowContinuousDrawing = enabled;
|
|
66271
|
+
}
|
|
66179
66272
|
/**
|
|
66180
66273
|
* 销毁管理器
|
|
66181
66274
|
*/
|
|
@@ -66183,6 +66276,9 @@ class DrawingManager {
|
|
|
66183
66276
|
this.clearAll();
|
|
66184
66277
|
this.clearDrawInteraction();
|
|
66185
66278
|
this.enableSelectAndModify(false);
|
|
66279
|
+
if (this._mapEventsDisabled) {
|
|
66280
|
+
this.toggleMapEventListeners(true);
|
|
66281
|
+
}
|
|
66186
66282
|
if (this._tooltipHelper) {
|
|
66187
66283
|
this._tooltipHelper.destroy();
|
|
66188
66284
|
this._tooltipHelper = null;
|
|
@@ -66192,6 +66288,8 @@ class DrawingManager {
|
|
|
66192
66288
|
this._eventListeners.clear();
|
|
66193
66289
|
this._currentMode = "none";
|
|
66194
66290
|
this._selectedDrawing = null;
|
|
66291
|
+
this._originalMapEventListeners.clear();
|
|
66292
|
+
this._mapEventsDisabled = false;
|
|
66195
66293
|
}
|
|
66196
66294
|
}
|
|
66197
66295
|
class DrawingManagerFactory {
|
|
@@ -81670,71 +81768,6 @@ class TileLayerHandler extends BaseLayer$2 {
|
|
|
81670
81768
|
}
|
|
81671
81769
|
}
|
|
81672
81770
|
}
|
|
81673
|
-
const defaultProxyConfig = {
|
|
81674
|
-
enabled: true,
|
|
81675
|
-
autoFallback: true,
|
|
81676
|
-
rules: [
|
|
81677
|
-
{
|
|
81678
|
-
pattern: "59.37.40.252:8055",
|
|
81679
|
-
target: "http://59.37.40.252:8055",
|
|
81680
|
-
proxyPath: "/hdrf-wms"
|
|
81681
|
-
},
|
|
81682
|
-
{
|
|
81683
|
-
pattern: "localhost:8080/geoserver",
|
|
81684
|
-
target: "http://localhost:8080/geoserver",
|
|
81685
|
-
proxyPath: "/api/geoserver"
|
|
81686
|
-
}
|
|
81687
|
-
]
|
|
81688
|
-
};
|
|
81689
|
-
let currentProxyConfig = { ...defaultProxyConfig };
|
|
81690
|
-
function convertWMSUrlToProxy(originalUrl, forceProxy = false) {
|
|
81691
|
-
if (!currentProxyConfig.enabled && !forceProxy) {
|
|
81692
|
-
return originalUrl;
|
|
81693
|
-
}
|
|
81694
|
-
for (const rule of currentProxyConfig.rules) {
|
|
81695
|
-
if (originalUrl.includes(rule.pattern)) {
|
|
81696
|
-
return originalUrl.replace(rule.target, rule.proxyPath);
|
|
81697
|
-
}
|
|
81698
|
-
}
|
|
81699
|
-
return originalUrl;
|
|
81700
|
-
}
|
|
81701
|
-
async function testUrlAccessibility(url) {
|
|
81702
|
-
try {
|
|
81703
|
-
const response = await fetch(url, {
|
|
81704
|
-
method: "HEAD",
|
|
81705
|
-
mode: "no-cors",
|
|
81706
|
-
cache: "no-cache"
|
|
81707
|
-
});
|
|
81708
|
-
return true;
|
|
81709
|
-
} catch (error2) {
|
|
81710
|
-
console.warn(`URL accessibility test failed for: ${url}`, error2);
|
|
81711
|
-
return false;
|
|
81712
|
-
}
|
|
81713
|
-
}
|
|
81714
|
-
async function getOptimalUrl(originalUrl) {
|
|
81715
|
-
if (!currentProxyConfig.autoFallback) {
|
|
81716
|
-
return convertWMSUrlToProxy(originalUrl);
|
|
81717
|
-
}
|
|
81718
|
-
const isOriginalAccessible = await testUrlAccessibility(originalUrl);
|
|
81719
|
-
if (isOriginalAccessible) {
|
|
81720
|
-
return originalUrl;
|
|
81721
|
-
}
|
|
81722
|
-
const proxyUrl = convertWMSUrlToProxy(originalUrl, true);
|
|
81723
|
-
if (proxyUrl !== originalUrl) {
|
|
81724
|
-
console.info(`Original URL failed, switching to proxy: ${originalUrl} -> ${proxyUrl}`);
|
|
81725
|
-
return proxyUrl;
|
|
81726
|
-
}
|
|
81727
|
-
return originalUrl;
|
|
81728
|
-
}
|
|
81729
|
-
function needsProxy(url) {
|
|
81730
|
-
if (url.includes("tianditu.gov.cn") || url.includes("restapi.amap.com") || url.includes("api.map.baidu.com")) {
|
|
81731
|
-
return true;
|
|
81732
|
-
}
|
|
81733
|
-
if (currentProxyConfig.enabled) {
|
|
81734
|
-
return currentProxyConfig.rules.some((rule) => url.includes(rule.pattern));
|
|
81735
|
-
}
|
|
81736
|
-
return false;
|
|
81737
|
-
}
|
|
81738
81771
|
class WMSLayerHandler extends BaseLayer$2 {
|
|
81739
81772
|
createLayer() {
|
|
81740
81773
|
const source = this.createWMSSource();
|
|
@@ -81742,16 +81775,14 @@ class WMSLayerHandler extends BaseLayer$2 {
|
|
|
81742
81775
|
source,
|
|
81743
81776
|
className: this.config.cssClass || this.config.className || void 0
|
|
81744
81777
|
});
|
|
81745
|
-
this.optimizeSourceUrl(source);
|
|
81746
81778
|
return imageLayer;
|
|
81747
81779
|
}
|
|
81748
81780
|
/**
|
|
81749
81781
|
* 创建WMS数据源
|
|
81750
81782
|
*/
|
|
81751
81783
|
createWMSSource() {
|
|
81752
|
-
const initialUrl = needsProxy(this.config.url) ? convertWMSUrlToProxy(this.config.url) : this.config.url;
|
|
81753
81784
|
return new ImageWMS$1({
|
|
81754
|
-
url:
|
|
81785
|
+
url: this.config.url,
|
|
81755
81786
|
params: {
|
|
81756
81787
|
"LAYERS": this.config.wmsLayers || "",
|
|
81757
81788
|
"FORMAT": this.config.wmsFormat || "image/png",
|
|
@@ -81762,22 +81793,6 @@ class WMSLayerHandler extends BaseLayer$2 {
|
|
|
81762
81793
|
crossOrigin: "anonymous"
|
|
81763
81794
|
});
|
|
81764
81795
|
}
|
|
81765
|
-
/**
|
|
81766
|
-
* 异步优化数据源URL
|
|
81767
|
-
*/
|
|
81768
|
-
async optimizeSourceUrl(source) {
|
|
81769
|
-
try {
|
|
81770
|
-
const optimalUrl = await getOptimalUrl(this.config.url);
|
|
81771
|
-
const currentUrl = source.getUrl();
|
|
81772
|
-
if (optimalUrl !== currentUrl) {
|
|
81773
|
-
console.info(`Optimizing WMS URL for layer ${this.config.id}: ${currentUrl} -> ${optimalUrl}`);
|
|
81774
|
-
source.setUrl(optimalUrl);
|
|
81775
|
-
source.refresh();
|
|
81776
|
-
}
|
|
81777
|
-
} catch (error2) {
|
|
81778
|
-
console.warn(`Failed to optimize URL for WMS layer ${this.config.id}:`, error2);
|
|
81779
|
-
}
|
|
81780
|
-
}
|
|
81781
81796
|
/**
|
|
81782
81797
|
* 更新WMS参数
|
|
81783
81798
|
*/
|
|
@@ -479701,9 +479716,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
479701
479716
|
return null;
|
|
479702
479717
|
},
|
|
479703
479718
|
// 绘制管理器方法
|
|
479704
|
-
getDrawingManager: () => {
|
|
479719
|
+
getDrawingManager: (config) => {
|
|
479705
479720
|
var _a3;
|
|
479706
|
-
|
|
479721
|
+
const drawingManager = (_a3 = mapContainerRef.value) == null ? void 0 : _a3.getDrawingManager();
|
|
479722
|
+
if (drawingManager && config) {
|
|
479723
|
+
if (config.enableSnap !== void 0) {
|
|
479724
|
+
drawingManager.setSnapEnabled(config.enableSnap);
|
|
479725
|
+
}
|
|
479726
|
+
if (config.enableModify !== void 0) {
|
|
479727
|
+
drawingManager.setModifyEnabled(config.enableModify);
|
|
479728
|
+
}
|
|
479729
|
+
if (config.enableSelect !== void 0) {
|
|
479730
|
+
drawingManager.setSelectEnabled(config.enableSelect);
|
|
479731
|
+
}
|
|
479732
|
+
if (config.allowContinuousDrawing !== void 0) {
|
|
479733
|
+
drawingManager.setContinuousDrawing(config.allowContinuousDrawing);
|
|
479734
|
+
}
|
|
479735
|
+
}
|
|
479736
|
+
return drawingManager;
|
|
479707
479737
|
},
|
|
479708
479738
|
startDrawing: (type) => {
|
|
479709
479739
|
var _a3;
|
|
@@ -480018,7 +480048,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
480018
480048
|
};
|
|
480019
480049
|
}
|
|
480020
480050
|
});
|
|
480021
|
-
const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
480051
|
+
const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6ff898ba"]]);
|
|
480022
480052
|
var u8 = Uint8Array;
|
|
480023
480053
|
var u16 = Uint16Array;
|
|
480024
480054
|
var i32 = Int32Array;
|
|
@@ -488290,7 +488320,7 @@ function(t3) {
|
|
|
488290
488320
|
*/
|
|
488291
488321
|
function(t3) {
|
|
488292
488322
|
function e8() {
|
|
488293
|
-
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-
|
|
488323
|
+
return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-a81be151.mjs")).catch(function(t4) {
|
|
488294
488324
|
return Promise.reject(new Error("Could not load canvg: " + t4));
|
|
488295
488325
|
}).then(function(t4) {
|
|
488296
488326
|
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-e3f12e06.mjs";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "ol";
|
|
4
4
|
var check = function(it) {
|
package/lib/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z, B, d, C, D, a2, a3, u, y, I, H, Z, $, L, J, K, a4, h, M, a0, a1, X, Y, U, W, Q, S, P, A, F, G, N, O, e, T, E, V, x, j, o, t, f, k, g, w, q, m, n, a5, i, s, l, v } from "./index-
|
|
1
|
+
import { z, B, d, C, D, a2, a3, u, y, I, H, Z, $, L, J, K, a4, h, M, a0, a1, X, Y, U, W, Q, S, P, A, F, G, N, O, e, T, E, V, x, j, o, t, f, k, g, w, q, m, n, a5, i, s, l, v } from "./index-e3f12e06.mjs";
|
|
2
2
|
import "vue";
|
|
3
3
|
import "ol";
|
|
4
4
|
export {
|
package/lib/index.umd.js
CHANGED
|
@@ -65027,6 +65027,9 @@ ${this.attributes_.map(
|
|
|
65027
65027
|
__publicField(this, "_multiLineStringCoordinates", []);
|
|
65028
65028
|
__publicField(this, "_multiPolygonDrawing", null);
|
|
65029
65029
|
__publicField(this, "_multiPolygonCoordinates", []);
|
|
65030
|
+
// 地图事件监听器管理
|
|
65031
|
+
__publicField(this, "_originalMapEventListeners", /* @__PURE__ */ new Map());
|
|
65032
|
+
__publicField(this, "_mapEventsDisabled", false);
|
|
65030
65033
|
/**
|
|
65031
65034
|
* 创建星形几何函数
|
|
65032
65035
|
*/
|
|
@@ -65259,6 +65262,8 @@ ${this.attributes_.map(
|
|
|
65259
65262
|
if ((options == null ? void 0 : options.allowContinuousDrawing) !== void 0) {
|
|
65260
65263
|
this._config.allowContinuousDrawing = options.allowContinuousDrawing;
|
|
65261
65264
|
}
|
|
65265
|
+
const disableMapInteractions = (options == null ? void 0 : options.disableMapInteractions) ?? true;
|
|
65266
|
+
this.toggleMapInteractions(!disableMapInteractions);
|
|
65262
65267
|
switch (mode2) {
|
|
65263
65268
|
case "point":
|
|
65264
65269
|
case "line":
|
|
@@ -65502,6 +65507,58 @@ ${this.attributes_.map(
|
|
|
65502
65507
|
}
|
|
65503
65508
|
}
|
|
65504
65509
|
}
|
|
65510
|
+
/**
|
|
65511
|
+
* 控制地图其他交互功能的启用/禁用
|
|
65512
|
+
*/
|
|
65513
|
+
toggleMapInteractions(enable) {
|
|
65514
|
+
const interactions = this._map.getInteractions().getArray();
|
|
65515
|
+
interactions.forEach((interaction) => {
|
|
65516
|
+
if (interaction === this._drawInteraction || interaction === this._selectInteraction || interaction === this._modifyInteraction || interaction === this._snapInteraction) {
|
|
65517
|
+
return;
|
|
65518
|
+
}
|
|
65519
|
+
if (interaction.setActive) {
|
|
65520
|
+
interaction.setActive(enable);
|
|
65521
|
+
}
|
|
65522
|
+
});
|
|
65523
|
+
this.toggleMapEventListeners(enable);
|
|
65524
|
+
console.log(`地图其他交互已${enable ? "启用" : "禁用"}`);
|
|
65525
|
+
}
|
|
65526
|
+
/**
|
|
65527
|
+
* 控制地图事件监听器的启用/禁用
|
|
65528
|
+
*/
|
|
65529
|
+
toggleMapEventListeners(enable) {
|
|
65530
|
+
if (enable && this._mapEventsDisabled) {
|
|
65531
|
+
this._originalMapEventListeners.forEach((listeners, eventType) => {
|
|
65532
|
+
listeners.forEach((listener) => {
|
|
65533
|
+
this._map.on(eventType, listener);
|
|
65534
|
+
});
|
|
65535
|
+
});
|
|
65536
|
+
this._mapEventsDisabled = false;
|
|
65537
|
+
console.log("地图事件监听器已恢复");
|
|
65538
|
+
} else if (!enable && !this._mapEventsDisabled) {
|
|
65539
|
+
this.disableMapEventListeners();
|
|
65540
|
+
this._mapEventsDisabled = true;
|
|
65541
|
+
console.log("地图事件监听器已禁用");
|
|
65542
|
+
}
|
|
65543
|
+
}
|
|
65544
|
+
/**
|
|
65545
|
+
* 禁用地图事件监听器
|
|
65546
|
+
*/
|
|
65547
|
+
disableMapEventListeners() {
|
|
65548
|
+
const mapListeners = this._map.listeners_;
|
|
65549
|
+
if (!mapListeners)
|
|
65550
|
+
return;
|
|
65551
|
+
const eventsToDisable = ["singleclick", "click", "dblclick"];
|
|
65552
|
+
eventsToDisable.forEach((eventType) => {
|
|
65553
|
+
if (mapListeners[eventType]) {
|
|
65554
|
+
const listeners = [...mapListeners[eventType]];
|
|
65555
|
+
this._originalMapEventListeners.set(eventType, listeners);
|
|
65556
|
+
listeners.forEach((listener) => {
|
|
65557
|
+
this._map.un(eventType, listener);
|
|
65558
|
+
});
|
|
65559
|
+
}
|
|
65560
|
+
});
|
|
65561
|
+
}
|
|
65505
65562
|
/**
|
|
65506
65563
|
* 处理绘制开始
|
|
65507
65564
|
*/
|
|
@@ -65567,6 +65624,7 @@ ${this.attributes_.map(
|
|
|
65567
65624
|
console.log("HandleDrawEnd: Setting mode to none");
|
|
65568
65625
|
this.setMode("none");
|
|
65569
65626
|
}
|
|
65627
|
+
this.toggleMapInteractions(true);
|
|
65570
65628
|
this.emit("drawing-end", drawing);
|
|
65571
65629
|
} catch (error2) {
|
|
65572
65630
|
console.error("Failed to create drawing:", error2);
|
|
@@ -66239,7 +66297,9 @@ ${this.attributes_.map(
|
|
|
66239
66297
|
* @returns 删除的标绘对象数量
|
|
66240
66298
|
*/
|
|
66241
66299
|
removeDrawingsByCondition(predicate) {
|
|
66242
|
-
const drawingsToRemove = Array.from(this._drawings.values()).filter(
|
|
66300
|
+
const drawingsToRemove = Array.from(this._drawings.values()).filter(
|
|
66301
|
+
predicate
|
|
66302
|
+
);
|
|
66243
66303
|
let removedCount = 0;
|
|
66244
66304
|
drawingsToRemove.forEach((drawing) => {
|
|
66245
66305
|
if (this.removeDrawing(drawing)) {
|
|
@@ -66685,6 +66745,39 @@ ${this.attributes_.map(
|
|
|
66685
66745
|
tooltipText += "\n双击结束当前多边形";
|
|
66686
66746
|
this._tooltipHelper.updateText(tooltipText);
|
|
66687
66747
|
}
|
|
66748
|
+
/**
|
|
66749
|
+
* 设置捕捉功能启用状态
|
|
66750
|
+
*/
|
|
66751
|
+
setSnapEnabled(enabled) {
|
|
66752
|
+
this._config.enableSnap = enabled;
|
|
66753
|
+
if (this._snapInteraction) {
|
|
66754
|
+
this._snapInteraction.setActive(enabled);
|
|
66755
|
+
}
|
|
66756
|
+
}
|
|
66757
|
+
/**
|
|
66758
|
+
* 设置修改功能启用状态
|
|
66759
|
+
*/
|
|
66760
|
+
setModifyEnabled(enabled) {
|
|
66761
|
+
this._config.enableModify = enabled;
|
|
66762
|
+
if (this._modifyInteraction) {
|
|
66763
|
+
this._modifyInteraction.setActive(enabled);
|
|
66764
|
+
}
|
|
66765
|
+
}
|
|
66766
|
+
/**
|
|
66767
|
+
* 设置选择功能启用状态
|
|
66768
|
+
*/
|
|
66769
|
+
setSelectEnabled(enabled) {
|
|
66770
|
+
this._config.enableSelect = enabled;
|
|
66771
|
+
if (this._selectInteraction) {
|
|
66772
|
+
this._selectInteraction.setActive(enabled);
|
|
66773
|
+
}
|
|
66774
|
+
}
|
|
66775
|
+
/**
|
|
66776
|
+
* 设置连续绘制功能
|
|
66777
|
+
*/
|
|
66778
|
+
setContinuousDrawing(enabled) {
|
|
66779
|
+
this._config.allowContinuousDrawing = enabled;
|
|
66780
|
+
}
|
|
66688
66781
|
/**
|
|
66689
66782
|
* 销毁管理器
|
|
66690
66783
|
*/
|
|
@@ -66692,6 +66785,9 @@ ${this.attributes_.map(
|
|
|
66692
66785
|
this.clearAll();
|
|
66693
66786
|
this.clearDrawInteraction();
|
|
66694
66787
|
this.enableSelectAndModify(false);
|
|
66788
|
+
if (this._mapEventsDisabled) {
|
|
66789
|
+
this.toggleMapEventListeners(true);
|
|
66790
|
+
}
|
|
66695
66791
|
if (this._tooltipHelper) {
|
|
66696
66792
|
this._tooltipHelper.destroy();
|
|
66697
66793
|
this._tooltipHelper = null;
|
|
@@ -66701,6 +66797,8 @@ ${this.attributes_.map(
|
|
|
66701
66797
|
this._eventListeners.clear();
|
|
66702
66798
|
this._currentMode = "none";
|
|
66703
66799
|
this._selectedDrawing = null;
|
|
66800
|
+
this._originalMapEventListeners.clear();
|
|
66801
|
+
this._mapEventsDisabled = false;
|
|
66704
66802
|
}
|
|
66705
66803
|
}
|
|
66706
66804
|
class DrawingManagerFactory {
|
|
@@ -82179,71 +82277,6 @@ ${this.attributes_.map(
|
|
|
82179
82277
|
}
|
|
82180
82278
|
}
|
|
82181
82279
|
}
|
|
82182
|
-
const defaultProxyConfig = {
|
|
82183
|
-
enabled: true,
|
|
82184
|
-
autoFallback: true,
|
|
82185
|
-
rules: [
|
|
82186
|
-
{
|
|
82187
|
-
pattern: "59.37.40.252:8055",
|
|
82188
|
-
target: "http://59.37.40.252:8055",
|
|
82189
|
-
proxyPath: "/hdrf-wms"
|
|
82190
|
-
},
|
|
82191
|
-
{
|
|
82192
|
-
pattern: "localhost:8080/geoserver",
|
|
82193
|
-
target: "http://localhost:8080/geoserver",
|
|
82194
|
-
proxyPath: "/api/geoserver"
|
|
82195
|
-
}
|
|
82196
|
-
]
|
|
82197
|
-
};
|
|
82198
|
-
let currentProxyConfig = { ...defaultProxyConfig };
|
|
82199
|
-
function convertWMSUrlToProxy(originalUrl, forceProxy = false) {
|
|
82200
|
-
if (!currentProxyConfig.enabled && !forceProxy) {
|
|
82201
|
-
return originalUrl;
|
|
82202
|
-
}
|
|
82203
|
-
for (const rule of currentProxyConfig.rules) {
|
|
82204
|
-
if (originalUrl.includes(rule.pattern)) {
|
|
82205
|
-
return originalUrl.replace(rule.target, rule.proxyPath);
|
|
82206
|
-
}
|
|
82207
|
-
}
|
|
82208
|
-
return originalUrl;
|
|
82209
|
-
}
|
|
82210
|
-
async function testUrlAccessibility(url) {
|
|
82211
|
-
try {
|
|
82212
|
-
const response = await fetch(url, {
|
|
82213
|
-
method: "HEAD",
|
|
82214
|
-
mode: "no-cors",
|
|
82215
|
-
cache: "no-cache"
|
|
82216
|
-
});
|
|
82217
|
-
return true;
|
|
82218
|
-
} catch (error2) {
|
|
82219
|
-
console.warn(`URL accessibility test failed for: ${url}`, error2);
|
|
82220
|
-
return false;
|
|
82221
|
-
}
|
|
82222
|
-
}
|
|
82223
|
-
async function getOptimalUrl(originalUrl) {
|
|
82224
|
-
if (!currentProxyConfig.autoFallback) {
|
|
82225
|
-
return convertWMSUrlToProxy(originalUrl);
|
|
82226
|
-
}
|
|
82227
|
-
const isOriginalAccessible = await testUrlAccessibility(originalUrl);
|
|
82228
|
-
if (isOriginalAccessible) {
|
|
82229
|
-
return originalUrl;
|
|
82230
|
-
}
|
|
82231
|
-
const proxyUrl = convertWMSUrlToProxy(originalUrl, true);
|
|
82232
|
-
if (proxyUrl !== originalUrl) {
|
|
82233
|
-
console.info(`Original URL failed, switching to proxy: ${originalUrl} -> ${proxyUrl}`);
|
|
82234
|
-
return proxyUrl;
|
|
82235
|
-
}
|
|
82236
|
-
return originalUrl;
|
|
82237
|
-
}
|
|
82238
|
-
function needsProxy(url) {
|
|
82239
|
-
if (url.includes("tianditu.gov.cn") || url.includes("restapi.amap.com") || url.includes("api.map.baidu.com")) {
|
|
82240
|
-
return true;
|
|
82241
|
-
}
|
|
82242
|
-
if (currentProxyConfig.enabled) {
|
|
82243
|
-
return currentProxyConfig.rules.some((rule) => url.includes(rule.pattern));
|
|
82244
|
-
}
|
|
82245
|
-
return false;
|
|
82246
|
-
}
|
|
82247
82280
|
class WMSLayerHandler extends BaseLayer$2 {
|
|
82248
82281
|
createLayer() {
|
|
82249
82282
|
const source = this.createWMSSource();
|
|
@@ -82251,16 +82284,14 @@ ${this.attributes_.map(
|
|
|
82251
82284
|
source,
|
|
82252
82285
|
className: this.config.cssClass || this.config.className || void 0
|
|
82253
82286
|
});
|
|
82254
|
-
this.optimizeSourceUrl(source);
|
|
82255
82287
|
return imageLayer;
|
|
82256
82288
|
}
|
|
82257
82289
|
/**
|
|
82258
82290
|
* 创建WMS数据源
|
|
82259
82291
|
*/
|
|
82260
82292
|
createWMSSource() {
|
|
82261
|
-
const initialUrl = needsProxy(this.config.url) ? convertWMSUrlToProxy(this.config.url) : this.config.url;
|
|
82262
82293
|
return new ImageWMS$1({
|
|
82263
|
-
url:
|
|
82294
|
+
url: this.config.url,
|
|
82264
82295
|
params: {
|
|
82265
82296
|
"LAYERS": this.config.wmsLayers || "",
|
|
82266
82297
|
"FORMAT": this.config.wmsFormat || "image/png",
|
|
@@ -82271,22 +82302,6 @@ ${this.attributes_.map(
|
|
|
82271
82302
|
crossOrigin: "anonymous"
|
|
82272
82303
|
});
|
|
82273
82304
|
}
|
|
82274
|
-
/**
|
|
82275
|
-
* 异步优化数据源URL
|
|
82276
|
-
*/
|
|
82277
|
-
async optimizeSourceUrl(source) {
|
|
82278
|
-
try {
|
|
82279
|
-
const optimalUrl = await getOptimalUrl(this.config.url);
|
|
82280
|
-
const currentUrl = source.getUrl();
|
|
82281
|
-
if (optimalUrl !== currentUrl) {
|
|
82282
|
-
console.info(`Optimizing WMS URL for layer ${this.config.id}: ${currentUrl} -> ${optimalUrl}`);
|
|
82283
|
-
source.setUrl(optimalUrl);
|
|
82284
|
-
source.refresh();
|
|
82285
|
-
}
|
|
82286
|
-
} catch (error2) {
|
|
82287
|
-
console.warn(`Failed to optimize URL for WMS layer ${this.config.id}:`, error2);
|
|
82288
|
-
}
|
|
82289
|
-
}
|
|
82290
82305
|
/**
|
|
82291
82306
|
* 更新WMS参数
|
|
82292
82307
|
*/
|
|
@@ -480502,9 +480517,24 @@ ${this.attributes_.map(
|
|
|
480502
480517
|
return null;
|
|
480503
480518
|
},
|
|
480504
480519
|
// 绘制管理器方法
|
|
480505
|
-
getDrawingManager: () => {
|
|
480520
|
+
getDrawingManager: (config) => {
|
|
480506
480521
|
var _a3;
|
|
480507
|
-
|
|
480522
|
+
const drawingManager = (_a3 = mapContainerRef.value) == null ? void 0 : _a3.getDrawingManager();
|
|
480523
|
+
if (drawingManager && config) {
|
|
480524
|
+
if (config.enableSnap !== void 0) {
|
|
480525
|
+
drawingManager.setSnapEnabled(config.enableSnap);
|
|
480526
|
+
}
|
|
480527
|
+
if (config.enableModify !== void 0) {
|
|
480528
|
+
drawingManager.setModifyEnabled(config.enableModify);
|
|
480529
|
+
}
|
|
480530
|
+
if (config.enableSelect !== void 0) {
|
|
480531
|
+
drawingManager.setSelectEnabled(config.enableSelect);
|
|
480532
|
+
}
|
|
480533
|
+
if (config.allowContinuousDrawing !== void 0) {
|
|
480534
|
+
drawingManager.setContinuousDrawing(config.allowContinuousDrawing);
|
|
480535
|
+
}
|
|
480536
|
+
}
|
|
480537
|
+
return drawingManager;
|
|
480508
480538
|
},
|
|
480509
480539
|
startDrawing: (type) => {
|
|
480510
480540
|
var _a3;
|
|
@@ -480819,8 +480849,8 @@ ${this.attributes_.map(
|
|
|
480819
480849
|
};
|
|
480820
480850
|
}
|
|
480821
480851
|
});
|
|
480822
|
-
const
|
|
480823
|
-
const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
480852
|
+
const index_vue_vue_type_style_index_0_scoped_6ff898ba_lang = "";
|
|
480853
|
+
const CustomOpenlayer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6ff898ba"]]);
|
|
480824
480854
|
const base = "";
|
|
480825
480855
|
var u8 = Uint8Array, u16 = Uint16Array, i32 = Int32Array;
|
|
480826
480856
|
var fleb = new u8([
|
package/lib/style.css
CHANGED
|
@@ -2461,7 +2461,7 @@ label {
|
|
|
2461
2461
|
font-size: 14px;
|
|
2462
2462
|
}
|
|
2463
2463
|
|
|
2464
|
-
.context-menu[data-v-
|
|
2464
|
+
.context-menu[data-v-6ff898ba] {
|
|
2465
2465
|
background: white;
|
|
2466
2466
|
border: 1px solid #dcdfe6;
|
|
2467
2467
|
border-radius: 4px;
|
|
@@ -2469,7 +2469,7 @@ label {
|
|
|
2469
2469
|
padding: 4px 0;
|
|
2470
2470
|
min-width: 120px;
|
|
2471
2471
|
}
|
|
2472
|
-
.context-menu-item[data-v-
|
|
2472
|
+
.context-menu-item[data-v-6ff898ba] {
|
|
2473
2473
|
display: flex;
|
|
2474
2474
|
align-items: center;
|
|
2475
2475
|
padding: 8px 12px;
|
|
@@ -2478,10 +2478,10 @@ label {
|
|
|
2478
2478
|
color: #606266;
|
|
2479
2479
|
transition: background-color 0.3s;
|
|
2480
2480
|
}
|
|
2481
|
-
.context-menu-item[data-v-
|
|
2481
|
+
.context-menu-item[data-v-6ff898ba]:hover {
|
|
2482
2482
|
background-color: #f5f7fa;
|
|
2483
2483
|
}
|
|
2484
|
-
.context-menu-item .el-icon[data-v-
|
|
2484
|
+
.context-menu-item .el-icon[data-v-6ff898ba] {
|
|
2485
2485
|
margin-right: 8px;
|
|
2486
2486
|
font-size: 16px;
|
|
2487
2487
|
}
|
package/package.json
CHANGED
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vue-openlayers-plugin",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "A Vue 3 plugin for OpenLayers with custom components and utilities",
|
|
5
|
-
"main": "lib/index.umd.js",
|
|
6
|
-
"module": "lib/index.esm.js",
|
|
7
|
-
"types": "types/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"lib",
|
|
10
|
-
"types",
|
|
11
|
-
"README.md",
|
|
12
|
-
"LICENSE"
|
|
13
|
-
],
|
|
14
|
-
"exports": {
|
|
15
|
-
".": {
|
|
16
|
-
"import": "./lib/index.esm.js",
|
|
17
|
-
"require": "./lib/index.umd.js",
|
|
18
|
-
"types": "./types/index.d.ts"
|
|
19
|
-
},
|
|
20
|
-
"./style": "./lib/style.css",
|
|
21
|
-
"./lib/style.css": "./lib/style.css",
|
|
22
|
-
"./package.json": "./package.json"
|
|
23
|
-
},
|
|
24
|
-
"sideEffects": false,
|
|
25
|
-
"scripts": {
|
|
26
|
-
"dev": "vite",
|
|
27
|
-
"build": "vue-tsc --noEmit && vite build --mode lib",
|
|
28
|
-
"build:lib": "vite build --mode lib",
|
|
29
|
-
"preview": "vite preview",
|
|
30
|
-
"type-check": "vue-tsc --noEmit",
|
|
31
|
-
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
32
|
-
"format": "prettier --write src/",
|
|
33
|
-
"prepublishOnly": "npm run build:lib",
|
|
34
|
-
"release": "npm version patch && npm publish",
|
|
35
|
-
"release:minor": "npm version minor && npm publish",
|
|
36
|
-
"release:major": "npm version major && npm publish"
|
|
37
|
-
},
|
|
38
|
-
"keywords": [
|
|
39
|
-
"vue",
|
|
40
|
-
"vue3",
|
|
41
|
-
"openlayers",
|
|
42
|
-
"map",
|
|
43
|
-
"gis",
|
|
44
|
-
"plugin",
|
|
45
|
-
"component"
|
|
46
|
-
],
|
|
47
|
-
"author": "kaixin <1501643111@qq.com>",
|
|
48
|
-
"license": "MIT",
|
|
49
|
-
"peerDependencies": {
|
|
50
|
-
"ol": "^10.6.1",
|
|
51
|
-
"vue": "^3.3.0"
|
|
52
|
-
},
|
|
53
|
-
"dependencies": {
|
|
54
|
-
"@element-plus/icons-vue": "^2.3.2",
|
|
55
|
-
"@supermapgis/iclient-ol": "^12.0.0-r",
|
|
56
|
-
"element-plus": "^2.11.1",
|
|
57
|
-
"gifler": "^0.1.0",
|
|
58
|
-
"html2canvas": "^1.4.1",
|
|
59
|
-
"jspdf": "^2.5.1",
|
|
60
|
-
"mitt": "^3.0.1",
|
|
61
|
-
"proj4": "^2.9.2",
|
|
62
|
-
"scss": "^0.2.4",
|
|
63
|
-
"uuid": "^11.1.0"
|
|
64
|
-
},
|
|
65
|
-
"devDependencies": {
|
|
66
|
-
"@types/node": "^20.5.2",
|
|
67
|
-
"@typescript-eslint/eslint-plugin": "^6.4.0",
|
|
68
|
-
"@typescript-eslint/parser": "^6.4.0",
|
|
69
|
-
"@vitejs/plugin-vue": "^4.2.3",
|
|
70
|
-
"@vue/eslint-config-prettier": "^8.0.0",
|
|
71
|
-
"@vue/eslint-config-typescript": "^11.0.3",
|
|
72
|
-
"@vue/tsconfig": "^0.4.0",
|
|
73
|
-
"eslint": "^8.45.0",
|
|
74
|
-
"eslint-plugin-vue": "^9.17.0",
|
|
75
|
-
"ol": "^10.6.1",
|
|
76
|
-
"prettier": "^3.0.0",
|
|
77
|
-
"sass": "^1.91.0",
|
|
78
|
-
"typescript": "~5.1.6",
|
|
79
|
-
"vite": "^4.4.5",
|
|
80
|
-
"vite-plugin-dts": "^3.5.2",
|
|
81
|
-
"vue": "^3.3.4",
|
|
82
|
-
"vue-tsc": "^1.8.5"
|
|
83
|
-
},
|
|
84
|
-
"repository": {
|
|
85
|
-
"type": "git",
|
|
86
|
-
"url": "https://github.com/YOUR_USERNAME/vue-openlayers-plugin.git"
|
|
87
|
-
},
|
|
88
|
-
"bugs": {
|
|
89
|
-
"url": "https://github.com/YOUR_USERNAME/vue-openlayers-plugin/issues"
|
|
90
|
-
},
|
|
91
|
-
"homepage": "https://github.com/YOUR_USERNAME/vue-openlayers-plugin#readme",
|
|
92
|
-
"publishConfig": {
|
|
93
|
-
"access": "public",
|
|
94
|
-
"registry": "https://registry.npmjs.org/"
|
|
95
|
-
},
|
|
96
|
-
"engines": {
|
|
97
|
-
"node": ">=16.0.0",
|
|
98
|
-
"npm": ">=7.0.0"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "vue-openlayers-plugin",
|
|
3
|
+
"version": "1.0.41",
|
|
4
|
+
"description": "A Vue 3 plugin for OpenLayers with custom components and utilities",
|
|
5
|
+
"main": "lib/index.umd.js",
|
|
6
|
+
"module": "lib/index.esm.js",
|
|
7
|
+
"types": "types/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"lib",
|
|
10
|
+
"types",
|
|
11
|
+
"README.md",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./lib/index.esm.js",
|
|
17
|
+
"require": "./lib/index.umd.js",
|
|
18
|
+
"types": "./types/index.d.ts"
|
|
19
|
+
},
|
|
20
|
+
"./style": "./lib/style.css",
|
|
21
|
+
"./lib/style.css": "./lib/style.css",
|
|
22
|
+
"./package.json": "./package.json"
|
|
23
|
+
},
|
|
24
|
+
"sideEffects": false,
|
|
25
|
+
"scripts": {
|
|
26
|
+
"dev": "vite",
|
|
27
|
+
"build": "vue-tsc --noEmit && vite build --mode lib",
|
|
28
|
+
"build:lib": "vite build --mode lib",
|
|
29
|
+
"preview": "vite preview",
|
|
30
|
+
"type-check": "vue-tsc --noEmit",
|
|
31
|
+
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
32
|
+
"format": "prettier --write src/",
|
|
33
|
+
"prepublishOnly": "npm run build:lib",
|
|
34
|
+
"release": "npm version patch && npm publish",
|
|
35
|
+
"release:minor": "npm version minor && npm publish",
|
|
36
|
+
"release:major": "npm version major && npm publish"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"vue",
|
|
40
|
+
"vue3",
|
|
41
|
+
"openlayers",
|
|
42
|
+
"map",
|
|
43
|
+
"gis",
|
|
44
|
+
"plugin",
|
|
45
|
+
"component"
|
|
46
|
+
],
|
|
47
|
+
"author": "kaixin <1501643111@qq.com>",
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"ol": "^10.6.1",
|
|
51
|
+
"vue": "^3.3.0"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@element-plus/icons-vue": "^2.3.2",
|
|
55
|
+
"@supermapgis/iclient-ol": "^12.0.0-r",
|
|
56
|
+
"element-plus": "^2.11.1",
|
|
57
|
+
"gifler": "^0.1.0",
|
|
58
|
+
"html2canvas": "^1.4.1",
|
|
59
|
+
"jspdf": "^2.5.1",
|
|
60
|
+
"mitt": "^3.0.1",
|
|
61
|
+
"proj4": "^2.9.2",
|
|
62
|
+
"scss": "^0.2.4",
|
|
63
|
+
"uuid": "^11.1.0"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@types/node": "^20.5.2",
|
|
67
|
+
"@typescript-eslint/eslint-plugin": "^6.4.0",
|
|
68
|
+
"@typescript-eslint/parser": "^6.4.0",
|
|
69
|
+
"@vitejs/plugin-vue": "^4.2.3",
|
|
70
|
+
"@vue/eslint-config-prettier": "^8.0.0",
|
|
71
|
+
"@vue/eslint-config-typescript": "^11.0.3",
|
|
72
|
+
"@vue/tsconfig": "^0.4.0",
|
|
73
|
+
"eslint": "^8.45.0",
|
|
74
|
+
"eslint-plugin-vue": "^9.17.0",
|
|
75
|
+
"ol": "^10.6.1",
|
|
76
|
+
"prettier": "^3.0.0",
|
|
77
|
+
"sass": "^1.91.0",
|
|
78
|
+
"typescript": "~5.1.6",
|
|
79
|
+
"vite": "^4.4.5",
|
|
80
|
+
"vite-plugin-dts": "^3.5.2",
|
|
81
|
+
"vue": "^3.3.4",
|
|
82
|
+
"vue-tsc": "^1.8.5"
|
|
83
|
+
},
|
|
84
|
+
"repository": {
|
|
85
|
+
"type": "git",
|
|
86
|
+
"url": "https://github.com/YOUR_USERNAME/vue-openlayers-plugin.git"
|
|
87
|
+
},
|
|
88
|
+
"bugs": {
|
|
89
|
+
"url": "https://github.com/YOUR_USERNAME/vue-openlayers-plugin/issues"
|
|
90
|
+
},
|
|
91
|
+
"homepage": "https://github.com/YOUR_USERNAME/vue-openlayers-plugin#readme",
|
|
92
|
+
"publishConfig": {
|
|
93
|
+
"access": "public",
|
|
94
|
+
"registry": "https://registry.npmjs.org/"
|
|
95
|
+
},
|
|
96
|
+
"engines": {
|
|
97
|
+
"node": ">=16.0.0",
|
|
98
|
+
"npm": ">=7.0.0"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as Map } from 'ol/Map';
|
|
2
2
|
import { MapConfig, LayerConfig, LegendConfig, MeasurementResult, MapEventCallbacks, MapClickEvent, TooltipTemplate, TooltipData } from './types';
|
|
3
|
+
import { DrawingManagerConfig } from './utils/drawing/DrawingManager';
|
|
3
4
|
import { PopupConfig, PopupType, PopupManagerConfig } from './components/MapPopup';
|
|
4
5
|
|
|
5
6
|
interface Props {
|
|
@@ -114,7 +115,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
|
|
|
114
115
|
locateByProperty: (geoJsonData: any, propertyFilter: (properties: any) => boolean, options?: any) => any;
|
|
115
116
|
locateByGeometryType: (geoJsonData: any, geometryType: string, options?: any) => any;
|
|
116
117
|
getGeoJSONExtent: (geoJsonData: any) => any;
|
|
117
|
-
getDrawingManager: () => any;
|
|
118
|
+
getDrawingManager: (config?: Partial<DrawingManagerConfig> | undefined) => any;
|
|
118
119
|
startDrawing: (type: string) => void;
|
|
119
120
|
stopDrawing: () => void;
|
|
120
121
|
clearDrawings: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/CustomOpenlayer/index.vue"],"names":[],"mappings":"AA6KA;AAKA,OAAO,GAAG,MAAM,QAAQ,CAAA;AAuBxB,OAAO,KAAK,EACV,SAAS,EACT,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,WAAW,EAMZ,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,kBAAkB,EACnB,MAAM,uBAAuB,CAAA;AAI9B,UAAU,KAAK;IAEb,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAA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,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QACxE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACT,CAAC;AACN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AACxD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
|
|
@@ -58,6 +58,8 @@ export declare class DrawingManager {
|
|
|
58
58
|
private _multiLineStringCoordinates;
|
|
59
59
|
private _multiPolygonDrawing;
|
|
60
60
|
private _multiPolygonCoordinates;
|
|
61
|
+
private _originalMapEventListeners;
|
|
62
|
+
private _mapEventsDisabled;
|
|
61
63
|
constructor(config: DrawingManagerConfig);
|
|
62
64
|
/**
|
|
63
65
|
* 初始化图层
|
|
@@ -84,6 +86,7 @@ export declare class DrawingManager {
|
|
|
84
86
|
*/
|
|
85
87
|
setMode(mode: DrawingMode, options?: DrawingStyleConfig & {
|
|
86
88
|
allowContinuousDrawing?: boolean;
|
|
89
|
+
disableMapInteractions?: boolean;
|
|
87
90
|
}): void;
|
|
88
91
|
/**
|
|
89
92
|
* 获取当前模式
|
|
@@ -105,6 +108,18 @@ export declare class DrawingManager {
|
|
|
105
108
|
* 启用/禁用选择和修改交互
|
|
106
109
|
*/
|
|
107
110
|
private enableSelectAndModify;
|
|
111
|
+
/**
|
|
112
|
+
* 控制地图其他交互功能的启用/禁用
|
|
113
|
+
*/
|
|
114
|
+
private toggleMapInteractions;
|
|
115
|
+
/**
|
|
116
|
+
* 控制地图事件监听器的启用/禁用
|
|
117
|
+
*/
|
|
118
|
+
private toggleMapEventListeners;
|
|
119
|
+
/**
|
|
120
|
+
* 禁用地图事件监听器
|
|
121
|
+
*/
|
|
122
|
+
private disableMapEventListeners;
|
|
108
123
|
/**
|
|
109
124
|
* 处理绘制开始
|
|
110
125
|
*/
|
|
@@ -345,6 +360,22 @@ export declare class DrawingManager {
|
|
|
345
360
|
* 更新多边形绘制的鼠标跟随提示
|
|
346
361
|
*/
|
|
347
362
|
private updateMultiPolygonTooltip;
|
|
363
|
+
/**
|
|
364
|
+
* 设置捕捉功能启用状态
|
|
365
|
+
*/
|
|
366
|
+
setSnapEnabled(enabled: boolean): void;
|
|
367
|
+
/**
|
|
368
|
+
* 设置修改功能启用状态
|
|
369
|
+
*/
|
|
370
|
+
setModifyEnabled(enabled: boolean): void;
|
|
371
|
+
/**
|
|
372
|
+
* 设置选择功能启用状态
|
|
373
|
+
*/
|
|
374
|
+
setSelectEnabled(enabled: boolean): void;
|
|
375
|
+
/**
|
|
376
|
+
* 设置连续绘制功能
|
|
377
|
+
*/
|
|
378
|
+
setContinuousDrawing(enabled: boolean): void;
|
|
348
379
|
/**
|
|
349
380
|
* 销毁管理器
|
|
350
381
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawingManager.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CustomOpenlayer/utils/drawing/DrawingManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,IA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CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,YAAY,CAAC,EAAE,kBAAkB,CAAC;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC5C;AAED;;;GAGG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,IAAI,CAAQ;IACpB,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,SAAS,CAAiD;IAClE,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,OAAO,CAAC,kBAAkB,CAAuB;IACjD,OAAO,CAAC,kBAAkB,CAAuB;IACjD,OAAO,CAAC,gBAAgB,CAAqB;IAC7C,OAAO,CAAC,gBAAgB,CAAsC;IAC9D,OAAO,CAAC,eAAe,CACX;IACZ,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,oBAAoB,CAAmC;IAC/D,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,oBAAoB,CAA0B;IAEtD,OAAO,CAAC,uBAAuB,CAAuC;IACtE,OAAO,CAAC,2BAA2B,CAAoB;IACvD,OAAO,CAAC,oBAAoB,CAAoC;IAChE,OAAO,CAAC,wBAAwB,CAAsB;
|
|
1
|
+
{"version":3,"file":"DrawingManager.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CustomOpenlayer/utils/drawing/DrawingManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,MAAM,IAAI,CAAC;AAoBlC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAiB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAgBvE,OAAO,KAAK,EAAE,kBAAkB,EAAiB,MAAM,kBAAkB,CAAC;AAE1E;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,OAAO,EAAE,OAAO,GAAG,IAAI;IAO/C;;OAEG;IACI,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAO/C;;OAEG;IACI,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAInD;;OAEG;IACI,OAAO,IAAI,IAAI;CAkCvB;AAED;;GAEG;AACH,qBAAa,qBAAqB;WAClB,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc;IAIlE;;OAEG;WACW,aAAa,CAAC,GAAG,EAAE,KAAK,GAAG,cAAc;CAYxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WMSLayerHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CustomOpenlayer/utils/layers/WMSLayerHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"WMSLayerHandler.d.ts","sourceRoot":"","sources":["../../../../../../src/components/CustomOpenlayer/utils/layers/WMSLayerHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;GAEG;AACH,qBAAa,eAAgB,SAAQ,SAAS;IAC5C,WAAW,IAAI,KAAK,CAAC,QAAQ,CAAC;IAU9B;;OAEG;IACH,OAAO,CAAC,eAAe;IAcvB;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAS/C;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACH,cAAc,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI;IAI1C;;OAEG;IACH,OAAO,IAAI,IAAI;IASf;;OAEG;IACH,iBAAiB,CACf,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC3B,MAAM,GAAG,SAAS;IAkBrB;;OAEG;IACG,0BAA0B,CAC9B,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAC5B,OAAO,GAAE;QACP,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,UAAU,CAAC,EAAE,MAAM,CAAC;KAChB,GACL,OAAO,CAAC,GAAG,EAAE,CAAC;IAoFjB;;OAEG;IACH,OAAO,CAAC,wBAAwB;CA2CjC"}
|
|
@@ -9,57 +9,17 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function convertTiandituUrlToProxy(originalUrl: string): string;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* 批量转换图层配置中的天地图URL
|
|
13
13
|
* @param layerConfig 图层配置对象
|
|
14
14
|
* @returns 转换后的图层配置
|
|
15
15
|
*/
|
|
16
16
|
export declare function convertLayerConfigToProxy(layerConfig: any): any;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* 批量转换地图配置中所有图层的天地图URL
|
|
19
19
|
* @param mapConfig 地图配置对象
|
|
20
20
|
* @returns 转换后的地图配置
|
|
21
21
|
*/
|
|
22
22
|
export declare function convertMapConfigToProxy(mapConfig: any): any;
|
|
23
|
-
/**
|
|
24
|
-
* 代理配置接口
|
|
25
|
-
*/
|
|
26
|
-
interface ProxyConfig {
|
|
27
|
-
enabled: boolean;
|
|
28
|
-
rules: Array<{
|
|
29
|
-
pattern: string;
|
|
30
|
-
target: string;
|
|
31
|
-
proxyPath: string;
|
|
32
|
-
}>;
|
|
33
|
-
autoFallback: boolean;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* 设置代理配置
|
|
37
|
-
* @param config 代理配置
|
|
38
|
-
*/
|
|
39
|
-
export declare function setProxyConfig(config: Partial<ProxyConfig>): void;
|
|
40
|
-
/**
|
|
41
|
-
* 获取当前代理配置
|
|
42
|
-
*/
|
|
43
|
-
export declare function getProxyConfig(): ProxyConfig;
|
|
44
|
-
/**
|
|
45
|
-
* 将WMS服务URL转换为使用代理的URL
|
|
46
|
-
* @param originalUrl 原始WMS服务URL
|
|
47
|
-
* @param forceProxy 是否强制使用代理
|
|
48
|
-
* @returns 转换后的代理URL
|
|
49
|
-
*/
|
|
50
|
-
export declare function convertWMSUrlToProxy(originalUrl: string, forceProxy?: boolean): string;
|
|
51
|
-
/**
|
|
52
|
-
* 检测URL是否可访问
|
|
53
|
-
* @param url 要检测的URL
|
|
54
|
-
* @returns Promise<boolean> 是否可访问
|
|
55
|
-
*/
|
|
56
|
-
export declare function testUrlAccessibility(url: string): Promise<boolean>;
|
|
57
|
-
/**
|
|
58
|
-
* 智能URL选择:优先使用原地址,失败时自动切换到代理
|
|
59
|
-
* @param originalUrl 原始URL
|
|
60
|
-
* @returns Promise<string> 最终使用的URL
|
|
61
|
-
*/
|
|
62
|
-
export declare function getOptimalUrl(originalUrl: string): Promise<string>;
|
|
63
23
|
/**
|
|
64
24
|
* 检查URL是否需要代理
|
|
65
25
|
* @param url 要检查的URL
|
|
@@ -96,16 +56,11 @@ export declare function getProxyConfigGuide(): {
|
|
|
96
56
|
export declare function createProxyUrlMap(): Record<string, string>;
|
|
97
57
|
declare const _default: {
|
|
98
58
|
convertTiandituUrlToProxy: typeof convertTiandituUrlToProxy;
|
|
99
|
-
convertWMSUrlToProxy: typeof convertWMSUrlToProxy;
|
|
100
59
|
convertLayerConfigToProxy: typeof convertLayerConfigToProxy;
|
|
101
60
|
convertMapConfigToProxy: typeof convertMapConfigToProxy;
|
|
102
61
|
needsProxy: typeof needsProxy;
|
|
103
62
|
getProxyConfigGuide: typeof getProxyConfigGuide;
|
|
104
63
|
createProxyUrlMap: typeof createProxyUrlMap;
|
|
105
|
-
setProxyConfig: typeof setProxyConfig;
|
|
106
|
-
getProxyConfig: typeof getProxyConfig;
|
|
107
|
-
testUrlAccessibility: typeof testUrlAccessibility;
|
|
108
|
-
getOptimalUrl: typeof getOptimalUrl;
|
|
109
64
|
};
|
|
110
65
|
export default _default;
|
|
111
66
|
//# sourceMappingURL=proxyHelper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxyHelper.d.ts","sourceRoot":"","sources":["../../../../../src/components/CustomOpenlayer/utils/proxyHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA+BrE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"proxyHelper.d.ts","sourceRoot":"","sources":["../../../../../src/components/CustomOpenlayer/utils/proxyHelper.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA+BrE;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,CAgB/D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,GAAG,GAAG,GAAG,CA2B3D;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAI/C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB;;;;;;;;oCASP,MAAM;;;;;;;;;;EAiBjC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAY1D;;;;;;;;;AAED,wBAOE"}
|