【发布时间】:2015-05-22 05:00:45
【问题描述】:
我正在探索 Airbnb 的东西是如何运作的,并且对地理搜索感兴趣。例如,我不明白 Airbnb 是如何通过New Zealand 找到他们的广告的?
如果要查看查询字符串参数:
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",国家代码:"NZ"
那么 Airbnb 是如何根据 GET 请求中客户端传递的“新西兰”字符串来检测这些数据的呢?
【问题讨论】:
标签: google-maps google-maps-api-3 geocoding geospatial geo