如何到达最近的地方?

时间:2014-02-12 07:19:01

标签: google-maps-api-3

我正在使用以下代码:

我想从谷歌到最近的地方(只需要最近的结果)。

为此,我改变了半径,但结果是错误的。

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=6.384314,81.324417&radius=1000&types=accounting|airport|amusement_park|aquarium|art_gallery|atm|bakery|bank|bar|beauty_salon|bicycle_store|book_store|bowling_alley|bus_station|cafe|campground|car_dealer|car_rental|car_repair|car_wash|casino|cemetery|church|city_hall|clothing_store|convenience_store|courthouse|dentist|department_store|doctor|electrician|electronics_store|embassy|establishment|finance|fire_station|florist|food|funeral_home|furniture_store|gas_station|general_contractor|grocery_or_supermarket|gym|hair_care|hardware_store|health|hindu_temple|home_goods_store|hospital|insurance_agency|jewelry_store|laundry|lawyer|library|liquor_store|local_government_office|locksmith|lodging|meal_delivery|meal_takeaway|mosque|movie_rental|movie_theater|moving_company|museum|night_club|painter|park|parking|pet_store|pharmacy|physiotherapist|place_of_worship|plumber|police|post_office|real_estate_agency|restaurant|roofing_contractor|rv_park|school|shoe_store|shopping_mall|spa|stadium|storage|store|subway_station|synagogue|taxi_stand|train_station|trave_agency|university|veterinary_care|zoo&sensor=false&key=AIzaSyA0JD_Z2Uo2AfnDTejQFWHAXOIaRRpjF8c

1 个答案:

答案 0 :(得分:0)

按距离排序结果(使用rankby - 参数):

https://maps.googleapis.com/maps/api/place/nearbysearch/json?rankby=distance&location=6.384314,81.324417&types=accounting|airport|......&sensor=false&key=AIzaSyA0JD_Z2Uo2AfnDTejQFWHAXOIaRRpjF8c

注意:

  • 在这种情况下你必须省略半径
  • 无法将结果数量限制为特定值