|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div ref="containerRef" class="map-container">
|
|
|
- <div id="aMap" class="map-container" :style="{ width: width, height: height }"></div>
|
|
|
+ <div id="aMap" class="map-container2" :style="{ width: width, height: height }"></div>
|
|
|
<!-- 右下工具 -->
|
|
|
<div v-show="mapState.showScale" class="zoom-text">{{ mapState.zoom }}级</div>
|
|
|
<div class="right-tool">
|
|
@@ -10,10 +10,6 @@
|
|
|
<div class="model-btn" @click="switchThreeDimensional">{{ mapState.isThreeDimensional ? '3D' : '2D' }}</div>
|
|
|
<div class="ruler-icon" style="margin-left: 5px" @click="changeScaleControl"></div>
|
|
|
</div>
|
|
|
- <!-- 测距工具 -->
|
|
|
- <!--<div class="model-btn" @click="toggleRangingTool">-->
|
|
|
- <!--{{ isRanging ? '关闭测距' : '开启测距' }}-->
|
|
|
- <!--</div>-->
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -22,7 +18,6 @@
|
|
|
import QuickZoom from './quickZoom.vue';
|
|
|
import { useAMap } from '@/hooks/AMap/useAMap';
|
|
|
import { useDrawTool } from '@/hooks/AMap/useDrawTool';
|
|
|
-import { useRuler } from '@/hooks/AMap/useRuler';
|
|
|
import { getPointInfoList } from '@/api/globalMap';
|
|
|
import { getDictLabel } from '@/utils/dict';
|
|
|
import { PointType } from '@/api/globalMap/type';
|
|
@@ -41,6 +36,8 @@ import {
|
|
|
getUAVDetails
|
|
|
} from '@/api/globalMap/spatialAnalysis';
|
|
|
import { pointDetailTemplate } from '@/views/globalMap/data/mapData';
|
|
|
+import ElementResizeDetectorMaker from 'element-resize-detector';
|
|
|
+import useAppStore from '@/store/modules/app';
|
|
|
|
|
|
interface Props {
|
|
|
activeMap: string;
|
|
@@ -51,12 +48,14 @@ const containerScale = inject('containerScale');
|
|
|
const props = withDefaults(defineProps<Props>(), {});
|
|
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
const { point_type } = toRefs<any>(proxy?.useDict('point_type'));
|
|
|
+const appStore = useAppStore();
|
|
|
|
|
|
const emits = defineEmits(['update:drawing', 'selectGraphics', 'unSelectGraphics', 'showTextEditBox', 'onDrawCompleted', 'handleShowVideo']);
|
|
|
const containerRef = ref();
|
|
|
const width = ref('100%');
|
|
|
const height = ref('100%');
|
|
|
|
|
|
+
|
|
|
const mapState = reactive({
|
|
|
center: [110.93154257997, 21.669064031332],
|
|
|
zoom: 15,
|
|
@@ -365,6 +364,22 @@ const handleResize = () => {
|
|
|
height.value = containerHeight + 'px';
|
|
|
map.resize();
|
|
|
};
|
|
|
+watch(
|
|
|
+ () => appStore.showLeftSection,
|
|
|
+ () => {
|
|
|
+ nextTick(() => {
|
|
|
+ handleResize();
|
|
|
+ });
|
|
|
+ }
|
|
|
+);
|
|
|
+watch(
|
|
|
+ () => appStore.showRightSection,
|
|
|
+ () => {
|
|
|
+ nextTick(() => {
|
|
|
+ handleResize();
|
|
|
+ })
|
|
|
+ }
|
|
|
+);
|
|
|
onMounted(() => {
|
|
|
window.addEventListener('resize', handleResize);
|
|
|
});
|
|
@@ -382,6 +397,10 @@ onUnmounted(() => {
|
|
|
.map-container {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+}
|
|
|
+.map-container2 {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
|
.zoom-text {
|
|
@@ -394,8 +413,8 @@ onUnmounted(() => {
|
|
|
}
|
|
|
.right-tool {
|
|
|
position: absolute;
|
|
|
- bottom: 50px;
|
|
|
- right: 5px;
|
|
|
+ bottom: 110px;
|
|
|
+ right: 175px;
|
|
|
z-index: 2;
|
|
|
}
|
|
|
.model-btn {
|