Search code examples
google-mapsgeolocationlocationmaps

Generate Google map link with nearby restaurants


Is there a way to generate a google map link which takes in lat , long values and shows me the place along with the nearby restaurants. Using the places API i get the required response but i get that in JSON format i require a link where you click and it opens up the google maps and shows your respective location and all the nearby restaurants.

If you use this link http://maps.google.com/?q=lat,long it would show me the location corresponding to the lat,long along with that can i also pass in some parameter to locate the nearby restaurants as well something like http://maps.google.com/?q=lat,lng&nearBy=restaurant


Solution

  • If it can be of help to anyone who is facing a similar problem as i was. Found out a way to generate a google link which points to the google maps with nearby restaurants(any field you want to search for can be replaced with the restaurant string)

    http://www.google.com/maps/search/restaurant/@your_latitude,your_longitude,17z
    

    You can replace the /restaurant/ with /bank/ and get the nearby banks to the latitude,longitude specified in the link

    http://www.google.com/maps/search/bank/@your_latitude,your_longitude,17z
    

    17 is the zoom level you can change that as per your requirement.