<?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 Re: Force snapping on draw/edit tool in ArcGIS API for Flex Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/force-snapping-on-draw-edit-tool/m-p/2335#M33</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry to bump but we really need a solution for this.&amp;nbsp; 'Faking' the keyboard control button press doesn't seem to work to enable snapping on the tools.&amp;nbsp; Does anyone have any ideas to solve this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After looking further, I believe what we want to ensure that the ctrlKey field is always set to true on the map MouseEvent click event.&amp;nbsp; The problem being that the handler for this is a private method in the Draw/Edit tool.&amp;nbsp; I can't figure out any way to block the mouse click event, change the ctrlKey to true and redispatch the event&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Oct 2011 07:04:10 GMT</pubDate>
    <dc:creator>LukeEvans</dc:creator>
    <dc:date>2011-10-26T07:04:10Z</dc:date>
    <item>
      <title>Force snapping on draw/edit tool</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/force-snapping-on-draw-edit-tool/m-p/2334#M32</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We have been requested by our client to &lt;/SPAN&gt;&lt;STRONG&gt;always&lt;/STRONG&gt;&lt;SPAN&gt; have snapping enabled when using the draw and edit tools.&amp;nbsp; Basically, they want to be able to have snapping enabled without the need to press the control key.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried extending the DrawTool and adding this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp; if (event.type == MouseEvent.MOUSE_DOWN)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; ViewerContainer.getInstance().dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_DOWN, true, false, Keyboard.CONTROL, Keyboard.CONTROL));
&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; else if (event.type == MouseEvent.MOUSE_UP)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; ViewerContainer.getInstance().dispatchEvent(new KeyboardEvent(KeyboardEvent.KEY_UP, true, false, Keyboard.CONTROL, Keyboard.CONTROL));
&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;I've tried changing the dispatcher from ViewerContainer, "this", the map, FlexGlobals.topLevelApplication but it seems to be having no effect.&amp;nbsp; Is there a simpler way to do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Luke&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Oct 2011 13:50:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/force-snapping-on-draw-edit-tool/m-p/2334#M32</guid>
      <dc:creator>LukeEvans</dc:creator>
      <dc:date>2011-10-13T13:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: Force snapping on draw/edit tool</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/force-snapping-on-draw-edit-tool/m-p/2335#M33</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry to bump but we really need a solution for this.&amp;nbsp; 'Faking' the keyboard control button press doesn't seem to work to enable snapping on the tools.&amp;nbsp; Does anyone have any ideas to solve this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After looking further, I believe what we want to ensure that the ctrlKey field is always set to true on the map MouseEvent click event.&amp;nbsp; The problem being that the handler for this is a private method in the Draw/Edit tool.&amp;nbsp; I can't figure out any way to block the mouse click event, change the ctrlKey to true and redispatch the event&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2011 07:04:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/force-snapping-on-draw-edit-tool/m-p/2335#M33</guid>
      <dc:creator>LukeEvans</dc:creator>
      <dc:date>2011-10-26T07:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: Force snapping on draw/edit tool</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/force-snapping-on-draw-edit-tool/m-p/2336#M34</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I've also tried extending the EditTool and setting the esri_internal snapping boolean to true but it does not allow a ChangeWatcher, so I can't monitor any changes and force it to remain as true&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The DrawTool only allows you to override the removeGraphic internal function&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 07:26:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/force-snapping-on-draw-edit-tool/m-p/2336#M34</guid>
      <dc:creator>LukeEvans</dc:creator>
      <dc:date>2011-11-04T07:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Force snapping on draw/edit tool</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/force-snapping-on-draw-edit-tool/m-p/2337#M35</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Luke,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; Having snapping enabled all the time is a horrible Idea. Think about what snapping is doing is is running some code every pixel that the mouse is moved and checking if it is in proximity of a vertex of a feature. This process is costly hence esri Flex API team choosing only to enable it with the holding of the control button. This is one of those situations that when I worked in the consulting world I would explain to the client that the overhead that this would cause is not worth degrading the responsiveness and functionality of the application so that they can have one less step. Clients do not understand the inner working of the application so it is up to you are the programmer to enlighten them as to what is a good or a horrible idea.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 11:38:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/force-snapping-on-draw-edit-tool/m-p/2337#M35</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2011-11-04T11:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Force snapping on draw/edit tool</title>
      <link>https://community.esri.com/t5/arcgis-api-for-flex-questions/force-snapping-on-draw-edit-tool/m-p/2338#M36</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What if the tool you are developing is for a tablet?&amp;nbsp; If you are adding or moving a feature, you still need some way to fake the control button if snapping is requested.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 17:15:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-flex-questions/force-snapping-on-draw-edit-tool/m-p/2338#M36</guid>
      <dc:creator>TimothyBaldwin</dc:creator>
      <dc:date>2011-11-04T17:15:03Z</dc:date>
    </item>
  </channel>
</rss>

