From e3c2da34f27e3f65b5885846dab478f4af20ffe6 Mon Sep 17 00:00:00 2001 From: lixuliang <lixuliang_hd@126.com> Date: 星期五, 15 三月 2024 09:50:14 +0800 Subject: [PATCH] console --- src/components/rightMenu/bottom2.vue | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/components/rightMenu/bottom2.vue b/src/components/rightMenu/bottom2.vue index 56874b4..b513f7a 100644 --- a/src/components/rightMenu/bottom2.vue +++ b/src/components/rightMenu/bottom2.vue @@ -1,10 +1,10 @@ <template> <div class="bottom" id="bottom" :style="customStyle" v-if="state1.show"> - <!-- <div class="mapTool"> - <div class="tool-rotate" @click="PointingNorth" title="鎸囧寳"> + <div class="mapTool"> + <div class="tool-rotate" @click="flyToCurrentPosition" title="瀹氫綅"> <img src="@/assets/img/collection/compass.png" /> </div> - </div> --> + </div> <div class="mapTool"> <div class="tool-rotate" @click="flyBack" title="澶嶄綅"> <img src="@/assets/img/collection/recover.png" /> @@ -23,7 +23,6 @@ </template> <style scoped> - .mapTool { width: 0.42rem; /* border-radius: 10px; */ @@ -46,7 +45,7 @@ align-items: center; justify-content: center; } -.mapTool2 .tool-rotate{ +.mapTool2 .tool-rotate { height: 0.33rem; line-height: 0.33rem; } @@ -78,7 +77,7 @@ }, }; }, - mounted() { }, + mounted() {}, watch: { "state.show": { handler(newVal) { @@ -131,9 +130,14 @@ duration: 1000, // 缂╂斁鎸佺画鏃堕棿锛岄粯璁や笉闇�瑕佽缃� }); }, - PointingNorth() { - alert("鎸囧寳閽堝紑鍙戜腑"); - // console.log("鎸囧寳閽堝紑鍙戜腑") + flyToCurrentPosition() { + window.mapapi.getView().animate({ + // 鍙缃渶瑕佺殑灞炴�у嵆鍙� + center: window.personalPoi, // 涓績鐐� + zoom: 17, // 缂╂斁绾у埆 + rotation: undefined, // 缂╂斁瀹屾垚view瑙嗗浘鏃嬭浆寮у害 + duration: 1500, // 缂╂斁鎸佺画鏃堕棿锛岄粯璁や笉闇�瑕佽缃� + }); }, }, }; -- Gitblit v1.9.3