ジオコード関数の外でマーカー オブジェクトをキャッチできるようにしたいのですが、その方法がわかりません。
私を助けてください。
コード:
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
});
}
}
});
前もって感謝します!