相关文章推荐
活泼的灌汤包  ·  Troubleshoot Azure ...·  1 年前    · 
安静的土豆  ·  python - 写入 csv ...·  1 年前    · 
奔放的熊猫  ·  Handler.PostDelayed ...·  2 年前    · 
 <map id="mapId" longitude="{{longitude}}" latitude="{{latitude}}" markers="{{markers}}" style="width: 100%; height: 100%;" scale="11">
<!-- <cover-view slot="callout">
<block wx:for="{{customCalloutMarkerIds}}" wx:key="*this">
<cover-view marker-id="{{item}}">
</cover-view>
</block>
</cover-view> -->

自定义气泡内容, 添加进markes

let markers = []
if(list.length > 0){
list.forEach(item=>{
let normalCallout = {
id: item.id,
latitude: item.lon,
longitude: item.lat,
iconPath: item.onoff == '上线' ? '/images/location1.png' : '/images/location3.png',
callout: {
content: `名称:${item.name}\n状态:${item.onoff}`,
color: '#000',
fontSize: 12,
borderWidth: 1,
borderRadius: 10,
borderColor: '#ccc',
bgColor: '#fff',
padding: 10,
display: 'BYCLICK',
textAlign: 'left',
markers.push(normalCallout)