| | |
| | | <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" /> |
| | | </div> |
| | | </div> |
| | | <div class="mapTool2" v-show="test.fwval"> |
| | | <div class="mapTool2"> |
| | | <div class="tool-rotate" @click="zoomIn" title="放大"> |
| | | <img src="@/assets/img/collection/add.png" /> |
| | | </div> |
| | |
| | | |
| | | <style scoped> |
| | | .mapTool { |
| | | width: 51px; |
| | | width: 0.42rem; |
| | | /* border-radius: 10px; */ |
| | | /* background: #ffffff; */ |
| | | /* margin-bottom: 8px; */ |
| | | } |
| | | |
| | | .mapTool .tool-rotate img { |
| | | width: 100%; |
| | | } |
| | | |
| | | .mapTool2 { |
| | | width: 40px; |
| | | height: 80px; |
| | | margin: 0 auto; |
| | | width: 0.32rem; |
| | | margin: auto; |
| | | background: #ffffff; |
| | | box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.21); |
| | | border-radius: 13px; |
| | | border-radius: 10px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: space-evenly; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | .mapTool2 .tool-rotate img { |
| | | width: 18px; |
| | | } |
| | | .border { |
| | | width: 36px; |
| | | height: 1px; |
| | | border: 1px solid #e5e5e5; |
| | | .mapTool2 .tool-rotate { |
| | | height: 0.33rem; |
| | | line-height: 0.33rem; |
| | | } |
| | | |
| | | /* .tool-rotate { |
| | | padding: 8px; |
| | | } */ |
| | | .mapTool2 .tool-rotate img { |
| | | width: 0.17rem; |
| | | } |
| | | |
| | | .border { |
| | | width: 100%; |
| | | height: 1px; |
| | | border: 0.005rem solid #f3f3f3; |
| | | } |
| | | </style> |
| | | |
| | | |
| | | <script> |
| | | import Bus from "../../js/bus.js"; |
| | | import store from "@/utils/store2"; |
| | |
| | | window.mapapi.getView().animate({ |
| | | // 只设置需要的属性即可 |
| | | center: window.mapapi.getView().getCenter(), // 中心点 |
| | | projection: "EPSG:3857", |
| | | zoom: zoom + 1, // 缩放级别 |
| | | rotation: undefined, // 缩放完成view视图旋转弧度 |
| | | duration: 1000, // 缩放持续时间,默认不需要设置 |
| | |
| | | window.mapapi.getView().animate({ |
| | | // 只设置需要的属性即可 |
| | | center: window.mapapi.getView().getCenter(), // 中心点 |
| | | projection: "EPSG:3857", |
| | | zoom: zoom - 1, // 缩放级别 |
| | | rotation: undefined, // 缩放完成view视图旋转弧度 |
| | | duration: 1000, // 缩放持续时间,默认不需要设置 |
| | |
| | | flyBack() { |
| | | window.mapapi.getView().animate({ |
| | | // 只设置需要的属性即可 |
| | | center: [116.52217697339846, 39.75979421847914], // 中心点 |
| | | center: ol.proj.fromLonLat([116.52217697339846, 39.75979421847914]), // 中心点 |
| | | projection: "EPSG:3857", |
| | | zoom: 12, // 缩放级别 |
| | | rotation: undefined, // 缩放完成view视图旋转弧度 |
| | | duration: 1000, // 缩放持续时间,默认不需要设置 |
| | | }); |
| | | }, |
| | | PointingNorth() { |
| | | alert("指北针开发中"); |
| | | // console.log("指北针开发中") |
| | | flyToCurrentPosition() { |
| | | window.mapapi.getView().animate({ |
| | | // 只设置需要的属性即可 |
| | | center: window.personalPoi, // 中心点 |
| | | projection: "EPSG:3857", |
| | | zoom: 17, // 缩放级别 |
| | | rotation: undefined, // 缩放完成view视图旋转弧度 |
| | | duration: 1500, // 缩放持续时间,默认不需要设置 |
| | | }); |
| | | }, |
| | | }, |
| | | }; |