<?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 eMapSwitcherWidget modify forcescaleonswitch behaviour in ArcGIS Viewer for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/emapswitcherwidget-modify-forcescaleonswitch/m-p/543542#M15385</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have one layer that has the forscaleonswitch enabled and is working fine.&amp;nbsp; However, it just changes scale, and I would like it to also change extent when this basemap is changed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to code a "centroid" or something along with the scale to that it also snaps back to where I want it (basically, back to initialextent).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am only using this option on one of my basemaps, so it doesn't matter if it is layer specific or not, so could hard code into the mxml if I knew what/where.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Aug 2012 19:01:51 GMT</pubDate>
    <dc:creator>RhettZufelt</dc:creator>
    <dc:date>2012-08-16T19:01:51Z</dc:date>
    <item>
      <title>eMapSwitcherWidget modify forcescaleonswitch behaviour</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/emapswitcherwidget-modify-forcescaleonswitch/m-p/543542#M15385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Robert,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have one layer that has the forscaleonswitch enabled and is working fine.&amp;nbsp; However, it just changes scale, and I would like it to also change extent when this basemap is changed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to code a "centroid" or something along with the scale to that it also snaps back to where I want it (basically, back to initialextent).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am only using this option on one of my basemaps, so it doesn't matter if it is layer specific or not, so could hard code into the mxml if I knew what/where.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 19:01:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/emapswitcherwidget-modify-forcescaleonswitch/m-p/543542#M15385</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2012-08-16T19:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: eMapSwitcherWidget modify forcescaleonswitch behaviour</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/emapswitcherwidget-modify-forcescaleonswitch/m-p/543543#M15386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Rhett,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Just remember I will not always be willing to do the coding for you.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the dispatchChangeBasemapEvent function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;if(basemapList.getItemAt(basemapSelectionComponent.selectedIndex).forcescaleonswitch &amp;amp;&amp;amp; map.scale &amp;lt; basemapList.getItemAt(basemapSelectionComponent.selectedIndex).forcescaleonswitch){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.scale = basemapList.getItemAt(basemapSelectionComponent.selectedIndex).forcescaleonswitch; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(basemapList.getItemAt(basemapSelectionComponent.selectedIndex).label == "myspecialbasemap"){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.centerAt(new MapPoint(x,y, map.spatialReference)); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and in the basemapButtonBar_changeHandler function:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(basemapList.getItemAt(event.newIndex).forcescaleonswitch &amp;amp;&amp;amp; map.scale &amp;lt; basemapList.getItemAt(event.newIndex).forcescaleonswitch){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.scale = basemapList.getItemAt(event.newIndex).forcescaleonswitch; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(basemapList.getItemAt(basemapSelectionComponent.selectedIndex).label == "myspecialbasemap"){ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.centerAt(new MapPoint(x,y, map.spatialReference)); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 20:14:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/emapswitcherwidget-modify-forcescaleonswitch/m-p/543543#M15386</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2012-08-16T20:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: eMapSwitcherWidget modify forcescaleonswitch behaviour</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/emapswitcherwidget-modify-forcescaleonswitch/m-p/543544#M15387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That did the trick, thanks again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, I have noticed a quirk in the widget now.&amp;nbsp; I have a layer set with forcescaleonswitch="250000".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I am zoomed in beyond that and change to my forcescale layer, it will automatically change the scale to my 1:250000.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if I am zoomed OUT from there (1:500000) the forcescale does not seem to take affect.&amp;nbsp; I don't see a forcescale layer on your example page to test.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the interesting part, I see this happening "before" I make any changes to the mxml.&amp;nbsp; Then, I made the changes that you gave me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The weird thing is that the new code to center at my MapPoint seems to work if I'm zoomed in or OUT from my forcescale setting, but the scale only changes if I am zoomed in from my forcescale setting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, if I'm zoomed in and change&amp;nbsp; the basemap, it will center on my x,y, AND change the scale.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I'm zoomed out and change the basemap, it will center on my x,y, and NOT change the scale.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this makes sense, and thanks yet again,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 21:51:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/emapswitcherwidget-modify-forcescaleonswitch/m-p/543544#M15387</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2012-08-16T21:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: eMapSwitcherWidget modify forcescaleonswitch behaviour</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/emapswitcherwidget-modify-forcescaleonswitch/m-p/543545#M15388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Rhett,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; The forcescaleonswitch is only designed to work if your current map scale is less then the value set in the forcescaleonswitch it will not work the other direction as this would cause your map to never be able to leave the set scale when that base map is selected.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 22:39:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/emapswitcherwidget-modify-forcescaleonswitch/m-p/543545#M15388</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2012-08-16T22:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: eMapSwitcherWidget modify forcescaleonswitch behaviour</title>
      <link>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/emapswitcherwidget-modify-forcescaleonswitch/m-p/543546#M15389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Guess that would kind of defeat the utility of it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for the help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 22:49:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-viewer-for-flex-questions/emapswitcherwidget-modify-forcescaleonswitch/m-p/543546#M15389</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2012-08-16T22:49:02Z</dc:date>
    </item>
  </channel>
</rss>

