ITeye博客

通过经纬度获取地址信息(googleMap v3)

y1d2y3xyz · 2011-01-31 22:39 · googleMap · Web前端 · Markdown


//必须要导入googleAPI才可以这么做 V3
var geocoder = new google.maps.Geocoder();
function parseAddress (weidu,jingdu,id){
	if(document.getElementById(id)!=null){
		geocoder.geocode({"address":weidu+","+jingdu}, function(results,status) {
			if (status == google.maps.GeocoderStatus.OK) {			 				document.getElementById(id).innerHTML=results[0].formatted_address;
                 }
		});
	}
}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。