Ploting foursquare venues on google map - google-maps-api-3

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

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

Related

Is it possible to include businesses in the HERE Geocoder Autocomplete Search?

Use Case:
I've got a search box where the intention is to search for addresses, cities and businesses, and up to 5 matching locations will be returned. Then, I'll use the geocoder to get lat/lon coordinates for a selected location based upon locationId.
Desired Outcome: The geocoder autocomplete API works well for cities/states/addresses/etc., but I'd like for the results to include businesses as well (where a business result would come with a locationId). Is this going to be possible with the Here API? Using the Places segment of the API would be an option as well if there's a path forward along that route.
NO, Geocoder API helps to find only addresses based on housenumber, street, country ,county, pincode but it does not tell you if the address is of a business category.
You can try Places API and check if it works for your usecase. Read more at developer.here.com/documentation/places/topics/quick-start-find-text-string.html.
Below is an example of Hotel category(Business) in Sunny Vale, CA. You can get the id and location details here.
https://places.cit.api.here.com/places/v1/discover/explore?at=37.370831%2C-122.024636&cat=500-5000-0000&cs=pds&Accept-Language=en-US%2Cen%3Bq%3D0.5&app_id=xxxx&app_code=xxxx

how to get street coordinate from google map api?

I am trying to make a web app based on google map api.I want to put image icon at different position of street in map.
how wiil i get these street coordinate from google map api?
Please give your useful suggestion.
Thanks.
Google have a service called Geocoding - you send a request including an address, a google.maps.latLng, or a Place_ID and it returns an array with all three of them. they explain all about this here.

Google Maps API and ASP.Net

I am new to Google Maps API and I have a requirement to integrate Google Maps API with an ASP.Net application. Is there a Google service where in I can input a UK postcode and radius as input parameters and get results only, without the map.
For example if I search for solicitors in a particular area like Z1 1XY (not real post code) with a radius of 5 mi, can I get the results of all solicitors with the postcodes 5 mile radius? Is there any service that would return the result set only? I know GeoCoding does something similar but can I provide radius as one of the input parameter and get results.
Any help would be appreciated. Thanks in advance.
Seaton
The Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.
Source: https://developers.google.com/maps/documentation/geocoding/#Limits
yes, you can use the Google Geocoding API to do address lookups (in this case postcodes). The response contains lat/lon co-ordinates which you can then subsequently use as the epicenter of your search to find items within a radius. Have a look at this blog post on how to use the DbGeography in .NET to perform radius queries based on lat/lon co-ordinates.

two sets of locations on googlemaps

I have a two lists of locations....(via postcodes or long and lats), and would like to put two lists onto the same googlemap... but representas different colours..
It is a follow up to the original question
postcode distances using google
I.e. Is there a away to put up all the student locations and the school locations on a single google map represented as different colours?
maybe using googleVis?
Sounds like a "categories" map. Here is an example of a categories map from Mike Williams' Google Maps API v2 tutorial ported to the Google Maps API v3.
If you have a significant amount of data it would be impractical to show them all at one time. It would be better to show only one data type eg schools and if you click on an individual marker show the nearest students within a specific radius of that school.
The answer for your last question shows you how to find the coordinates required to display on map

Google places API: from CID to reference?

My objective: populate a database with known business places in order to generate maps with those places. I insist on "known places", because my users will only search for the places that are in the database.
I don't want to recreate business places as markers on the map (so latitude and longitude is not enough to id a place), because the places are already available on Google Maps with interesting information (address, comments, ratings, pictures...).
The natural reference is to use the CID and store it in the database.
Now imagine the database is populate with places and their CID, and I want to generate maps with those places as click-able markers. When the user clicks on the marker, she access the business place's page, e.g. http://maps.google.com/maps/place?cid=998657413562662319. Great!
But how to generate those maps? I don't have the coordinates in the database (assumption). And I cannot use Google Places API (which would give me the coordinates), because it uses a different reference, to retrieve the location of the business so as to generate the maps.
Any ideas?
Thanks a lot!
To clarify: I want to use Google Maps API to generate a map with many business places of which I know the CID. It is comparable to "my maps" in Google. Only that I want to store the places in my database.
Potential solution: For each business in the database, store the name, CID, and coordinates. Write a script that uses Google Places to find businesses at specific coordinates. Loop through the response array (JSON/XML) until the response with the CID corresponding to the searched business is found. Store the Google Places reference into the database. Repeat this script for each newly added business. Cumbersome...
Is this what you are looking for?
http://maps.google.com/maps?cid=998657413562662319
It looks like your best option if you want more than one cid on a map is to use:
http://maps.google.com/maps?cid=998657413562662319&q=a&output=json

Resources