LayerList widget expand on startup

3461
15
12-12-2016 06:16 AM
NatashaManzuiga
Occasional Contributor

Hello,

I want to know if there is a way to expand RootLayer at the LayerList widget startup.

Thanks,

Naty

0 Kudos
15 Replies
RobertScheitlin__GISP
MVP Emeritus

Naty,

   Sure add this code block to the end of the _initOperations function in the LayerListView.js file:

      this.own(on(this.operationsDropMenu ,
        'onMenuClick',
        lang.hitch(this, this._onOperationsMenuItemClick)));
       setTimeout(lang.hitch(this, function(){
         this.foldOrUnfoldAllRootLayers(false);
       }), 300);
NatashaManzuiga
Occasional Contributor

Thanks Robert!

And can I hide root node?

Naty

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Not that I know of. Why would you want to? If the root was hidden how would you change it's visibility?

0 Kudos
NatashaManzuiga
Occasional Contributor
Its visibility must always be active and it's redundant to see it in LayerList.
Naty
0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Naty,

   Maybe a screen shot would help explain better, because I do not understand.

0 Kudos
NatashaManzuiga
Occasional Contributor

I just have only one operational layer...and I want to remove the root Level

deleted-user-CQZbjNeBXm49
Occasional Contributor III

I had very much like to do same too

TimHayes1
Occasional Contributor III

Me too!

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Naty,

   OK, so you have a Map Service that only has one layer and you have the MapService name the same as the one layer that that service contains. Hmm. I will have to think about this, as it is not common practice for a GIS data manager/publisher to have a scenario like that.