Enhanced Search Widget Version 2.5 (only Search results)

390
1
11-02-2017 06:46 AM
James_001
Occasional Contributor II

Hi all,

I am using Robert esearch widget which is really good! I am trying to find the way when the Search will apply in esearch widget all other layers turn off by self, only data from esearch layer (results) should display on map.  Right now I have layer toggle button widget which is doing this job manually.  Any idea?

Thanks,

Irfan Afsar

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus

Ifran,

   If you are just wanting to turn all other layers in the map off then you can do this:

      _onSearchFinish: function (layerIndex, closeOnComplete, removing, adding, results) {
        array.forEach(this.operLayerInfos.getLayerInfoArray(), function(layerInfo2) {
          if(layerInfo2._visible){
            layerInfo2.setTopLayerVisible(false);
          }
        });
        ...‍‍‍‍‍‍‍