How to programmatically change the config search layer in eSearch?

306
2
Jump to solution
05-14-2018 04:52 AM
MartinOwens1
Occasional Contributor II

I was wondering if it is possible to programmatically change the config search layer based on a condition being met. I know you can access a search layer by its name using:

this.config.layers.name === "Name of the Search Layer";  

What I'm trying to do is set it to a particular search layer in my config. Any help programmatically changing this would be great.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Martin,

You can use the code below. Where X is equal to the index (number) of the layer you want to switch to (i.e first layer in the drop down is 0, etc, etc).

this.onAttributeLayerChange(X);

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

Martin,

You can use the code below. Where X is equal to the index (number) of the layer you want to switch to (i.e first layer in the drop down is 0, etc, etc).

this.onAttributeLayerChange(X);
0 Kudos
MartinOwens1
Occasional Contributor II

Thanks Robert, that's exactly what I needed.

0 Kudos