Foursquare venue search / Google Maps search
I'm trying to implement a venue search for Foursquare. I want the user to type in a city, or a street within a city, or a specific venue (e.g. "Cinema London") so that all venues around this place are listed. The problem is, that the foursquare API requires a "ll" attribute where the latitude and longitude of the user is given. Then around this position, venues are displayed.
https://api.foursquare.com/v2/venues/search?ll=40.7,-74
There is a "query" attribute which can be applied optional and which includes a search term for the venues around the "ll" attribute. The problem is, that I do开发者_Python百科n't have the position of the user. I want the user to type in a city and/or a venue like in Google Maps. That was, btw, my second idea. Search a venue through the Google Maps Geocoder and call then foursquare with this lat/long values.
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
}
});
I'm wondering if there is a better, and faster method, so that I don't have to call Google Maps first, than send the value to foursquare and then get the results.
Hope someone can help me!
thx, tux
I see http://www.4sqmap.com/search use similar method to what your described. Its text "Location" is converted to GPS location for a foursquare venue search. Seems that's done via Google Maps API.
Looks like there are no better options.
精彩评论