相关疑难解决方法(0)

使用Google Maps API对模糊地址进行地理编码

在过去(大约在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)

结果数组现在只有一个项目,而它用于包含多个与输入地址匹配的地址.

google-maps google-geocoding-api

1
推荐指数
1
解决办法
1237
查看次数

标签 统计

google-geocoding-api ×1

google-maps ×1