Select to view content in your preferred language

Live Maps Window Size

1054
9
08-11-2010 12:04 PM
MatthewLawton
Deactivated User
I have the Live Maps window preloaded to appear when my SFV 1.3 app is loaded. How do I change the default height and width for the Live Maps window? I tried adding height and width tags to the Live Maps widget tag in the config.xml, but that didn't work.
Tags (2)
0 Kudos
9 Replies
RobertScheitlin__GISP
MVP Emeritus
Matthew,

    The height and width have to be set on the WidgetTemplate inside the LiveMapsWidget.mxml code.

Glad to see your not giving up on Flex. Once you learn it, it is a great development platform.
0 Kudos
MatthewLawton
Deactivated User
Close Robert, I found the value I was looking for is the height value in the "mx:Canvas" in the WidgetTemplate.mxml. Unfortunately I have a feeling that changing this value is going to affect how all widgets are docked in the app, so I may have to reconsider this.

Me and Flex are in the Thunderdome now. Two have entered, only one will leave.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Matthew,

   Yep if you adjust the canvas height and width in the WidgetTemplate.mxml than you will be affecting all widgets but if you follow what I said only the LiveMapsWidget will be changed.
0 Kudos
MatthewLawton
Deactivated User
I have tried changing the height value for all of the tags in the WidgetTemplate in LiveLayerWidget.mxml, but none seem to affect the window height. I even tried adding a height value at the top under "BaseWidget", but that didn't do anything. Maybe there is a tag I have missed. Any suggestions?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Matthew,

   Ahh, I know what your issue is... In SFV 1.3 there are two LiveMapWidgets on in the src/com/esri/solutions/flexviewer/widgets/LiveMapsWidget.mxml and another in src/com/esri/solutions/esa/widgets/LiveMapsWidget.mxml the latter one in the esa folder is the one that is used by default try changing that one.
0 Kudos
MatthewLawton
Deactivated User
All right, Robert. I'm going to come clean with you... I'm actually using the VDEM VIPER source code. There doesn't appear to be an "esa" directory. I did a Windows search and the only LiveMapsWidget.mxml that comes up is src\com\esri\solutions\flexviewer\widgets\LiveMapsWidget.mxml.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Matthew,

   OK, I don't have access to that source yet but there should not be a difference in  how it handles the widgettemplate. I just made the change of the width and height in the templatewidget element like I told you, in a 1.3 and a 1.0 flexviewer project and they worked as expected. So the question is have you seen any of your code changes take affect when you run or debug your project?
0 Kudos
MatthewLawton
Deactivated User
The changes I made to the height value in WidgetTemplate.mxml certainly had an affect. I added the TOC expand code to the LiveMapsWidget.mxml and got that to work. So it would seem that some of my changes are having an effect. Are you adding your height and width properties to the WidgetTemplate tag? Are you using percent values or pixels? Here is what mine looks like right now, it should pretty much be the default:
 <WidgetTemplate id="wTemplate">
  <mx:ViewStack id="viewStack" width="100%" height="100%" creationPolicy="all">
   <mx:VBox width="100%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off">
    <mx:Label text="{visibilityLabel}" styleName="WidgetText" width="100%"/>
    <toccomp:TOC id="toc" width="100%" height="100%"/>
   </mx:VBox>
   <mx:VBox width="100%" height="100%">
    <mx:Label text="{transparencyLabel}" styleName="WidgetText" width="100%"/>
    <mx:Repeater id="layerRepeater">
      <widgets:LayerAlpha layer="{layerRepeater.currentItem}"/>
    </mx:Repeater>
   </mx:VBox>
  </mx:ViewStack>
 </WidgetTemplate>
0 Kudos
MatthewLawton
Deactivated User
Robert, why do you always have to be right?;)

I decided to revisit this at the end of the day, and sure enough when I added height="600" to the Widget Template tag and it worked just fine. I think when I tried it before I was entering a percentage instead of a fixed pixel height.

Thanks, Robert! <--(has anybody tried searching this forum for that phrase to see how many times it comes up?)
0 Kudos