Browse Source

配送地图demo

fix_bug_pro20231227
kilo 1 year ago
parent
commit
7451cc9a95
  1. 23
      src/views/distribution/reservation/atlas1.vue

23
src/views/distribution/reservation/atlas1.vue

@ -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();

Loading…
Cancel
Save