vue-openlayers-plugin 1.0.82 → 1.0.85
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-3f78db9f.mjs +280 -0
- package/lib/CoordinateLocationDialog-d265fbae.mjs +263 -0
- package/lib/FilterPanel-136dc7d8.mjs +6 -0
- package/lib/LayerPanel-58997ef0.mjs +6 -0
- package/lib/MapPrintDialog-6ed0e095.mjs +6 -0
- package/lib/MeasurementDialog-b86c21c6.mjs +369 -0
- package/lib/MyMarkersDialog-fbbd0aeb.mjs +584 -0
- package/lib/RegionNavigationDialog-0808549f.mjs +1320 -0
- package/lib/ViewBookmarksDialog-94010687.mjs +723 -0
- package/lib/index-14efa785.mjs +756 -0
- package/lib/{index-61901e1f.mjs → index-5a13e877.mjs} +50503 -53903
- package/lib/index-5b1583d0.mjs +839 -0
- package/lib/{index.es-c17b5917.mjs → index.es-0c397170.mjs} +1 -1
- package/lib/index.esm.js +65 -56
- package/lib/index.umd.js +73180 -71503
- package/lib/style.css +1705 -1704
- package/package.json +11 -5
- package/types/src/assets/index.d.ts +9 -0
- package/types/src/assets/index.d.ts.map +1 -0
- package/types/src/components/CustomDialog/CustomDialog.vue.d.ts +16 -16
- package/types/src/components/CustomDialog/icons/index.d.ts +14 -0
- package/types/src/components/CustomDialog/icons/index.d.ts.map +1 -0
- package/types/src/components/OlBaseLayerSwitcher.vue.d.ts +19 -0
- package/types/src/components/OlBaseLayerSwitcher.vue.d.ts.map +1 -0
- package/types/src/components/OlControlPanel.vue.d.ts +63 -0
- package/types/src/components/OlControlPanel.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/BasemapPanel.vue.d.ts +20 -0
- package/types/src/components/OlDialogs/BasemapPanel.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/CoordinateLocationDialog.vue.d.ts +21 -0
- package/types/src/components/OlDialogs/CoordinateLocationDialog.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/DialogManager.d.ts +58 -0
- package/types/src/components/OlDialogs/DialogManager.d.ts.map +1 -0
- package/types/src/components/OlDialogs/FilterPanel.vue.d.ts +33 -0
- package/types/src/components/OlDialogs/FilterPanel.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/LayerPanel.vue.d.ts +1345 -0
- package/types/src/components/OlDialogs/LayerPanel.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/LayerStyleConfig.vue.d.ts +23 -0
- package/types/src/components/OlDialogs/LayerStyleConfig.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/LayerTreeNode.vue.d.ts +28 -0
- package/types/src/components/OlDialogs/LayerTreeNode.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/MapDrawingDialog/components/ListTab.vue.d.ts +3 -0
- package/types/src/components/OlDialogs/MapDrawingDialog/components/ListTab.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/MapDrawingDialog/components/MarkTab.vue.d.ts +3 -0
- package/types/src/components/OlDialogs/MapDrawingDialog/components/MarkTab.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/MapDrawingDialog/index.vue.d.ts +3 -0
- package/types/src/components/OlDialogs/MapDrawingDialog/index.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/MapPrintDialog.vue.d.ts +24 -0
- package/types/src/components/OlDialogs/MapPrintDialog.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/MeasurementDialog.vue.d.ts +41 -0
- package/types/src/components/OlDialogs/MeasurementDialog.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/MyMarkersDialog.vue.d.ts +21 -0
- package/types/src/components/OlDialogs/MyMarkersDialog.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/RegionNavigationDialog.vue.d.ts +25 -0
- package/types/src/components/OlDialogs/RegionNavigationDialog.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/ViewBookmarksDialog.vue.d.ts +21 -0
- package/types/src/components/OlDialogs/ViewBookmarksDialog.vue.d.ts.map +1 -0
- package/types/src/components/OlDialogs/registry.d.ts +39 -0
- package/types/src/components/OlDialogs/registry.d.ts.map +1 -0
- package/types/src/components/OlDrawToolbar.vue.d.ts +61 -0
- package/types/src/components/OlDrawToolbar.vue.d.ts.map +1 -0
- package/types/src/components/OlLegendPanel.vue.d.ts +69 -0
- package/types/src/components/OlLegendPanel.vue.d.ts.map +1 -0
- package/types/src/components/OlMapContainer.vue.d.ts +112 -0
- package/types/src/components/OlMapContainer.vue.d.ts.map +1 -0
- package/types/src/components/OlMapPopup/ArrayPopup.vue.d.ts +47 -0
- package/types/src/components/OlMapPopup/ArrayPopup.vue.d.ts.map +1 -0
- package/types/src/components/OlMapPopup/BasePopup.vue.d.ts +63 -0
- package/types/src/components/OlMapPopup/BasePopup.vue.d.ts.map +1 -0
- package/types/src/components/OlMapPopup/HtmlPopup.vue.d.ts +45 -0
- package/types/src/components/OlMapPopup/HtmlPopup.vue.d.ts.map +1 -0
- package/types/src/components/OlMapPopup/ImagePopup.vue.d.ts +45 -0
- package/types/src/components/OlMapPopup/ImagePopup.vue.d.ts.map +1 -0
- package/types/src/components/OlMapPopup/index.d.ts +9 -0
- package/types/src/components/OlMapPopup/index.d.ts.map +1 -0
- package/types/src/components/OlMapPopup/types.d.ts +118 -0
- package/types/src/components/OlMapPopup/types.d.ts.map +1 -0
- package/types/src/components/OlMapSearch.vue.d.ts +126 -0
- package/types/src/components/OlMapSearch.vue.d.ts.map +1 -0
- package/types/src/components/OlMapTooltip.vue.d.ts +70 -0
- package/types/src/components/OlMapTooltip.vue.d.ts.map +1 -0
- package/types/src/core/EventBus.d.ts +66 -0
- package/types/src/core/EventBus.d.ts.map +1 -0
- package/types/src/core/EventManager.d.ts +147 -0
- package/types/src/core/EventManager.d.ts.map +1 -0
- package/types/src/core/FeatureHighlightManager.d.ts +103 -0
- package/types/src/core/FeatureHighlightManager.d.ts.map +1 -0
- package/types/src/core/GlobalStyleManager.d.ts +76 -0
- package/types/src/core/GlobalStyleManager.d.ts.map +1 -0
- package/types/src/core/LayerConfigManager.d.ts +66 -0
- package/types/src/core/LayerConfigManager.d.ts.map +1 -0
- package/types/src/core/LayerManager.d.ts +198 -0
- package/types/src/core/LayerManager.d.ts.map +1 -0
- package/types/src/core/LayerTreeManager.d.ts +125 -0
- package/types/src/core/LayerTreeManager.d.ts.map +1 -0
- package/types/src/core/MapManager.d.ts +203 -0
- package/types/src/core/MapManager.d.ts.map +1 -0
- package/types/src/core/MarkerDrawingAdapter.d.ts +125 -0
- package/types/src/core/MarkerDrawingAdapter.d.ts.map +1 -0
- package/types/src/core/PluginManager.d.ts +158 -0
- package/types/src/core/PluginManager.d.ts.map +1 -0
- package/types/src/core/PopupManager.d.ts +110 -0
- package/types/src/core/PopupManager.d.ts.map +1 -0
- package/types/src/core/SearchMarkerManager.d.ts +96 -0
- package/types/src/core/SearchMarkerManager.d.ts.map +1 -0
- package/types/src/core/TooltipHelper.d.ts +134 -0
- package/types/src/core/TooltipHelper.d.ts.map +1 -0
- package/types/src/core/amapSearchApi.d.ts +57 -0
- package/types/src/core/amapSearchApi.d.ts.map +1 -0
- package/types/src/core/basemapManager.d.ts +63 -0
- package/types/src/core/basemapManager.d.ts.map +1 -0
- package/types/src/core/configLoader.d.ts +159 -0
- package/types/src/core/configLoader.d.ts.map +1 -0
- package/types/src/core/drawing/BaseDrawing.d.ts +255 -0
- package/types/src/core/drawing/BaseDrawing.d.ts.map +1 -0
- package/types/src/core/drawing/DrawingManager.d.ts +394 -0
- package/types/src/core/drawing/DrawingManager.d.ts.map +1 -0
- package/types/src/core/drawing/IconDrawing.d.ts +188 -0
- package/types/src/core/drawing/IconDrawing.d.ts.map +1 -0
- package/types/src/core/drawing/ImageDrawing.d.ts +193 -0
- package/types/src/core/drawing/ImageDrawing.d.ts.map +1 -0
- package/types/src/core/drawing/LineDrawing.d.ts +193 -0
- package/types/src/core/drawing/LineDrawing.d.ts.map +1 -0
- package/types/src/core/drawing/MilitaryDrawing.d.ts +175 -0
- package/types/src/core/drawing/MilitaryDrawing.d.ts.map +1 -0
- package/types/src/core/drawing/MultiLineStringDrawing.d.ts +294 -0
- package/types/src/core/drawing/MultiLineStringDrawing.d.ts.map +1 -0
- package/types/src/core/drawing/MultiPointDrawing.d.ts +244 -0
- package/types/src/core/drawing/MultiPointDrawing.d.ts.map +1 -0
- package/types/src/core/drawing/MultiPolygonDrawing.d.ts +206 -0
- package/types/src/core/drawing/MultiPolygonDrawing.d.ts.map +1 -0
- package/types/src/core/drawing/PointDrawing.d.ts +175 -0
- package/types/src/core/drawing/PointDrawing.d.ts.map +1 -0
- package/types/src/core/drawing/PointWithTextDrawing.d.ts +183 -0
- package/types/src/core/drawing/PointWithTextDrawing.d.ts.map +1 -0
- package/types/src/core/drawing/PolygonDrawing.d.ts +240 -0
- package/types/src/core/drawing/PolygonDrawing.d.ts.map +1 -0
- package/types/src/core/drawing/TextDrawing.d.ts +164 -0
- package/types/src/core/drawing/TextDrawing.d.ts.map +1 -0
- package/types/src/core/drawing/index.d.ts +525 -0
- package/types/src/core/drawing/index.d.ts.map +1 -0
- package/types/src/core/geoJsonLocationTool.d.ts +116 -0
- package/types/src/core/geoJsonLocationTool.d.ts.map +1 -0
- package/types/src/core/layers/BaseLayer.d.ts +162 -0
- package/types/src/core/layers/BaseLayer.d.ts.map +1 -0
- package/types/src/core/layers/CanvasLayerHandler.d.ts +65 -0
- package/types/src/core/layers/CanvasLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/ClusterLayerHandler.d.ts +122 -0
- package/types/src/core/layers/ClusterLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/GMLLayerHandler.d.ts +107 -0
- package/types/src/core/layers/GMLLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/GeoJSONLayerHandler.d.ts +125 -0
- package/types/src/core/layers/GeoJSONLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/HeatmapLayerHandler.d.ts +86 -0
- package/types/src/core/layers/HeatmapLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/ImageVectorLayerHandler.d.ts +77 -0
- package/types/src/core/layers/ImageVectorLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/KMLLayerHandler.d.ts +95 -0
- package/types/src/core/layers/KMLLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/LayerFactory.d.ts +63 -0
- package/types/src/core/layers/LayerFactory.d.ts.map +1 -0
- package/types/src/core/layers/SuperMapServiceTester.d.ts +54 -0
- package/types/src/core/layers/SuperMapServiceTester.d.ts.map +1 -0
- package/types/src/core/layers/SuperMapTiledMapServiceHandler.d.ts +35 -0
- package/types/src/core/layers/SuperMapTiledMapServiceHandler.d.ts.map +1 -0
- package/types/src/core/layers/TiandituConfigHelper.d.ts +120 -0
- package/types/src/core/layers/TiandituConfigHelper.d.ts.map +1 -0
- package/types/src/core/layers/TiandituLayerHandler.d.ts +75 -0
- package/types/src/core/layers/TiandituLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/TileLayerHandler.d.ts +42 -0
- package/types/src/core/layers/TileLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/TileSuperMapRestHandler.d.ts +161 -0
- package/types/src/core/layers/TileSuperMapRestHandler.d.ts.map +1 -0
- package/types/src/core/layers/VectorTileLayerHandler.d.ts +126 -0
- package/types/src/core/layers/VectorTileLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/WFSLayerHandler.d.ts +80 -0
- package/types/src/core/layers/WFSLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/WKTLayerHandler.d.ts +123 -0
- package/types/src/core/layers/WKTLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/WMSLayerHandler.d.ts +78 -0
- package/types/src/core/layers/WMSLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/WMTSLayerHandler.d.ts +44 -0
- package/types/src/core/layers/WMTSLayerHandler.d.ts.map +1 -0
- package/types/src/core/layers/index.d.ts +20 -0
- package/types/src/core/layers/index.d.ts.map +1 -0
- package/types/src/core/layers/interfaces.d.ts +95 -0
- package/types/src/core/layers/interfaces.d.ts.map +1 -0
- package/types/src/core/mapOperationTool.d.ts +145 -0
- package/types/src/core/mapOperationTool.d.ts.map +1 -0
- package/types/src/core/measurementTool.d.ts +136 -0
- package/types/src/core/measurementTool.d.ts.map +1 -0
- package/types/src/core/overviewMapUtil.d.ts +62 -0
- package/types/src/core/overviewMapUtil.d.ts.map +1 -0
- package/types/src/core/proxyHelper.d.ts +66 -0
- package/types/src/core/proxyHelper.d.ts.map +1 -0
- package/types/src/core/storage.d.ts +139 -0
- package/types/src/core/storage.d.ts.map +1 -0
- package/types/src/core/styles/StyleFactory.d.ts +74 -0
- package/types/src/core/styles/StyleFactory.d.ts.map +1 -0
- package/types/src/core/styles/StyleManager.d.ts +77 -0
- package/types/src/core/styles/StyleManager.d.ts.map +1 -0
- package/types/src/core/styles/index.d.ts +67 -0
- package/types/src/core/styles/index.d.ts.map +1 -0
- package/types/src/core/styles/interfaces.d.ts +221 -0
- package/types/src/core/styles/interfaces.d.ts.map +1 -0
- package/types/src/core/tiandituSearchApi.d.ts +51 -0
- package/types/src/core/tiandituSearchApi.d.ts.map +1 -0
- package/types/src/data-old/testLayers.d.ts +84 -0
- package/types/src/data-old/testLayers.d.ts.map +1 -0
- package/types/src/examples-old/FilterExamples.d.ts +104 -0
- package/types/src/examples-old/FilterExamples.d.ts.map +1 -0
- package/types/src/hooks/useMap.d.ts +5 -0
- package/types/src/hooks/useMap.d.ts.map +1 -0
- package/types/src/services/searchService.d.ts +106 -0
- package/types/src/services/searchService.d.ts.map +1 -0
- package/types/src/test-old/FilterSystemTest.d.ts +57 -0
- package/types/src/test-old/FilterSystemTest.d.ts.map +1 -0
- package/types/src/types/index.d.ts +2 -11
- package/types/src/types/index.d.ts.map +1 -1
- package/types/src/types/map.d.ts +819 -0
- package/types/src/types/map.d.ts.map +1 -0
- package/types/src/types/plugin.d.ts +202 -0
- package/types/src/types/plugin.d.ts.map +1 -0
- package/types/src/utils/DiffusionAnimationHelper.d.ts +60 -0
- package/types/src/utils/DiffusionAnimationHelper.d.ts.map +1 -0
- package/types/src/utils/GifAnimationHelper.d.ts +31 -0
- package/types/src/utils/GifAnimationHelper.d.ts.map +1 -0
- package/types/src/utils/coordinateTransform.d.ts +28 -0
- package/types/src/utils/coordinateTransform.d.ts.map +1 -0
- package/types/src/utils/index.d.ts +8 -8
- package/types/src/utils/index.d.ts.map +1 -1
- package/types/src/utils/unitConverter.d.ts +36 -0
- package/types/src/utils/unitConverter.d.ts.map +1 -0
- package/types/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { defineComponent, inject, computed, ref, watch, onMounted, onUnmounted, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString } from "vue";
|
|
2
|
+
import { l as layerEventBus } from "./index-5a13e877.mjs";
|
|
3
|
+
import "ol";
|
|
4
|
+
const _hoisted_1 = { class: "basemap-content" };
|
|
5
|
+
const _hoisted_2 = { class: "basemap-grid" };
|
|
6
|
+
const _hoisted_3 = ["onClick"];
|
|
7
|
+
const _hoisted_4 = { class: "basemap-preview" };
|
|
8
|
+
const _hoisted_5 = ["src", "alt"];
|
|
9
|
+
const _hoisted_6 = { class: "basemap-name" };
|
|
10
|
+
const tdtImgUrl = "";
|
|
11
|
+
const tdtVecUrl = "";
|
|
12
|
+
const gaodeImgUrl = "";
|
|
13
|
+
const gaodeVecUrl = "";
|
|
14
|
+
const bdImgUrl = "";
|
|
15
|
+
const bdVecUrl = "";
|
|
16
|
+
const tencentImgUrl = "";
|
|
17
|
+
const tencentVecUrl = "";
|
|
18
|
+
const osmUrl = "";
|
|
19
|
+
const customBlueUrl = "";
|
|
20
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
21
|
+
__name: "BasemapPanel",
|
|
22
|
+
props: {
|
|
23
|
+
modelValue: { type: Boolean }
|
|
24
|
+
},
|
|
25
|
+
emits: ["update:modelValue"],
|
|
26
|
+
setup(__props, { emit: __emit }) {
|
|
27
|
+
const props = __props;
|
|
28
|
+
const emit = __emit;
|
|
29
|
+
const layerPanelConfig = inject("layerPanelConfig", { baseLayers: [] });
|
|
30
|
+
const visible = computed({
|
|
31
|
+
get: () => props.modelValue,
|
|
32
|
+
set: (value) => {
|
|
33
|
+
if (!value) {
|
|
34
|
+
emit("update:modelValue", false);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const getInitialSelectedBasemap = () => {
|
|
39
|
+
var _a;
|
|
40
|
+
if (((_a = layerPanelConfig.value) == null ? void 0 : _a.baseLayers) && layerPanelConfig.value.baseLayers.length > 0) {
|
|
41
|
+
let lastVisibleBasemap = null;
|
|
42
|
+
for (let i = layerPanelConfig.value.baseLayers.length - 1; i >= 0; i--) {
|
|
43
|
+
const layer = layerPanelConfig.value.baseLayers[i];
|
|
44
|
+
if (layer.visible === true) {
|
|
45
|
+
lastVisibleBasemap = layer.id;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (lastVisibleBasemap) {
|
|
50
|
+
return lastVisibleBasemap;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
};
|
|
55
|
+
const selectedBasemap = ref(getInitialSelectedBasemap());
|
|
56
|
+
const handleClose = () => {
|
|
57
|
+
emit("update:modelValue", false);
|
|
58
|
+
};
|
|
59
|
+
const handleBasemapChanged = (event) => {
|
|
60
|
+
console.log("BasemapPanel: 收到底图切换事件,同步UI状态", event);
|
|
61
|
+
if (selectedBasemap.value !== event.basemapId) {
|
|
62
|
+
selectedBasemap.value = event.basemapId;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
watch(
|
|
66
|
+
() => layerPanelConfig.value,
|
|
67
|
+
() => {
|
|
68
|
+
const newSelectedBasemap = getInitialSelectedBasemap();
|
|
69
|
+
if (selectedBasemap.value !== newSelectedBasemap) {
|
|
70
|
+
selectedBasemap.value = newSelectedBasemap;
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{ deep: true, immediate: false }
|
|
74
|
+
);
|
|
75
|
+
watch(
|
|
76
|
+
() => selectedBasemap.value,
|
|
77
|
+
(newValue, oldValue) => {
|
|
78
|
+
console.log("BasemapPanel: selectedBasemap changed from", oldValue, "to", newValue);
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
onMounted(() => {
|
|
82
|
+
layerEventBus.on("basemap-changed", handleBasemapChanged);
|
|
83
|
+
});
|
|
84
|
+
onUnmounted(() => {
|
|
85
|
+
layerEventBus.off("basemap-changed", handleBasemapChanged);
|
|
86
|
+
});
|
|
87
|
+
const defaultBasemaps = [
|
|
88
|
+
{
|
|
89
|
+
id: "tianditu-img",
|
|
90
|
+
name: "天地图卫星",
|
|
91
|
+
type: "tianditu-img",
|
|
92
|
+
thumbnail: tdtImgUrl
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "tianditu-vec",
|
|
96
|
+
name: "天地图矢量",
|
|
97
|
+
type: "tianditu-vec",
|
|
98
|
+
thumbnail: tdtVecUrl
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "gaode-img",
|
|
102
|
+
name: "高德卫星",
|
|
103
|
+
type: "gaode-img",
|
|
104
|
+
thumbnail: gaodeImgUrl
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: "gaode-vec",
|
|
108
|
+
name: "高德矢量",
|
|
109
|
+
type: "gaode-vec",
|
|
110
|
+
thumbnail: gaodeVecUrl
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
id: "baidu-img",
|
|
114
|
+
name: "百度影像",
|
|
115
|
+
type: "baidu-img",
|
|
116
|
+
thumbnail: bdImgUrl
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "baidu-vec",
|
|
120
|
+
name: "百度矢量",
|
|
121
|
+
type: "baidu-vec",
|
|
122
|
+
thumbnail: bdVecUrl
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
id: "tencent-img",
|
|
126
|
+
name: "腾讯影像",
|
|
127
|
+
type: "tencent-img",
|
|
128
|
+
thumbnail: tencentImgUrl
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
id: "tencent-vec",
|
|
132
|
+
name: "腾讯矢量",
|
|
133
|
+
type: "tencent-vec",
|
|
134
|
+
thumbnail: tencentVecUrl
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "osm",
|
|
138
|
+
name: "OpenStreetMap",
|
|
139
|
+
type: "osm",
|
|
140
|
+
thumbnail: osmUrl
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: "custom-blue",
|
|
144
|
+
name: "自定义蓝色",
|
|
145
|
+
type: "custom",
|
|
146
|
+
thumbnail: customBlueUrl,
|
|
147
|
+
url: "https://your-custom-tile-server/{z}/{x}/{y}.png"
|
|
148
|
+
}
|
|
149
|
+
];
|
|
150
|
+
const displayBasemaps = computed(() => {
|
|
151
|
+
var _a;
|
|
152
|
+
if (((_a = layerPanelConfig.value) == null ? void 0 : _a.baseLayers) && layerPanelConfig.value.baseLayers.length > 0) {
|
|
153
|
+
return layerPanelConfig.value.baseLayers.map((layer) => ({
|
|
154
|
+
id: layer.id,
|
|
155
|
+
name: layer.name,
|
|
156
|
+
type: layer.type,
|
|
157
|
+
url: layer.url,
|
|
158
|
+
visible: layer.visible,
|
|
159
|
+
opacity: layer.opacity,
|
|
160
|
+
attribution: layer.attribution,
|
|
161
|
+
maxZoom: layer.maxZoom,
|
|
162
|
+
thumbnail: getBasemapThumbnail(layer.type, layer.id, layer)
|
|
163
|
+
}));
|
|
164
|
+
}
|
|
165
|
+
return defaultBasemaps;
|
|
166
|
+
});
|
|
167
|
+
const getBasemapThumbnail = (type, id, layer) => {
|
|
168
|
+
if (layer && layer.thumbnail) {
|
|
169
|
+
return layer.thumbnail;
|
|
170
|
+
}
|
|
171
|
+
const typeMap = {
|
|
172
|
+
"osm": osmUrl,
|
|
173
|
+
"OSM": osmUrl,
|
|
174
|
+
"XYZ": tdtImgUrl,
|
|
175
|
+
"tianditu": tdtImgUrl,
|
|
176
|
+
"tianditu-img": tdtImgUrl,
|
|
177
|
+
"tianditu-vec": tdtVecUrl,
|
|
178
|
+
"gaode": gaodeImgUrl,
|
|
179
|
+
"gaode-img": gaodeImgUrl,
|
|
180
|
+
"gaode-vec": gaodeVecUrl,
|
|
181
|
+
"baidu": bdImgUrl,
|
|
182
|
+
"baidu-img": bdImgUrl,
|
|
183
|
+
"baidu-vec": bdVecUrl,
|
|
184
|
+
"tencent": tencentImgUrl,
|
|
185
|
+
"tencent-img": tencentImgUrl,
|
|
186
|
+
"tencent-vec": tencentVecUrl,
|
|
187
|
+
"custom": customBlueUrl
|
|
188
|
+
};
|
|
189
|
+
if (typeMap[type]) {
|
|
190
|
+
return typeMap[type];
|
|
191
|
+
}
|
|
192
|
+
if (id.includes("vec") || id.includes("vector")) {
|
|
193
|
+
return tdtVecUrl;
|
|
194
|
+
}
|
|
195
|
+
if (id.includes("img") || id.includes("imagery")) {
|
|
196
|
+
return tdtImgUrl;
|
|
197
|
+
}
|
|
198
|
+
if (id.includes("osm")) {
|
|
199
|
+
return osmUrl;
|
|
200
|
+
}
|
|
201
|
+
if (id.includes("gaode")) {
|
|
202
|
+
return id.includes("vec") ? gaodeVecUrl : gaodeImgUrl;
|
|
203
|
+
}
|
|
204
|
+
if (id.includes("baidu") || id.includes("bd")) {
|
|
205
|
+
return id.includes("vec") ? bdVecUrl : bdImgUrl;
|
|
206
|
+
}
|
|
207
|
+
if (id.includes("tencent")) {
|
|
208
|
+
return id.includes("vec") ? tencentVecUrl : tencentImgUrl;
|
|
209
|
+
}
|
|
210
|
+
return tdtImgUrl;
|
|
211
|
+
};
|
|
212
|
+
const selectBasemap = (basemap) => {
|
|
213
|
+
const wasSelected = selectedBasemap.value === basemap.id;
|
|
214
|
+
selectedBasemap.value = wasSelected ? null : basemap.id;
|
|
215
|
+
if (wasSelected) {
|
|
216
|
+
layerEventBus.emit("basemap-switch-request", {
|
|
217
|
+
basemapId: basemap.id,
|
|
218
|
+
basemapName: basemap.name,
|
|
219
|
+
basemapType: basemap.type,
|
|
220
|
+
basemapConfig: null
|
|
221
|
+
// 传递null表示关闭底图
|
|
222
|
+
});
|
|
223
|
+
console.log("BasemapPanel: 请求关闭底图:", basemap.name);
|
|
224
|
+
} else {
|
|
225
|
+
layerEventBus.emit("basemap-switch-request", {
|
|
226
|
+
basemapId: basemap.id,
|
|
227
|
+
basemapName: basemap.name,
|
|
228
|
+
basemapType: basemap.type,
|
|
229
|
+
basemapConfig: basemap
|
|
230
|
+
});
|
|
231
|
+
console.log("BasemapPanel: 请求切换底图到:", basemap.name);
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
return (_ctx, _cache) => {
|
|
235
|
+
const _component_EPlusDialog = resolveComponent("EPlusDialog");
|
|
236
|
+
return openBlock(), createBlock(_component_EPlusDialog, {
|
|
237
|
+
modelValue: visible.value,
|
|
238
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
|
|
239
|
+
title: "底图选择",
|
|
240
|
+
width: "400px",
|
|
241
|
+
height: "500px",
|
|
242
|
+
"show-modal": false,
|
|
243
|
+
draggable: true,
|
|
244
|
+
resizable: true,
|
|
245
|
+
"show-close": true,
|
|
246
|
+
cacheId: "basemap-dialog",
|
|
247
|
+
position: "right",
|
|
248
|
+
class: "basemap-dialog",
|
|
249
|
+
onClose: handleClose
|
|
250
|
+
}, {
|
|
251
|
+
default: withCtx(() => [
|
|
252
|
+
createElementVNode("div", _hoisted_1, [
|
|
253
|
+
createElementVNode("div", _hoisted_2, [
|
|
254
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(displayBasemaps.value, (basemap) => {
|
|
255
|
+
return openBlock(), createElementBlock("div", {
|
|
256
|
+
key: basemap.id,
|
|
257
|
+
class: normalizeClass(["basemap-item", { active: selectedBasemap.value === basemap.id }]),
|
|
258
|
+
onClick: ($event) => selectBasemap(basemap)
|
|
259
|
+
}, [
|
|
260
|
+
createElementVNode("div", _hoisted_4, [
|
|
261
|
+
createElementVNode("img", {
|
|
262
|
+
src: basemap.thumbnail,
|
|
263
|
+
alt: basemap.name,
|
|
264
|
+
loading: "lazy"
|
|
265
|
+
}, null, 8, _hoisted_5)
|
|
266
|
+
]),
|
|
267
|
+
createElementVNode("div", _hoisted_6, toDisplayString(basemap.name), 1)
|
|
268
|
+
], 10, _hoisted_3);
|
|
269
|
+
}), 128))
|
|
270
|
+
])
|
|
271
|
+
])
|
|
272
|
+
]),
|
|
273
|
+
_: 1
|
|
274
|
+
}, 8, ["modelValue"]);
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
export {
|
|
279
|
+
_sfc_main as default
|
|
280
|
+
};
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { defineComponent, inject, computed, ref, reactive, resolveComponent, openBlock, createBlock, withCtx, createElementVNode, createVNode, createTextVNode } from "vue";
|
|
2
|
+
import { T as TooltipHelper } from "./index-5a13e877.mjs";
|
|
3
|
+
import "ol";
|
|
4
|
+
const _hoisted_1 = { class: "coordinate-content" };
|
|
5
|
+
const _hoisted_2 = { class: "format-selection" };
|
|
6
|
+
const _hoisted_3 = { class: "format-options" };
|
|
7
|
+
const _hoisted_4 = { class: "coordinate-input" };
|
|
8
|
+
const _hoisted_5 = { class: "dialog-footer" };
|
|
9
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
+
__name: "CoordinateLocationDialog",
|
|
11
|
+
props: {
|
|
12
|
+
modelValue: { type: Boolean }
|
|
13
|
+
},
|
|
14
|
+
emits: ["update:modelValue"],
|
|
15
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const emit = __emit;
|
|
18
|
+
const measurementToolRef = inject("measurementTool");
|
|
19
|
+
const measurementTool = computed(() => measurementToolRef == null ? void 0 : measurementToolRef.value);
|
|
20
|
+
const mapOperationToolRef = inject("mapOperationTool");
|
|
21
|
+
const mapOperationTool = computed(() => mapOperationToolRef == null ? void 0 : mapOperationToolRef.value);
|
|
22
|
+
const mapRef = inject("map");
|
|
23
|
+
const map = computed(() => mapRef == null ? void 0 : mapRef.value);
|
|
24
|
+
let tooltipHelper = null;
|
|
25
|
+
const dialogVisible = computed({
|
|
26
|
+
get: () => props.modelValue,
|
|
27
|
+
set: (value) => emit("update:modelValue", value)
|
|
28
|
+
});
|
|
29
|
+
const selectedFormat = ref("decimal");
|
|
30
|
+
const coordinateForm = reactive({
|
|
31
|
+
longitude: "116.709805",
|
|
32
|
+
latitude: "39.926296"
|
|
33
|
+
});
|
|
34
|
+
ref(null);
|
|
35
|
+
const decimalToDMS = (decimal) => {
|
|
36
|
+
const degrees = Math.floor(Math.abs(decimal));
|
|
37
|
+
const minutes = Math.floor((Math.abs(decimal) - degrees) * 60);
|
|
38
|
+
const seconds = ((Math.abs(decimal) - degrees) * 60 - minutes) * 60;
|
|
39
|
+
const direction = decimal >= 0 ? "" : "-";
|
|
40
|
+
return `${direction}${degrees}°${minutes}'${seconds.toFixed(2)}"`;
|
|
41
|
+
};
|
|
42
|
+
const dmsToDecimal = (dms) => {
|
|
43
|
+
const regex = /(-?)(\d+)°(\d+)'([\d.]+)"/;
|
|
44
|
+
const match = dms.match(regex);
|
|
45
|
+
if (!match)
|
|
46
|
+
return 0;
|
|
47
|
+
const [, sign, degrees, minutes, seconds] = match;
|
|
48
|
+
const decimal = parseInt(degrees) + parseInt(minutes) / 60 + parseFloat(seconds) / 3600;
|
|
49
|
+
return sign === "-" ? -decimal : decimal;
|
|
50
|
+
};
|
|
51
|
+
const onFormatChange = () => {
|
|
52
|
+
console.log("坐标格式变化:", selectedFormat.value);
|
|
53
|
+
updateCoordinateDisplay();
|
|
54
|
+
};
|
|
55
|
+
const updateCoordinateDisplay = () => {
|
|
56
|
+
if (!coordinateForm.longitude || !coordinateForm.latitude)
|
|
57
|
+
return;
|
|
58
|
+
const lng = parseFloat(coordinateForm.longitude);
|
|
59
|
+
const lat = parseFloat(coordinateForm.latitude);
|
|
60
|
+
if (isNaN(lng) || isNaN(lat))
|
|
61
|
+
return;
|
|
62
|
+
if (selectedFormat.value === "dms") {
|
|
63
|
+
if (!coordinateForm.longitude.includes("°")) {
|
|
64
|
+
coordinateForm.longitude = decimalToDMS(lng);
|
|
65
|
+
coordinateForm.latitude = decimalToDMS(lat);
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
if (coordinateForm.longitude.includes("°")) {
|
|
69
|
+
coordinateForm.longitude = dmsToDecimal(coordinateForm.longitude).toFixed(6);
|
|
70
|
+
coordinateForm.latitude = dmsToDecimal(coordinateForm.latitude).toFixed(6);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const getCurrentLocation = () => {
|
|
75
|
+
if (!measurementTool.value) {
|
|
76
|
+
console.warn("measurementTool未初始化");
|
|
77
|
+
console.warn("测量工具未初始化");
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (!map.value) {
|
|
81
|
+
console.warn("地图对象未初始化");
|
|
82
|
+
console.warn("地图未初始化");
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
console.log("开始图上拾取坐标");
|
|
86
|
+
console.log("请在地图上点击选择位置");
|
|
87
|
+
if (!tooltipHelper) {
|
|
88
|
+
tooltipHelper = new TooltipHelper(map.value);
|
|
89
|
+
}
|
|
90
|
+
tooltipHelper.showTooltip("点击地图获取坐标信息");
|
|
91
|
+
measurementTool.value.startCoordinateMeasurement((result) => {
|
|
92
|
+
if (result && result.longitude && result.latitude) {
|
|
93
|
+
setPickedCoordinate(parseFloat(result.longitude), parseFloat(result.latitude));
|
|
94
|
+
if (tooltipHelper) {
|
|
95
|
+
tooltipHelper.hideTooltip();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
const setPickedCoordinate = (longitude, latitude) => {
|
|
101
|
+
if (selectedFormat.value === "decimal") {
|
|
102
|
+
coordinateForm.longitude = longitude.toFixed(6);
|
|
103
|
+
coordinateForm.latitude = latitude.toFixed(6);
|
|
104
|
+
} else {
|
|
105
|
+
coordinateForm.longitude = decimalToDMS(longitude);
|
|
106
|
+
coordinateForm.latitude = decimalToDMS(latitude);
|
|
107
|
+
}
|
|
108
|
+
console.log("坐标已获取");
|
|
109
|
+
};
|
|
110
|
+
const locateOnMap = () => {
|
|
111
|
+
if (!coordinateForm.longitude || !coordinateForm.latitude) {
|
|
112
|
+
console.warn("请输入经纬度坐标");
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (!mapOperationTool.value) {
|
|
116
|
+
console.warn("地图操作工具未初始化");
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
let longitude;
|
|
120
|
+
let latitude;
|
|
121
|
+
try {
|
|
122
|
+
if (selectedFormat.value === "dms") {
|
|
123
|
+
longitude = dmsToDecimal(coordinateForm.longitude);
|
|
124
|
+
latitude = dmsToDecimal(coordinateForm.latitude);
|
|
125
|
+
} else {
|
|
126
|
+
longitude = parseFloat(coordinateForm.longitude);
|
|
127
|
+
latitude = parseFloat(coordinateForm.latitude);
|
|
128
|
+
}
|
|
129
|
+
if (isNaN(longitude) || isNaN(latitude)) {
|
|
130
|
+
console.error("坐标格式不正确");
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
console.log("定位到坐标:", { longitude, latitude });
|
|
134
|
+
mapOperationTool.value.locateToCoordinate(longitude, latitude);
|
|
135
|
+
} catch (error) {
|
|
136
|
+
console.error("坐标解析失败");
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const handleClose = () => {
|
|
140
|
+
if (measurementTool.value) {
|
|
141
|
+
measurementTool.value.clearMeasurements();
|
|
142
|
+
}
|
|
143
|
+
if (tooltipHelper) {
|
|
144
|
+
tooltipHelper.destroy();
|
|
145
|
+
tooltipHelper = null;
|
|
146
|
+
}
|
|
147
|
+
dialogVisible.value = false;
|
|
148
|
+
};
|
|
149
|
+
__expose({
|
|
150
|
+
setPickedCoordinate
|
|
151
|
+
});
|
|
152
|
+
return (_ctx, _cache) => {
|
|
153
|
+
const _component_el_radio = resolveComponent("el-radio");
|
|
154
|
+
const _component_el_radio_group = resolveComponent("el-radio-group");
|
|
155
|
+
const _component_el_input = resolveComponent("el-input");
|
|
156
|
+
const _component_el_form_item = resolveComponent("el-form-item");
|
|
157
|
+
const _component_el_form = resolveComponent("el-form");
|
|
158
|
+
const _component_el_button = resolveComponent("el-button");
|
|
159
|
+
const _component_EPlusDialog = resolveComponent("EPlusDialog");
|
|
160
|
+
return openBlock(), createBlock(_component_EPlusDialog, {
|
|
161
|
+
modelValue: dialogVisible.value,
|
|
162
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => dialogVisible.value = $event),
|
|
163
|
+
title: "坐标拾取",
|
|
164
|
+
width: "450px",
|
|
165
|
+
onClose: handleClose,
|
|
166
|
+
cacheId: "coordinate-dialog",
|
|
167
|
+
"show-modal": false,
|
|
168
|
+
class: "coordinate-dialog"
|
|
169
|
+
}, {
|
|
170
|
+
footer: withCtx(() => [
|
|
171
|
+
createElementVNode("div", _hoisted_5, [
|
|
172
|
+
createVNode(_component_el_button, {
|
|
173
|
+
type: "primary",
|
|
174
|
+
onClick: getCurrentLocation
|
|
175
|
+
}, {
|
|
176
|
+
default: withCtx(() => [..._cache[7] || (_cache[7] = [
|
|
177
|
+
createTextVNode(" 图上拾取 ", -1)
|
|
178
|
+
])]),
|
|
179
|
+
_: 1
|
|
180
|
+
}),
|
|
181
|
+
createVNode(_component_el_button, {
|
|
182
|
+
type: "success",
|
|
183
|
+
onClick: locateOnMap
|
|
184
|
+
}, {
|
|
185
|
+
default: withCtx(() => [..._cache[8] || (_cache[8] = [
|
|
186
|
+
createTextVNode(" 坐标定位 ", -1)
|
|
187
|
+
])]),
|
|
188
|
+
_: 1
|
|
189
|
+
})
|
|
190
|
+
])
|
|
191
|
+
]),
|
|
192
|
+
default: withCtx(() => [
|
|
193
|
+
createElementVNode("div", _hoisted_1, [
|
|
194
|
+
createElementVNode("div", _hoisted_2, [
|
|
195
|
+
_cache[6] || (_cache[6] = createElementVNode("div", { class: "format-title" }, "坐标格式", -1)),
|
|
196
|
+
createElementVNode("div", _hoisted_3, [
|
|
197
|
+
createVNode(_component_el_radio_group, {
|
|
198
|
+
modelValue: selectedFormat.value,
|
|
199
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedFormat.value = $event),
|
|
200
|
+
onChange: onFormatChange
|
|
201
|
+
}, {
|
|
202
|
+
default: withCtx(() => [
|
|
203
|
+
createVNode(_component_el_radio, { value: "decimal" }, {
|
|
204
|
+
default: withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
205
|
+
createTextVNode("十进制", -1)
|
|
206
|
+
])]),
|
|
207
|
+
_: 1
|
|
208
|
+
}),
|
|
209
|
+
createVNode(_component_el_radio, { value: "dms" }, {
|
|
210
|
+
default: withCtx(() => [..._cache[5] || (_cache[5] = [
|
|
211
|
+
createTextVNode("度分秒", -1)
|
|
212
|
+
])]),
|
|
213
|
+
_: 1
|
|
214
|
+
})
|
|
215
|
+
]),
|
|
216
|
+
_: 1
|
|
217
|
+
}, 8, ["modelValue"])
|
|
218
|
+
])
|
|
219
|
+
]),
|
|
220
|
+
createElementVNode("div", _hoisted_4, [
|
|
221
|
+
createVNode(_component_el_form, {
|
|
222
|
+
model: coordinateForm,
|
|
223
|
+
"label-width": "60px"
|
|
224
|
+
}, {
|
|
225
|
+
default: withCtx(() => [
|
|
226
|
+
createVNode(_component_el_form_item, { label: "经度:" }, {
|
|
227
|
+
default: withCtx(() => [
|
|
228
|
+
createVNode(_component_el_input, {
|
|
229
|
+
modelValue: coordinateForm.longitude,
|
|
230
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => coordinateForm.longitude = $event),
|
|
231
|
+
placeholder: "请输入经度",
|
|
232
|
+
type: selectedFormat.value === "decimal" ? "number" : "text",
|
|
233
|
+
step: selectedFormat.value === "decimal" ? "0.000001" : void 0
|
|
234
|
+
}, null, 8, ["modelValue", "type", "step"])
|
|
235
|
+
]),
|
|
236
|
+
_: 1
|
|
237
|
+
}),
|
|
238
|
+
createVNode(_component_el_form_item, { label: "纬度:" }, {
|
|
239
|
+
default: withCtx(() => [
|
|
240
|
+
createVNode(_component_el_input, {
|
|
241
|
+
modelValue: coordinateForm.latitude,
|
|
242
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => coordinateForm.latitude = $event),
|
|
243
|
+
placeholder: "请输入纬度",
|
|
244
|
+
type: selectedFormat.value === "decimal" ? "number" : "text",
|
|
245
|
+
step: selectedFormat.value === "decimal" ? "0.000001" : void 0
|
|
246
|
+
}, null, 8, ["modelValue", "type", "step"])
|
|
247
|
+
]),
|
|
248
|
+
_: 1
|
|
249
|
+
})
|
|
250
|
+
]),
|
|
251
|
+
_: 1
|
|
252
|
+
}, 8, ["model"])
|
|
253
|
+
])
|
|
254
|
+
])
|
|
255
|
+
]),
|
|
256
|
+
_: 1
|
|
257
|
+
}, 8, ["modelValue"]);
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
export {
|
|
262
|
+
_sfc_main as default
|
|
263
|
+
};
|