You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
898 B

1 year ago
search: function (res) {
var type = e.target.dataset.type;
this.nearbySearch(type);
}
nearbySearch: function (res) {
var location = this.data.latitude + ',' + this.data.longitude
let _this = this;
qqmapsdk.search({
keyword: keyword,
location: location,
success: function (res) {
var markers = [];
for (var i = 0; i < res.data.length; i++) {
markers.push({
title: res.data[i].location.lat,
id: res.data[i].id,
latitude: res.data[i].location.lat,
longitude: res.data[i].location.lng,
iconPath: "images/location.png",
width: 20,
height: 20,
callout: {
content: res.data[i].title,
color: '#000',
display: 'ALWAYS'
}
})
}
_this.setData({
markers: markers,
perimeter: res.data
})
}
})
}