problem description
Mengxin just started using vue-amap and encountered some problems:
1. Map status is not punctual
2. I want to use the map properties of the Gaud open platform-"how to use the hot spot of the map in vue-amap
the environmental background of the problems and what methods you have tried
the first item can not find the key to the problem
the second item I Baidu has a lot of but no related instructions. Maybe no one has ever encountered this function, specifically, when clicked, it displays the corresponding merchant name, location, distance, type and other information
related codes
/ / Please paste the code text below (do not replace the code with pictures)
I only have a piece of marker code, I do not know how to write the hot code, where to write
markerClick: {
click:(result)=>{
this.show = true
let self = this
AMap.service(["AMap.PlaceSearch"], function() {
var placeSearch = new AMap.PlaceSearch({ //
pageSize: 5,
pageIndex: 1
});
var cpoint = []; //
cpoint.push(result.lnglat.lng,result.lnglat.lat)
placeSearch.searchNearBy("", cpoint, 200, function(status, result) {
// console.log(result)
let nowDistancee = [self.lng,self.lat],
dis = Math.round(AMap.GeometryUtil.distance(nowDistancee, cpoint));
if (dis>500){
self.distance = Math.round(dis/1000) + ""
}else {
self.distance = dis + ""
}
self.names = result.poiList.pois[0].name
self.address = result.poiList.pois[0].address
});
});
}
}
what result do you expect? What is the error message actually seen?
I want to be able to click on hotspots to achieve the corresponding results, instead of clicking on the whole map or just clicking marker
.