<?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: Using the LocateButton to trigger an event in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260315#M24107</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;john,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;what tim noticed is that currently you are 'listening' for the locate event to be triggered, but using that geometry to create your circle graphic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in your code right now you are wiring up a second event listener to wait for someone to click on the map after the locate button has already been pressed.&amp;nbsp; you can see that its working if you click on the map after using the locate widget and then zoom out enough levels to display the 10 mile diameter ring.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jun 2014 19:16:46 GMT</pubDate>
    <dc:creator>JohnGravois</dc:creator>
    <dc:date>2014-06-30T19:16:46Z</dc:date>
    <item>
      <title>Using the LocateButton to trigger an event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260308#M24100</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;I am putting together a web app that contains the LocateButton functionality and then buffering and selecting features.&amp;nbsp; At this point I have it set up so that when I click on a point on the map, a buffer is created and the features within it are selected, and the LocateButton finds the current location.&amp;nbsp; What I would like to do is activate the location button and have it trigger the buffer and selection functionalities.&amp;nbsp; Essentially have it replace the click on the map functionality.&amp;nbsp; I looked at the following links:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/locatebutton-amd.html#event-load"&gt;https://developers.arcgis.com/javascript/jsapi/locatebutton-amd.html#event-load&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/map.html"&gt;https://developers.arcgis.com/javascript/jsapi/map.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;but could not find any event events that would fulfill what I'm looking for, maybe I'm missing something since I'm new to scripting.&amp;nbsp; Attached is my work in progress.&amp;nbsp; Hope it helps.&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;John&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 01:26:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260308#M24100</guid>
      <dc:creator>JohnPapageorgiou</dc:creator>
      <dc:date>2014-06-25T01:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using the LocateButton to trigger an event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260309#M24101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since you only want to fire your buffer function when a location has been found, you could use this code to get you going:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var geoLocate = new LocateButton({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map:map
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }, "LocateButton");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geoLocate.startup();
&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; geoLocate.on("locate", dothis);
&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; function dothis(locate){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Put your buffer code here
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Once the user clicks on the locate button and it finds a location your function will run.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can access the results (for example the position) through accessing the locate properties as outlined &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/locatebutton-amd.html#event-locate" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this makes sense!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tim&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:48:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260309#M24101</guid>
      <dc:creator>TimWitt</dc:creator>
      <dc:date>2021-12-11T12:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using the LocateButton to trigger an event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260310#M24102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;you can also trigger the widget programmatically...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;locateButton.locate()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/jsapi/locatebutton-amd.html#locate"&gt;https://developers.arcgis.com/javascript/jsapi/locatebutton-amd.html#locate&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jun 2014 13:58:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260310#M24102</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2014-06-25T13:58:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using the LocateButton to trigger an event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260311#M24103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you both for your replies.&amp;nbsp; Pardon my ignorance, and my delay in responding.&amp;nbsp; I've been looking at the arcgis API reference pages and reading through the dojo documentation.&amp;nbsp; I am new at this and trying to make sense of it all.&amp;nbsp; Tim, I think I understand the first three lines of code you sent, but everything becomes confusing to me when you mention "dothis" and then the Function and everything associated with that.&amp;nbsp; Is the "dothis" something that I should be referring to in the html part of my webmap application? I tried setting up a function that would contain the create buffer functionality, but it didn't work.&amp;nbsp; Any sources you could recommend that will explain this in a more basic level.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;John&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 20:50:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260311#M24103</guid>
      <dc:creator>JohnPapageorgiou</dc:creator>
      <dc:date>2014-06-28T20:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using the LocateButton to trigger an event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260312#M24104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;i wrote up a sample fiddle to show what tim is talking about and demonstrate where to place a callback function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://jsfiddle.net/jagravois/4zz6P/"&gt;http://jsfiddle.net/jagravois/4zz6P/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;basically, he is recommending that you create an event listener so that you can have some code fire only after someone has used the widget to identify their location.&amp;nbsp; 'doThis' is just the name of the function which is called after that event fires.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hope that helps!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jun 2014 21:50:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260312#M24104</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2014-06-28T21:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using the LocateButton to trigger an event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260313#M24105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for getting back to me.&amp;nbsp; Things are sort of starting to make sense.&amp;nbsp; I tried what you recommended in the fiddle, but it didn't work.&amp;nbsp; Is it possible that I'm not using a correct javascript method?&amp;nbsp; Essentially what I want to do is replicate the functionality of &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/jssamples/query_buffer.html"&gt;https://developers.arcgis.com/javascript/jssamples/query_buffer.html&lt;/A&gt;&lt;SPAN&gt; (which is done), but have the locateButton be the trigger instead of the click.&amp;nbsp; I have tried all kinds of combinations of things.&amp;nbsp; Would you be willing to take a look at my code to see what is going on?&amp;nbsp; If yes, it is at: &lt;/SPAN&gt;&lt;A href="http://www.wheresmyclinic.com/WMC_html.html"&gt;http://www.wheresmyclinic.com/WMC_html.html&lt;/A&gt;&lt;SPAN&gt; and the javascript file can be accessed by clicking on the link on line 11 of the html page.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;John&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Jun 2014 04:30:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260313#M24105</guid>
      <dc:creator>JohnPapageorgiou</dc:creator>
      <dc:date>2014-06-29T04:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using the LocateButton to trigger an event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260314#M24106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;John,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;add this to your code and let me know if it works:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geoLocate.on("locate", dothat);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function dothat(evt){
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circle = new Circle({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; center: evt.graphic.geometry,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geodesic: true,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; radius: 5,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; radiusUnit: "esriMiles"
&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.graphics.clear();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.infoWindow.hide();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var graphic = new Graphic(circle, circleSymb);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.graphics.add(graphic);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var query = new Query();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; query.geometry = circle.getExtent();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureLayer.queryFeatures(query, selectInBuffer);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tim&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:48:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260314#M24106</guid>
      <dc:creator>TimWitt</dc:creator>
      <dc:date>2021-12-11T12:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using the LocateButton to trigger an event</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260315#M24107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;john,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;what tim noticed is that currently you are 'listening' for the locate event to be triggered, but using that geometry to create your circle graphic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;in your code right now you are wiring up a second event listener to wait for someone to click on the map after the locate button has already been pressed.&amp;nbsp; you can see that its working if you click on the map after using the locate widget and then zoom out enough levels to display the 10 mile diameter ring.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 19:16:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-the-locatebutton-to-trigger-an-event/m-p/260315#M24107</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2014-06-30T19:16:46Z</dc:date>
    </item>
  </channel>
</rss>

