无效地点请求

Invalid Places Request

我正在发送这样的请求:

https://maps.googleapis.com/maps/api/place/search/json?radius=30&location=37.7858742105946,-122.406341359019&rankby=distance&key=MYKEYHERE&type=establishment

但是返回的响应是这样的:

{
   "html_attributions" : [],
   "results" : [],
   "status" : "INVALID_REQUEST"
}

我的请求有什么问题导致它无效?

来自文档:

radius — Defines the distance (in meters) within which to return place results. The maximum allowed radius is 50 000 meters. Note that radius must not be included if rankby=distance (described under Optional parameters below) is specified.

从请求中删除 rankby=distance(对于 30 米半径,它没有意义)。

https://maps.googleapis.com/maps/api/place/search/json?radius=30&location=37.7858742105946,-122.406341359019&key=<KEY>&type=establishment

给我这个回复:

{
   "html_attributions" : [],
   "results" : [
      {
         "geometry" : {
            "location" : {
               "lat" : 37.7860877,
               "lng" : -122.4064646
            },
            "viewport" : {
               "northeast" : {
                  "lat" : 37.7874464802915,
                  "lng" : -122.4050379197085
               },
               "southwest" : {
                  "lat" : 37.7847485197085,
                  "lng" : -122.4077358802915
               }
            }
         },
         "icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/shopping-71.png",
         "id" : "acf15a7460a5b2a3c8f7bba1af978fb2fc744f0d",
         "name" : "A/X Armani Exchange",
         "opening_hours" : {
            "open_now" : false,
            "weekday_text" : []
         },
         "place_id" : "ChIJZyuhr4iAhYARpQEX4hwEJQI",
         "rating" : 4.1,
         "reference" : "CmRRAAAAMfTprFXJRaU_yLIqTAeIcGTxQ_6S2eYtBeRTwKk_7Pl6yXePzu3fNbz1gsEyTGEE_l8k_iW7VPjjpL34ynxSdzti1ivWeFQds_m9UD7cEqTuIldgqnT-46iySaeTEdMtEhBCcM7tqTnT5B_4a7gnK81cGhRJKFvJGTM33KhWHKUlrZ6xN7TuEQ",
         "scope" : "GOOGLE",
         "types" : [ "clothing_store", "store", "point_of_interest", "establishment" ],
         "vicinity" : "25 Stockton Street, San Francisco"
      }
   ],
   "status" : "OK"
}