0
我在探索Airbnb的工作原理,並對地理搜索感興趣。我不明白Airbnb如何通過New Zealand找到他們的廣告?Airbnb如何實現地理搜索?
如果看一下查詢字符串參數:
page:1
location:New Zealand
ss_id:3sdsi3ff
只有位置字符串New Zealand
進入到服務器,但不是像座標LNG,LAT。
但在響應我們得到以下:
center_lat: -40.900557
center_lng: 174.885971,
geo: {accuracy: 1, district: null, city: null, state: null, country: "New Zealand", country_code: "NZ",…}
accuracy: 1
city: null
colloquial_area: null
country: "New Zealand"
country_code: "NZ"
district: null
market: "Other (International)"
natural_feature: null
result_type: "country"
state: null
state_short: null
success?: true
我們看到,我們得到center_lat: -40.900557 center_lng: 174.885971
座標,國家:"New Zealand"
,COUNTRY_CODE:"NZ"
那麼,如何製作的Airbnb可以檢測基於該數據在GET請求中從客戶端傳遞的「新西蘭」字符串?
那麼有可能在服務器端使用地理編碼?我使用nodejs服務器 – Erik 2015-03-19 10:20:14
我認爲你可以使用相同的API,因爲注意js只是JavaScript ... – kaho 2015-03-19 13:22:47
你的意思是Google Maps API? – Erik 2015-03-19 13:24:21