在过去(大约在2015年1月左右),当我将地址片段发送到google maps API时,我会找回与我的地址片段匹配的内容列表.例如,如果我输入"16 Crystal Street",我曾经获得可能的匹配列表.现在,我得到一个部分匹配的结果.
有没有办法让google maps API返回一个与地址片段匹配的地址列表?
在java API中,例如:
public GeocodingResult[] queryService()
{
GeoApiContext context = new GeoApiContext().setApiKey(Geocoder.GOOGLE_API_KEY);
GeocodingResult[] results;
try
{
results = GeocodingApi.geocode(context,"16 Crystal Street").await();
return results;
}
catch (Exception e)
{
e.printStackTrace();
}
return null;
}
Run Code Online (Sandbox Code Playgroud)
结果数组现在只有一个项目,而它用于包含多个与输入地址匹配的地址.