表单中的地理位置

| 我有一个Javascript表单,用户可以在其中输入地址,城市和州。提交此表单后,我希望将地址转换为纬度和经度,并将这两个值存储到数据库中。任何帮助都将不胜感激!     
已邀请:
看一下这个: http://batchgeo.com/lookup/     
您可以使用Google Maps API v3,例如:
//get the input from user, in a normal looking address string
var add = this.ListingAddress + \', \' + this.ListingCity + \', \' + this.ListingZipCode;

var geocoder = new google.maps.Geocoder();
geocoder.geocode({ \'address\': add }, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK) {
        var LatLong = results[0].geometry.location; //here is the LatLong
    } else {
        alert(\"Address not found! Error Code: \" + status);
    }
});
    

要回复问题请先登录注册