vue-openlayers-plugin 1.0.91 → 1.0.93
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-97a57e6f.mjs → BasemapPanel-ed3aedc9.mjs} +68 -22
- package/lib/{CoordinateLocationDialog-090ead21.mjs → CoordinateLocationDialog-1b493dd9.mjs} +105 -51
- package/lib/{FilterPanel-ac96a573.mjs → FilterPanel-a5f38164.mjs} +1 -1
- package/lib/{MapPrintDialog-a440a6ab.mjs → LayerPanel-fd86591b.mjs} +1 -1
- package/lib/{LayerPanel-f9bbcdc1.mjs → MapPrintDialog-ce441446.mjs} +1 -1
- package/lib/{MeasurementDialog-6ec17375.mjs → MeasurementDialog-901a569f.mjs} +84 -33
- package/lib/{MyMarkersDialog-1f9f82ed.mjs → MyMarkersDialog-c0883329.mjs} +138 -63
- package/lib/{RegionNavigationDialog-d21ed4a6.mjs → RegionNavigationDialog-b0b6f86b.mjs} +29 -26
- package/lib/{ViewBookmarksDialog-b9fdb1d5.mjs → ViewBookmarksDialog-9f767176.mjs} +250 -92
- package/lib/{index-cdbb6879.mjs → index-3dc1ae8a.mjs} +13 -17
- package/lib/{index-a081b5c1.mjs → index-915b9f4d.mjs} +1 -1
- package/lib/{index-dd63f686.mjs → index-bc98d31c.mjs} +3359 -1919
- package/lib/{index.es-d367a4fc.mjs → index.es-31d767d5.mjs} +1 -1
- package/lib/index.esm.js +63 -63
- package/lib/index.umd.js +3947 -2128
- package/lib/style.css +707 -634
- package/package.json +2 -2
- package/types/index.d.ts +6616 -1
- package/types/src/components/CustomDialog/CustomDialog.vue.d.ts +11 -11
- package/types/src/components/CustomDialog/CustomDialog.vue.d.ts.map +1 -1
- package/types/src/components/CustomDialog/dialogCache.d.ts.map +1 -1
- package/types/src/components/CustomDialog/icons/index.d.ts.map +1 -1
- package/types/src/components/CustomDialog/index.d.ts.map +1 -1
- package/types/src/components/OlBaseLayerSwitcher.vue.d.ts.map +1 -1
- package/types/src/components/OlControlPanel.vue.d.ts +2 -2
- package/types/src/components/OlControlPanel.vue.d.ts.map +1 -1
- package/types/src/components/OlDialogs/BasemapPanel.vue.d.ts +1 -1
- package/types/src/components/OlDialogs/BasemapPanel.vue.d.ts.map +1 -1
- package/types/src/components/OlDialogs/CoordinateLocationDialog.vue.d.ts +1 -1
- package/types/src/components/OlDialogs/CoordinateLocationDialog.vue.d.ts.map +1 -1
- package/types/src/components/OlDialogs/DialogManager.d.ts +1 -1
- package/types/src/components/OlDialogs/DialogManager.d.ts.map +1 -1
- package/types/src/components/OlDialogs/FilterPanel.vue.d.ts +3 -3
- package/types/src/components/OlDialogs/FilterPanel.vue.d.ts.map +1 -1
- package/types/src/components/OlDialogs/LayerPanel.vue.d.ts +786 -786
- package/types/src/components/OlDialogs/LayerPanel.vue.d.ts.map +1 -1
- package/types/src/components/OlDialogs/LayerStyleConfig.vue.d.ts +3 -3
- package/types/src/components/OlDialogs/LayerStyleConfig.vue.d.ts.map +1 -1
- package/types/src/components/OlDialogs/LayerTreeNode.vue.d.ts +5 -5
- package/types/src/components/OlDialogs/LayerTreeNode.vue.d.ts.map +1 -1
- package/types/src/components/OlDialogs/MapDrawingDialog/index.vue.d.ts.map +1 -1
- package/types/src/components/OlDialogs/MapPrintDialog.vue.d.ts +2 -2
- package/types/src/components/OlDialogs/MapPrintDialog.vue.d.ts.map +1 -1
- package/types/src/components/OlDialogs/MeasurementDialog.vue.d.ts +1 -1
- package/types/src/components/OlDialogs/MeasurementDialog.vue.d.ts.map +1 -1
- package/types/src/components/OlDialogs/MyMarkersDialog.vue.d.ts +2 -2
- package/types/src/components/OlDialogs/MyMarkersDialog.vue.d.ts.map +1 -1
- package/types/src/components/OlDialogs/RegionNavigationDialog.vue.d.ts +5 -5
- package/types/src/components/OlDialogs/RegionNavigationDialog.vue.d.ts.map +1 -1
- package/types/src/components/OlDialogs/ViewBookmarksDialog.vue.d.ts +2 -2
- package/types/src/components/OlDialogs/ViewBookmarksDialog.vue.d.ts.map +1 -1
- package/types/src/components/OlDialogs/registry.d.ts.map +1 -1
- package/types/src/components/OlDrawToolbar.vue.d.ts +16 -16
- package/types/src/components/OlDrawToolbar.vue.d.ts.map +1 -1
- package/types/src/components/OlLegendPanel.vue.d.ts +1 -1
- package/types/src/components/OlLegendPanel.vue.d.ts.map +1 -1
- package/types/src/components/OlMapContainer.vue.d.ts +31 -31
- package/types/src/components/OlMapContainer.vue.d.ts.map +1 -1
- package/types/src/components/OlMapPopup/ArrayPopup.vue.d.ts +4 -4
- package/types/src/components/OlMapPopup/ArrayPopup.vue.d.ts.map +1 -1
- package/types/src/components/OlMapPopup/BasePopup.vue.d.ts +6 -6
- package/types/src/components/OlMapPopup/BasePopup.vue.d.ts.map +1 -1
- package/types/src/components/OlMapPopup/HtmlPopup.vue.d.ts +3 -3
- package/types/src/components/OlMapPopup/HtmlPopup.vue.d.ts.map +1 -1
- package/types/src/components/OlMapPopup/ImagePopup.vue.d.ts +3 -3
- package/types/src/components/OlMapPopup/ImagePopup.vue.d.ts.map +1 -1
- package/types/src/components/OlMapPopup/index.d.ts +1 -1
- package/types/src/components/OlMapPopup/index.d.ts.map +1 -1
- package/types/src/components/OlMapPopup/types.d.ts +12 -12
- package/types/src/components/OlMapPopup/types.d.ts.map +1 -1
- package/types/src/components/OlMapSearch.vue.d.ts +3 -3
- package/types/src/components/OlMapSearch.vue.d.ts.map +1 -1
- package/types/src/components/OlMapTooltip.vue.d.ts +8 -8
- package/types/src/components/OlMapTooltip.vue.d.ts.map +1 -1
- package/types/src/components/SvgIcon/index.vue.d.ts.map +1 -1
- package/types/src/core/EventBus.d.ts.map +1 -1
- package/types/src/core/EventManager.d.ts.map +1 -1
- package/types/src/core/FeatureHighlightManager.d.ts.map +1 -1
- package/types/src/core/GlobalStyleManager.d.ts +1 -1
- package/types/src/core/LayerConfigManager.d.ts.map +1 -1
- package/types/src/core/LayerManager.d.ts +2 -2
- package/types/src/core/LayerManager.d.ts.map +1 -1
- package/types/src/core/LayerTreeManager.d.ts +1 -1
- package/types/src/core/LayerTreeManager.d.ts.map +1 -1
- package/types/src/core/MapManager.d.ts +15 -15
- package/types/src/core/MapManager.d.ts.map +1 -1
- package/types/src/core/MarkerDrawingAdapter.d.ts.map +1 -1
- package/types/src/core/PluginManager.d.ts +1 -1
- package/types/src/core/PluginManager.d.ts.map +1 -1
- package/types/src/core/PopupManager.d.ts.map +1 -1
- package/types/src/core/SearchMarkerManager.d.ts.map +1 -1
- package/types/src/core/TooltipHelper.d.ts +1 -1
- package/types/src/core/TooltipHelper.d.ts.map +1 -1
- package/types/src/core/amapSearchApi.d.ts.map +1 -1
- package/types/src/core/configLoader.d.ts +33 -33
- package/types/src/core/configLoader.d.ts.map +1 -1
- package/types/src/core/drawing/BaseDrawing.d.ts.map +1 -1
- package/types/src/core/drawing/DrawingManager.d.ts.map +1 -1
- package/types/src/core/drawing/IconDrawing.d.ts.map +1 -1
- package/types/src/core/drawing/ImageDrawing.d.ts.map +1 -1
- package/types/src/core/drawing/LineDrawing.d.ts.map +1 -1
- package/types/src/core/drawing/MilitaryDrawing.d.ts.map +1 -1
- package/types/src/core/drawing/MultiLineStringDrawing.d.ts.map +1 -1
- package/types/src/core/drawing/MultiPointDrawing.d.ts.map +1 -1
- package/types/src/core/drawing/MultiPolygonDrawing.d.ts.map +1 -1
- package/types/src/core/drawing/PointDrawing.d.ts +2 -2
- package/types/src/core/drawing/PointDrawing.d.ts.map +1 -1
- package/types/src/core/drawing/PointWithTextDrawing.d.ts +2 -2
- package/types/src/core/drawing/PointWithTextDrawing.d.ts.map +1 -1
- package/types/src/core/drawing/PolygonDrawing.d.ts.map +1 -1
- package/types/src/core/drawing/TextDrawing.d.ts.map +1 -1
- package/types/src/core/drawing/index.d.ts +12 -12
- package/types/src/core/drawing/index.d.ts.map +1 -1
- package/types/src/core/geoJsonLocationTool.d.ts +3 -3
- package/types/src/core/geoJsonLocationTool.d.ts.map +1 -1
- package/types/src/core/layers/BaseLayer.d.ts +1 -1
- package/types/src/core/layers/BaseLayer.d.ts.map +1 -1
- package/types/src/core/layers/CanvasLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/ClusterLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/GMLLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/GeoJSONLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/HeatmapLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/ImageVectorLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/KMLLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/LayerFactory.d.ts.map +1 -1
- package/types/src/core/layers/SuperMapServiceTester.d.ts.map +1 -1
- package/types/src/core/layers/SuperMapTiledMapServiceHandler.d.ts.map +1 -1
- package/types/src/core/layers/TiandituConfigHelper.d.ts.map +1 -1
- package/types/src/core/layers/TiandituLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/TileLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/TileSuperMapRestHandler.d.ts +1 -1
- package/types/src/core/layers/TileSuperMapRestHandler.d.ts.map +1 -1
- package/types/src/core/layers/VectorTileLayerHandler.d.ts +3 -3
- package/types/src/core/layers/VectorTileLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/WFSLayerHandler.d.ts +1 -1
- package/types/src/core/layers/WFSLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/WKTLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/WMSLayerHandler.d.ts +1 -1
- package/types/src/core/layers/WMSLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/WMTSLayerHandler.d.ts.map +1 -1
- package/types/src/core/layers/interfaces.d.ts +1 -1
- package/types/src/core/layers/interfaces.d.ts.map +1 -1
- package/types/src/core/mapOperationTool.d.ts.map +1 -1
- package/types/src/core/measurementTool.d.ts.map +1 -1
- package/types/src/core/overviewMapUtil.d.ts.map +1 -1
- package/types/src/core/proxyHelper.d.ts +1 -1
- package/types/src/core/proxyHelper.d.ts.map +1 -1
- package/types/src/core/storage.d.ts.map +1 -1
- package/types/src/core/styles/StyleFactory.d.ts.map +1 -1
- package/types/src/core/styles/StyleManager.d.ts.map +1 -1
- package/types/src/core/styles/index.d.ts +1 -1
- package/types/src/core/styles/index.d.ts.map +1 -1
- package/types/src/core/styles/interfaces.d.ts +3 -3
- package/types/src/core/styles/interfaces.d.ts.map +1 -1
- package/types/src/core/tiandituSearchApi.d.ts.map +1 -1
- package/types/src/hooks/useMap.d.ts.map +1 -1
- package/types/src/services/searchService.d.ts +2 -2
- package/types/src/services/searchService.d.ts.map +1 -1
- package/types/src/style.d.ts.map +1 -1
- package/types/src/types/map.d.ts +75 -0
- package/types/src/types/map.d.ts.map +1 -1
- package/types/src/utils/DiffusionAnimationHelper.d.ts.map +1 -1
- package/types/src/utils/GifAnimationHelper.d.ts.map +1 -1
- package/types/src/utils/coordinateTransform.d.ts.map +1 -1
- package/types/src/utils/html2pdf.d.ts +3 -0
- package/types/src/utils/html2pdf.d.ts.map +1 -1
- package/types/src/utils/index.d.ts +1 -1
- package/types/src/utils/index.d.ts.map +1 -1
- package/types/src/utils/unitConverter.d.ts.map +1 -1
- package/types/tsconfig.tsbuildinfo +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, reactive, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createVNode, createTextVNode, unref, createElementBlock, Fragment, renderList, withModifiers, toDisplayString, createCommentVNode } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import { E as ElMessageBox } from "./index-
|
|
1
|
+
import { defineComponent, inject, computed, ref, reactive, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createVNode, createTextVNode, unref, createElementBlock, Fragment, renderList, withModifiers, toDisplayString, createCommentVNode } from "vue";
|
|
2
|
+
import { j as plus_default, k as folder_opened_default, m as download_default, n as delete_default, s as search_default, v as camera_default, w as view_default, q as edit_default, x as location_default, z as zoom_in_default, u as toLonLat, t as fromLonLat, E as ElMessage, y as getUid } from "./index-bc98d31c.mjs";
|
|
3
|
+
import { E as ElMessageBox } from "./index-915b9f4d.mjs";
|
|
4
4
|
import "ol";
|
|
5
5
|
const _hoisted_1 = { class: "bookmarks-content" };
|
|
6
6
|
const _hoisted_2 = { class: "toolbar" };
|
|
@@ -8,26 +8,30 @@ const _hoisted_3 = { class: "search-filter" };
|
|
|
8
8
|
const _hoisted_4 = { class: "bookmarks-grid" };
|
|
9
9
|
const _hoisted_5 = ["onClick"];
|
|
10
10
|
const _hoisted_6 = { class: "bookmark-thumbnail" };
|
|
11
|
-
const _hoisted_7 =
|
|
12
|
-
const _hoisted_8 = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
11
|
+
const _hoisted_7 = ["src"];
|
|
12
|
+
const _hoisted_8 = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "thumbnail-placeholder"
|
|
15
|
+
};
|
|
16
|
+
const _hoisted_9 = { class: "bookmark-overlay" };
|
|
17
|
+
const _hoisted_10 = { class: "bookmark-info" };
|
|
18
|
+
const _hoisted_11 = { class: "bookmark-title" };
|
|
19
|
+
const _hoisted_12 = { class: "bookmark-meta" };
|
|
20
|
+
const _hoisted_13 = { class: "use-count" };
|
|
21
|
+
const _hoisted_14 = { class: "bookmark-description" };
|
|
22
|
+
const _hoisted_15 = { class: "bookmark-details" };
|
|
20
23
|
const _hoisted_16 = { class: "detail-item" };
|
|
21
|
-
const _hoisted_17 = { class: "
|
|
22
|
-
const _hoisted_18 = {
|
|
24
|
+
const _hoisted_17 = { class: "detail-item" };
|
|
25
|
+
const _hoisted_18 = { class: "bookmark-time" };
|
|
26
|
+
const _hoisted_19 = {
|
|
23
27
|
key: 0,
|
|
24
28
|
class: "empty-state"
|
|
25
29
|
};
|
|
26
|
-
const
|
|
30
|
+
const _hoisted_20 = {
|
|
27
31
|
key: 1,
|
|
28
32
|
class: "statistics"
|
|
29
33
|
};
|
|
30
|
-
const
|
|
34
|
+
const _hoisted_21 = { class: "dialog-footer" };
|
|
31
35
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
32
36
|
__name: "ViewBookmarksDialog",
|
|
33
37
|
props: {
|
|
@@ -37,6 +41,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
37
41
|
setup(__props, { emit: __emit }) {
|
|
38
42
|
const props = __props;
|
|
39
43
|
const emit = __emit;
|
|
44
|
+
const mapRef = inject("map");
|
|
45
|
+
const map = computed(() => mapRef == null ? void 0 : mapRef.value);
|
|
40
46
|
const dialogVisible = computed({
|
|
41
47
|
get: () => props.modelValue,
|
|
42
48
|
set: (value) => emit("update:modelValue", value)
|
|
@@ -77,8 +83,110 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
77
83
|
centerLon: 116.407526,
|
|
78
84
|
centerLat: 39.90403,
|
|
79
85
|
zoom: 10,
|
|
80
|
-
rotation: 0
|
|
86
|
+
rotation: 0,
|
|
87
|
+
thumbnail: "",
|
|
88
|
+
saveLayerState: true
|
|
81
89
|
});
|
|
90
|
+
const getLayerStates = () => {
|
|
91
|
+
if (!map.value)
|
|
92
|
+
return [];
|
|
93
|
+
const states = [];
|
|
94
|
+
const layers = map.value.getLayers().getArray();
|
|
95
|
+
const processLayer = (layer) => {
|
|
96
|
+
const id = layer.get("id") || getUid(layer).toString();
|
|
97
|
+
const title = layer.get("title") || layer.get("name") || "未命名图层";
|
|
98
|
+
states.push({
|
|
99
|
+
id,
|
|
100
|
+
visible: layer.getVisible(),
|
|
101
|
+
opacity: layer.getOpacity(),
|
|
102
|
+
title
|
|
103
|
+
});
|
|
104
|
+
if (layer.getLayers) {
|
|
105
|
+
layer.getLayers().forEach((child) => processLayer(child));
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
layers.forEach((layer) => processLayer(layer));
|
|
109
|
+
return states;
|
|
110
|
+
};
|
|
111
|
+
const mapManager = inject("mapManager");
|
|
112
|
+
inject("eventBus");
|
|
113
|
+
const layerEventBus = inject("layerEventBus");
|
|
114
|
+
const restoreLayerStates = (states) => {
|
|
115
|
+
if (!map.value || !states || states.length === 0)
|
|
116
|
+
return;
|
|
117
|
+
let restoredCount = 0;
|
|
118
|
+
const allLayers = [];
|
|
119
|
+
const collectLayers = (layers) => {
|
|
120
|
+
layers.forEach((layer) => {
|
|
121
|
+
allLayers.push(layer);
|
|
122
|
+
if (layer.getLayers) {
|
|
123
|
+
collectLayers(layer.getLayers().getArray());
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
collectLayers(map.value.getLayers().getArray());
|
|
128
|
+
states.forEach((state) => {
|
|
129
|
+
var _a, _b;
|
|
130
|
+
const layer = allLayers.find((l) => {
|
|
131
|
+
const id = l.get("id") || getUid(l).toString();
|
|
132
|
+
return id === state.id || state.title && l.get("title") === state.title;
|
|
133
|
+
});
|
|
134
|
+
if (layer) {
|
|
135
|
+
if (layer.getVisible() !== state.visible) {
|
|
136
|
+
layer.setVisible(state.visible);
|
|
137
|
+
const layerId = layer.get("id") || getUid(layer).toString();
|
|
138
|
+
const layerName = layer.get("name") || layer.get("title") || "未命名图层";
|
|
139
|
+
const layerType = layer.get("type") || "unknown";
|
|
140
|
+
if ((_a = mapManager == null ? void 0 : mapManager.value) == null ? void 0 : _a.layerManager) {
|
|
141
|
+
mapManager.value.layerManager.setLayerVisible(layerId, state.visible);
|
|
142
|
+
}
|
|
143
|
+
if (layerEventBus) {
|
|
144
|
+
layerEventBus.emit("layer-visibility-changed", {
|
|
145
|
+
layerId,
|
|
146
|
+
visible: state.visible,
|
|
147
|
+
layerName,
|
|
148
|
+
layerType
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (Math.abs(layer.getOpacity() - state.opacity) > 0.01) {
|
|
153
|
+
layer.setOpacity(state.opacity);
|
|
154
|
+
const layerId = layer.get("id") || getUid(layer).toString();
|
|
155
|
+
if ((_b = mapManager == null ? void 0 : mapManager.value) == null ? void 0 : _b.layerManager) {
|
|
156
|
+
mapManager.value.layerManager.setLayerOpacity(layerId, state.opacity);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
restoredCount++;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
if (restoredCount < states.length) {
|
|
163
|
+
console.warn(
|
|
164
|
+
`部分图层状态未恢复: 仅恢复 ${restoredCount}/${states.length} 个图层`
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
const generateThumbnail = () => {
|
|
169
|
+
if (!map.value)
|
|
170
|
+
return "";
|
|
171
|
+
try {
|
|
172
|
+
const mapCanvas = map.value.getViewport().querySelector("canvas");
|
|
173
|
+
if (mapCanvas) {
|
|
174
|
+
const canvas = document.createElement("canvas");
|
|
175
|
+
const ctx = canvas.getContext("2d");
|
|
176
|
+
const width = 300;
|
|
177
|
+
const height = width * (mapCanvas.height / mapCanvas.width);
|
|
178
|
+
canvas.width = width;
|
|
179
|
+
canvas.height = height;
|
|
180
|
+
if (ctx) {
|
|
181
|
+
ctx.drawImage(mapCanvas, 0, 0, width, height);
|
|
182
|
+
return canvas.toDataURL("image/jpeg", 0.7);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
} catch (error) {
|
|
186
|
+
console.error("生成缩略图失败:", error);
|
|
187
|
+
}
|
|
188
|
+
return "";
|
|
189
|
+
};
|
|
82
190
|
const categories = computed(() => {
|
|
83
191
|
const cats = [...new Set(bookmarks.value.map((b) => b.category))];
|
|
84
192
|
return cats.filter((cat) => cat);
|
|
@@ -92,7 +200,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
92
200
|
);
|
|
93
201
|
}
|
|
94
202
|
if (filterCategory.value) {
|
|
95
|
-
result = result.filter(
|
|
203
|
+
result = result.filter(
|
|
204
|
+
(bookmark) => bookmark.category === filterCategory.value
|
|
205
|
+
);
|
|
96
206
|
}
|
|
97
207
|
result.sort((a, b) => {
|
|
98
208
|
switch (sortBy.value) {
|
|
@@ -113,12 +223,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
113
223
|
return bookmarks.value.filter((bookmark) => bookmark.createTime >= today).length;
|
|
114
224
|
});
|
|
115
225
|
const totalUseCount = computed(() => {
|
|
116
|
-
return bookmarks.value.reduce(
|
|
226
|
+
return bookmarks.value.reduce(
|
|
227
|
+
(total, bookmark) => total + bookmark.useCount,
|
|
228
|
+
0
|
|
229
|
+
);
|
|
117
230
|
});
|
|
118
231
|
const handleSearch = () => {
|
|
119
232
|
};
|
|
120
233
|
const showAddBookmark = () => {
|
|
121
234
|
editingIndex.value = -1;
|
|
235
|
+
const thumbnail = generateThumbnail();
|
|
122
236
|
Object.assign(bookmarkForm, {
|
|
123
237
|
name: "",
|
|
124
238
|
category: "默认",
|
|
@@ -126,8 +240,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
126
240
|
centerLon: 116.407526,
|
|
127
241
|
centerLat: 39.90403,
|
|
128
242
|
zoom: 10,
|
|
129
|
-
rotation: 0
|
|
243
|
+
rotation: 0,
|
|
244
|
+
thumbnail,
|
|
245
|
+
saveLayerState: true
|
|
130
246
|
});
|
|
247
|
+
if (map.value) {
|
|
248
|
+
const view = map.value.getView();
|
|
249
|
+
const center = view.getCenter();
|
|
250
|
+
const zoom = view.getZoom();
|
|
251
|
+
const rotation = view.getRotation();
|
|
252
|
+
const projection = view.getProjection().getCode();
|
|
253
|
+
const lonLat = projection === "EPSG:4326" || projection === "EPSG:4490" ? center : toLonLat(center);
|
|
254
|
+
Object.assign(bookmarkForm, {
|
|
255
|
+
centerLon: lonLat[0],
|
|
256
|
+
centerLat: lonLat[1],
|
|
257
|
+
zoom,
|
|
258
|
+
rotation: rotation * 180 / Math.PI
|
|
259
|
+
// 转换为角度
|
|
260
|
+
});
|
|
261
|
+
}
|
|
131
262
|
showBookmarkForm.value = true;
|
|
132
263
|
};
|
|
133
264
|
const editBookmark = (bookmark, index) => {
|
|
@@ -139,7 +270,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
139
270
|
centerLon: bookmark.center[0],
|
|
140
271
|
centerLat: bookmark.center[1],
|
|
141
272
|
zoom: bookmark.zoom,
|
|
142
|
-
rotation: bookmark.rotation
|
|
273
|
+
rotation: bookmark.rotation,
|
|
274
|
+
thumbnail: bookmark.thumbnail || "",
|
|
275
|
+
saveLayerState: !!(bookmark.layerStates && bookmark.layerStates.length > 0)
|
|
143
276
|
});
|
|
144
277
|
showBookmarkForm.value = true;
|
|
145
278
|
};
|
|
@@ -148,16 +281,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
148
281
|
console.error("请输入书签名称");
|
|
149
282
|
return;
|
|
150
283
|
}
|
|
284
|
+
const layerStates = bookmarkForm.saveLayerState ? getLayerStates() : void 0;
|
|
151
285
|
const bookmarkData = {
|
|
152
286
|
id: editingIndex.value >= 0 ? bookmarks.value[editingIndex.value].id : Date.now().toString(),
|
|
153
287
|
name: bookmarkForm.name,
|
|
154
288
|
category: bookmarkForm.category || "默认",
|
|
155
289
|
description: bookmarkForm.description,
|
|
156
|
-
center: [
|
|
290
|
+
center: [
|
|
291
|
+
Number(bookmarkForm.centerLon),
|
|
292
|
+
Number(bookmarkForm.centerLat)
|
|
293
|
+
],
|
|
157
294
|
zoom: bookmarkForm.zoom,
|
|
158
295
|
rotation: bookmarkForm.rotation,
|
|
159
296
|
useCount: editingIndex.value >= 0 ? bookmarks.value[editingIndex.value].useCount : 0,
|
|
160
|
-
createTime: editingIndex.value >= 0 ? bookmarks.value[editingIndex.value].createTime : /* @__PURE__ */ new Date()
|
|
297
|
+
createTime: editingIndex.value >= 0 ? bookmarks.value[editingIndex.value].createTime : /* @__PURE__ */ new Date(),
|
|
298
|
+
thumbnail: bookmarkForm.thumbnail,
|
|
299
|
+
layerStates
|
|
161
300
|
};
|
|
162
301
|
if (editingIndex.value >= 0) {
|
|
163
302
|
bookmarks.value[editingIndex.value] = bookmarkData;
|
|
@@ -174,6 +313,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
174
313
|
};
|
|
175
314
|
const applyBookmark = (bookmark) => {
|
|
176
315
|
bookmark.useCount++;
|
|
316
|
+
if (map.value) {
|
|
317
|
+
const view = map.value.getView();
|
|
318
|
+
const projection = view.getProjection().getCode();
|
|
319
|
+
const center = projection === "EPSG:4326" || projection === "EPSG:4490" ? bookmark.center : fromLonLat(bookmark.center);
|
|
320
|
+
view.animate({
|
|
321
|
+
center,
|
|
322
|
+
zoom: bookmark.zoom,
|
|
323
|
+
rotation: bookmark.rotation * Math.PI / 180,
|
|
324
|
+
// 转换为弧度
|
|
325
|
+
duration: 1e3
|
|
326
|
+
});
|
|
327
|
+
if (bookmark.layerStates && bookmark.layerStates.length > 0) {
|
|
328
|
+
restoreLayerStates(bookmark.layerStates);
|
|
329
|
+
ElMessage.success(`已应用视角并恢复图层状态`);
|
|
330
|
+
} else {
|
|
331
|
+
ElMessage.success(`已应用视角`);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
177
334
|
emit("bookmark-action", {
|
|
178
335
|
action: "apply",
|
|
179
336
|
bookmark
|
|
@@ -181,15 +338,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
181
338
|
console.log(`已应用视角: ${bookmark.name}`);
|
|
182
339
|
};
|
|
183
340
|
const deleteBookmark = (index) => {
|
|
184
|
-
ElMessageBox.confirm(
|
|
185
|
-
"
|
|
186
|
-
"
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
cancelButtonText: "取消",
|
|
190
|
-
type: "warning"
|
|
191
|
-
}
|
|
192
|
-
).then(() => {
|
|
341
|
+
ElMessageBox.confirm("确定要删除这个书签吗?", "确认删除", {
|
|
342
|
+
confirmButtonText: "确定",
|
|
343
|
+
cancelButtonText: "取消",
|
|
344
|
+
type: "warning"
|
|
345
|
+
}).then(() => {
|
|
193
346
|
const bookmark = bookmarks.value[index];
|
|
194
347
|
bookmarks.value.splice(index, 1);
|
|
195
348
|
emit("bookmark-action", {
|
|
@@ -201,15 +354,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
201
354
|
});
|
|
202
355
|
};
|
|
203
356
|
const clearAllBookmarks = () => {
|
|
204
|
-
ElMessageBox.confirm(
|
|
205
|
-
"
|
|
206
|
-
"
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
cancelButtonText: "取消",
|
|
210
|
-
type: "warning"
|
|
211
|
-
}
|
|
212
|
-
).then(() => {
|
|
357
|
+
ElMessageBox.confirm("确定要清空所有书签吗?此操作不可恢复!", "确认清空", {
|
|
358
|
+
confirmButtonText: "确定",
|
|
359
|
+
cancelButtonText: "取消",
|
|
360
|
+
type: "warning"
|
|
361
|
+
}).then(() => {
|
|
213
362
|
bookmarks.value = [];
|
|
214
363
|
emit("bookmark-action", {
|
|
215
364
|
action: "clear"
|
|
@@ -285,7 +434,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
285
434
|
const _component_el_col = resolveComponent("el-col");
|
|
286
435
|
const _component_el_row = resolveComponent("el-row");
|
|
287
436
|
const _component_el_form_item = resolveComponent("el-form-item");
|
|
288
|
-
const
|
|
437
|
+
const _component_el_checkbox = resolveComponent("el-checkbox");
|
|
289
438
|
const _component_el_form = resolveComponent("el-form");
|
|
290
439
|
const _component_EPlusDialog = resolveComponent("EPlusDialog");
|
|
291
440
|
return openBlock(), createBlock(_component_EPlusDialog, {
|
|
@@ -296,13 +445,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
296
445
|
"before-close": handleClose,
|
|
297
446
|
"show-modal": false,
|
|
298
447
|
"modal-class": ["pointer-events-none"],
|
|
299
|
-
|
|
448
|
+
"cache-id": "bookmarks-dialog",
|
|
300
449
|
class: "bookmarks-dialog"
|
|
301
450
|
}, {
|
|
302
451
|
footer: withCtx(() => [
|
|
303
|
-
createElementVNode("div",
|
|
452
|
+
createElementVNode("div", _hoisted_21, [
|
|
304
453
|
createVNode(_component_el_button, { onClick: handleClose }, {
|
|
305
|
-
default: withCtx(() => [..._cache[
|
|
454
|
+
default: withCtx(() => [..._cache[24] || (_cache[24] = [
|
|
306
455
|
createTextVNode("关闭", -1)
|
|
307
456
|
])]),
|
|
308
457
|
_: 1
|
|
@@ -342,8 +491,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
342
491
|
}, 8, ["icon"]),
|
|
343
492
|
createVNode(_component_el_button, {
|
|
344
493
|
icon: unref(delete_default),
|
|
345
|
-
|
|
346
|
-
|
|
494
|
+
disabled: bookmarks.value.length === 0,
|
|
495
|
+
onClick: clearAllBookmarks
|
|
347
496
|
}, {
|
|
348
497
|
default: withCtx(() => [..._cache[16] || (_cache[16] = [
|
|
349
498
|
createTextVNode(" 清空全部 ", -1)
|
|
@@ -358,8 +507,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
358
507
|
placeholder: "搜索书签名称或描述...",
|
|
359
508
|
"prefix-icon": unref(search_default),
|
|
360
509
|
clearable: "",
|
|
361
|
-
|
|
362
|
-
|
|
510
|
+
style: { "width": "300px" },
|
|
511
|
+
onInput: handleSearch
|
|
363
512
|
}, null, 8, ["modelValue", "prefix-icon"]),
|
|
364
513
|
createVNode(_component_el_select, {
|
|
365
514
|
modelValue: filterCategory.value,
|
|
@@ -414,7 +563,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
414
563
|
onClick: ($event) => applyBookmark(bookmark)
|
|
415
564
|
}, [
|
|
416
565
|
createElementVNode("div", _hoisted_6, [
|
|
417
|
-
|
|
566
|
+
bookmark.thumbnail ? (openBlock(), createElementBlock("img", {
|
|
567
|
+
key: 0,
|
|
568
|
+
src: bookmark.thumbnail,
|
|
569
|
+
class: "thumbnail-image"
|
|
570
|
+
}, null, 8, _hoisted_7)) : (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
418
571
|
createVNode(_component_el_icon, {
|
|
419
572
|
size: "40",
|
|
420
573
|
color: "#409eff"
|
|
@@ -424,8 +577,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
424
577
|
]),
|
|
425
578
|
_: 1
|
|
426
579
|
})
|
|
427
|
-
]),
|
|
428
|
-
createElementVNode("div",
|
|
580
|
+
])),
|
|
581
|
+
createElementVNode("div", _hoisted_9, [
|
|
429
582
|
createVNode(_component_el_button_group, null, {
|
|
430
583
|
default: withCtx(() => [
|
|
431
584
|
createVNode(_component_el_button, {
|
|
@@ -452,8 +605,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
452
605
|
createVNode(_component_el_button, {
|
|
453
606
|
size: "small",
|
|
454
607
|
icon: unref(delete_default),
|
|
455
|
-
|
|
456
|
-
|
|
608
|
+
class: "delete-btn",
|
|
609
|
+
onClick: withModifiers(($event) => deleteBookmark(index), ["stop"])
|
|
457
610
|
}, {
|
|
458
611
|
default: withCtx(() => [..._cache[19] || (_cache[19] = [
|
|
459
612
|
createTextVNode(" 删除 ", -1)
|
|
@@ -465,9 +618,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
465
618
|
}, 1024)
|
|
466
619
|
])
|
|
467
620
|
]),
|
|
468
|
-
createElementVNode("div",
|
|
469
|
-
createElementVNode("div",
|
|
470
|
-
createElementVNode("div",
|
|
621
|
+
createElementVNode("div", _hoisted_10, [
|
|
622
|
+
createElementVNode("div", _hoisted_11, toDisplayString(bookmark.name), 1),
|
|
623
|
+
createElementVNode("div", _hoisted_12, [
|
|
471
624
|
createVNode(_component_el_tag, {
|
|
472
625
|
size: "small",
|
|
473
626
|
type: "info"
|
|
@@ -477,11 +630,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
477
630
|
]),
|
|
478
631
|
_: 2
|
|
479
632
|
}, 1024),
|
|
480
|
-
createElementVNode("span",
|
|
633
|
+
createElementVNode("span", _hoisted_13, "使用 " + toDisplayString(bookmark.useCount) + " 次", 1)
|
|
481
634
|
]),
|
|
482
|
-
createElementVNode("div",
|
|
483
|
-
createElementVNode("div",
|
|
484
|
-
createElementVNode("span",
|
|
635
|
+
createElementVNode("div", _hoisted_14, toDisplayString(bookmark.description), 1),
|
|
636
|
+
createElementVNode("div", _hoisted_15, [
|
|
637
|
+
createElementVNode("span", _hoisted_16, [
|
|
485
638
|
createVNode(_component_el_icon, null, {
|
|
486
639
|
default: withCtx(() => [
|
|
487
640
|
createVNode(unref(location_default))
|
|
@@ -490,7 +643,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
490
643
|
}),
|
|
491
644
|
createTextVNode(" " + toDisplayString(bookmark.center[0].toFixed(4)) + ", " + toDisplayString(bookmark.center[1].toFixed(4)), 1)
|
|
492
645
|
]),
|
|
493
|
-
createElementVNode("span",
|
|
646
|
+
createElementVNode("span", _hoisted_17, [
|
|
494
647
|
createVNode(_component_el_icon, null, {
|
|
495
648
|
default: withCtx(() => [
|
|
496
649
|
createVNode(unref(zoom_in_default))
|
|
@@ -500,12 +653,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
500
653
|
createTextVNode(" 缩放: " + toDisplayString(bookmark.zoom), 1)
|
|
501
654
|
])
|
|
502
655
|
]),
|
|
503
|
-
createElementVNode("div",
|
|
656
|
+
createElementVNode("div", _hoisted_18, toDisplayString(formatTime(bookmark.createTime)), 1)
|
|
504
657
|
])
|
|
505
658
|
], 8, _hoisted_5);
|
|
506
659
|
}), 128))
|
|
507
660
|
]),
|
|
508
|
-
filteredBookmarks.value.length === 0 ? (openBlock(), createElementBlock("div",
|
|
661
|
+
filteredBookmarks.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_19, [
|
|
509
662
|
createVNode(_component_el_empty, { description: "暂无书签" }, {
|
|
510
663
|
default: withCtx(() => [
|
|
511
664
|
createVNode(_component_el_button, {
|
|
@@ -521,7 +674,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
521
674
|
_: 1
|
|
522
675
|
})
|
|
523
676
|
])) : createCommentVNode("", true),
|
|
524
|
-
bookmarks.value.length > 0 ? (openBlock(), createElementBlock("div",
|
|
677
|
+
bookmarks.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_20, [
|
|
525
678
|
createVNode(_component_el_row, { gutter: 20 }, {
|
|
526
679
|
default: withCtx(() => [
|
|
527
680
|
createVNode(_component_el_col, { span: 6 }, {
|
|
@@ -570,14 +723,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
570
723
|
"onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => showBookmarkForm.value = $event),
|
|
571
724
|
title: editingIndex.value >= 0 ? "编辑书签" : "保存视角书签",
|
|
572
725
|
width: "450px",
|
|
573
|
-
|
|
726
|
+
"cache-id": "bookmark-form",
|
|
574
727
|
"show-modal": false
|
|
575
728
|
}, {
|
|
576
729
|
footer: withCtx(() => [
|
|
577
730
|
createVNode(_component_el_button, {
|
|
578
731
|
onClick: _cache[10] || (_cache[10] = ($event) => showBookmarkForm.value = false)
|
|
579
732
|
}, {
|
|
580
|
-
default: withCtx(() => [..._cache[
|
|
733
|
+
default: withCtx(() => [..._cache[22] || (_cache[22] = [
|
|
581
734
|
createTextVNode("取消", -1)
|
|
582
735
|
])]),
|
|
583
736
|
_: 1
|
|
@@ -586,7 +739,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
586
739
|
type: "primary",
|
|
587
740
|
onClick: saveBookmark
|
|
588
741
|
}, {
|
|
589
|
-
default: withCtx(() => [..._cache[
|
|
742
|
+
default: withCtx(() => [..._cache[23] || (_cache[23] = [
|
|
590
743
|
createTextVNode("保存", -1)
|
|
591
744
|
])]),
|
|
592
745
|
_: 1
|
|
@@ -649,27 +802,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
649
802
|
}),
|
|
650
803
|
createVNode(_component_el_form_item, { label: "中心点" }, {
|
|
651
804
|
default: withCtx(() => [
|
|
652
|
-
createVNode(_component_el_row, {
|
|
805
|
+
createVNode(_component_el_row, {
|
|
806
|
+
gutter: 10,
|
|
807
|
+
style: { "width": "100%", "margin": "0" }
|
|
808
|
+
}, {
|
|
653
809
|
default: withCtx(() => [
|
|
654
|
-
createVNode(_component_el_col, {
|
|
810
|
+
createVNode(_component_el_col, {
|
|
811
|
+
span: 12,
|
|
812
|
+
style: { "padding-left": "0" }
|
|
813
|
+
}, {
|
|
655
814
|
default: withCtx(() => [
|
|
656
815
|
createVNode(_component_el_input, {
|
|
657
816
|
modelValue: bookmarkForm.centerLon,
|
|
658
817
|
"onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => bookmarkForm.centerLon = $event),
|
|
659
|
-
|
|
660
|
-
step: "0.000001",
|
|
818
|
+
readonly: "",
|
|
661
819
|
placeholder: "经度"
|
|
662
820
|
}, null, 8, ["modelValue"])
|
|
663
821
|
]),
|
|
664
822
|
_: 1
|
|
665
823
|
}),
|
|
666
|
-
createVNode(_component_el_col, {
|
|
824
|
+
createVNode(_component_el_col, {
|
|
825
|
+
span: 12,
|
|
826
|
+
style: { "padding-right": "0" }
|
|
827
|
+
}, {
|
|
667
828
|
default: withCtx(() => [
|
|
668
829
|
createVNode(_component_el_input, {
|
|
669
830
|
modelValue: bookmarkForm.centerLat,
|
|
670
831
|
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => bookmarkForm.centerLat = $event),
|
|
671
|
-
|
|
672
|
-
step: "0.000001",
|
|
832
|
+
readonly: "",
|
|
673
833
|
placeholder: "纬度"
|
|
674
834
|
}, null, 8, ["modelValue"])
|
|
675
835
|
]),
|
|
@@ -681,29 +841,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
681
841
|
]),
|
|
682
842
|
_: 1
|
|
683
843
|
}),
|
|
684
|
-
createVNode(_component_el_form_item, { label: "
|
|
844
|
+
createVNode(_component_el_form_item, { label: "旋转角度" }, {
|
|
685
845
|
default: withCtx(() => [
|
|
686
|
-
createVNode(
|
|
687
|
-
modelValue: bookmarkForm.
|
|
688
|
-
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => bookmarkForm.
|
|
689
|
-
|
|
690
|
-
max: 20,
|
|
691
|
-
step: 0.1,
|
|
692
|
-
"show-input": ""
|
|
846
|
+
createVNode(_component_el_input, {
|
|
847
|
+
modelValue: bookmarkForm.rotation,
|
|
848
|
+
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => bookmarkForm.rotation = $event),
|
|
849
|
+
readonly: ""
|
|
693
850
|
}, null, 8, ["modelValue"])
|
|
694
851
|
]),
|
|
695
852
|
_: 1
|
|
696
853
|
}),
|
|
697
|
-
createVNode(_component_el_form_item,
|
|
854
|
+
createVNode(_component_el_form_item, null, {
|
|
698
855
|
default: withCtx(() => [
|
|
699
|
-
createVNode(
|
|
700
|
-
modelValue: bookmarkForm.
|
|
701
|
-
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => bookmarkForm.
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
856
|
+
createVNode(_component_el_checkbox, {
|
|
857
|
+
modelValue: bookmarkForm.saveLayerState,
|
|
858
|
+
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => bookmarkForm.saveLayerState = $event)
|
|
859
|
+
}, {
|
|
860
|
+
default: withCtx(() => [..._cache[21] || (_cache[21] = [
|
|
861
|
+
createTextVNode("保存当前图层状态(可见性、透明度)", -1)
|
|
862
|
+
])]),
|
|
863
|
+
_: 1
|
|
864
|
+
}, 8, ["modelValue"])
|
|
707
865
|
]),
|
|
708
866
|
_: 1
|
|
709
867
|
})
|