私は入力フィールドを持っていますが、アドレスだけが返ってきます。Google Maps APIオートコンプリート - ストリートネームのみを出力する方法は?
しかし、私がstreetnameを入力するとき、入力フィールドはstreetnameとコンマと街の街を返します。
私は、次のコードしまっ:
<script src="http://maps.google.com/maps/api/js?libraries=places®ion=de&language=de&sensor=false"></script>
<input id="strasse" type="text" size="50">
$(function(){
var input = document.getElementById('strasse');
var autocomplete = new google.maps.places.Autocomplete(input, {
types: ["address"]
});
$("#strasse").focusin(function() {
$(document).keypress(function (e) {
if (e.which == 13) {
infowindow.close();
}
});
});
});
EG:
I入力して "Teststreet" 出力= "Teststreet、ミュンヘン"
リターンは唯一の "Teststreet" でなければなりません。
"、"(多分jQuery上)の後にすべてを削除する方法はありますか?
http://stackoverflow.com/questions/10125189/google-maps-autocomplete-output-only-address-without-country-and-city –
[Google maps Autocomplete:国と都市のない出力のみのアドレス](http://stackoverflow.com/questions/10125189/google-maps-autocomplete-output-only-address-without-country-and-city) –