我希望能够在地理编码功能之外捕获标记对象并且无法弄清楚如何。
请帮我。
编码:
geocoder.geocode({ address: address },
function(results, status) {
if (status == google.maps.GeocoderStatus.OK && results.length) {
if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
position: results[0].geometry.location,
map: map
});
}
}
});
提前致谢!