我们看到一个问题,其中PlacesService的textSearch没有返回“Strood Station Car Park,Rochester”的任何结果,而Autocomplete则是。我已经创建了这个JS Fiddle,它显示了这种行为:http://jsfiddle.net/anero/b5jh56gy/6/
是否有办法为两个API调用设置一致的结果集?
var client = new google.maps.places.PlacesService($("#google-attributions")[0]);
var query = "Strood Station Car Park, Rochester";
var textSearchRequest = {
query: query
};
client.textSearch(textSearchRequest, function (response, status) {
if (status === google.maps.GeocoderStatus.OK && response.length > 0) {
alert('Found place!');
} else {
alert('Did not find place!');
}
});