邓洁 : 地图接口

This commit is contained in:
dengj
2023-11-16 12:50:58 +08:00
parent e50e90c841
commit 88dfe5760b
4 changed files with 83 additions and 31 deletions

View File

@@ -76,7 +76,42 @@
console.log("markerClusterCreate", e);
});
},
created() {
this.getMapList()
},
methods: {
getMapList() {
const realData = {
longitude: uni.getStorageSync('longitude'),
latitude: uni.getStorageSync('latitude'),
radius: 100
}
const mockData = {
longitude: 23.40,
latitude: 116.38,
radius: 1111111111
}
this.$api.getMap(mockData).then(res => {
console.log('getMap', res);
let obj = {}
if (res.statusCode === 200) {
// res.data.data.forEach(item => {
// obj = {
// id: parseInt(item.id),
// latitude: item.lat,
// longitude: item.lng,
// // iconPath: '../../../static/map/sp_icon_dw.png',
// width: '58rpx',
// height: '72rpx',
// rotate: 0,
// alpha: 1
// }
// })
// this.marker.push(obj)
// console.log('this.marker', this.marker);
}
})
},
// 图标点击
markerClick(e) {
console.log('标记点击', e);