|
@@ -2,18 +2,18 @@
|
|
|
<div class="map-container">
|
|
|
<div id="yztMap" class="map-container"></div>
|
|
|
<!-- 右下工具 -->
|
|
|
-<!-- <div v-show="mapState.showScale" class="zoom-text">{{ mapState.zoom }}级</div>-->
|
|
|
+ <!-- <div v-show="mapState.showScale" class="zoom-text">{{ mapState.zoom }}级</div>-->
|
|
|
<div class="right-tool">
|
|
|
<!-- 快捷缩放 -->
|
|
|
<QuickZoom :step="mapState.zoom" :min-step="mapState.minZoom" :max-step="mapState.maxZoom" @change-step="setMapZoom" />
|
|
|
<div class="flex" style="margin-top: 5px">
|
|
|
<div class="model-btn" @click="switchThreeDimensional">{{ mapState.isThreeDimensional ? '3D' : '2D' }}</div>
|
|
|
-<!-- <div class="model-btn" style="margin-left: 5px" @click="changeScaleControl">尺</div>-->
|
|
|
+ <!-- <div class="model-btn" style="margin-left: 5px" @click="changeScaleControl">尺</div>-->
|
|
|
</div>
|
|
|
<!-- 测距工具 -->
|
|
|
-<!-- <div class="model-btn" @click="toggleRangingTool">-->
|
|
|
-<!-- {{ isRanging ? '关闭测距' : '开启测距' }}-->
|
|
|
-<!-- </div>-->
|
|
|
+ <!-- <div class="model-btn" @click="toggleRangingTool">-->
|
|
|
+ <!-- {{ isRanging ? '关闭测距' : '开启测距' }}-->
|
|
|
+ <!-- </div>-->
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -21,7 +21,6 @@
|
|
|
import WMTSManager from "@/utils/wmtsManager";
|
|
|
import QuickZoom from "@/components/Map/quickZoom.vue";
|
|
|
import { reactive } from "vue";
|
|
|
-import * as turf from '@turf/turf';
|
|
|
|
|
|
interface Props {
|
|
|
activeMap: string;
|
|
@@ -83,6 +82,7 @@ const initMapEvent = () => {
|
|
|
};
|
|
|
// 切换地图
|
|
|
const switchMap = (type) => {
|
|
|
+ debugger
|
|
|
let queryParamsArr = [];
|
|
|
if (type === 'satellite2') {
|
|
|
queryParamsArr = [
|
|
@@ -99,6 +99,7 @@ const switchMap = (type) => {
|
|
|
wmtsManager = new WMTSManager(map);
|
|
|
wmtsManager.init();
|
|
|
}
|
|
|
+
|
|
|
wmtsManager.addWmtsLayers(queryParamsArr, (res) => {});
|
|
|
};
|
|
|
|
|
@@ -143,7 +144,7 @@ const measureFunc = (e) => {
|
|
|
//测面
|
|
|
if (features[0].geometry.type == 'Polygon') {
|
|
|
if (features.length > 0) {
|
|
|
- var area = turf.area(features[0]);
|
|
|
+ // var area = turf.area(features[0]);
|
|
|
// restrict to area to 2 decimal points
|
|
|
var rounded_area = Math.round(area * 100) / 100;
|
|
|
var htmlStr = '<p>面积:<strong>' +
|