Select to view content in your preferred language

Resize Map in mxml

519
1
Jump to solution
05-15-2012 06:50 AM
philippschnetzer
Frequent Contributor
In the main config.xml I have the left tag of the map window set to 300 (left="300")  so that I can have some space reserved for non-map components on the left of the screen.  Now, I am trying to insert a collapse/expand button which will basically resize the map to something like left="10".

To do this, unsuccessfully, I'm inserting an <s:image> of an arrow in the index.mxml and calling the following function on click:

public function Collapse():void    {     hostComponent.mapLeft = 10;     hostComponent.mapTop = 60;     hostComponent.mapRight = 10;     hostComponent.mapBottom = 30;    }


I also included this in the index.mxml:

<fx:Metadata>   [HostComponent("com.esri.viewer.managers.MapManager")]   [ResourceBundle("ViewerStrings")]  </fx:Metadata>



Nothing at all seems to be happening....  Is this a completely backwards strategy...is there an easier way?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Phillip,

   Your collapse function need to dispatch the MAP_RESIZE AppEvent.

            import com.esri.viewer.AppEvent; AppEvent.dispatch(AppEvent.MAP_RESIZE,{left: 10, top: 60, right: 10, bottom: 30});

View solution in original post

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Emeritus
Phillip,

   Your collapse function need to dispatch the MAP_RESIZE AppEvent.

            import com.esri.viewer.AppEvent; AppEvent.dispatch(AppEvent.MAP_RESIZE,{left: 10, top: 60, right: 10, bottom: 30});
0 Kudos