Google map offers

Does anyone know if there is a way to reproduce the ajax prompt window, for example http://maps.google.com/ on my webpage using google api maps?

An idea would be, for example, if someone writes a "15 Avenue" list of offers:

"15 Americas, New York, NY, USA"

"15 Avenue of the Stars, Los Angeles, California, USA"

Etc

Just yes no qustion =)

thanks

+4
source share
3 answers

Yes.

Look at the geocode request for 15th Avenue ...

http://maps.googleapis.com/maps/api/geocode/json?address=15+Avenue&sensor=false

You will get a list of possible results that you can add to the drop-down list.

+5
source

Google has an example API.

Make sure you download the places library:

 <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3&libraries=places"> </script> 

Next is your javascript:

 var autocomplete; function initialize() { autocomplete = new google.maps.places.Autocomplete( document.getElementById('autocomplete'), { types: ['geocode'] } ); } google.maps.event.addDomListener(window, 'load', initialize); 

With HTML

 <div><input id="autocomplete" type="text"></div> 

Also see https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform

+3
source

I found this in another answer on stackoverflow. This page shows how to provide autocomplete options using google maps / geocoding.

http://tech.cibul.net/geocode-with-google-maps-api-v3/

+2
source

All Articles