From 54b454b6b8d8150757399f0af593c124579eab2e Mon Sep 17 00:00:00 2001
From: kun <1422840143@qq.com>
Date: Tue, 28 Nov 2023 15:07:43 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20BUG=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.production | 4 +-
.../largeScreenOne/components/BDmaps3D.vue | 111 +++++++++---------
2 files changed, 60 insertions(+), 55 deletions(-)
diff --git a/.env.production b/.env.production
index e7f45d8..9147f20 100644
--- a/.env.production
+++ b/.env.production
@@ -5,8 +5,8 @@ NODE_ENV = "production"
# VITE_API_URL = "http://139.9.66.234:6688"
# VITE_API_URL = "http://jxjzw.zhgdyun.com:6688"
# VITE_API_URL = 'http://192.168.34.155:6688'
-VITE_API_URL = 'http://10.75.253.12:6090'
-# VITE_API_URL = "http://jxjzw.zhgdyun.com:9013"
+# VITE_API_URL = 'http://10.75.253.12:6090'
+VITE_API_URL = "http://jxjzw.zhgdyun.com:9013"
VITE_WPAPI_URL = "http://jxjzw.zhgdyun.com:8081"
# VITE_API_URL = "http://101.43.164.214:6688"
# VITE_API_URL = "https://wx.antjg.com:6081/"
diff --git a/src/views/goverment/huizhou/largeScreen/largeScreenOne/components/BDmaps3D.vue b/src/views/goverment/huizhou/largeScreen/largeScreenOne/components/BDmaps3D.vue
index 8d74b8f..0233a65 100644
--- a/src/views/goverment/huizhou/largeScreen/largeScreenOne/components/BDmaps3D.vue
+++ b/src/views/goverment/huizhou/largeScreen/largeScreenOne/components/BDmaps3D.vue
@@ -6,8 +6,9 @@
x
-
项目负责人:{{ infoWindowData?.projectManage }}
-
项目地址:{{ infoWindowData.projectAddress }}
+
项目造价:{{ infoWindowData?.engineering_cost ? infoWindowData?.engineering_cost : 0 }}万元
+
项目面积:{{ infoWindowData?.engineering_area ? infoWindowData?.engineering_area : 0 }}㎡
+
项目地址:{{ infoWindowData.address }}
@@ -109,59 +110,63 @@ const addMarker = () => {
if (!props.projectData.length > 0) {
return;
}
- const createMarkerImage = (state: string) => new URL(`../../../../../../assets/images/hzImg/xm/${state}`, import.meta.url).href; // 图片引入
- let myIcon = new BMapGL.Icon(createMarkerImage("marker.png"), new BMapGL.Size(80, 80), {
- imageSize: new BMapGL.Size(40, 40),
- imageOffset: new BMapGL.Size(0, 0 - 25) // 设置图片偏移
- });
- let point = new BMapGL.Point(114.316196, 23.011847); // 点位设置
- let marker = new BMapGL.Marker(point, { icon: myIcon }); // 标记点
- map.value.addOverlay(marker); // 添加标记点
- //鼠标点击marker弹出自定义的信息窗体
- marker.addEventListener("click", async function () {
- // markerList.value = markerList.value.map(val =>
- // val === item ? { ...item, showGif: true } : { ...val, showGif: false, showInfo: false }
- // );
-
- // const curr = markerList.value.find(item => item.showGif);
- // console.log(curr);
- // curr.showInfo = !curr.showInfo;
-
- infoName.value = props.projectData[0].projectName;
- // const res = await getproDetail({ projectId: item.projectId });
- // @ts-expect-error
- infoWindowData.value = props.projectData[0];
- infoShow.value = true;
- // const infowindow = new AMapRef.value.InfoWindow({
- // isCustom: true, //使用自定义窗体
- // content: infoWindowPage.value,
- // offset: new AMap.Pixel(16, -45)
- // });
-
- // infowindow.open(map.value, marker.getPosition());
- function createDOM() {
- const img = infoWindowPage.value;
- return img;
- }
- const customOverlay = new BMapGL.CustomOverlay(createDOM, {
- point: new BMapGL.Point(Number(114.272994) || 113, Number(23.032578) || 21),
- opacity: 0.5,
- map: map.value,
- offsetY: -45,
- offsetX: 16,
- properties: {
- title: "this is a title",
- size: "100"
- }
+ console.log(props.projectData, "------------------");
+ props.projectData.map((item, index) => {
+ const createMarkerImage = (state: string) =>
+ new URL(`../../../../../../assets/images/hzImg/xm/${state}`, import.meta.url).href; // 图片引入
+ let myIcon = new BMapGL.Icon(createMarkerImage("marker.png"), new BMapGL.Size(80, 80), {
+ imageSize: new BMapGL.Size(40, 40),
+ imageOffset: new BMapGL.Size(0, 0 - 25) // 设置图片偏移
});
- map.value.addOverlay(customOverlay);
- // if (curr.showInfo) {
+ let point = new BMapGL.Point(item.longitude, item.latitude); // 点位设置
+ let marker = new BMapGL.Marker(point, { icon: myIcon }); // 标记点
+ map.value.addOverlay(marker); // 添加标记点
+ //鼠标点击marker弹出自定义的信息窗体
+ marker.addEventListener("click", async function () {
+ // markerList.value = markerList.value.map(val =>
+ // val === item ? { ...item, showGif: true } : { ...val, showGif: false, showInfo: false }
+ // );
- // // customOverlay.open(BDMaps.value, marker.getPosition());
- // } else {
- // // infoShow.value = false;
- // onClose();
- // }
+ // const curr = markerList.value.find(item => item.showGif);
+ // console.log(curr);
+ // curr.showInfo = !curr.showInfo;
+
+ infoName.value = props.projectData[index].engineering_name;
+ // const res = await getproDetail({ projectId: item.projectId });
+ // @ts-expect-error
+ infoWindowData.value = props.projectData[index];
+ infoShow.value = true;
+ // const infowindow = new AMapRef.value.InfoWindow({
+ // isCustom: true, //使用自定义窗体
+ // content: infoWindowPage.value,
+ // offset: new AMap.Pixel(16, -45)
+ // });
+
+ // infowindow.open(map.value, marker.getPosition());
+ function createDOM() {
+ const img = infoWindowPage.value;
+ return img;
+ }
+ const customOverlay = new BMapGL.CustomOverlay(createDOM, {
+ point: new BMapGL.Point(Number(114.272994) || 113, Number(23.032578) || 21),
+ opacity: 0.5,
+ map: map.value,
+ offsetY: -45,
+ offsetX: 16,
+ properties: {
+ title: "this is a title",
+ size: "100"
+ }
+ });
+ map.value.addOverlay(customOverlay);
+ // if (curr.showInfo) {
+
+ // // customOverlay.open(BDMaps.value, marker.getPosition());
+ // } else {
+ // // infoShow.value = false;
+ // onClose();
+ // }
+ });
});
};
// 坐标转换回调