Redrawing/refreshing/updating overlays

Hi everyone,

I am working on some project that uses viewer.get(‘overlays’) to show some additional data on thye diagram. I am able to add it in the place where |I want and with the style that I want. Now I would like to add some differents overlay point in the diagram after removing old ones. I have some combobox in my app, that based on selection different data is shown on the diagram.
When app starts, diagram is firstly created, then I add overlays and everything works fine. Now I need on combo selection to remove old overlays and add new once. I thought it will be piece of cake but it seems like it is not that easy.

I attempt to remove overlays in different ways e.g.

viewer().get(‘overlays’).clear() ;

var overlays = viewer().get(‘overlays’);
_for ( var id in overlays.overlays) {
overlays.remove(id);
}

and then run my standard script that adds new overlays points but all I can see in the diagram that old points are removed, and nothing else happens. When I refresh hole page by pressing F5 I can see that diagram has different overlay!! Now how to force overlay to be refreshed. I do not want to rebuilt/recreate hole diagram every combo selection. I want just the overlay to be changed. Is there a way to do it?

thank you for you help,
cheers

Sorry , it is my mistake, everything works just fine! Problem does not appear at all :slight_smile: