如何用Google Map API取得当前位置的周边信息

网友 1

最佳答案

回答者:网友
var map = new GMap2(document.getElementById("map"));
var geocod身每损美员她量er = new GClientGeocoder();

function showAddress(addr来自ess) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " not found");
} else {
map.setCenter(point, 13);
var marker = new GMarker(point);
map.addOverlay(marke特元r);
marker.openInfoWindowHtml(address);
}
}
);
}

我来回答