开发者

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 );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜