javascript:
$(document).ready(function(address){
var address = "{{ userprofile.work_street }},{{userprofile.work_suburb}},{{userprofile.work_postcode}},{{ userprofile.work_country }}";
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location,
});
$("#img-clck").hide();
}
});
$('#refreshmap').on('click', address);
});
html:
<button type="button" id="refreshmap" class="map_buttons button_style">Refresh map</button>
Onload 它在指定地址上显示标记,如果我按刷新按钮,地图会刷新,但刷新 4 或 5 次后,标记会消失。
需要帮忙。