使用 iClient Classic 不通过点击,在页面加载时,通过循环数组,调用函数,直接显示弹窗,但是出现如图的错误
for (var i = 0; i < jingdu.length; i++) { addData(jingdu[i], weidu[i]); addEventInfo(jingdu[i], weidu[i]);//显示弹窗 } function addEventInfo(a,b) { var infowin = null; var size = new SuperMap.Size(0, 33); var offset = new SuperMap.Pixel(11, -30); var icon = new SuperMap.Icon("./images/marker.png", size, offset); var contentHTML = "<div style='width:80px; font-size:12px;font-weight:bold ; opacity: 0.8'>"; contentHTML += "编号 时间 描述 状态"; contentHTML += "</div>"; //初始化FramedCloud类 popup = new SuperMap.Popup.FramedCloud( "chicken", new SuperMap.LonLat(a,b), null, contentHTML, icon, true, null, true ); console.log(popup); infowin = popup; map.addPopup(popup); }
您帮忙看一下