I'm running into some issues trying to customize the Search widget. The use case is as follows.
It appears that what is happening is that when you zoom to the selected features, it causes the hidden layers to draw for the first time. This calls resume on the layers, which appears to clear any selections on the layer if it is the first time resume has been called. This basically clears out the selection from step 3. I found similar behavior in the Attribute Table widget. If you double-click on a feature that is not visible, it will zoom to it. If it is the first time that the given layer has been displayed, the zoom ends up clearing the selection. You can see it in how the blue color in the row disappears. If you double-click it again, the blue color stays. The issue is the same with my Search widget. It is only an issue the first time the layer is displayed. After that, it works correctly.
Any ideas?
Solved! Go to Solution.
Eventually, I decided that the best solution was just to host the JS 3.x API internally and remove the offending call to clearSelection. That fixed the issue. I still don't know why there is a need to clear a layer the first time it is drawn.
Eventually, I decided that the best solution was just to host the JS 3.x API internally and remove the offending call to clearSelection. That fixed the issue. I still don't know why there is a need to clear a layer the first time it is drawn.