开发者

Google map overlay update technique

开发者 https://www.devze.com 2023-01-20 07:13 出处:网络
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;

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

精彩评论

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