2013-06-05 28 views
3

JS:地圖刷新點擊JavaScript的

function initialize() { 
    var latLng = new google.maps.LatLng({{location_latitude}}, {{location_longitude}}); 
    var map = new google.maps.Map(document.getElementById('mapCanvas'), { 
    zoom: 8, 
    center: latLng, 
    mapTypeId: google.maps.MapTypeId.ROADMAP 
    }); 

地圖加載在頁面加載的時間。

除此之外,我需要它來刷新在地圖上點擊一個按鈕,即"<button>Refresh Map</button>"

如何使地圖刷新上點擊Refresh Map按鈕。

回答

3
$('button').on('click',initialize); 
+0

工作正常....謝謝 – user2086641