<?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 How can I keep my Map click handler from responding to the Draw Toolbar? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-keep-my-map-click-handler-from/m-p/589263#M55068</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just recently realized that my Map.graphics click handler has been interfering with the Draw Toolbar.&amp;nbsp; When I draw polylines and I click to start a new line in the same poly, the click (which always falls on the line) causes errors because my handler only expects to handle the graphics that I have added, not those from the draw toolbar.&amp;nbsp; My first instinct is to use a distinct graphics layer for the draw toolbar.&amp;nbsp; This would cause the least changes in my code.&amp;nbsp; If not possible, the only other solution I see is to use a distinct graphics layer for my graphics.&amp;nbsp; This would take a lot more work on my part. Is it possible to use a different graphics layer than the map's default graphics layer for the draw (and edit) toolbar? If not, is there maybe another solution I'm not considering?&amp;nbsp; My click handler code &lt;EM&gt;could&lt;/EM&gt; be changed, but I don't know what would always distinguish my graphics from those created by the draw toolbar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Apr 2015 19:39:16 GMT</pubDate>
    <dc:creator>DavidElies</dc:creator>
    <dc:date>2015-04-09T19:39:16Z</dc:date>
    <item>
      <title>How can I keep my Map click handler from responding to the Draw Toolbar?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-keep-my-map-click-handler-from/m-p/589263#M55068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just recently realized that my Map.graphics click handler has been interfering with the Draw Toolbar.&amp;nbsp; When I draw polylines and I click to start a new line in the same poly, the click (which always falls on the line) causes errors because my handler only expects to handle the graphics that I have added, not those from the draw toolbar.&amp;nbsp; My first instinct is to use a distinct graphics layer for the draw toolbar.&amp;nbsp; This would cause the least changes in my code.&amp;nbsp; If not possible, the only other solution I see is to use a distinct graphics layer for my graphics.&amp;nbsp; This would take a lot more work on my part. Is it possible to use a different graphics layer than the map's default graphics layer for the draw (and edit) toolbar? If not, is there maybe another solution I'm not considering?&amp;nbsp; My click handler code &lt;EM&gt;could&lt;/EM&gt; be changed, but I don't know what would always distinguish my graphics from those created by the draw toolbar.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 19:39:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-keep-my-map-click-handler-from/m-p/589263#M55068</guid>
      <dc:creator>DavidElies</dc:creator>
      <dc:date>2015-04-09T19:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can the Draw Toolbar use a different GraphicsLayer?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-keep-my-map-click-handler-from/m-p/589264#M55069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my app, I created a pauasble event for the map click (this requires "dojo/on").&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mapClickEvent = on.pausable(map, "click", function (evt) { mapClickHandler(evt); });&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the user draws a feature with the Draw toolbar, I pause that event and restart it when the drawing is complete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;toolbar = new Draw(map);
toolbar.on('draw-end', performQuery);
registry.byId('btnPoint').on('click', function () {
&amp;nbsp;&amp;nbsp;&amp;nbsp; mapClickEvent.pause();
&amp;nbsp;&amp;nbsp;&amp;nbsp; toolbar.activate(this.drawtype);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;function performQuery(evt) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; mapClickEvent.resume();&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:18:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-keep-my-map-click-handler-from/m-p/589264#M55069</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-12T01:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: How can I keep my Map click handler from responding to the Draw Toolbar?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-keep-my-map-click-handler-from/m-p/589265#M55070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/migrated-users/3856"&gt;Ken Buja&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had to refactor a bit so that my drawtoolbar code could see the click handler, but it works a treat!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 20:39:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-keep-my-map-click-handler-from/m-p/589265#M55070</guid>
      <dc:creator>DavidElies</dc:creator>
      <dc:date>2015-04-09T20:39:21Z</dc:date>
    </item>
  </channel>
</rss>

