This commit is contained in:
duanxiaohai 2024-08-30 11:24:49 +08:00
parent 61ec90104a
commit fb553082d9
1 changed files with 34 additions and 0 deletions

View File

@ -2504,11 +2504,45 @@ const createZyys = (polygon, indexx, name) => {
content.style.zIndex = BMapGL.Overlay.getZIndex(this.point.lat); content.style.zIndex = BMapGL.Overlay.getZIndex(this.point.lat);
content.style.height = "30px"; content.style.height = "30px";
content.style.width = "30px"; content.style.width = "30px";
// content.style.position = "relative"; // 使
let img2 = document.createElement("img"); let img2 = document.createElement("img");
img2.style.width = "20px"; img2.style.width = "20px";
img2.style.height = "26px"; img2.style.height = "26px";
img2.src = this.properties.imgSrc2; img2.src = this.properties.imgSrc2;
// title
img2.title = "这是一个图标的提示文字";
// //
// let tooltip = document.createElement("div");
// tooltip.textContent = "";
// tooltip.style.visibility = "hidden";
// tooltip.style.backgroundColor = "black";
// tooltip.style.color = "#fff";
// tooltip.style.textAlign = "center";
// tooltip.style.borderRadius = "5px";
// tooltip.style.padding = "5px";
// tooltip.style.position = "absolute";
// tooltip.style.bottom = "100%"; //
// tooltip.style.left = "50%";
// tooltip.style.transform = "translateX(-50%)";
// tooltip.style.zIndex = "1";
// //
// content.addEventListener("mouseover", function() {
// console.log(556);
// tooltip.style.visibility = "visible";
// });
// //
// content.addEventListener("mouseout", function() {
// tooltip.style.visibility = "hidden";
// });
content.appendChild(img2); content.appendChild(img2);
// content.appendChild(tooltip);
return content; return content;
} }
yaosuIcon.value[name].sj[indexx].overlay = new BMapGL.CustomOverlay( yaosuIcon.value[name].sj[indexx].overlay = new BMapGL.CustomOverlay(