Adi*_*rma 4 javascript latitude-longitude
我是第一次使用javascript.实际上我想使用java脚本获取地址的纬度和经度.任何人都可以指导我..
如果您需要给定地址的纬度和经度,可以使用google maps api https://developers.google.com/maps/documentation/javascript/
以下是一个示例:https: //google-developers.appspot.com/maps/documentation/javascript/examples/geocoding-simple
编辑:在警告弹出窗口中显示它:
var address = document.getElementById("address").value;
var geocoder = new google.maps.Geocoder();
geocoder.geocode( { 'address': address}, function(results, status) {
var location = results[0].geometry.location;
alert(location.lat() + '' + location.lng());
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
32377 次 |
| 最近记录: |