<?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 Copy coordinates from context menu in FlexViewer 2.1 in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42039#M982</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In my SFV 1.3 site I added the functionality to right click the map and copy coordinates to clipboard, based on code I found in the old forum, I think it was code from Robert Scheitlin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want the same thing in my new FlexViewer 2.1 site, I've come so far that I've added a custom item to the context menu that copies a hard-coded string to the clipboard.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need some help figuring out how to get the coordinates, from the mapmanager.mxml.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the SFV 1.3 the coordinates came from the banner (roberts modified banner that shows the coordinates) and the code looked like this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var myString:String = SiteContainer.getInstance().controller.banner.mapXY;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using the Coordinatewidget and I guess the best way is to get the coordinates from the 'coords' label in CoordinateWidget. But I don't know how to access that wigdet and label from the mapmanager.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Oct 2010 12:22:21 GMT</pubDate>
    <dc:creator>MattiasEkström</dc:creator>
    <dc:date>2010-10-04T12:22:21Z</dc:date>
    <item>
      <title>Copy coordinates from context menu in FlexViewer 2.1</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42039#M982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In my SFV 1.3 site I added the functionality to right click the map and copy coordinates to clipboard, based on code I found in the old forum, I think it was code from Robert Scheitlin.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want the same thing in my new FlexViewer 2.1 site, I've come so far that I've added a custom item to the context menu that copies a hard-coded string to the clipboard.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need some help figuring out how to get the coordinates, from the mapmanager.mxml.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the SFV 1.3 the coordinates came from the banner (roberts modified banner that shows the coordinates) and the code looked like this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;var myString:String = SiteContainer.getInstance().controller.banner.mapXY;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using the Coordinatewidget and I guess the best way is to get the coordinates from the 'coords' label in CoordinateWidget. But I don't know how to access that wigdet and label from the mapmanager.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 12:22:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42039#M982</guid>
      <dc:creator>MattiasEkström</dc:creator>
      <dc:date>2010-10-04T12:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Copy coordinates from context menu in FlexViewer 2.1</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42040#M983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'd like to see that too. Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 13:12:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42040#M983</guid>
      <dc:creator>EjayLai</dc:creator>
      <dc:date>2010-10-04T13:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Copy coordinates from context menu in FlexViewer 2.1</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42041#M984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mattias,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is probably not the most elegant solution but it will require the least amount of changes to the framework.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; In the WidgetManager change line 66 from private to public.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;public var controlContainer:Group;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then in the MapManger.mxml add this to your context menu item click function&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;for (var c:int = 0; c &amp;lt; ViewerContainer.getInstance().widgetManager.controlContainer.numElements; c++){
&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; try{
&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; var cw:* = ViewerContainer.getInstance().widgetManager.controlContainer.getElementAt(c);
&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; System.setClipboard(cw.coords.text); 
&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; } catch(error:Error){}
&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:37:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42041#M984</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-10T21:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: Copy coordinates from context menu in FlexViewer 2.1</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42042#M985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Robert! That works great, even though I don't completely understand how it works, but am happy as long as it works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 05:49:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42042#M985</guid>
      <dc:creator>MattiasEkström</dc:creator>
      <dc:date>2010-10-05T05:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: Copy coordinates from context menu in FlexViewer 2.1</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42043#M986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I thought this worked, until I realized this morning that the coordinates that is copied to the clipboard is not the point were I right clicked but the point behind the context menu were I click when selecting the copy coordinates menu item.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The coordinates in the coordinate widget seems to "freeze" when I right click the map, but apparently they're not, not the ones I'm getting from the function that is triggered from my context menu item.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I guess I somehow need to first save the coordinate when right clicking and then access that saved coordinates from the functions that's triggered from my context menu item.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have a solution for this??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Oct 2010 10:19:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42043#M986</guid>
      <dc:creator>MattiasEkström</dc:creator>
      <dc:date>2010-10-08T10:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Copy coordinates from context menu in FlexViewer 2.1</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42044#M987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could try using this event:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/ContextMenu.html#event:menuSelect"&gt;http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/ContextMenu.html#event:menuSelect&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Oct 2010 19:31:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42044#M987</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2010-10-11T19:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Copy coordinates from context menu in FlexViewer 2.1</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42045#M988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dasa,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; So is it possible to get the stage XY from a ContextMenuEvent?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Oct 2010 20:58:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42045#M988</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2010-10-11T20:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Copy coordinates from context menu in FlexViewer 2.1</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42046#M989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, but you can use &lt;/SPAN&gt;&lt;A href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#mouseX"&gt;http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#mouseX&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#localToGlobal()"&gt;http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#localToGlobal()&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Oct 2010 21:05:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42046#M989</guid>
      <dc:creator>DasaPaddock</dc:creator>
      <dc:date>2010-10-11T21:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Copy coordinates from context menu in FlexViewer 2.1</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42047#M990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not skilled enough to figure out how to use the mouseX and localToGlobal() to get the coordinates from a ContextMenuEvent.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But I added an EventListener for the MENU_SELECT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map.contextMenu.addEventListener(ContextMenuEvent.MENU_SELECT, menuSelectHandler);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And put Roberts code to access the coordinates from the coordinatewidget in the menuSelectHandler function. Except I don't set the Clipboard just store it in another String that is set to Clipboard when the user clicks that specific menu item. I thought that made better sense &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So now the correct coordinates are copied, so that works for now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Dasa and Robert.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Oct 2010 09:30:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/copy-coordinates-from-context-menu-in-flexviewer-2/m-p/42047#M990</guid>
      <dc:creator>MattiasEkström</dc:creator>
      <dc:date>2010-10-13T09:30:09Z</dc:date>
    </item>
  </channel>
</rss>

