|
|
|
@ -31,6 +31,7 @@
|
|
|
|
|
import { getDictionaryBiz } from '@/api/system/dict'; |
|
|
|
|
import { onMounted, reactive, toRefs, watchEffect } from 'vue'; |
|
|
|
|
import { useRouter } from 'vue-router'; |
|
|
|
|
import { selectStockArticleAtlasInfo } from '@/api/distribution/distributionDeliveryList'; |
|
|
|
|
let router = useRouter(); |
|
|
|
|
let details = reactive({ |
|
|
|
|
name: 'BmapDemo', |
|
|
|
@ -43,17 +44,22 @@
|
|
|
|
|
}); |
|
|
|
|
onMounted(() => { |
|
|
|
|
details.item = JSON.parse(router.currentRoute.value.query.item); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
init(); |
|
|
|
|
}, 1500); |
|
|
|
|
selectStockArticleAtlasInfo(details.item.id).then(res => { |
|
|
|
|
const data = res.data.data; |
|
|
|
|
console.log('res------------->', data); |
|
|
|
|
setTimeout(() => { |
|
|
|
|
init(data); |
|
|
|
|
}, 1500); |
|
|
|
|
}); |
|
|
|
|
// setTimeout(()=>{ |
|
|
|
|
// details.mapLoc.clearOverlays(); |
|
|
|
|
|
|
|
|
|
// },9500) |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
function init() { |
|
|
|
|
function init(data) { |
|
|
|
|
details.mapLoc = new BMapGL.Map('container'); // 创建地图实例 |
|
|
|
|
|
|
|
|
|
let point = new BMapGL.Point(116.404, 39.915); // 创建点坐标 |
|
|
|
|
details.mapLoc.centerAndZoom(point, 12); |
|
|
|
|
details.mapLoc.enableScrollWheelZoom(true); |
|
|
|
@ -61,7 +67,14 @@
|
|
|
|
|
if (details.mapLoc) { |
|
|
|
|
details.mapLoc.clearOverlays(); //清除地图的label |
|
|
|
|
} |
|
|
|
|
maplabel('四川成都龙泉驿区','展示的内容', 0); |
|
|
|
|
let a = data; |
|
|
|
|
a.forEach((item,index)=>{ |
|
|
|
|
console.log('item------------->', item); |
|
|
|
|
maplabel(item.customerAddress, item.customerName+"--"+item.customerAddress+"--"+item.customerTelephone, index); |
|
|
|
|
|
|
|
|
|
// maplabel('中国四川省成都市简阳市石桥镇简阳市石桥镇红星美凯龙雄州商场-1-26-154', '周娅', 0); |
|
|
|
|
}) |
|
|
|
|
// maplabel('四川成都龙泉驿区','展示的内容', 0); |
|
|
|
|
} |
|
|
|
|
function maplabel(address,contents, index) { |
|
|
|
|
let myGeo = new BMapGL.Geocoder(); |
|
|
|
|