<?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 Interacting with the Map after selecting a button/tool in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/interacting-with-the-map-after-selecting-a-button/m-p/410149#M37761</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does anyone know how to wire up a dojo button (or toggle button) in a toolbar to a mouse click event on the map?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want the user to have to select a tool/button before clicking on the map and NOT just have the map listen to any old mouse click event as this is too open i.e. I want to constrain the functionality to the selecting a tool from the UI.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Aug 2010 07:21:34 GMT</pubDate>
    <dc:creator>SimonEarnshaw</dc:creator>
    <dc:date>2010-08-17T07:21:34Z</dc:date>
    <item>
      <title>Interacting with the Map after selecting a button/tool</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/interacting-with-the-map-after-selecting-a-button/m-p/410149#M37761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does anyone know how to wire up a dojo button (or toggle button) in a toolbar to a mouse click event on the map?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want the user to have to select a tool/button before clicking on the map and NOT just have the map listen to any old mouse click event as this is too open i.e. I want to constrain the functionality to the selecting a tool from the UI.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Aug 2010 07:21:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/interacting-with-the-map-after-selecting-a-button/m-p/410149#M37761</guid>
      <dc:creator>SimonEarnshaw</dc:creator>
      <dc:date>2010-08-17T07:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Interacting with the Map after selecting a button/tool</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/interacting-with-the-map-after-selecting-a-button/m-p/410150#M37762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Simon,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You don't want the user to have any control in the "map" itself without the user first clicking a button, i.e. no pan, no double-click zoom, no wheel zoom, etc.?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My first thought is that you should be able to use the activate() and deactivate() functions on the the dojo button tools to turn each other on and off similar to the "extent" buttons is in this sample:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/demos/toolbar/toolbar_navigation.html"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/demos/toolbar/toolbar_navigation.html&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you really want the map to be deaf to clicks you could deactivate() the map itself.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would wire up the tools of the buttons to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1) activate the tool and map on(button)Click&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) declare a variable to keep track of the use of the tool (only works if var use = 0)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) set the variable after use (var use = 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4) deactivate the tool and map when the var use = 1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Something along those lines&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You'd have to work on all the if/esle logic, but basically the user would not be able to do anything unless he/she clicks a button each and everytime before interacting with the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perhaps I have taken your want a tad to far, but you can really lock the app down its just going to take a lot of "getting" and "setting" of variables to keep track of the state of items.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also like to control the users input, i.e. validate input and make them use the map the way I want so I don't have to account for too mnay stupid user issues. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But at a certain point of control you won't have to worry about the user anymore because they won't want to use the app.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Aug 2010 23:28:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/interacting-with-the-map-after-selecting-a-button/m-p/410150#M37762</guid>
      <dc:creator>KeithSandell</dc:creator>
      <dc:date>2010-08-17T23:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Interacting with the Map after selecting a button/tool</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/interacting-with-the-map-after-selecting-a-button/m-p/410151#M37763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey, thanks for that! I will check it out next week.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Aug 2010 19:44:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/interacting-with-the-map-after-selecting-a-button/m-p/410151#M37763</guid>
      <dc:creator>SimonEarnshaw</dc:creator>
      <dc:date>2010-08-19T19:44:47Z</dc:date>
    </item>
  </channel>
</rss>

