需求:地图上面需展示多个的地点信息

查阅文档上面:使用markets就好,但是只会出来一个点

<map id="myMap" style="width: 100%; height: 300px;" latitude="{{latitude}}" longitude="{{longitude}}"      markers="{{markers}}" show-location bindmarkertap="selectMarket" ></map>

解决方案:添加上 include-points=”{{markers}}” 即可显示多个点

<map id="myMap" style="width: 100%; height: 300px;" latitude="{{latitude}}" longitude="{{longitude}}"      markers="{{markers}}" show-location bindmarkertap="selectMarket" include-points="{{markers}}"></map>data = {latitude: 23.1,    longitude: 113.32452,    markers: [      {        id: 1,        latitude: 23.1,        longitude: 113.32452,        name: 'T.I.T 创意园',        iconPath: './location.png',      },      {        id: 2,        latitude: 23.3,        longitude: 113.32452,        name: '扎根',        iconPath: './location.png',      },      {        id: 3,        latitude: 23.5,        longitude: 113.32452,        name: '圣诞快乐',        iconPath: './location.png',      },    ],}

TAG标签: 微信小程序数据聚合

http://www.xiaochengxub.com/read-99690.html