Google map overlay update technique
I have a circle on the a map that I need to update, here开发者_StackOverflow 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?
According to the documentation, you should just be able to do this
circle.setOptions( circleopts );
精彩评论