jQueryを使用してasp.netで地理座標を取得します 以下はコードです
テキストボックスに住所を入力し、ラベルに緯度と経度を表示したい。誰かが私に正しい方法を提案できますか
<script type="text/javascript">
var geocoder = new google.maps.Geocoder();
var address = "adeliade";
geocoder.geocode({ 'address': address }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK) {
latitude = results[0].geometry.location.lat();
longitude = results[0].geometry.location.lng();
alert(latitude + ", " + longitude);
}
});
</script>