如图所示;
<map id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" markers="{{markers}}" bindtap='onLocation' polyline="{{polyline}}" show-location style="width: 100%; height:{{windowH}}px;"></map>
我们只需给组件markers传入一个数组即可,参数如下;
具体参数可参考官方文档
https://developers.weixin.qq.com/miniprogram/dev/component/map.html
喜欢上方小程序,需要源码的,私信小编留下邮箱。