Foursquare场地搜索/谷歌地图搜索

时间:2011-02-14 10:38:20

标签: javascript api google-maps foursquare

我正在尝试为Foursquare实施场地搜索。我希望用户键入城市,城市内的街道或特定场所(例如“Cinema London”),以便列出该地点周围的所有场所。 问题是,foursquare API需要“ll”属性,其中给出了用户的纬度和经度。然后围绕这个位置展示场地。

https://api.foursquare.com/v2/venues/search?ll=40.7,-74

存在“查询”属性,该属性可以应用为可选的,并且包括“ll”属性周围的场所的搜索项。问题是,我没有用户的位置。我希望用户在Google地图中输入城市和/或地点。 那是,顺便说一下,我的第二个想法。通过Google Maps Geocoder搜索地点,然后使用此纬度/经度值调用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,然后得到结果。

希望有人可以帮助我!

THX, TUX

1 个答案:

答案 0 :(得分:1)

我看到http://www.4sqmap.com/search使用与您描述的方法类似的方法。它的文本“位置”被转换为GPS位置,用于四方场地搜索。似乎是通过Google Maps API完成的。

看起来没有更好的选择。

相关问题