const randomMarker = (len) =>
Array(len)
.fill(true)
.map((e, idx) => ({
position: {
longitude: 100 + Math.random() * 30,
latitude: 30 + Math.random() * 20
},
myLabel: 债券${alphabet[idx]},
myIndex: idx + 1,
title: 债券${alphabet[idx]},
address: 债券${alphabet[idx]},
name: 债券${alphabet[idx]},
district: 债券${alphabet[idx]}
}));
this.markers = randomMarker(10);
Reproduce Example Link or Code Fragment
What is Expected?
What is actually happening?
我已经搜索过 issue,没有类似的问题,或者类似的问题仍然没有解决方案。
没有搜到相关
我已经搜索过文档,并且仍然没有找到解决方案。
没有搜到相关
我写了个问题重现的例子,链接或者代码将会贴在下面。
window.AMap.plugin('AMap.PlaceSearch', () => {
placeSearch = new window.AMap.PlaceSearch({
input: 'tipinput',
pageSize: 10,
pageIndex: 1,
citylimit: false
// citylimit: true // 仅搜索本城市的地名
});
const randomMarker = (len) =>
Array(len)
.fill(true)
.map((e, idx) => ({
position: {
longitude: 100 + Math.random() * 30,
latitude: 30 + Math.random() * 20
},
myLabel:
债券${alphabet[idx]},myIndex: idx + 1,
title:
债券${alphabet[idx]},address:
债券${alphabet[idx]},name:
债券${alphabet[idx]},district:
债券${alphabet[idx]}}));
this.markers = randomMarker(10);
Reproduce Example Link or Code Fragment
What is Expected?
What is actually happening?