如何获得可编辑圈子的半径Google Map Api V3?可能吗?

时间:2013-02-02 08:37:44

标签: javascript google-maps-api-3 overlay

 var sunCircle = {
    strokeColor: "#c3fc49",
    strokeOpacity: 0.8,
    strokeWeight: 2,
    fillColor: "#c3fc49",
    fillOpacity: 0.35,
    map: map,
    center: userPosition,
    radius: 1000, // in meters
    editable:true
};
cityCircle = new google.maps.Circle(sunCircle);
cityCircle.bindTo('center', marker, 'position');

现在它的Editable是真的我们可以编辑圆圈,如果用户改变半径,我可以获得半径吗?

1 个答案:

答案 0 :(得分:5)

google.maps.event.addListener(cityCircle, 'radius_changed', function () {
    console.log(cityCircle.getRadius());
});

您可以找到有关编辑活动here

的更多信息