2013-07-20 183 views
0

我看到很多應用程序,我們可以在附近找到當前位置,咖啡廳,歷史景點附近的酒店。我的問題是這些應用程序如何工作。我想使用谷歌地圖查找我所在位置附近的所有美容院。如何使用谷歌地圖查找附近的沙龍

在此先感謝

回答

2

這不是真正的問題。

你應該在這裏分享一些代碼。

從技術上講,應用程序訪問您的設備來獲取您的實際位置。該位置發送到谷歌服務,以獲得附近的場地。

這裏是您正在尋找的API文檔:在500米半徑的位置的酒店+網吧

https://developers.google.com/places/documentation/search#PlaceSearchRequests

一個例子JSON請求看起來是這樣的:

https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=lodging|cafe&sensor=false&key= 

答案:

{ 
    "debug_info" : [], 
    "html_attributions" : [ 
     "Listings by \u003ca href=\"http://www.yellowpages.com.au/\"\u003eYellow Pages\u003c/a\u003e" 
    ], 
    "next_page_token" : "CmRWAAAAsUEgntucrrrrrztccccccccccccccccctrutiuztiztbiuztuizbtiutiuztbiuiuviuzviuzvtiuzvtiuztzt", 
    "results" : [ 
     { 
     "geometry" : { 
      "location" : { 
       "lat" : -33.8682320, 
       "lng" : 151.1944780 
      } 
     }, 
     "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/lodging-71.png", 
     "id" : "44fdc977984610cd873c790a7d850e8185ed0e5e", 
     "name" : "The Star", 
     "opening_hours" : { 
      "open_now" : true 
     }, 
     "photos" : [ 
      { 
       "height" : 645, 
       "html_attributions" : [], 
       "photo_reference" : "CnRnAAAAiPbYRZyb3g2U24OseZ_SY8QsqV6_f7nTvTafCMjNx_ND8XAVSu9GRzlVuC6_vgpNLvla_15CwobVJ8OQ28cErzsRJoEv9oLcGUC0OgjckITJsV8KpFVqMJDckK_6YFVYl338abMILn1WhNelkAqf8RIQ2b2Ce5Iuj8b1r0RRRSl-fxoU5ukXpkS4l2tLXk0ww4AIO1DcPTU", 
       "width" : 1024 
      } 
     ], 
     "rating" : 4.10, 
     "reference" : "CnRlAAAA0DFDJkHyQzlm5FYgwa2LMPqFJ8shLUy8eDuzTL_EJUYywpxhfM1u0tZrs1v2qEm7_jBhLkO6bTZ-9C2DGetrRXddXOOuOpu0_iX3aejDZA4LtnhjnbSsY1dUCKrz4TopBl4C_N0jo-psa8gqpjk7YBIQCITjeps5I49ktTl0YdcmORoUQOEpyEx83-3C31WQhaO244HIKtY", 
     "types" : [ "lodging", "casino", "establishment" ], 
     "vicinity" : "80 Pyrmont Street, Pyrmont" 
     }, 
     { 
     "geometry" : { 
      "location" : { 
       "lat" : -33.8711760, 
       "lng" : 151.1977440 
      } 
     }, 
     "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/lodging-71.png", 
     "id" : "64725a86605e7682a694c5383338e95b8993b398", 
     "name" : "Ibis Sydney Darling Harbour", 
     "photos" : [ 
      { 
       "height" : 512, 
       "html_attributions" : [], 
       "photo_reference" : "CnRpAAAArVHuwn2GgRDxrOCgsD4GFElM6FqS-A0-u73Qu0Nj0oOx0owIchJ0PCrbioL6_69iS_ySkMSXf9mh0lWCrZ4WhuFCd8sEuaXoYTxgnvEcPAOAVrqJh7o1a7P7CYUJokTYYVJsBM4lkqwahLnfSmUHexIQTTSmg_rTSG6IZyQIRvxaFBoU_9xy_-UEolJkP84XmpCJXBd9uu8", 
       "width" : 768 
      } 
     ], 
     "rating" : 2.50, 
     "reference" : "CoQBeQAAADAz-pJrKjgSXfk_6Ob_MgkKhgLFEnDgP8uzr3xD0Dd5-uoOMIWz6nb8LqZClFMkliJWWabGrGVrTt2W2iSpMUCfjisk-PXFPp8wGHF-9UwCZLYUgajlgbaDksAgPpv3MpK_rOGXkDCHhGZR2nDmVjYR-O6DzAqlgxdQjSyMnKZzEhDA-WdS63oMMHyMketIdRQzGhQLhebOlBk_1kaVbuoKrZJ0OVOzDA", 
     "types" : [ "lodging", "establishment" ], 
     "vicinity" : "70 Murray Street, Pyrmont" 
     }, 
     { 
     "geometry" : { 
      "location" : { 
       "lat" : -33.8682560, 
       "lng" : 151.19470 
      } 
     }, 
     "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/lodging-71.png", 
     "id" : "8d3d1de1853d3f71bde4abce55f34d8b08bc0778", 
     "name" : "The Darling", 
     "photos" : [ 
      { 
       "height" : 1632, 
       "html_attributions" : [ "From a Google User" ], 
       "photo_reference" : "CnRoAAAA3PhdRqh3hanXgxS7dPztPzHA0KaHQaF5fzKoL6ZGY70E_ylX9Weg-WSVG2q3aZIN_qakszBSlLXJf7PDkNni2n03q0n1Nny2IUKz299JCLyOawkoXNVNi2iiXMnibGQ9mG43fNpdICFcWjH2qfXANRIQZ4Z9COimQVjrr1dWG-20_RoUZ9FopmujWWO4aUeWE-oFOnjz9HQ", 
       "width" : 920 
      } 
     ], 
     "reference" : "CnRoAAAA_1MR3bAPwizOqNXQmdMZBI2ES9wEG7RljLZy27FX4Hrc1OY_7u6MtGhYHJnFHoMxxTVI2gN-DgMuFvvIiR6iRbMFP0yq-xQpVEpBAXsWFjI_PkmxSHvr24nk0TRVgx2o7deAtQ7vNanSm26-xjrHZhIQC97he353JJ9Kj8DIhArcLBoUbJj58dqAdM5_RCJI_FW_1KmZCmg", 
     "types" : [ "lodging", "establishment" ], 
     "vicinity" : "80 Pyrmont Street, Pyrmont" 
     }, 

這裏是不同的場地類型pes你可以看:

https://developers.google.com/places/documentation/supported_types

相關問題