From 81f54040c2cb65537c6c6e1db8358a39a57dea0d Mon Sep 17 00:00:00 2001
From: mayisheng <admin>
Date: Mon, 15 Aug 2022 16:14:01 +0800
Subject: [PATCH] 1
---
src/store/modules/mobile.js | 78 ++++++++++++++++++++++++++++----------
1 files changed, 57 insertions(+), 21 deletions(-)
diff --git a/src/store/modules/mobile.js b/src/store/modules/mobile.js
index 62f7d47..cb8845d 100644
--- a/src/store/modules/mobile.js
+++ b/src/store/modules/mobile.js
@@ -80,7 +80,7 @@
pitch: -90,
roll: 0
},
- zoomRange: [80, 200], // 缩放程度
+ zoomRange: [100, 1000], // 缩放程度
frislayertHeight: 160, // 默认弹窗高度
perspectiveControl: '', // 视角控制:高度、角度 ()=>{}
perspectiveControls: '', // 视角控制:高度、角度 ()=>{}
@@ -119,13 +119,17 @@
// drawALineLayerMany: null, // 活动路线图层
// drawAPointLayerMany: null, // 活动点图层
isOpenDrawALineMany: null, // 是否开启活动
- seeRight: true // 右侧控制栏显影
+ seeRight: true, // 右侧控制栏显影
+ pinchFlag: false
},
mutations: {
...urlParameter.mutations, // url参数
// MSET_VIEWER (state, viewer) {
// global.viewer = viewer
// },
+ SET_PINCHFLAG (state, pinchFlag) {
+ state.pinchFlag = pinchFlag
+ },
MSET_BIGPOPUP (state, viewer) {
state.mBigPopup = viewer
$store.dispatch('closeMobileWindowsDom') // 关闭弹窗
@@ -1021,6 +1025,9 @@
})
// 订阅事件
window.billboarddaohang.on(global.DC.MouseEventType.CLICK, (e) => {
+ if (state.pinchFlag == true) {
+ return
+ }
// console.log(e);
// return;
// 定制化窗体
@@ -1088,7 +1095,7 @@
})
window.drawALineLayerMany = new global.DC.VectorLayer('manyLinePointLayer')
global.viewer.addLayer(window.drawALineLayerMany)
- window.drawAPointLayerMany = new global.DC.HtmlLayer('manyPointPointLayer')
+ window.drawAPointLayerMany = new global.DC.VectorLayer('manyPointPointLayer')
global.viewer.addLayer(window.drawAPointLayerMany)
// 多条线
for (const k in Strs) {
@@ -1159,24 +1166,28 @@
// // outlineWidth: 1, //边框大小,
// pixelOffset: { x: 0, y: -47 }, //偏移像素
// });
- window.drawAPointLayerManyLabels = new global.DC.DivIcon(
- // new this.DC.Position(Number(item[0]), Number(item[1]), 0),
+ const billboard = new global.DC.Billboard(
+ window.drawAPointLayerManyposition, '/img/icon/activity.png')
+
+ const label = new global.DC.Label(
window.drawAPointLayerManyposition,
- `
- <div class="point-entitys-box">
- <div class="point-logo">
- <img src="/img/icon/activity.png">
- </div>
- <div class="point-title">
- ${point[k].name}
- </div>
- </div>
- `
+ point[k].name
)
- // 订阅事件
- window.drawAPointLayerManyLabels.on(global.DC.MouseEventType.CLICK, (e) => {
- // console.log(e);
- // return;
+
+ label.setStyle({
+ fillColor: global.DC.Color.RED,
+ style: global.DC.Namespace.Cesium.LabelStyle.FILL_AND_OUTLINE,
+ outlineColor: global.DC.Color.WHITE, // 边框颜色
+ outlineWidth: 8, // 边框大小,
+ font: '12px sans-serif',
+ pixelOffset: { x: 0, y: -24 }
+ })
+
+ billboard.on(global.DC.MouseEventType.CLICK, (e) => {
+ if (state.pinchFlag == true) {
+ return
+ }
+
if (value[3]) {
value[3]()
}
@@ -1195,8 +1206,33 @@
}
dispatch('setMobileWindows', windowData)
})
- window.drawAPointLayerMany.addOverlay(window.drawAPointLayerManyLabels)
- // console.log(point[k]);
+
+ label.on(global.DC.MouseEventType.CLICK, (e) => {
+ if (state.pinchFlag == true) {
+ return
+ }
+
+ if (value[3]) {
+ value[3]()
+ }
+ // 定制化窗体
+ const position = e.position
+ const lntLat = [e.overlay._position._lng, e.overlay._position._lat]
+ const windowData = {
+ position,
+ lntLat,
+ query: {
+ ...(value[2] || {}),
+ position,
+ lntLat
+ },
+ useJWD: true // 仅使用经纬度
+ }
+ dispatch('setMobileWindows', windowData)
+ })
+
+ window.urlParameterLayer.addOverlay(billboard) // 加入图标
+ window.urlParameterLayer.addOverlay(label)
}
// state.drawALineLayerMany = drawALineLayerMany
// state.drawAPointLayerMany = drawAPointLayerMany
--
Gitblit v1.9.3