|
function fnaddBillboard() {
var aMap = api.require('aMap');
for (var i = 0; i < 235; i++) {
let random1 = Math.random() * (160 - 90) + 90;
let random2 = Math.random() * (60 - 23) + 23;
random1 = random1.toFixed(7);
random2 = random2.toFixed(7);
console.log(random1);
console.log(random2);
console.log(i)
aMap.addBillboard({
id: i,
draggable: true,
coords: {
lon: random1,
lat: random2
},
bgImg: 'widget://image/default_list.png',
content: {
title: '1234',
subTitle: '12345',
illus: 'https://community.yonyou.com/uc_server/data/avatar/000/10/47/68_avatar_middle.jpg?ts=1635840970'
},
styles: {
titleColor: '#000',
titleSize: 16,
subTitleColor: '#999',
subTitleSize: 12,
illusAlign: 'left'
}
}, function (ret) {
if (ret) {
alert(JSON.stringify(ret));
alert('添加成功');
}
});
}
}
单独用这段代码试试,我这好像没出现 |
|