Sure Erick, use Google Places API. You can use the search by query. So you 
give to the API a query like this: "Google Inc near Mountain View, CA - 
USA". The API prioritize it by location, so the closest companies will 
appear first on the result.

You can actually do that using both, a google web-service, so you just call 
a http request with the url to the API, or use the JavaScript API. Only 
thing is you need to generate an API key in order to have it working, do 
you know what the API key is?

Here is an example to get the information I just told you, just copy and 
paste to your browser and see the result!
https://maps.googleapis.com/maps/api/place/textsearch/xml?query=Google+Inc+near+Mountain+View,+CA+-+USA&sensor=false&key=ADD_YOUR_KEY_HERE

If you want to do this through JavaScript, you should actually move to the 
Google Maps JavaScript API V3 group, the V2 is being deprecated.
Here is an example:

First, you have to have this code to call the API (add this to your HEAD 
session in the HTML file):
<script src="https://maps.googleapis.com/maps/api/js?libraries=geometry,*
places*&sensor=false&key=YOUR_KEY_HERE"></script>

Then you have to create the places service object:
var placesService = new google.maps.places.PlacesService(map);

Then this is the code to get the result!
placesService.textSearch('Google Inc near Mountain View, CA - USA', 
function(){alert('YOUR_CODE_HERE');});

BR,
Jonathan



Em sexta-feira, 25 de janeiro de 2013 16h04min05s UTC-5, Erick Nassar 
escreveu:
>
> We have a database of companies with incomplete street addresses. A lot of 
> them only have a city and state, so in the end we end up with a lot of 
> duplicate addresses. We are using Google Fusion Tables to map these 
> records, and the result is a single pinpoint for each address. So, Is it 
> possible to write a few lines of code against the Google Maps API where I 
> send it a company name, city, state, country string and get back 
> prioritized list of physical addresses?

-- 


Reply via email to