点标记实例2: 地图渲染出多个标记点和其文本标注

//动态获取的数据 res
res.forEach(item) => {

  var marker = new AMap.Marker({
      icon: "http://webapi.amap.com/theme/v1.3/markers/n/mark_b.png",
      position: new AMap.LngLat(item.longitude,item.latitude),
      label: {
          offset: new AMap.Pixel(-10, -40),  //设置文本标注偏移量
          content: `
${item.label}
`, //设置文本标注内容 direction: 'right' //设置文本标注方位 }, title: item.label, }); marker.setMap(_this.map); }); //css

你可能感兴趣的:(vue.js,高德地图)