2011-05-12 17 views
4

我有以下代碼,圓圈已經移動了,現在我希望它是調整大小:如何在google maps v3中製作可調整大小的圈子?

function init() { 
    var mapCenter = new google.maps.LatLng(0, 0); 
    var map = new google.maps.Map(document.getElementById('map'), { 
     'zoom': 1, 
     'center': mapCenter, 
     'mapTypeId': google.maps.MapTypeId.ROADMAP 
    }); 

    var marker = new google.maps.Marker({ 
     map: map, 
     position: new google.maps.LatLng(55, 0), 
     draggable: true, 
     title: 'Drag me!' 
    }); 

    var circle = new google.maps.Circle({ 
     map: map, 
     radius: 3000000 // 3000 km 
    }); 

    circle.bindTo('center', marker, 'position'); 
    } 

    // Register an event listener to fire when the page finishes loading. 
    google.maps.event.addDomListener(window, 'load', init); 

現在,我該怎麼辦尺寸調整?我已經閱讀:http://code.google.com/intl/pt-BR/apis/maps/articles/mvcfun.html 但是沒有其他方法可以做到這一點?

回答

5

該對象具有方法.setEditable(true)。從該文檔中的描述表示:

如果設置爲true時,用戶可以通過拖動控制在中心處和周圍的圓的圓周所示 點編輯這個圓。

相關問題