vue-openlayers-plugin 1.2.6 → 1.2.7
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/{BasemapPanel-de2f80f7.mjs → BasemapPanel-ebe413da.mjs} +1 -1
- package/lib/{CoordinateLocationDialog-15b7aa45.mjs → CoordinateLocationDialog-ba72d9ea.mjs} +1 -1
- package/lib/{MapPrintDialog-2365b24f.mjs → FilterPanel-22070c3b.mjs} +1 -1
- package/lib/{FilterPanel-0d414bb8.mjs → LayerPanel-1398051d.mjs} +1 -1
- package/lib/{LayerPanel-f7fcc9a2.mjs → MapPrintDialog-d071ff8b.mjs} +1 -1
- package/lib/{MeasurementDialog-bbe0c78d.mjs → MeasurementDialog-e078d1c1.mjs} +1 -1
- package/lib/{MyMarkersDialog-8e8f081e.mjs → MyMarkersDialog-e0441cb0.mjs} +1 -1
- package/lib/{QuadCompareDialog-ffc425f1.mjs → QuadCompareDialog-b6315ab1.mjs} +1 -1
- package/lib/{RegionNavigationDialog-d43c4f64.mjs → RegionNavigationDialog-d533c521.mjs} +1 -1
- package/lib/{SplitCompareDialog-eb236ada.mjs → SplitCompareDialog-2d49fbc6.mjs} +1 -1
- package/lib/{SwipeCompareDialog-5640b36d.mjs → SwipeCompareDialog-50dfd6b1.mjs} +1 -1
- package/lib/{ViewBookmarksDialog-8c3c7c5a.mjs → ViewBookmarksDialog-8c3f5a5b.mjs} +1 -1
- package/lib/{index-01e0d980.mjs → index-b7a615a7.mjs} +220 -42
- package/lib/{index-c65930cf.mjs → index-ee2fa791.mjs} +1 -1
- package/lib/{index.es-08af44d0.mjs → index.es-dcd9031f.mjs} +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.umd.js +206 -28
- package/lib/style.css +33 -26
- package/package.json +1 -1
- package/types/components/OlControlPanel.vue.d.ts +3 -1
- package/types/components/OlControlPanel.vue.d.ts.map +1 -1
- package/types/components/OlMap.vue.d.ts +3 -1
- package/types/components/OlMap.vue.d.ts.map +1 -1
- package/types/lowcode-entry.d.ts +5 -0
- package/types/lowcode-entry.d.ts.map +1 -1
- package/types/types/map.d.ts +20 -0
- package/types/types/map.d.ts.map +1 -1
package/lib/index.umd.js
CHANGED
|
@@ -335095,7 +335095,7 @@ ${indentData}`);
|
|
|
335095
335095
|
};
|
|
335096
335096
|
const _hoisted_12$b = ["onClick"];
|
|
335097
335097
|
const _hoisted_13$a = ["src", "alt"];
|
|
335098
|
-
const _hoisted_14$
|
|
335098
|
+
const _hoisted_14$8 = {
|
|
335099
335099
|
key: 3,
|
|
335100
335100
|
class: "slideshow-controls"
|
|
335101
335101
|
};
|
|
@@ -335311,7 +335311,7 @@ ${indentData}`);
|
|
|
335311
335311
|
], 10, _hoisted_12$b);
|
|
335312
335312
|
}), 128))
|
|
335313
335313
|
])) : vue.createCommentVNode("", true),
|
|
335314
|
-
_ctx.config.slideshow && imageList.value.length > 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$
|
|
335314
|
+
_ctx.config.slideshow && imageList.value.length > 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$8, [
|
|
335315
335315
|
vue.createVNode(vue.unref(elementPlus.ElButton), {
|
|
335316
335316
|
class: vue.normalizeClass(["slideshow-btn", { active: isSlideshow.value }]),
|
|
335317
335317
|
type: isSlideshow.value ? "primary" : "default",
|
|
@@ -335393,7 +335393,7 @@ ${indentData}`);
|
|
|
335393
335393
|
class: "sort-indicator"
|
|
335394
335394
|
};
|
|
335395
335395
|
const _hoisted_13$9 = ["onClick"];
|
|
335396
|
-
const _hoisted_14$
|
|
335396
|
+
const _hoisted_14$7 = { key: 0 };
|
|
335397
335397
|
const _hoisted_15$5 = ["src", "alt"];
|
|
335398
335398
|
const _hoisted_16$5 = { key: 1 };
|
|
335399
335399
|
const _hoisted_17$5 = ["href"];
|
|
@@ -335676,7 +335676,7 @@ ${indentData}`);
|
|
|
335676
335676
|
return vue.openBlock(), vue.createElementBlock("td", {
|
|
335677
335677
|
key: field.key
|
|
335678
335678
|
}, [
|
|
335679
|
-
field.type === "image" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_14$
|
|
335679
|
+
field.type === "image" ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_14$7, [
|
|
335680
335680
|
vue.createElementVNode("img", {
|
|
335681
335681
|
src: getFieldValue(item, field.key || field.name),
|
|
335682
335682
|
alt: field.label,
|
|
@@ -339201,7 +339201,7 @@ ${indentData}`);
|
|
|
339201
339201
|
const _hoisted_11$b = { class: "result-count" };
|
|
339202
339202
|
const _hoisted_12$9 = ["onClick"];
|
|
339203
339203
|
const _hoisted_13$8 = { class: "item-content" };
|
|
339204
|
-
const _hoisted_14$
|
|
339204
|
+
const _hoisted_14$6 = ["innerHTML"];
|
|
339205
339205
|
const _hoisted_15$4 = ["innerHTML"];
|
|
339206
339206
|
const _hoisted_16$4 = {
|
|
339207
339207
|
key: 0,
|
|
@@ -339732,7 +339732,7 @@ ${indentData}`);
|
|
|
339732
339732
|
vue.createElementVNode("div", {
|
|
339733
339733
|
class: "item-name",
|
|
339734
339734
|
innerHTML: highlightText(result.name, searchQuery.value)
|
|
339735
|
-
}, null, 8, _hoisted_14$
|
|
339735
|
+
}, null, 8, _hoisted_14$6),
|
|
339736
339736
|
vue.createElementVNode("div", {
|
|
339737
339737
|
class: "item-address",
|
|
339738
339738
|
innerHTML: highlightText(result.address, searchQuery.value)
|
|
@@ -339921,17 +339921,21 @@ ${indentData}`);
|
|
|
339921
339921
|
const _hoisted_9$c = { class: "drawing-tool-list" };
|
|
339922
339922
|
const _hoisted_10$c = {
|
|
339923
339923
|
key: 0,
|
|
339924
|
-
class: "drawing-
|
|
339924
|
+
class: "drawing-import-row"
|
|
339925
339925
|
};
|
|
339926
339926
|
const _hoisted_11$a = {
|
|
339927
339927
|
key: 1,
|
|
339928
|
-
class: "drawing-
|
|
339928
|
+
class: "drawing-menu-divider"
|
|
339929
339929
|
};
|
|
339930
339930
|
const _hoisted_12$8 = {
|
|
339931
|
+
key: 2,
|
|
339932
|
+
class: "drawing-toggle-row"
|
|
339933
|
+
};
|
|
339934
|
+
const _hoisted_13$7 = {
|
|
339931
339935
|
key: 7,
|
|
339932
339936
|
class: "control-divider"
|
|
339933
339937
|
};
|
|
339934
|
-
const
|
|
339938
|
+
const _hoisted_14$5 = {
|
|
339935
339939
|
key: 8,
|
|
339936
339940
|
class: "control-section"
|
|
339937
339941
|
};
|
|
@@ -339947,7 +339951,7 @@ ${indentData}`);
|
|
|
339947
339951
|
bottomOffset: {},
|
|
339948
339952
|
viewBookmarks: {}
|
|
339949
339953
|
},
|
|
339950
|
-
emits: ["drawing-complete", "drawing-clear"],
|
|
339954
|
+
emits: ["drawing-complete", "drawing-clear", "drawing-import"],
|
|
339951
339955
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
339952
339956
|
const props = __props;
|
|
339953
339957
|
const emit = __emit;
|
|
@@ -340075,7 +340079,7 @@ ${indentData}`);
|
|
|
340075
340079
|
return !!((tools == null ? void 0 : tools.viewBookmarks) || props.config.viewBookmarks);
|
|
340076
340080
|
});
|
|
340077
340081
|
const drawingControlConfig = vue.computed(() => {
|
|
340078
|
-
var _a2;
|
|
340082
|
+
var _a2, _b2, _c2, _d;
|
|
340079
340083
|
const rawConfig = ((_a2 = props.config.tools) == null ? void 0 : _a2.drawing) ?? props.config.drawing;
|
|
340080
340084
|
if (rawConfig === false) {
|
|
340081
340085
|
return {
|
|
@@ -340083,8 +340087,15 @@ ${indentData}`);
|
|
|
340083
340087
|
trigger: "hover",
|
|
340084
340088
|
continuous: false,
|
|
340085
340089
|
showContinuousToggle: true,
|
|
340090
|
+
showImportButton: false,
|
|
340091
|
+
importOptions: {
|
|
340092
|
+
clearBeforeImport: false,
|
|
340093
|
+
fitToImported: true,
|
|
340094
|
+
accept: ".json,.geojson"
|
|
340095
|
+
},
|
|
340086
340096
|
tools: DEFAULT_DRAWING_TOOLS,
|
|
340087
|
-
onDrawEnd: void 0
|
|
340097
|
+
onDrawEnd: void 0,
|
|
340098
|
+
onImportEnd: void 0
|
|
340088
340099
|
};
|
|
340089
340100
|
}
|
|
340090
340101
|
if (rawConfig === true || rawConfig === void 0) {
|
|
@@ -340093,8 +340104,15 @@ ${indentData}`);
|
|
|
340093
340104
|
trigger: "hover",
|
|
340094
340105
|
continuous: false,
|
|
340095
340106
|
showContinuousToggle: true,
|
|
340107
|
+
showImportButton: false,
|
|
340108
|
+
importOptions: {
|
|
340109
|
+
clearBeforeImport: false,
|
|
340110
|
+
fitToImported: true,
|
|
340111
|
+
accept: ".json,.geojson"
|
|
340112
|
+
},
|
|
340096
340113
|
tools: DEFAULT_DRAWING_TOOLS,
|
|
340097
|
-
onDrawEnd: void 0
|
|
340114
|
+
onDrawEnd: void 0,
|
|
340115
|
+
onImportEnd: void 0
|
|
340098
340116
|
};
|
|
340099
340117
|
}
|
|
340100
340118
|
const config = rawConfig;
|
|
@@ -340106,8 +340124,15 @@ ${indentData}`);
|
|
|
340106
340124
|
trigger: config.trigger || "hover",
|
|
340107
340125
|
continuous: config.continuous ?? false,
|
|
340108
340126
|
showContinuousToggle: config.showContinuousToggle !== false,
|
|
340127
|
+
showImportButton: config.showImportButton === true,
|
|
340128
|
+
importOptions: {
|
|
340129
|
+
clearBeforeImport: ((_b2 = config.importOptions) == null ? void 0 : _b2.clearBeforeImport) ?? false,
|
|
340130
|
+
fitToImported: ((_c2 = config.importOptions) == null ? void 0 : _c2.fitToImported) ?? true,
|
|
340131
|
+
accept: ((_d = config.importOptions) == null ? void 0 : _d.accept) || ".json,.geojson"
|
|
340132
|
+
},
|
|
340109
340133
|
tools: tools.length > 0 ? Array.from(new Set(tools)) : DEFAULT_DRAWING_TOOLS,
|
|
340110
|
-
onDrawEnd: config.onDrawEnd
|
|
340134
|
+
onDrawEnd: config.onDrawEnd,
|
|
340135
|
+
onImportEnd: config.onImportEnd
|
|
340111
340136
|
};
|
|
340112
340137
|
});
|
|
340113
340138
|
const isDrawingEnabled = vue.computed(() => drawingControlConfig.value.enabled);
|
|
@@ -340325,6 +340350,136 @@ ${indentData}`);
|
|
|
340325
340350
|
source: "controls"
|
|
340326
340351
|
};
|
|
340327
340352
|
};
|
|
340353
|
+
const normalizeImportedGeoJSON = (rawData) => {
|
|
340354
|
+
if (typeof rawData === "string") {
|
|
340355
|
+
const trimmed = rawData.trim();
|
|
340356
|
+
if (!trimmed) {
|
|
340357
|
+
throw new Error("文件内容为空");
|
|
340358
|
+
}
|
|
340359
|
+
return normalizeImportedGeoJSON(
|
|
340360
|
+
JSON.parse(trimmed)
|
|
340361
|
+
);
|
|
340362
|
+
}
|
|
340363
|
+
if (!rawData || typeof rawData !== "object") {
|
|
340364
|
+
throw new Error("仅支持导入 GeoJSON 对象");
|
|
340365
|
+
}
|
|
340366
|
+
const geoJson = rawData;
|
|
340367
|
+
if (geoJson.type === "FeatureCollection" && Array.isArray(geoJson.features)) {
|
|
340368
|
+
return geoJson;
|
|
340369
|
+
}
|
|
340370
|
+
if (geoJson.type === "Feature") {
|
|
340371
|
+
return geoJson;
|
|
340372
|
+
}
|
|
340373
|
+
if ("coordinates" in geoJson && typeof geoJson.type === "string") {
|
|
340374
|
+
return geoJson;
|
|
340375
|
+
}
|
|
340376
|
+
throw new Error("文件不是有效的 GeoJSON 格式");
|
|
340377
|
+
};
|
|
340378
|
+
const collectImportedExtent = (geojson) => {
|
|
340379
|
+
var _a2;
|
|
340380
|
+
if (!currentMap.value)
|
|
340381
|
+
return null;
|
|
340382
|
+
try {
|
|
340383
|
+
const features2 = geoJsonFormat.readFeatures(geojson, {
|
|
340384
|
+
dataProjection: "EPSG:4326",
|
|
340385
|
+
featureProjection: currentMap.value.getView().getProjection()
|
|
340386
|
+
});
|
|
340387
|
+
if (!features2.length) {
|
|
340388
|
+
return null;
|
|
340389
|
+
}
|
|
340390
|
+
let extent3 = (_a2 = features2[0].getGeometry()) == null ? void 0 : _a2.getExtent();
|
|
340391
|
+
if (!extent3) {
|
|
340392
|
+
return null;
|
|
340393
|
+
}
|
|
340394
|
+
for (let i2 = 1; i2 < features2.length; i2 += 1) {
|
|
340395
|
+
const geometry = features2[i2].getGeometry();
|
|
340396
|
+
if (!geometry)
|
|
340397
|
+
continue;
|
|
340398
|
+
const currentExtent = geometry.getExtent();
|
|
340399
|
+
extent3 = [
|
|
340400
|
+
Math.min(extent3[0], currentExtent[0]),
|
|
340401
|
+
Math.min(extent3[1], currentExtent[1]),
|
|
340402
|
+
Math.max(extent3[2], currentExtent[2]),
|
|
340403
|
+
Math.max(extent3[3], currentExtent[3])
|
|
340404
|
+
];
|
|
340405
|
+
}
|
|
340406
|
+
return extent3;
|
|
340407
|
+
} catch (error2) {
|
|
340408
|
+
console.warn("解析导入图形范围失败:", error2);
|
|
340409
|
+
return null;
|
|
340410
|
+
}
|
|
340411
|
+
};
|
|
340412
|
+
const fitToImportedGeoJSON = (geojson) => {
|
|
340413
|
+
if (!currentMap.value)
|
|
340414
|
+
return;
|
|
340415
|
+
const extent3 = collectImportedExtent(geojson);
|
|
340416
|
+
if (!extent3)
|
|
340417
|
+
return;
|
|
340418
|
+
currentMap.value.getView().fit(extent3, {
|
|
340419
|
+
duration: 500,
|
|
340420
|
+
padding: [30, 30, 30, 30],
|
|
340421
|
+
maxZoom: 18
|
|
340422
|
+
});
|
|
340423
|
+
};
|
|
340424
|
+
const importDrawings = () => {
|
|
340425
|
+
var _a2;
|
|
340426
|
+
const drawingManager = (_a2 = mapManager == null ? void 0 : mapManager.value) == null ? void 0 : _a2.getDrawingManager();
|
|
340427
|
+
if (!drawingManager) {
|
|
340428
|
+
elementPlus.ElMessage.warning("绘制管理器未初始化");
|
|
340429
|
+
return;
|
|
340430
|
+
}
|
|
340431
|
+
const input = document.createElement("input");
|
|
340432
|
+
input.type = "file";
|
|
340433
|
+
input.accept = drawingControlConfig.value.importOptions.accept;
|
|
340434
|
+
input.onchange = (event) => {
|
|
340435
|
+
var _a3;
|
|
340436
|
+
const file = (_a3 = event.target.files) == null ? void 0 : _a3[0];
|
|
340437
|
+
if (!file) {
|
|
340438
|
+
return;
|
|
340439
|
+
}
|
|
340440
|
+
const reader = new FileReader();
|
|
340441
|
+
reader.onload = (loadEvent) => {
|
|
340442
|
+
var _a4, _b2, _c2;
|
|
340443
|
+
try {
|
|
340444
|
+
const parsedGeojson = normalizeImportedGeoJSON(
|
|
340445
|
+
((_a4 = loadEvent.target) == null ? void 0 : _a4.result) ?? ""
|
|
340446
|
+
);
|
|
340447
|
+
if (drawingControlConfig.value.importOptions.clearBeforeImport) {
|
|
340448
|
+
drawingManager.clearAll();
|
|
340449
|
+
}
|
|
340450
|
+
const drawings = drawingManager.addGeoJSONData(parsedGeojson);
|
|
340451
|
+
if (!drawings.length) {
|
|
340452
|
+
elementPlus.ElMessage.warning("未识别到可导入的图形");
|
|
340453
|
+
return;
|
|
340454
|
+
}
|
|
340455
|
+
if (drawingControlConfig.value.importOptions.fitToImported) {
|
|
340456
|
+
fitToImportedGeoJSON(parsedGeojson);
|
|
340457
|
+
}
|
|
340458
|
+
const result = {
|
|
340459
|
+
fileName: file.name,
|
|
340460
|
+
importedCount: drawings.length,
|
|
340461
|
+
geojson: parsedGeojson,
|
|
340462
|
+
drawings: drawings.map((drawing) => buildDrawingResult(drawing)),
|
|
340463
|
+
source: "controls"
|
|
340464
|
+
};
|
|
340465
|
+
(_c2 = (_b2 = drawingControlConfig.value).onImportEnd) == null ? void 0 : _c2.call(_b2, result);
|
|
340466
|
+
emit("drawing-import", result);
|
|
340467
|
+
elementPlus.ElMessage.success(`成功导入 ${drawings.length} 个图形`);
|
|
340468
|
+
isDrawingMenuOpen.value = false;
|
|
340469
|
+
} catch (error2) {
|
|
340470
|
+
console.error("导入图形失败:", error2);
|
|
340471
|
+
elementPlus.ElMessage.error(
|
|
340472
|
+
error2 instanceof Error ? error2.message : "导入图形失败"
|
|
340473
|
+
);
|
|
340474
|
+
}
|
|
340475
|
+
};
|
|
340476
|
+
reader.onerror = () => {
|
|
340477
|
+
elementPlus.ElMessage.error("读取文件失败");
|
|
340478
|
+
};
|
|
340479
|
+
reader.readAsText(file);
|
|
340480
|
+
};
|
|
340481
|
+
input.click();
|
|
340482
|
+
};
|
|
340328
340483
|
const cleanupDrawingListeners = () => {
|
|
340329
340484
|
if (boundDrawingManager && boundDrawingEndHandler && boundModeChangeHandler) {
|
|
340330
340485
|
boundDrawingManager.off("drawing-end", boundDrawingEndHandler);
|
|
@@ -340739,7 +340894,7 @@ ${indentData}`);
|
|
|
340739
340894
|
]),
|
|
340740
340895
|
default: vue.withCtx(() => [
|
|
340741
340896
|
vue.createElementVNode("div", _hoisted_8$d, [
|
|
340742
|
-
_cache[
|
|
340897
|
+
_cache[6] || (_cache[6] = vue.createElementVNode("div", { class: "drawing-menu-title" }, "快捷绘制", -1)),
|
|
340743
340898
|
vue.createElementVNode("div", _hoisted_9$c, [
|
|
340744
340899
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(drawingControlConfig.value.tools, (tool) => {
|
|
340745
340900
|
return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElTooltip), {
|
|
@@ -340790,26 +340945,45 @@ ${indentData}`);
|
|
|
340790
340945
|
}, 1032, ["content"]);
|
|
340791
340946
|
}), 128))
|
|
340792
340947
|
]),
|
|
340793
|
-
drawingControlConfig.value.
|
|
340794
|
-
|
|
340948
|
+
drawingControlConfig.value.showImportButton ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_10$c, [
|
|
340949
|
+
vue.createVNode(vue.unref(elementPlus.ElButton), {
|
|
340950
|
+
size: "small",
|
|
340951
|
+
text: "",
|
|
340952
|
+
class: "drawing-import-btn",
|
|
340953
|
+
onClick: importDrawings
|
|
340954
|
+
}, {
|
|
340955
|
+
default: vue.withCtx(() => [
|
|
340956
|
+
vue.createVNode(vue.unref(elementPlus.ElIcon), null, {
|
|
340957
|
+
default: vue.withCtx(() => [
|
|
340958
|
+
vue.createVNode(vue.unref(iconsVue.Upload))
|
|
340959
|
+
]),
|
|
340960
|
+
_: 1
|
|
340961
|
+
}),
|
|
340962
|
+
_cache[3] || (_cache[3] = vue.createElementVNode("span", null, "导入图形", -1))
|
|
340963
|
+
]),
|
|
340964
|
+
_: 1
|
|
340965
|
+
})
|
|
340966
|
+
])) : vue.createCommentVNode("", true),
|
|
340967
|
+
drawingControlConfig.value.showContinuousToggle || isDrawingActive.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_11$a)) : vue.createCommentVNode("", true),
|
|
340968
|
+
drawingControlConfig.value.showContinuousToggle ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_12$8, [
|
|
340795
340969
|
vue.createVNode(vue.unref(elementPlus.ElCheckbox), {
|
|
340796
340970
|
modelValue: continuousDrawing.value,
|
|
340797
340971
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => continuousDrawing.value = $event)
|
|
340798
340972
|
}, {
|
|
340799
|
-
default: vue.withCtx(() => [..._cache[
|
|
340973
|
+
default: vue.withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
340800
340974
|
vue.createTextVNode(" 是否连续绘制 ", -1)
|
|
340801
340975
|
])]),
|
|
340802
340976
|
_: 1
|
|
340803
340977
|
}, 8, ["modelValue"])
|
|
340804
340978
|
])) : vue.createCommentVNode("", true),
|
|
340805
340979
|
isDrawingActive.value ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElButton), {
|
|
340806
|
-
key:
|
|
340980
|
+
key: 3,
|
|
340807
340981
|
size: "small",
|
|
340808
340982
|
text: "",
|
|
340809
340983
|
class: "drawing-stop-btn",
|
|
340810
340984
|
onClick: stopQuickDrawing
|
|
340811
340985
|
}, {
|
|
340812
|
-
default: vue.withCtx(() => [..._cache[
|
|
340986
|
+
default: vue.withCtx(() => [..._cache[5] || (_cache[5] = [
|
|
340813
340987
|
vue.createTextVNode(" 停止绘制 ", -1)
|
|
340814
340988
|
])]),
|
|
340815
340989
|
_: 1
|
|
@@ -340819,8 +340993,8 @@ ${indentData}`);
|
|
|
340819
340993
|
_: 1
|
|
340820
340994
|
}, 8, ["placement", "trigger", "visible", "disabled"])
|
|
340821
340995
|
])) : vue.createCommentVNode("", true),
|
|
340822
|
-
(((_o2 = _ctx.config.tools) == null ? void 0 : _o2.clearAll) || _ctx.config.clearAll) && (hasOtherTools.value || isDrawingEnabled.value || ((_p = _ctx.config.tools) == null ? void 0 : _p.zoom) || _ctx.config.zoom || ((_q = _ctx.config.tools) == null ? void 0 : _q.rotate) || _ctx.config.rotate) ? (vue.openBlock(), vue.createElementBlock("div",
|
|
340823
|
-
((_r2 = _ctx.config.tools) == null ? void 0 : _r2.clearAll) || _ctx.config.clearAll ? (vue.openBlock(), vue.createElementBlock("div",
|
|
340996
|
+
(((_o2 = _ctx.config.tools) == null ? void 0 : _o2.clearAll) || _ctx.config.clearAll) && (hasOtherTools.value || isDrawingEnabled.value || ((_p = _ctx.config.tools) == null ? void 0 : _p.zoom) || _ctx.config.zoom || ((_q = _ctx.config.tools) == null ? void 0 : _q.rotate) || _ctx.config.rotate) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13$7)) : vue.createCommentVNode("", true),
|
|
340997
|
+
((_r2 = _ctx.config.tools) == null ? void 0 : _r2.clearAll) || _ctx.config.clearAll ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$5, [
|
|
340824
340998
|
vue.createVNode(vue.unref(elementPlus.ElButton), {
|
|
340825
340999
|
class: "control-btn",
|
|
340826
341000
|
title: "清空绘制内容",
|
|
@@ -340844,8 +341018,8 @@ ${indentData}`);
|
|
|
340844
341018
|
};
|
|
340845
341019
|
}
|
|
340846
341020
|
});
|
|
340847
|
-
const
|
|
340848
|
-
const OlControlPanel = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-
|
|
341021
|
+
const OlControlPanel_vue_vue_type_style_index_0_scoped_5317d890_lang = "";
|
|
341022
|
+
const OlControlPanel = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-5317d890"]]);
|
|
340849
341023
|
const _hoisted_1$u = {
|
|
340850
341024
|
key: 0,
|
|
340851
341025
|
class: "ol-legend-header"
|
|
@@ -366130,7 +366304,7 @@ ${indentData}`);
|
|
|
366130
366304
|
popupConfig: {},
|
|
366131
366305
|
enableGeolocation: { type: Boolean, default: true }
|
|
366132
366306
|
},
|
|
366133
|
-
emits: ["map-ready", "map-click", "map-dblclick", "map-contextmenu", "map-move", "zoom-change", "feature-click", "tooltip-show", "tooltip-hide", "layer-change", "measurement-change", "measurement-start", "measurement-end", "measurement-result", "context-menu", "bookmark-action", "marker-action", "tool-action", "drawing-complete", "drawing-clear", "search", "search-select", "search-clear", "popup-show", "popup-hide", "popup-close"],
|
|
366307
|
+
emits: ["map-ready", "map-click", "map-dblclick", "map-contextmenu", "map-move", "zoom-change", "feature-click", "tooltip-show", "tooltip-hide", "layer-change", "measurement-change", "measurement-start", "measurement-end", "measurement-result", "context-menu", "bookmark-action", "marker-action", "tool-action", "drawing-complete", "drawing-clear", "drawing-import", "search", "search-select", "search-clear", "popup-show", "popup-hide", "popup-close"],
|
|
366134
366308
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
366135
366309
|
const currentLegends = vue.ref([]);
|
|
366136
366310
|
const currentLayers = vue.ref([]);
|
|
@@ -367002,6 +367176,9 @@ ${indentData}`);
|
|
|
367002
367176
|
const onDrawingClear = (event) => {
|
|
367003
367177
|
emit("drawing-clear", event);
|
|
367004
367178
|
};
|
|
367179
|
+
const onDrawingImport = (result) => {
|
|
367180
|
+
emit("drawing-import", result);
|
|
367181
|
+
};
|
|
367005
367182
|
const onPrintAction = (data2) => {
|
|
367006
367183
|
console.log("打印操作:", data2);
|
|
367007
367184
|
switch (data2.action) {
|
|
@@ -367690,7 +367867,8 @@ ${indentData}`);
|
|
|
367690
367867
|
"bottom-offset": finalControlsConfig.value.bottomOffset,
|
|
367691
367868
|
"view-bookmarks": props.viewBookmarks,
|
|
367692
367869
|
onDrawingComplete,
|
|
367693
|
-
onDrawingClear
|
|
367870
|
+
onDrawingClear,
|
|
367871
|
+
onDrawingImport
|
|
367694
367872
|
}, {
|
|
367695
367873
|
custom: vue.withCtx(({ controls }) => [
|
|
367696
367874
|
vue.renderSlot(_ctx.$slots, "controls", {
|
|
@@ -367827,8 +368005,8 @@ ${indentData}`);
|
|
|
367827
368005
|
};
|
|
367828
368006
|
}
|
|
367829
368007
|
});
|
|
367830
|
-
const
|
|
367831
|
-
const OlMap = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-
|
|
368008
|
+
const OlMap_vue_vue_type_style_index_0_scoped_984651bc_lang = "";
|
|
368009
|
+
const OlMap = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-984651bc"]]);
|
|
367832
368010
|
const ol = "";
|
|
367833
368011
|
const Property$1 = {
|
|
367834
368012
|
ACCURACY: "accuracy",
|
package/lib/style.css
CHANGED
|
@@ -888,7 +888,7 @@ to {
|
|
|
888
888
|
.position-bottom-right {
|
|
889
889
|
bottom: 5px;
|
|
890
890
|
}
|
|
891
|
-
}.control-bar[data-v-
|
|
891
|
+
}.control-bar[data-v-5317d890] {
|
|
892
892
|
display: flex;
|
|
893
893
|
align-items: center;
|
|
894
894
|
gap: 0;
|
|
@@ -901,77 +901,77 @@ to {
|
|
|
901
901
|
border: 1px solid var(--el-border-color-light);
|
|
902
902
|
transition: all 0.3s ease;
|
|
903
903
|
}
|
|
904
|
-
.control-bar[data-v-
|
|
904
|
+
.control-bar[data-v-5317d890]:hover {
|
|
905
905
|
box-shadow: var(--el-box-shadow);
|
|
906
906
|
border-color: var(--el-border-color-hover);
|
|
907
907
|
}
|
|
908
|
-
.control-bar.flex-col[data-v-
|
|
908
|
+
.control-bar.flex-col[data-v-5317d890] {
|
|
909
909
|
flex-direction: column;
|
|
910
910
|
width: fit-content;
|
|
911
911
|
}
|
|
912
|
-
.control-bar.flex-row[data-v-
|
|
912
|
+
.control-bar.flex-row[data-v-5317d890] {
|
|
913
913
|
flex-direction: row;
|
|
914
914
|
height: fit-content;
|
|
915
915
|
}
|
|
916
|
-
.control-section[data-v-
|
|
916
|
+
.control-section[data-v-5317d890] {
|
|
917
917
|
display: flex;
|
|
918
918
|
align-items: center;
|
|
919
919
|
justify-content: center;
|
|
920
920
|
gap: 4px;
|
|
921
921
|
/* Inherit direction from parent implicitly via flex layout */
|
|
922
922
|
}
|
|
923
|
-
.flex-col .control-section[data-v-
|
|
923
|
+
.flex-col .control-section[data-v-5317d890] {
|
|
924
924
|
flex-direction: column;
|
|
925
925
|
width: 100%;
|
|
926
926
|
}
|
|
927
|
-
.flex-row .control-section[data-v-
|
|
927
|
+
.flex-row .control-section[data-v-5317d890] {
|
|
928
928
|
flex-direction: row;
|
|
929
929
|
height: 100%;
|
|
930
930
|
}
|
|
931
|
-
.control-divider[data-v-
|
|
931
|
+
.control-divider[data-v-5317d890] {
|
|
932
932
|
background-color: var(--el-border-color-light);
|
|
933
933
|
}
|
|
934
|
-
.flex-col .control-divider[data-v-
|
|
934
|
+
.flex-col .control-divider[data-v-5317d890] {
|
|
935
935
|
width: 80%;
|
|
936
936
|
height: 1px;
|
|
937
937
|
margin: 4px 0;
|
|
938
938
|
}
|
|
939
|
-
.flex-row .control-divider[data-v-
|
|
939
|
+
.flex-row .control-divider[data-v-5317d890] {
|
|
940
940
|
width: 1px;
|
|
941
941
|
height: 16px; /* Explicit height for horizontal mode */
|
|
942
942
|
margin: 0 4px;
|
|
943
943
|
}
|
|
944
944
|
|
|
945
945
|
/* ensure buttons themselves are interactive */
|
|
946
|
-
.control-btn[data-v-
|
|
946
|
+
.control-btn[data-v-5317d890] {
|
|
947
947
|
pointer-events: auto;
|
|
948
948
|
margin: 0 !important; /* Ensure no margin interferes */
|
|
949
949
|
transition: transform 0.1s;
|
|
950
950
|
}
|
|
951
|
-
.control-btn[data-v-
|
|
951
|
+
.control-btn[data-v-5317d890]:active {
|
|
952
952
|
transform: scale(0.95);
|
|
953
953
|
}
|
|
954
954
|
|
|
955
955
|
/* reset Element Plus button default adjacent margin and use our gap instead */
|
|
956
|
-
[data-v-
|
|
956
|
+
[data-v-5317d890] .el-button + .el-button {
|
|
957
957
|
margin-left: 0 !important;
|
|
958
958
|
}
|
|
959
959
|
|
|
960
960
|
/* make sure all EP interactive widgets are clickable */
|
|
961
|
-
[data-v-
|
|
961
|
+
[data-v-5317d890] .el-button,[data-v-5317d890] .el-slider,[data-v-5317d890] .el-icon {
|
|
962
962
|
pointer-events: auto;
|
|
963
963
|
}
|
|
964
|
-
.drawing-menu-panel-content[data-v-
|
|
964
|
+
.drawing-menu-panel-content[data-v-5317d890] {
|
|
965
965
|
display: flex;
|
|
966
966
|
flex-direction: column;
|
|
967
967
|
}
|
|
968
|
-
.drawing-menu-title[data-v-
|
|
968
|
+
.drawing-menu-title[data-v-5317d890] {
|
|
969
969
|
margin-bottom: 8px;
|
|
970
970
|
font-size: 12px;
|
|
971
971
|
font-weight: 600;
|
|
972
972
|
color: var(--el-text-color-primary);
|
|
973
973
|
}
|
|
974
|
-
.drawing-tool-list[data-v-
|
|
974
|
+
.drawing-tool-list[data-v-5317d890] {
|
|
975
975
|
display: grid;
|
|
976
976
|
grid-template-columns: repeat(4, 1fr);
|
|
977
977
|
gap: 8px;
|
|
@@ -979,7 +979,7 @@ to {
|
|
|
979
979
|
overflow-y: auto;
|
|
980
980
|
padding: 4px;
|
|
981
981
|
}
|
|
982
|
-
.drawing-tool-btn[data-v-
|
|
982
|
+
.drawing-tool-btn[data-v-5317d890] {
|
|
983
983
|
width: 32px;
|
|
984
984
|
height: 32px;
|
|
985
985
|
margin: 0 !important;
|
|
@@ -988,17 +988,24 @@ to {
|
|
|
988
988
|
align-items: center;
|
|
989
989
|
font-size: 16px; /* Icon size */
|
|
990
990
|
}
|
|
991
|
-
.drawing-
|
|
991
|
+
.drawing-import-row[data-v-5317d890] {
|
|
992
|
+
margin-top: 8px;
|
|
993
|
+
}
|
|
994
|
+
.drawing-import-btn[data-v-5317d890] {
|
|
995
|
+
width: 100%;
|
|
996
|
+
justify-content: flex-start;
|
|
997
|
+
}
|
|
998
|
+
.drawing-menu-divider[data-v-5317d890] {
|
|
992
999
|
height: 1px;
|
|
993
1000
|
margin: 8px 0;
|
|
994
1001
|
background: var(--el-border-color-light);
|
|
995
1002
|
}
|
|
996
|
-
.drawing-toggle-row[data-v-
|
|
1003
|
+
.drawing-toggle-row[data-v-5317d890] {
|
|
997
1004
|
display: flex;
|
|
998
1005
|
align-items: center;
|
|
999
1006
|
justify-content: space-between;
|
|
1000
1007
|
}
|
|
1001
|
-
.drawing-stop-btn[data-v-
|
|
1008
|
+
.drawing-stop-btn[data-v-5317d890] {
|
|
1002
1009
|
justify-content: flex-start;
|
|
1003
1010
|
width: 100%;
|
|
1004
1011
|
margin-top: 6px !important;
|
|
@@ -1725,7 +1732,7 @@ label {
|
|
|
1725
1732
|
width: 100% !important;
|
|
1726
1733
|
height: 100% !important;
|
|
1727
1734
|
}
|
|
1728
|
-
.context-menu[data-v-
|
|
1735
|
+
.context-menu[data-v-984651bc] {
|
|
1729
1736
|
background: var(--el-bg-color-overlay);
|
|
1730
1737
|
border: 1px solid var(--el-border-color-light);
|
|
1731
1738
|
border-radius: var(--el-border-radius-base);
|
|
@@ -1734,7 +1741,7 @@ label {
|
|
|
1734
1741
|
min-width: 140px;
|
|
1735
1742
|
overflow: hidden;
|
|
1736
1743
|
}
|
|
1737
|
-
.context-menu .context-menu-item[data-v-
|
|
1744
|
+
.context-menu .context-menu-item[data-v-984651bc] {
|
|
1738
1745
|
display: flex;
|
|
1739
1746
|
align-items: center;
|
|
1740
1747
|
padding: 8px 16px;
|
|
@@ -1743,14 +1750,14 @@ label {
|
|
|
1743
1750
|
color: var(--el-text-color-primary);
|
|
1744
1751
|
transition: all 0.2s;
|
|
1745
1752
|
}
|
|
1746
|
-
.context-menu .context-menu-item[data-v-
|
|
1753
|
+
.context-menu .context-menu-item[data-v-984651bc]:hover {
|
|
1747
1754
|
background-color: var(--el-fill-color-light);
|
|
1748
1755
|
color: var(--el-color-primary);
|
|
1749
1756
|
}
|
|
1750
|
-
.context-menu .context-menu-item:hover .el-icon[data-v-
|
|
1757
|
+
.context-menu .context-menu-item:hover .el-icon[data-v-984651bc] {
|
|
1751
1758
|
color: var(--el-color-primary);
|
|
1752
1759
|
}
|
|
1753
|
-
.context-menu .context-menu-item .el-icon[data-v-
|
|
1760
|
+
.context-menu .context-menu-item .el-icon[data-v-984651bc] {
|
|
1754
1761
|
margin-right: 8px;
|
|
1755
1762
|
font-size: 16px;
|
|
1756
1763
|
color: var(--el-text-color-secondary);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { Map } from 'ol';
|
|
3
|
-
import { MapControlsConfig, MapControlDrawingClearEvent, MapControlDrawingResult, ViewBookmark } from '../types';
|
|
3
|
+
import { MapControlsConfig, MapControlDrawingClearEvent, MapControlDrawingImportResult, MapControlDrawingResult, ViewBookmark } from '../types';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
6
|
config: MapControlsConfig;
|
|
@@ -39,12 +39,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
39
39
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
40
40
|
"drawing-complete": (result: MapControlDrawingResult) => void;
|
|
41
41
|
"drawing-clear": (event: MapControlDrawingClearEvent) => void;
|
|
42
|
+
"drawing-import": (result: MapControlDrawingImportResult) => void;
|
|
42
43
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
43
44
|
position: string;
|
|
44
45
|
direction: string;
|
|
45
46
|
}>>> & Readonly<{
|
|
46
47
|
"onDrawing-complete"?: (result: MapControlDrawingResult) => any;
|
|
47
48
|
"onDrawing-clear"?: (event: MapControlDrawingClearEvent) => any;
|
|
49
|
+
"onDrawing-import"?: (result: MapControlDrawingImportResult) => any;
|
|
48
50
|
}>, {
|
|
49
51
|
position: "bottom-left" | "bottom-right" | "top-left" | "top-right";
|
|
50
52
|
direction: "horizontal" | "vertical";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OlControlPanel.vue.d.ts","sourceRoot":"","sources":["../../src/components/OlControlPanel.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OlControlPanel.vue.d.ts","sourceRoot":"","sources":["../../src/components/OlControlPanel.vue"],"names":[],"mappings":"AA+UA;AA8BA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC;AAmB9B,OAAO,KAAK,EACV,iBAAiB,EAEjB,2BAA2B,EAC3B,6BAA6B,EAC7B,uBAAuB,EAEvB,YAAY,EACb,MAAM,UAAU,CAAC;AAKlB,UAAU,KAAK;IACb,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,CAAC,EAAE,UAAU,GAAG,WAAW,GAAG,aAAa,GAAG,cAAc,CAAC;IACrE,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0lED,wBAQG;AACH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,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"}
|
|
@@ -2,7 +2,7 @@ import { default as Map } from 'ol/Map';
|
|
|
2
2
|
import { MeasurementTool } from '../core/measurementTool';
|
|
3
3
|
import { PopupManager, PopupConfig, PopupType, PopupManagerConfig } from './OlMapPopup';
|
|
4
4
|
import { GeoJSONInput } from '../core/geoJsonLocationTool';
|
|
5
|
-
import { MapConfig, LayerConfig, LegendConfig, MeasurementResult, MapEventCallbacks, MapClickEvent, TooltipTemplate, TooltipData, SearchResult, FeatureInput, LayerInput, MapControlsConfig, MapControlDrawingClearEvent, MapControlDrawingResult, MapSearchConfig, ViewBookmark, BookmarkAction } from '../types';
|
|
5
|
+
import { MapConfig, LayerConfig, LegendConfig, MeasurementResult, MapEventCallbacks, MapClickEvent, TooltipTemplate, TooltipData, SearchResult, FeatureInput, LayerInput, MapControlsConfig, MapControlDrawingClearEvent, MapControlDrawingImportResult, MapControlDrawingResult, MapSearchConfig, ViewBookmark, BookmarkAction } from '../types';
|
|
6
6
|
import { DrawingManagerConfig } from '../core/drawing/DrawingManager';
|
|
7
7
|
|
|
8
8
|
interface Props {
|
|
@@ -238,6 +238,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
|
|
|
238
238
|
"tool-action": (data: Record<string, any>) => void;
|
|
239
239
|
"drawing-complete": (result: MapControlDrawingResult) => void;
|
|
240
240
|
"drawing-clear": (event: MapControlDrawingClearEvent) => void;
|
|
241
|
+
"drawing-import": (result: MapControlDrawingImportResult) => void;
|
|
241
242
|
search: (query: string) => void;
|
|
242
243
|
"search-select": (result: SearchResult) => void;
|
|
243
244
|
"search-clear": () => void;
|
|
@@ -283,6 +284,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
|
|
|
283
284
|
"onBookmark-action"?: (data: BookmarkAction) => any;
|
|
284
285
|
"onDrawing-complete"?: (result: MapControlDrawingResult) => any;
|
|
285
286
|
"onDrawing-clear"?: (event: MapControlDrawingClearEvent) => any;
|
|
287
|
+
"onDrawing-import"?: (result: MapControlDrawingImportResult) => any;
|
|
286
288
|
"onTool-action"?: (data: Record<string, any>) => any;
|
|
287
289
|
"onMap-dblclick"?: (event: MapClickEvent) => any;
|
|
288
290
|
"onMap-contextmenu"?: (event: MapClickEvent) => any;
|