私はこのジオコードからマーカーの緯度と経度を取得しようとしています。これは皆さんにとっては本当にシンプルなようです。申し訳ありませんが、私はaddListenerのようなものをたくさん試しましたが、何も動作していないようです。助けてください:(Googleマップgeocode to latlng
function codeAddress() {
var address = document.getElementById("address").value;
geocoder.geocode({ 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}
実際には、ジオコードの緯度と経度を取得し、テキストボックスに表示することです – catt17
あなたの提案に感謝nosoul ..私は私のジオコードの座標を抽出して表示する方法を見つけることができましたテキストボックスには表示されません。以下に投稿した回答を参照してください。 – catt17