Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Google Maps API offer a way to search for locations by name?

Tags:

When one visits http://maps.google.com, they are able to type queries into the search field and receive results based on locations or places, and not hard search results, as they would in a normal Google Search query. They're a unique style of result (names of places, locations) suited to the Maps interface for obvious reasons.

I've been digging through both the Maps and standard Google Search API for a couple hours now, and have done multiple searches on this question, and I can't seem to find the answer.

They obviously have the Local Search, but that's been deprecated, and it only yields results if you provide an initial lat/long. I want to be able to find places or locations with no initial lat/long.

Essentially what I want to do is allow a user to type in an address, name of a place or name of a city or state or a zip code, or essentially any other kind of location that is allowable on Maps, and geocode it. I feel stupid because this seems like it has to be there, but nothing I've seen in the API seems to do this.

I don't need the AJAX suggested results, necessarily. Just a way for a user to type in a nice name and geocode from it, though results as a user types would be ideal.

What am I missing here?

like image 334
dclowd9901 Avatar asked May 08 '11 08:05

dclowd9901


2 Answers

What you are looking is Geocoding API from google maps.

Find Documentation here

UPDATE 5/12/2011

Google just opened up public access to their Places API. This is more to the heart of the original question request:

https://developers.google.com/maps/documentation/places/web-service/autocomplete

like image 136
rbawaskar Avatar answered Oct 12 '22 22:10

rbawaskar


I think you're looking for the google.maps.Geocoder class:

A service for converting between an address and a LatLng.

like image 42
mu is too short Avatar answered Oct 12 '22 22:10

mu is too short