2
콤보 메뉴의 값을 변경하여 원 반경을 변경하려고합니다. 그래서 나는 onchange 함수를 다음과 같이 썼다.Google Map API에서 마커 주변의 원 반경을 변경하는 방법
function changeRadius(){
var selectedRadius = (document.getElementById("circle_radius").value)*1000;
var circle = new google.maps.Circle({
map: map,
radius: selectedRadius // radius unit is meter.
});
var marker2 = new google.maps.Marker({
map: map,
position: new google.maps.LatLng(40,-90),
draggable: true,
title: 'Drag me!'
});
circle1.bindTo('center', marker2, 'position');
}
하지만 작동하지 않습니다. 어떤 생각?
google maps api documentation이 원에 대한 bindTo() 함수를 나타내지 않고 자체 함수입니까? – slawekwin
이 질문은 https://stackoverflow.com/questions/15095118/interactive-circle-in-google-map-which-changes-on-changing-radius의 중복이며 원하는 답변은 https :// /stackoverflow.com/a/15095490/1290746 – kris