views:

21

answers:

1

I have a circle on the a map that I need to update, here is one way to do it:

circleopts.radius=100*distance;
// delete old circle overlay
circle.setMap(null);
// create new circle overlay
circle = new google.maps.Circle(circleopts);
// display new circle overlay
circle.setMap(map);

For some reason I don't find this very elegant. Is that the best way to do it?

+1  A: 

According to the documentation, you should just be able to do this

circle.setOptions( circleopts );
Peter Bailey
Nice, thanks, I could not find that
standup75