Closed wmbeers closed 2 years ago
Traced it back to the scope of the "_handlers" arrays created in the declarations of _DynamicSublayer and _DynamicFolder. These are assigned in a way that makes them work like a static class-level array, and each creation of a new instance of a widget based on these is creating new handlers, but assigning them to this class-level array. If two handlers are created when the first folder or sublayer is created, _handlers.size is 2, but on the second creation of another folder or layer, two new handlers are created, and added to the same shared array. Both widgets will have the same array of four handlers.
Then when the destroy method is called, this array is iterated over, and all handlers removed, from all folders and dynamic sublayers: https://github.com/wmbeers/cmv-app/blob/fd901cd555182ab26b13e164fcfe7353ab5d88aa/viewer/js/gis/dijit/LayerControl/controls/_DynamicFolder.js#L277-L281
Reopening for merge to public site
Merged and deployed to public site. Closing issue.
This should not have been re-opened in October. It's been merged to public site.
Originally reported during initial testing of #67.
Steps to reproduce:
Expected result: Map service is removed, controls for other map services in the map remain operational
Actual result: Map service is removed, controls for other map services stop working. The root-level checkbox is the only control that works, subfolders do not.