PlacesService的文本搜索与自动填充不一致

时间:2014-11-10 17:09:45

标签: javascript google-maps-api-3 google-places-api google-places

我们看到一个问题,其中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!');
    }
});

0 个答案:

没有答案