<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Resize Map/Collapsible Widgets in ArcGIS Viewer for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/resize-map-collapsible-widgets/m-p/464219#M13139</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've looked hard in the FlexViewer forums for any advice on how to dynamically resize the map based on widget collapse or resize, but I can't find much.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know how to resize the map layout during runtime, based on a widget's resizing or collapse?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have three widgets, fixed to the left, bottom, and right of the window. I'd like to have these collapse or resize, but I can't figure out how to get the map container to resize this when I do. I've dug deep into the core library of the FlexViewer and none of the events that seem like they'd resize the map do the job.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's how my map tag in the config file starts:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;map wraparound180="true" esrilogovisible="false" top="35" bottom="175" left="200" right="165"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initialextent="-16677000 2009000 -4819000 8330000" fullextent="-16677000 2009000 -4819000 8330000" &amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically, I'd like to change the bottom, left, and right properties dynamically based on widget resize events.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One example that accomplishes this is &lt;/SPAN&gt;&lt;A href="http://texaswildfirerisk.com/Map" rel="nofollow noopener noreferrer" target="_blank"&gt;Texas Wildfire Risk&lt;/A&gt;&lt;SPAN&gt;, but their code is not open and what digging I did turned up an extended proprietary codeset. The functionality is the Hide Tools button.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 20:37:22 GMT</pubDate>
    <dc:creator>TomAuer</dc:creator>
    <dc:date>2021-12-11T20:37:22Z</dc:date>
    <item>
      <title>Resize Map/Collapsible Widgets</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/resize-map-collapsible-widgets/m-p/464219#M13139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've looked hard in the FlexViewer forums for any advice on how to dynamically resize the map based on widget collapse or resize, but I can't find much.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone know how to resize the map layout during runtime, based on a widget's resizing or collapse?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have three widgets, fixed to the left, bottom, and right of the window. I'd like to have these collapse or resize, but I can't figure out how to get the map container to resize this when I do. I've dug deep into the core library of the FlexViewer and none of the events that seem like they'd resize the map do the job.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's how my map tag in the config file starts:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;map wraparound180="true" esrilogovisible="false" top="35" bottom="175" left="200" right="165"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initialextent="-16677000 2009000 -4819000 8330000" fullextent="-16677000 2009000 -4819000 8330000" &amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically, I'd like to change the bottom, left, and right properties dynamically based on widget resize events.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One example that accomplishes this is &lt;/SPAN&gt;&lt;A href="http://texaswildfirerisk.com/Map" rel="nofollow noopener noreferrer" target="_blank"&gt;Texas Wildfire Risk&lt;/A&gt;&lt;SPAN&gt;, but their code is not open and what digging I did turned up an extended proprietary codeset. The functionality is the Hide Tools button.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:37:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/resize-map-collapsible-widgets/m-p/464219#M13139</guid>
      <dc:creator>TomAuer</dc:creator>
      <dc:date>2021-12-11T20:37:22Z</dc:date>
    </item>
    <item>
      <title>Re: Resize Map/Collapsible Widgets</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/resize-map-collapsible-widgets/m-p/464220#M13140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've had this problem too.&amp;nbsp; You can manage this through:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;ViewerContainer.getInstance().mapManager.bottom&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or left, top, or right.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought to use the bindable mapBottom, mapLeft, mapRight, mapTop, but those don't work.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Mar 2012 10:08:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/resize-map-collapsible-widgets/m-p/464220#M13140</guid>
      <dc:creator>JonettaNg</dc:creator>
      <dc:date>2012-03-09T10:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Resize Map/Collapsible Widgets</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/resize-map-collapsible-widgets/m-p/464221#M13141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I recently did something similar. It's not perfect, but here is how I approached it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Make the initial map lined up with the widget in config.xml. for example, if you want a left-hand-side widget that collapses, set its left=0 and then set the map's left to the widget's width:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;map initialextent="-14225000 1864000 -6525000 6658000" left="350" top="0" zoomslidervisible="false"&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;widget left="0"&amp;nbsp; top="0" width="350" config="widgets/MyCollapsibleWidget/MyCollapsibleWidget.xml" url="widgets/MyCollapsibleWidget/MyCollapsibleWidget.swf"/&amp;gt;&amp;nbsp; &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will cause the map and widget to be lined up right next to each other. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In your widget's MXML code, when you transition between your "open" and "closed" states, update the map's left also: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;lt;s:states&amp;gt;
 &amp;lt;s:State name="normal" /&amp;gt;
 &amp;lt;s:State name="collapsed" /&amp;gt;
&amp;lt;/s:states&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;lt;s:transitions&amp;gt;
 &amp;lt;s:Transition fromState="normal" toState="collapsed"&amp;gt;
&amp;nbsp; &amp;lt;s:Resize target="{mainPartOfYourCollapsibleWidget}" duration="450"&amp;nbsp; effectUpdate="moveTheMap(event)" /&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 &amp;lt;/s:Transition&amp;gt;
 &amp;lt;s:Transition fromState="collapsed" toState="normal"&amp;gt; 
&amp;nbsp; &amp;lt;s:Resize target="{mainPartOfYourCollapsibleWidget}" duration="450"&amp;nbsp; effectUpdate="moveTheMap(event)" /&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 &amp;lt;/s:Transition&amp;gt;
 &amp;lt;/s:transitions&amp;gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This effectUpdate handler function gets called repeatedly during the resize animation, and will make the map grow as the collapsible widget shrinks:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private function moveTheMap(evt:EffectEvent):void{&amp;nbsp;&amp;nbsp;&amp;nbsp; 
 ViewerContainer.getInstance().mapManager.left = mainContainer.width
} &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The nice thing about that is that you don't need separate handlers for each state, the map will just follow the width of the widget. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This isn't perfect, it runs a little slowly and the map tends to re-center as it resizes. I think this may be solvable by watching for an extent change or similar event and re-positioning, but I need to explore it more.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:37:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/resize-map-collapsible-widgets/m-p/464221#M13141</guid>
      <dc:creator>ChrisAult</dc:creator>
      <dc:date>2021-12-11T20:37:25Z</dc:date>
    </item>
  </channel>
</rss>

