可能是 latitude 或者 longitude 值溢出 /** 纬度 * @remarks 浮点数,范围 -90 ~ 90 */ latitude: number /** 经度 * @remarks 浮点数,范围 -180 ~ 180 */ longitude: number
地图的数据填充时候一直报错"ret is not defined"//正常情况 { iconPath: "/images/store.png", id: 4, latitude: 22.489344, longitude: 113.916919, width: 30, height: 30, callout: { content: "姓名字:李龙\n电话:11223344550\n地址:深圳市龙华新区创业大厦", color: "#000", id: 3, fontSize: 14, borderRadius: 3, bgColor: "#ffffff", padding: 10, display: "BYCLICK", textAlign: "left" }, label: { content: "" } } //异常情况 for (var i = 0; i < list.length; i++) { fieldArr.push({}); fieldArr[i].iconPath = "/images/grower.png"; fieldArr[i].id = i; fieldArr[i].latitude = list[i].lat; fieldArr[i].longitude = list[i].lng; fieldArr[i].width = 30; fieldArr[i].height = 30; fieldArr[i].callout = { content: "", color: "#000000", id: i, fontSize: 14, borderRadius: 3, bgColor: "#ffffff", padding: 10, display: "BYCLICK", textAlign: "left" }; calllout.content = "微信名字:" + list[i].userName + "\n电话:" + list[i].tel + "\n点击查看最新一条种植记录"; fieldArr[i].label = { content: "" } } 我就用个循环填充数据,结构就报错,我结构有问题啊吗,我的天,
2021-12-01