我想要一个用于谷歌地图的交互式圆圈,当我改变滑块的半径时它会增加或减少。
当我增加半径时它工作正常,但在减小半径时它不会改变(减少)地图中的圆圈
$(function() {
$("#slide").slider({
orientation: "horizontal",
range: "min",
max: 10000,
min: 500,
value: 500,
slide: function( event, ui ) {
drawCircle(ui.value);
}
});
});
function drawCircle(rad){
circle = new google.maps.Circle({
strokeColor: "#FF0000",
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: "#FF0000",
fillOpacity: 0.35,
map: myMap,
radius: rad });
circle.bindTo('center', marker, 'position');
}