我有一个问题,因为我不知道如何在标记点添加圆圈。但是我想当我移动标记时,圆圈的位置也会改善。这是我的代码的一部分。
<script>
function initMap() {
var radius_circle = 50000;
mapOptions = {
zoom: 6,
center: center,
disableDefaultUI: false,
scrollWheel: true,
draggable: true,
var center = {lat: 52.215933, lng: 19.134422};
};
var map = new google.maps.Map(
document.getElementById('map'), mapOptions);
// create marker
marker = new google.maps.Marker({
position: mapOptions.center,
map: map,
draggable: true
});
var circle = drawCircle(mapOptions.center, radius_circle);
// draw circle
function drawCircle(center, radius) {
return new google.maps.Circle({
strokeColor: '#0000FF',
strokeOpacity: 0.7,
strokeWeight: 1,
fillColor: '#0000FF',
fillOpacity: 0.15,
draggable: true,
map: map,
center: center,
radius: radius
});
}
</script>