user1178102
user1178102

Reputation: 11

Ploting foursquare venues on google map

Has anyone got sample code/file which they could share as i am trying to plot foursquare venues on a Google map. For example: Given the Long and Lat of i.e. London. i would like to show restaurants within a 3 miles radius. Is this possible without having to pass the client ID when using the API?

Your help would be greatly appreciated

Kamran

Upvotes: 1

Views: 2708

Answers (1)

Jonathan Levison
Jonathan Levison

Reputation: 2617

Do not have a direct sample you can copy paste, but it is not that complicated to do:

Foursquare wise: You must register as a consumer here, this gives you a Client ID + Secret.
You do not need to have your users go through the authentication to just display the venue information around a specific lat/lng, you can use the Venue Platform for that, specifically search for venues and (if required) get the venue details.

According to your specific example, show restaurants in a 3 mile (~5000 meters) radius, you will want to call search with intent=browse, radius=5000, ll={your search location}, limit=50 (the max) and categoryId=4d4b7105d754a06374d81259 (it is the food category, see here on how to get the category id listing)

So searching will produce a json array of foursquare locations, from there you can take what data you need and display it on google map via the maps api. For Maps v3 you will probably want to drop a marker for each venue returned.

Also check out this answer for how to drop pins on google maps: Google Maps API - Drop a new pin

Upvotes: 4

Related Questions