Select to view content in your preferred language

Turn on layer when querywidget is opened.

736
1
Jump to solution
08-09-2012 01:18 PM
ThomasDyer
Emerging Contributor
I know this is a simple question, but I can't seem to find the right answer. All I want to do is make the layer I'm running the QueryWidget against visible when the widget is opened. I'm querying a shaded polygon feature using the QueryWidget. It works fine, but it would be more user friendly if it would also turn on that layer as soon as the user clicked the QueryWidget. Any help would be appreciated. Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Thomas,

   Sure that would be as simple as adding a line to the widgetOpenedHandler function in the QueryWidget.mxml

map.getLayer("yourlayerlabelintheconfig").visible = true;


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:

View solution in original post

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus
Thomas,

   Sure that would be as simple as adding a line to the widgetOpenedHandler function in the QueryWidget.mxml

map.getLayer("yourlayerlabelintheconfig").visible = true;


Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow the steps as shown in the below graphic:
0 Kudos