Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use the Google Maps API to find landmarks near a given location?

I want to be able to use the Google Maps API to give me a list of the nearest landmarks from a given location. Consider a situation where I give latitude and longitude to the Maps API and in return it gives a list of landmarks (collection of latitude and longitude coordinates). Is this possible with the Maps API?

like image 455
MasterCode Avatar asked Feb 12 '23 09:02

MasterCode


1 Answers

It depends what you mean by landmark, but the Google Place Search API sounds similar to what you're asking for. In each request, you need to pass in a location, the maximum distance from the location you want results from and optionally the type of place(s) you want to search for. The list of supported place types is here.

If you go through that list and decide which ones you class as landmarks, then you could search for just those by separating the types with a pipe symbol in your search string. e.g. (type1|type2|etc)

like image 157
Alain Bates Avatar answered May 14 '23 14:05

Alain Bates