Reposition the Layer List Widget

4943
6
Jump to solution
02-05-2015 10:10 AM
AlexanderMcKoy
New Contributor II


I am using the Layer List widget in a web app service.  I have it configured to open at start.  Although the window opens up fine, it opens up directly over the navigation widget.  What do I need to add to the code to modify the position which the Layer list window opens on start?

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Alexander,

  OK, in the main config.xml you can change the top and left properties of any widget.

Example:

<widget label="Print" left="390" top="400"
                icon="assets/images/i_print.png"
                config="widgets/Print/PrintWidget.xml"
                url="widgets/Print/PrintWidget.swf"/>

View solution in original post

6 Replies
RobertScheitlin__GISP
MVP Emeritus

Alexander,

   As you have just posted this question in the general GeoNet help, what platform are you talking about? Flex Viewer, Web AppBuilder, etc.

0 Kudos
AlexanderMcKoy
New Contributor II

Sorry for placing this question in the general section as I have not yet familiarized myself with the site.  I am on the Flex Viewer platform.  I mainly use ArcGIS Viewer for Flex Application Builder v3.6.  I also go directly into the .xml file to make some configuration changes if I'm not sure how to access the parameters in the AppBuilder.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Alexander,

  OK, in the main config.xml you can change the top and left properties of any widget.

Example:

<widget label="Print" left="390" top="400"
                icon="assets/images/i_print.png"
                config="widgets/Print/PrintWidget.xml"
                url="widgets/Print/PrintWidget.swf"/>
AlexanderMcKoy
New Contributor II

Wow...this worked perfectly.  I went into the config.xml file and added the highlighted portion to the code and I was able to reposition it exactly where I needed it after a few iterations (no clue what the default position is ).

    <widget url="widgets/LayerList/LayerListWidget.swf"

          config="widgets/LayerList/LayerListWidget_1.xml"

          label="Layer List"

          left="120" top="120"

          icon="assets/images/i_layers.png"

          preload="open"/>

Thanks so much!

0 Kudos
BarnabyRockwell
Occasional Contributor III

Alex,

You can also add "width" and "height" params to adjust the size of the widget in your app.

Here is some xml:

<widget url="widgets/eLayerList/eLayerListWidget.swf" 
config="widgets/eLayerList/eLayerListWidget_1.xml" 
label="Table of Contents and Explanation" icon="assets/images/Legend32.png" preload="open" 
width="600" height="405" x="100" y="90"

/>

A bummer with these custom settings is that you have to re-add them to the config.xml every time you save the app from Flex App Builder.  I wish these widget settings could be edited (and saved) directly from the App Builder.

Cheers,

Barnaby

AlexanderMcKoy
New Contributor II

Ok, thanks for that insight Barnaby.  That is helpful to know so when I re-save my settings in App Builder and the widget reverts back, I will at least know what happened.

0 Kudos