当我尝试搜索AnimalClinics时,Google Place API未显示当前结果

时间:2019-03-03 13:55:15

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

最初我尝试过

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=19.031959,%2072.895695&radius=10000&type=school&sensor=true&key=AIzaSyCjQ03Ldxx9c55QmQ7ANGKRhEL*********s

此网址显示正确的结果

         "rating" : 3.4,
         "reference" : "ChIJSSUqsiDG5zsRyRBoSTT6WaA",
         "scope" : "GOOGLE",
         "types" : [ "point_of_interest", "school", "establishment" ],
         "user_ratings_total" : 21,
         "vicinity" : "Janardhan Krishna Karmalkar Marg, Brindavan Colony, Chembur West, Mumbai"
      },

但是当我尝试搜索动物诊所时,它显示了一些奇怪的位置。 我的网址:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=19.031959,%2072.895695&radius=10000&type=AnimalClinics&sensor=true&key=AIzaSyCjQ03Ldxx9c55QmQ7ANGKR********

结果:

         "name" : "Nishraj Insurance Services",
         "opening_hours" : {
            "open_now" : true

仅在学校,医院和酒店的位置可以正常工作,但我必须显示最近的动物诊所和牛奶场的位置。

1 个答案:

答案 0 :(得分:0)

此行为符合预期,因为位置类型当前不支持动物诊所,您可以访问文档here来查看当前支持的位置类型。

您可能遇到的地点类型是veterinary_care

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=19.031959,%2072.895695&radius=10000&type=veterinary_care&sensor=true&Key=YOUR_API_KEY

结果将是:

rating: 3.9,
reference: "ChIJVVVVlffO5zsR9rpcrHikEzs",
scope: "GOOGLE",
types: [
"veterinary_care",
"point_of_interest",
"establishment"
],