-1
var placeSearch, autocomplete;
var componentForm = {
street_number: 'short_name',
route: 'long_name',
locality: 'long_name',
administrative_area_level_1: 'short_name',
country: 'long_name',
postal_code: 'short_name'
};
function initialize1() {
// Create the autocomplete object, restricting the search
// to geographical location types.
autocomplete = new google.maps.places.Autocomplete(
/** @type {HTMLInputElement} */
(document.getElementById('cityzip')), {
types: ['geocode']
});
// When the user selects an address from the dropdown,
// populate the address fields in the form.
google.maps.event.addListener(autocomplete, 'place_changed', function() {
console.log(autocomplete.getPlace().geometry.location);
});
}
私はなぜそれが自動提案を表示していない、なぜそれがコンソールで緯度と経度を表示しないのを助けてください。どうすれば解決できますか?申し訳ありませんが文法やスペルミス。Googleの自動補完機能が動作しない解決方法?
ご例えばhttps://jsfiddle.net/リンクを投稿してください。 –
GoogleマップのJavascript API v3をどのように含めていますか?あなたは場所の図書館を含めていますか?あなたの鍵に対応していますか?問題を示す[mcve](**そのものに** **)を記入してください。 – geocodezip
@geocodezipのすべての質問が回答された後、jsFiddleや他の外部サイトの質問に答えてください - [JavaScriptコンソール](https://webmasters.stackexchange.com/questions/)にエラーがありますか? 8525/how-to-the-javascript-console-in-different-browser?) –