USEPA / R9-Widgets

Shareable R9 widgets
6 stars 2 forks source link

Using SelectionManager causing unexpected behavior b/c featureLayer.id is null #10

Closed tbock closed 1 year ago

tbock commented 6 years ago

When using the SelectionManager in the GRP widget to highlight features all selections are being cleared in other layers instead of the requested layer. It turns out this is b/c the id attribute of the feature layer we are passing in has a value of null. So when the SelectionManager goes to clear the layer with the matching id it always hits the same null reference. I believe this is b/c we are instantiating new FeatureLayers instead of using the ones already connected to the map. In the 3.x docs it says "If not assigned, esri.Map assigns value" (https://developers.arcgis.com/javascript/3/jsapi/featurelayer-amd.html#id). Since we are not actually adding this to the map I think the id attribute is never populated....

To resolve this we will need to more thoroughly use the LayerStructure/LayerNode (formerly LayerInfos/LayerInfo) to get the instances of the layers actually used in the map.

tbock commented 1 year ago

GRP app not in use so widget isn't relevant.