| | |
| | | |
| | | function initOverlayListener(overlay) { |
| | | const id = overlay.objInfo.Id |
| | | const objInfoNameEle = document.querySelector(".obj-info-name-" + id); |
| | | objInfoNameEle?.addEventListener("click", () => { |
| | | console.log('id:', id) |
| | | // FIXME: 每次切换都会新增同样的元素, 需要优化 |
| | | const objInfoNameEleList = document.querySelectorAll(".obj-info-name-" + id); |
| | | const lastEle = objInfoNameEleList[objInfoNameEleList.length - 1]; |
| | | |
| | | lastEle?.addEventListener("click", () => { |
| | | _callBackObj.JumpSimulation(overlay.objInfo.Id); |
| | | }); |
| | | } |
| | |
| | | info.push(overlay.objInfo.Customer); |
| | | info.push("</p>"); |
| | | info.push("</div>"); |
| | | |
| | | infoWindow = new AMap.InfoWindow({ |
| | | anchor: "bottom-center", |
| | | content: info.join(""), |