Commit 98abf5b3 authored by 郭铭瑶's avatar 郭铭瑶 🤘

开启鼠标事件&去掉拖拽开关按钮

parent 0561516b
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { computed, defineComponent, nextTick, onMounted, PropType } from 'vue' import { computed, defineComponent, PropType } from 'vue'
import store from '@/store' import store from '@/store'
declare const SMap: any declare const SMap: any
declare const Plugins: any declare const Plugins: any
...@@ -43,7 +43,7 @@ export default defineComponent({ ...@@ -43,7 +43,7 @@ export default defineComponent({
viewMode: '3D', viewMode: '3D',
center: [1019.614669, 54.167243], center: [1019.614669, 54.167243],
// center: [-135.98002789627407, -722.1597065437004], // center: [-135.98002789627407, -722.1597065437004],
zooms: [7, 12], zooms: [7, 20],
zoom: 8, zoom: 8,
pitch: 45, pitch: 45,
mapStyle: 'smap://styles/dark', mapStyle: 'smap://styles/dark',
...@@ -51,7 +51,6 @@ export default defineComponent({ ...@@ -51,7 +51,6 @@ export default defineComponent({
...config, ...config,
...props.config, ...props.config,
}).on(SMap.MapEvent.maploaded, () => { }).on(SMap.MapEvent.maploaded, () => {
setMouseEvent(false)
// setBuildingBlock() // setBuildingBlock()
ctx.emit('complete', map) ctx.emit('complete', map)
addListener() addListener()
......
...@@ -65,7 +65,6 @@ export interface GlobalStateProps { ...@@ -65,7 +65,6 @@ export interface GlobalStateProps {
curView: ViewType curView: ViewType
curMapType: string curMapType: string
showCommunityPoints: boolean showCommunityPoints: boolean
mapDragable: boolean
readonly zhenxing: any readonly zhenxing: any
readonly weihai: any readonly weihai: any
readonly workArea1: any readonly workArea1: any
......
...@@ -26,9 +26,6 @@ export default { ...@@ -26,9 +26,6 @@ export default {
SET_SHOW_COMMUNITY_POINTS(state: GlobalStateProps, val: boolean): void { SET_SHOW_COMMUNITY_POINTS(state: GlobalStateProps, val: boolean): void {
state.showCommunityPoints = val state.showCommunityPoints = val
}, },
SET_MAP_DRAGABLE(state: GlobalStateProps, val: boolean): void {
state.mapDragable = val
},
SET_PROPERTY_SUMMARY( SET_PROPERTY_SUMMARY(
state: GlobalStateProps, state: GlobalStateProps,
val: { [key: string]: number } val: { [key: string]: number }
......
...@@ -5,7 +5,6 @@ export default { ...@@ -5,7 +5,6 @@ export default {
curMapType: '2D', curMapType: '2D',
curView: { name: '南京东路街道', type: 'street' }, curView: { name: '南京东路街道', type: 'street' },
showCommunityPoints: false, showCommunityPoints: false,
mapDragable: false,
viewOptions: [ viewOptions: [
{ name: '南京东路街道', type: 'street' }, { name: '南京东路街道', type: 'street' },
{ name: '第一工作站', type: 'work1', id: '01001' }, { name: '第一工作站', type: 'work1', id: '01001' },
......
...@@ -77,14 +77,6 @@ ...@@ -77,14 +77,6 @@
/> />
<template #title> 缩小地图 </template> <template #title> 缩小地图 </template>
</a-tooltip> </a-tooltip>
<a-tooltip placement="left">
<img
draggable="false"
src="@/assets/images/map-btn8.png"
@click="setMapDrag"
/>
<template #title> 开启/关闭地图拖拽 </template>
</a-tooltip>
</div> </div>
<m-modal <m-modal
v-model="showMonitor" v-model="showMonitor"
...@@ -371,10 +363,6 @@ export default defineComponent({ ...@@ -371,10 +363,6 @@ export default defineComponent({
map.value.zoom(type) map.value.zoom(type)
} }
const dragAble = ref(false) const dragAble = ref(false)
const setMapDrag = () => {
dragAble.value = !dragAble.value
map.value.setMouseEvent(dragAble.value)
}
return { return {
prefix, prefix,
rotation, rotation,
...@@ -395,7 +383,6 @@ export default defineComponent({ ...@@ -395,7 +383,6 @@ export default defineComponent({
isCommunityPointsShowNow, isCommunityPointsShowNow,
showCommunityPoints, showCommunityPoints,
zoomMap, zoomMap,
setMapDrag,
} }
}, },
}) })
......
...@@ -64,7 +64,6 @@ import btn4 from '@/assets/images/map-btn4.png' ...@@ -64,7 +64,6 @@ import btn4 from '@/assets/images/map-btn4.png'
import btn5 from '@/assets/images/map-btn5.png' import btn5 from '@/assets/images/map-btn5.png'
import btn6 from '@/assets/images/map-btn6.png' import btn6 from '@/assets/images/map-btn6.png'
import btn7 from '@/assets/images/map-btn7.png' import btn7 from '@/assets/images/map-btn7.png'
import btn8 from '@/assets/images/map-btn8.png'
import d2 from '@/assets/images/2d.png' import d2 from '@/assets/images/2d.png'
import d3 from '@/assets/images/3d.png' import d3 from '@/assets/images/3d.png'
import zoomIn from '@/assets/images/zoom-in.png' import zoomIn from '@/assets/images/zoom-in.png'
...@@ -83,7 +82,6 @@ export default defineComponent({ ...@@ -83,7 +82,6 @@ export default defineComponent({
: { key: '2D', icon: d2, title: '开启2D地图' } : { key: '2D', icon: d2, title: '开启2D地图' }
const list = [ const list = [
// { key: 'search', icon: btn1 }, // { key: 'search', icon: btn1 },
{ key: 'dragable', icon: btn8, title: '开启/关闭拖拽功能' },
{ key: 'in', icon: zoomIn, title: '放大地图' }, { key: 'in', icon: zoomIn, title: '放大地图' },
{ key: 'out', icon: zoomOut, title: '缩小地图' }, { key: 'out', icon: zoomOut, title: '缩小地图' },
{ key: 'full', icon: btn2, title: '全屏' }, { key: 'full', icon: btn2, title: '全屏' },
...@@ -125,8 +123,6 @@ export default defineComponent({ ...@@ -125,8 +123,6 @@ export default defineComponent({
!store.state.showCommunityPoints !store.state.showCommunityPoints
) )
break break
case 'dragable':
store.commit('SET_MAP_DRAGABLE', !store.state.mapDragable)
default: default:
break break
} }
......
...@@ -13,12 +13,6 @@ export default function useSwitchMap(map: any) { ...@@ -13,12 +13,6 @@ export default function useSwitchMap(map: any) {
}, },
{ immediate: true } { immediate: true }
) )
watch(
() => store.state.mapDragable,
(val) => {
map.value.setMouseEvent(val)
}
)
watch( watch(
() => store.state.showCommunityPoints, () => store.state.showCommunityPoints,
(val) => { (val) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment