You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Maps Autocomplete选择后返回错误城市问题求助

Google Maps Autocomplete地址显示不一致问题

我们在网站中使用Google Maps Autocomplete功能时遇到异常:输入地址31900 S Las Vegas Blvd, Primm, NV 89019, USA后,下拉列表显示正确地址,但选中该条目后,Place对象返回的城市为Jean而非Primm。当前使用的是Google Maps API 3.43.3。

自动补全请求

https://maps.googleapis.com/maps/api/place/js/AutocompletionService.GetPredictions?1s31900%20S%20Las%20Vegas%20Blvd%2C%20Prim%2C%20NV%2089019%2C%20USA&4sen-US&7scountry%3Aus&15e3&20sE64F37BA-8B6D-4A33-86BE-83F54790D5472pjedyc73ylv&21m1&2e1&callback=_xdc_._dz8gxh&key=xxxxx&token=xxxx

自动补全响应(注意返回的城市为Primm)

[0,[["31900 S Las Vegas Blvd, Primm, NV 89019, USA",null,["premise","geocode"],"ChIJ10dOFw9Ez4ARmRsXd3LXKB0",null,[["31900",0],["S Las Vegas Blvd",6],["Primm",24],["NV",31],["89019",34],["USA",41]],[[0,5],[6,16],[24,5],[31,2],[34,5],[41,3]],null,"ChIJ10dOFw9Ez4ARmRsXd3LXKB0",["31900 S Las Vegas Blvd","Primm, NV 89019, USA",[[0,5],[6,16]],[[0,5],[7,2],[10,5],[17,3]]]],["31900 S Las Vegas Blvd, Primm, NV 89054, USA",null,["street_address","geocode"],"EiwzMTkwMCBTIExhcyBWZWdhcyBCbHZkLCBQcmltbSwgTlYgODkwNTQsIFVTQSIyEjAKFAoSCft3o2d4Sc-AEYLrJ4-B0RgjEJz5ASoUChIJ07Ypyp3DyIARp-OXpm9DxRM",null,[["31900 S Las Vegas Blvd",0],["Primm",24],["NV",31],["89054",34],["USA",41]],[[0,22],[24,5],[31,2],[34,5],[41,3]],null,"EiwzMTkwMCBTIExhcyBWZWdhcyBCbHZkLCBQcmltbSwgTlYgODkwNTQsIFVTQSIyEjAKFAoSCft3o2d4Sc-AEYLrJ4-B0RgjEJz5ASoUChIJ07Ypyp3DyIARp-OXpm9DxRM",["31900 S Las Vegas Blvd","Primm, NV 89054, USA",[[0,22]],[[0,5],[7,2],[10,5],[17,3]]]]]]

选中下拉条目后触发的请求

https://maps.googleapis.com/maps/api/place/js/PlaceService.GetPlaceDetails?2sen-US&10e3&14m1&1sChIJ10dOFw9Ez4ARmRsXd3LXKB0&15sE64F37BA-8B6D-4A33-86BE-83F54790D5472pjedyc73ylv&16m1&1saddress_com

响应(注意城市/区域为Jean而非Primm)

{
   "html_attributions" : [],
   "result" : {
      "address_components" : [
         {
            "long_name" : "31900",
            "short_name" : "31900",
            "types" : [ "street_number" ]
         },
         {
            "long_name" : "South Las Vegas Boulevard",
            "short_name" : "S Las Vegas Blvd",
            "types" : [ "route" ]
         },
         {
            "long_name" : "Jean",
            "short_name" : "Jean",
            "types" : [ "locality", "political" ]
         },
         {
            "long_name" : "Clark County",
            "short_name" : "Clark County",
            "types" : [ "administrative_area_level_2", "political" ]
         },
         {
            "long_name" : "Nevada",
            "short_name" : "NV",
            "types" : [ "administrative_area_level_1", "political" ]
         },
         {
            "long_name" : "United States",
            "short_name" : "US",
            "types" : [ "country", "political" ]
         },
         {
            "long_name" : "89019",
            "short_name" : "89019",
            "types" : [ "postal_code" ]
         }
      ],
      "adr_address" : "\u003cspan class=\"street-address\"\u003e31900 S Las Vegas Blvd\u003c/span\u003e, \u003cspan class=\"locality\"\u003eJean\u003c/span\u003e, \u003cspan class=\"region\"\u003eNV\u003c/span\u003e \u003cspan class=\"postal-code\"\u003e89019\u003c/span\u003e, \u003cspan class=\"country-name\"\u003eUSA\u003c/span\u003e",
      "formatted_address" : "31900 S Las Vegas Blvd, Jean, NV 89019, USA",
      "geometry" : {
         "location" : {
            "lat" : 35.6101639,
            "lng" : -115.3921341
         },
         "viewport" : {
            "northeast" : {
               "lat" : 35.6115836802915,
               "lng" : -115.3906660197085
            },
            "southwest" : {
               "lat" : 35.6088857197085,
               "lng" : -115.3933639802915
            }
         }
      },
      "name" : "31900 S Las Vegas Blvd"
   },
   "status" : "OK"
}

请问该异常产生的原因是什么?是Google服务器端的Bug,还是我方可以自行修正?


内容的提问来源于stack exchange,提问作者Michael Kurtz

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.20 15:12:01