From 722dbde665a8e335bccaa9d984cd02eb22333e54 Mon Sep 17 00:00:00 2001
From: liuyg <liuyg@qq.com>
Date: Sat, 05 Mar 2022 17:49:13 +0800
Subject: [PATCH] +新增标签,可编辑,可加图片
---
src/components/mobilemap/index.vue | 126 ++++++++++++++++++++++++++++++++---------
1 files changed, 97 insertions(+), 29 deletions(-)
diff --git a/src/components/mobilemap/index.vue b/src/components/mobilemap/index.vue
index 7a3821e..4d2bb22 100644
--- a/src/components/mobilemap/index.vue
+++ b/src/components/mobilemap/index.vue
@@ -93,7 +93,14 @@
towlayerNum: 120,
threelayerNum: 160,
forlayerNum: 200,
+ intervallayerNum: 20,
frislayertHeight: 160, //默认高度
+ // onelayerNum: 80,
+ // towlayerNum: 200,
+ // threelayerNum: 320,
+ // forlayerNum: 440,
+ // intervallayerNum: 60,
+ // frislayertHeight: 320, //默认高度
};
},
computed: {
@@ -333,7 +340,7 @@
},
duration: 0.5, // 定位的时间间隔
});
- overii();
+ // overii();
};
that.butbut = function () {
//放大
@@ -356,18 +363,18 @@
// if (height > 100) {
// butSetViews(80);
// }
- if (height > 180) {
- butSetViews(160);
+ if (height > that.forlayerNum - that.intervallayerNum) {
+ butSetViews(that.threelayerNum);
return;
}
- if (height > 140) {
- butSetViews(120);
+ if (height > that.threelayerNum - that.intervallayerNum) {
+ butSetViews(that.towlayerNum);
return;
}
- if (height > 100) {
- butSetViews(80);
+ if (height > that.towlayerNum - that.intervallayerNum) {
+ butSetViews(that.onelayerNum);
}
}
};
@@ -380,16 +387,34 @@
);
console.log(height);
- if (height <= 100) {
- butSetViews(120);
+ // if (height <= 100) {
+ // butSetViews(120);
+ // }
+
+ // if (height > 100 && height <= 140) {
+ // butSetViews(160);
+ // }
+
+ // if (height > 140 && height < 180) {
+ // butSetViews(200);
+ // }
+
+ if (height <= that.towlayerNum - that.intervallayerNum) {
+ butSetViews(that.towlayerNum);
}
- if (height > 100 && height <= 140) {
- butSetViews(160);
+ if (
+ height > that.towlayerNum - that.intervallayerNum &&
+ height <= that.threelayerNum - that.intervallayerNum
+ ) {
+ butSetViews(that.threelayerNum);
}
- if (height > 140 && height < 180) {
- butSetViews(200);
+ if (
+ height > that.threelayerNum - that.intervallayerNum &&
+ height < that.forlayerNum - that.intervallayerNum
+ ) {
+ butSetViews(that.forlayerNum);
}
}
};
@@ -432,7 +457,7 @@
ii++;
cutHeight = height - startHeight;
// console.log(cutHeight);
- // console.log(height);
+ console.log(height, "see");
that.heights = height;
that.heights1 = cutHeight;
// return;
@@ -451,29 +476,66 @@
let takes = () => {
if (ii != 1) {
if (cutHeight >= 0) {
- if (cutHeight > 3) {
- if (height >= 83 && height < 120) {
- setViews(120);
+ if (cutHeight > 2) {
+ // if (height >= 83 && height < 120) {
+ // setViews(120);
+ // }
+ // if (height >= 123 && height < 160) {
+ // setViews(160);
+ // }
+ // if (height >= 163 && height < 200) {
+ // setViews(200);
+ // }
+ if (
+ height >= that.onelayerNum + 2 &&
+ height < that.towlayerNum
+ ) {
+ setViews(that.towlayerNum);
}
- if (height >= 123 && height < 160) {
- setViews(160);
+ if (
+ height >= that.towlayerNum + 2 &&
+ height < that.threelayerNum
+ ) {
+ setViews(that.threelayerNum);
}
- if (height >= 163 && height < 200) {
- setViews(200);
+ if (
+ height >= that.threelayerNum + 2 &&
+ height < that.forlayerNum
+ ) {
+ setViews(that.forlayerNum);
}
}
//放大
} else {
//缩小
- if (cutHeight < -3) {
- if (height <= 200 && height > 157) {
- setViews(160);
+ // if (cutHeight < -3) {
+ // if (height <= 200 && height > 157) {
+ // setViews(160);
+ // }
+ // if (height <= 157 && height > 117) {
+ // setViews(120);
+ // }
+ // if (height <= 117 && height > 80) {
+ // setViews(80);
+ // }
+ if (cutHeight < -2) {
+ if (
+ height <= that.forlayerNum &&
+ height > that.threelayerNum - 2
+ ) {
+ setViews(that.threelayerNum);
}
- if (height <= 157 && height > 117) {
- setViews(120);
+ if (
+ height <= that.threelayerNum - 2 &&
+ height > that.towlayerNum - 2
+ ) {
+ setViews(that.towlayerNum);
}
- if (height <= 117 && height > 80) {
- setViews(80);
+ if (
+ height <= that.towlayerNum - 2 &&
+ height > that.onelayerNum
+ ) {
+ setViews(that.onelayerNum);
}
}
}
@@ -969,6 +1031,11 @@
//判断默认维度
//原本默认是2.5d 改为3d默认时做出改变
if (that.dimension == "2.5D") {
+ that.$store.commit("set_frislayertHeight", that.frislayertHeight); //送入默认弹窗高度
+ that.$store.commit("set_zoomRange", [
+ that.onelayerNum,
+ that.forlayerNum,
+ ]); //送入移动端缩放范围
that.$store.commit("MSET_DIMENSION", "2.5D"); //切换2.5D设置
} else if (that.dimension == "3D") {
// setTimeout((res) => {
@@ -1082,8 +1149,9 @@
that.$store.dispatch("setMobileWindows", d);
},
flytos(jd, wd) {
+ let height = this.frislayertHeight;
this.$store.dispatch("mapFlyTo", {
- lntLat: [jd, wd, 120], //114.04020791, 27.62934732
+ lntLat: [jd, wd, height], //114.04020791, 27.62934732
heading: 0,
pitch: -90,
roll: 0,
--
Gitblit v1.9.3