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 }) } }) }