i’m using google v3 js and i am trying to get the center of the circle whenever the person drag the circle or expand the circle. currently i do not know any event that is able to tigger that
<script type="text/javascript">
var latt = 1.3738459931841047;
var longg = 103.79745483398437;
var radius = 1000;
function alertame(lat, long) {
document.getElementById("<%= lblLatitute.ClientID %>").textContent = lat;
document.getElementById("<%= lblLongitude.ClientID %>").textContent = long;
latt = lat;
longg = long;
}
function show_alert() {
alert(latt + "hello"+radius);
}
function initialize() {
var myOptions = {
center: new google.maps.LatLng(1.3738459931841047, 103.79745483398437),
zoom: 11,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
var circleOptions = {
center: new google.maps.LatLng(latt, longg),
radius: radius,
map: map,
editable: true
};
var circle = new google.maps.Circle(circleOptions);
google.maps.event.addListener(circle, 'radius_changed', function () {
radius = circle.getRadius();
alert("test");
});
google.maps.event.addListener(circle, 'drag', function () {
alert("test");
});
circle.setMap(map);
}
</script>
<style type="text/css">
.style1
{
width: 124px;
}
</style>
Solved by using the below