优化项目部图标
This commit is contained in:
parent
498be77b97
commit
ac31265416
|
|
@ -8,6 +8,7 @@ let crossingListNew = []; // 跨越列表
|
||||||
let intLng = 116.254; // 初始经度
|
let intLng = 116.254; // 初始经度
|
||||||
let intLat = 39.965; // 初始纬度
|
let intLat = 39.965; // 初始纬度
|
||||||
let isMap = true; // 是否是地图模式
|
let isMap = true; // 是否是地图模式
|
||||||
|
let projectTitle = ""; // 项目名称
|
||||||
// 图例数据
|
// 图例数据
|
||||||
const legendData = [
|
const legendData = [
|
||||||
{
|
{
|
||||||
|
|
@ -319,7 +320,7 @@ function addAllMapPoints() {
|
||||||
8: "/gzDigitalSignage/img/digitalSignage/white.png",
|
8: "/gzDigitalSignage/img/digitalSignage/white.png",
|
||||||
9: "/gzDigitalSignage/img/digitalSignage/sd.png",
|
9: "/gzDigitalSignage/img/digitalSignage/sd.png",
|
||||||
11: "/gzDigitalSignage/img/digitalSignage/zt_white.png",
|
11: "/gzDigitalSignage/img/digitalSignage/zt_white.png",
|
||||||
20: "gzDigitalSignage/img/digitalSignage/project.png",
|
20: "/gzDigitalSignage/img/digitalSignage/project.png",
|
||||||
};
|
};
|
||||||
|
|
||||||
// 绘制索道标点
|
// 绘制索道标点
|
||||||
|
|
@ -431,6 +432,46 @@ function addAllMapPoints() {
|
||||||
|
|
||||||
const marker = new BMapGL.Marker(point, { icon: myIcon });
|
const marker = new BMapGL.Marker(point, { icon: myIcon });
|
||||||
|
|
||||||
|
// 索道
|
||||||
|
infoContent = `
|
||||||
|
<div class="map-container">
|
||||||
|
<h4>
|
||||||
|
${projectTitle}
|
||||||
|
</h4>
|
||||||
|
</div>`;
|
||||||
|
|
||||||
|
// 创建信息窗口,禁用默认样式
|
||||||
|
const infoWindow = new BMapGL.InfoWindow(infoContent, {
|
||||||
|
width: 0, // 宽度设为0,让内容决定宽度
|
||||||
|
height: 0, // 高度设为0,让内容决定高度
|
||||||
|
offset: new BMapGL.Size(0, -20), // 调整偏移量
|
||||||
|
enableAutoPan: true, // 自动平移地图
|
||||||
|
enableCloseOnClick: true, // 点击地图不关闭
|
||||||
|
});
|
||||||
|
|
||||||
|
marker.addEventListener("click", function () {
|
||||||
|
this.openInfoWindow(infoWindow);
|
||||||
|
|
||||||
|
// 移除百度地图默认添加的三角箭头
|
||||||
|
setTimeout(() => {
|
||||||
|
const infoWindowElements =
|
||||||
|
document.getElementsByClassName("BMap_bubble_pop");
|
||||||
|
if (infoWindowElements.length > 0) {
|
||||||
|
const popup = infoWindowElements[0];
|
||||||
|
// 移除箭头元素
|
||||||
|
const arrows =
|
||||||
|
popup.getElementsByClassName("BMap_bubble_arrow");
|
||||||
|
while (arrows[0]) {
|
||||||
|
arrows[0].parentNode.removeChild(arrows[0]);
|
||||||
|
}
|
||||||
|
// 移除百度地图添加的额外样式
|
||||||
|
popup.style.background = "none";
|
||||||
|
popup.style.border = "none";
|
||||||
|
popup.style.boxShadow = "none";
|
||||||
|
}
|
||||||
|
}, 50);
|
||||||
|
});
|
||||||
|
|
||||||
map.addOverlay(marker);
|
map.addOverlay(marker);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -827,6 +868,7 @@ function getOrgTreeData() {
|
||||||
) {
|
) {
|
||||||
intLng = data[0].children[0].children[0].lon;
|
intLng = data[0].children[0].children[0].lon;
|
||||||
intLat = data[0].children[0].children[0].lat;
|
intLat = data[0].children[0].children[0].lat;
|
||||||
|
projectTitle = data[0].children[0].children[0].title;
|
||||||
}
|
}
|
||||||
|
|
||||||
getScrollData(nodeId);
|
getScrollData(nodeId);
|
||||||
|
|
@ -1109,6 +1151,7 @@ document.addEventListener("DOMContentLoaded", function () {
|
||||||
nodeId = obj.data.id;
|
nodeId = obj.data.id;
|
||||||
intLng = obj.data.lon;
|
intLng = obj.data.lon;
|
||||||
intLat = obj.data.lat;
|
intLat = obj.data.lat;
|
||||||
|
projectTitle = obj.data.title;
|
||||||
getScrollData(nodeId);
|
getScrollData(nodeId);
|
||||||
getLegendData(nodeId);
|
getLegendData(nodeId);
|
||||||
getLocationInfo(nodeId);
|
getLocationInfo(nodeId);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue