2011-08-08 6 views
4

誰かが私のウェブページにGoogleマップのAPIを使用してhttp://maps.google.com/のようなajaxの提案ボックスを再現する方法があるかどうか知っていますか?Googleマップの提案を

誰かが「15番街」の下の提案のリストを書き込むとアイデアは、たとえば次のようになります。

「15アメリカ大陸のアベニュー、ニューヨーク、NY、米国」

「15番街のスター、ロサンゼルス、CA、米国」

その他、各種

だけはいいいえqustion =)

おかげ

答えて

3

GoogleからのAPIの例があります。

あなたはplacesライブラリのロードを確認します。またhttps://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform

を参照してくださいHTML

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

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

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

次あなたのjavascriptを