如何将results
返回到placesSearch
函数,而不是将results
返回到service.nearbySearch
函数?感谢
function placesSearch(map,myLatlng,myBusinessName) {
var searchArea = myLatlng;
var request = {
location: searchArea,
radius: 500
};
var service = new google.maps.places.PlacesService(map);
var googleBusNames = service.nearbySearch(request, callback);
validateFeature(googleBusNames,myBusinessName);
}
function callback(results, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
return results;
}
else {
console.log("Error");
}
}