【发布时间】:2011-02-14 10:38:19
【问题描述】:
我正在尝试为 Foursquare 实施场地搜索。我希望用户输入城市、城市内的街道或特定场所(例如“伦敦电影院”),以便列出该地点周围的所有场所。 问题是,foursquare API 需要一个“ll”属性,其中给出了用户的纬度和经度。然后在这个位置周围显示场地。
https://api.foursquare.com/v2/venues/search?ll=40.7,-74
有一个“查询”属性可以应用为可选,其中包括围绕“ll”属性的场所的搜索词。问题是,我没有用户的位置。我希望用户在谷歌地图中输入城市和/或地点。 那是,顺便说一句,我的第二个想法。通过 Google 地图地理编码器搜索场地,然后使用此纬度/经度值调用foursquare。
geocoder.geocode( { 'address': 'london trafalgar square'}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
// here, call the foursquare api
// in results[0].geometry.location the location of the first location is stored
}
});
我想知道是否有更好更快的方法,这样我就不必先调用谷歌地图,而是将值发送到foursquare然后获取结果。
希望有人可以帮助我!
谢谢, 晚礼服
【问题讨论】:
标签: javascript api google-maps foursquare