diff --git a/src/components/public/viewMap.vue b/src/components/public/viewMap.vue index 69cb533..a4d3a22 100644 --- a/src/components/public/viewMap.vue +++ b/src/components/public/viewMap.vue @@ -26,10 +26,10 @@ const props = defineProps({ }) let key = ref("MVNBZ-PEFWI-O4OGT-5ADVJ-7QAYJ-NBFY4") - +let map const initMap = () => { let center = new TMap.LatLng(props.latlng['latitude'], props.latlng['longitude']); - let map = new TMap.Map("container", { + map = new TMap.Map("container", { zoom: 15, disableDefaultUI: true, //禁止所有控件 zoomControl: false, @@ -60,7 +60,12 @@ loadScript(`https://map.qq.com/api/gljs?v=1.exp&key=${key.value}&callback=initMa let show = ref(false) // 弹窗状态 -const showPop = () => show.value = !show.value +const showPop = () => { + show.value = !show.value + // if (!show.value) return + // map.addControl(TMap.constants.DEFAULT_CONTROL_ID.ZOOM); + // map.addControl(TMap.constants.DEFAULT_CONTROL_ID.ROTATION); +} @@ -84,7 +89,7 @@ const showPop = () => show.value = !show.value height: calc(100% - 100px); background: #fff; border-radius: 20px; - padding: 20px; + padding: 8px; max-width: 90vw; // max-height: 85vh;