<?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: How to add current location button to AGO Web App in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440831#M40698</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You're welcome, sorry it was't more help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was under the impression that HighAccuracy = true used the device GPS, I forget where I read that however.&amp;nbsp; I'm also trying to do the same thing with a web editing app and the LocateButton I found at &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jssamples/widget_locate.html"&gt;https://developers.arcgis.com/en/javascript/jssamples/widget_locate.html&lt;/A&gt;&lt;SPAN&gt; but I'm having trouble getting my code to work with the locate button.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 30 Oct 2013 18:11:37 GMT</pubDate>
    <dc:creator>NathanSommers</dc:creator>
    <dc:date>2013-10-30T18:11:37Z</dc:date>
    <item>
      <title>How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440826#M40693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a Widows 7 Panasonic ToughPad for a field device. We are using ArcGIS Online for our mobile solution. Since Windows 7 doesn't have an app like iOS or Android, creating a Web Application is the only option.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I create a Web Application with, for example the Basic Viewer there is no current location or locate me button. Is there a way to add one? I've downloaded the web app and have it running off our server. I've found the "locate button" ArcGIS APR for JavaScript (found in link below), and have tried adding it the web app code, but it doesn't work properly. I've also found code names for "GetCurrentLocation" and "WatchPosition" but don't know how to code those in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ultimately I'd like to add a locate button, that would use the device's GPS? I know the Parcel Viewer has a locate button. It works ok, not that great though. Even if there was a way to take the parcel viewer's locate button and put it into the other Web Applications, that would be better than nothing. As you can probably tell I'm not a programer, so don't understand the code that much. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Locate Button Link:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jssamples/widget_locate.html"&gt;https://developers.arcgis.com/en/javascript/jssamples/widget_locate.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2013 17:23:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440826#M40693</guid>
      <dc:creator>RichardLittlefield</dc:creator>
      <dc:date>2013-10-23T17:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440827#M40694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The LocateButton takes standard Geolocation API settings, such as enableHighAccuracy&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jsapi/locatebutton-amd.html#geolocationoptions"&gt;https://developers.arcgis.com/en/javascript/jsapi/locatebutton-amd.html#geolocationoptions&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This will use a GPS if available, if not, it does some fallbacks to other methods, but that is handled by the API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Geolocation API specs&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.w3.org/TR/geolocation-API/#position-options"&gt;http://www.w3.org/TR/geolocation-API/#position-options&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The widget actually has a github page showing all the options&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://github.com/driskull/arcgis-dijit-locate-button-js"&gt;https://github.com/driskull/arcgis-dijit-locate-button-js&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not familiar with the setup of the Basic Viewer, but you should be able to get the widget working with it. Do you have some code you used to try and add it to the viewer? Make sure the viewer is referencing version 3.7 of the AGS JS API.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Oct 2013 17:55:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440827#M40694</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2013-10-23T17:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440828#M40695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have opened up the "layout.js" file from the javascript folder and just added the below code to the end of the file. It didn't work. Any ideas? Am I using the correct code?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; //one time snapshot&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; navigator.geolocation.getCurrentPosition(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; processGeolocation,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; //optional settings below&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; geolocationError,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; timeout: 0,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; enableHighAccuracy: true,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; maximumAge: Infinity&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; );&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; //Tracking user position&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; watchID = navigator.geolocation.watchPosition(&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; processGeolocation,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; //Optional settings below&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; geolocationError,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; timeout: 0,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; enableHighAccuracy: true,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; maximumAge: Infinity&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; );&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 16:37:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440828#M40695</guid>
      <dc:creator>RichardLittlefield</dc:creator>
      <dc:date>2013-10-30T16:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440829#M40696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Richard,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try this thread.&amp;nbsp; It explains it pretty well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/48343-Geolocate-API"&gt;http://forums.arcgis.com/threads/48343-Geolocate-API&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 17:06:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440829#M40696</guid>
      <dc:creator>NathanSommers</dc:creator>
      <dc:date>2013-10-30T17:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440830#M40697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Richard,&lt;BR /&gt;&lt;BR /&gt;Try this thread.&amp;nbsp; It explains it pretty well.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/48343-Geolocate-API"&gt;http://forums.arcgis.com/threads/48343-Geolocate-API&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Ian. Unfortunetly I have already done that one. It works pretty good. Could be better though.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I like the idea of the HighAccuracy = true from one of the post above. I'd like it to be more accurate, and use the device's GPS. I also like the idea of the standard look of the current location button. I'm also interested in the watchPostion function.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the one that you mentioned in my back pocket, to use if I can't get anything else working. I'm still trying though to get a better option. Thanks again.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 17:35:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440830#M40697</guid>
      <dc:creator>RichardLittlefield</dc:creator>
      <dc:date>2013-10-30T17:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440831#M40698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You're welcome, sorry it was't more help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was under the impression that HighAccuracy = true used the device GPS, I forget where I read that however.&amp;nbsp; I'm also trying to do the same thing with a web editing app and the LocateButton I found at &lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/en/javascript/jssamples/widget_locate.html"&gt;https://developers.arcgis.com/en/javascript/jssamples/widget_locate.html&lt;/A&gt;&lt;SPAN&gt; but I'm having trouble getting my code to work with the locate button.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 18:11:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440831#M40698</guid>
      <dc:creator>NathanSommers</dc:creator>
      <dc:date>2013-10-30T18:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440832#M40699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You're welcome, sorry it was't more help.&lt;BR /&gt;&lt;BR /&gt;I was under the impression that HighAccuracy = true used the device GPS, I forget where I read that however.&amp;nbsp; I'm also trying to do the same thing with a web editing app and the LocateButton I found at &lt;A href="https://developers.arcgis.com/en/javascript/jssamples/widget_locate.html"&gt;https://developers.arcgis.com/en/javascript/jssamples/widget_locate.html&lt;/A&gt; but I'm having trouble getting my code to work with the locate button.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'd like to use that locate button as well. Sounds like we are in the same boat. Update me if you figure it out, I'll do the same.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 18:18:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440832#M40699</guid>
      <dc:creator>RichardLittlefield</dc:creator>
      <dc:date>2013-10-30T18:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440833#M40700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Will do, thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Oct 2013 18:20:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440833#M40700</guid>
      <dc:creator>NathanSommers</dc:creator>
      <dc:date>2013-10-30T18:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440834#M40701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here's some info on how to add the locate button to the basic viewer. Let me know if you have any questions. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Open layout.js and load the LocateButton module by adding the following code at the top of layout.js below the existing dojo.require statements. &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
dojo.require("esri.dijit.LocateButton");
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Now find the line of code that sets the map variable to response.map. You can find this by searching for map = response.map. It should be at approximately line 215 of layout.js. Below that line of code add the following code to create the LocateButton. &lt;/SPAN&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;&amp;nbsp;&amp;nbsp; //add locate button 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var locateButton = new esri.dijit.LocateButton({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp; },"locateDiv");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; locateButton.startup();

&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Open index.html and add a new div. This div will be the container for the locate button. Add this new div directly below the existing timeFloater div. &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;!--Floating window contains the time slider--&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div id="timeFloater" style='display:none;'&amp;gt;&amp;lt;/div&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div id="locateDiv"&amp;gt;&amp;lt;/div&amp;gt; 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Open layout.css and add css that will position the layout button on the map. The example below will position this button directly below the +/- slider. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
#locateDiv{
&amp;nbsp; position: absolute;
&amp;nbsp; top:120px;
&amp;nbsp; left:20px;
&amp;nbsp; z-index: 30;
}

&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:29:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440834#M40701</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2021-12-12T16:29:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440835#M40702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Kelly,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the input.&amp;nbsp; Do you know if there is anyway to leverage the device GPS for the location much like ArcGIS for iPad or ArcGIS for Android App?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 16:45:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440835#M40702</guid>
      <dc:creator>NathanSommers</dc:creator>
      <dc:date>2013-10-31T16:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440836#M40703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The locate button uses the getCurrentPosition function of the Geolocation api. getCurrentPosition tries to get the location answer for you as quickly as possible and in some cases this means that it will return IP location or wifi instead of the device gps. You can try setting the enableHighAccuracy geolocation option to true. If this doesn't work you'll want to create your own button that uses the geolocation api with the watchPostion function. watchPosition will provide an updated location if the device moves or if more accurate information becomes available.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 16:58:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440836#M40703</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2013-10-31T16:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440837#M40704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is the watchPosition something I can add to the locate button code in the js file?&amp;nbsp; You'll have to forgive me I'm very new with javascript .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ian&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 17:44:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440837#M40704</guid>
      <dc:creator>NathanSommers</dc:creator>
      <dc:date>2013-10-31T17:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440838#M40705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;The locate button uses the getCurrentPosition function of the Geolocation api. getCurrentPosition tries to get the location answer for you as quickly as possible and in some cases this means that it will return IP location or wifi instead of the device gps. You can try setting the enableHighAccuracy geolocation option to true. If this doesn't work you'll want to create your own button that uses the geolocation api with the watchPostion function. watchPosition will provide an updated location if the device moves or if more accurate information becomes available.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you Kelly! Your code worked. I agree with Ian and would like to use the GPS on the device. So where can I place the enable High Accuracy code? How do I change it to the watchPosition?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 18:02:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440838#M40705</guid>
      <dc:creator>RichardLittlefield</dc:creator>
      <dc:date>2013-10-31T18:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440839#M40706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;To enable high accuracy specify it as a geolocation option when creating the button. For details on how the geolocation options work view the &lt;/SPAN&gt;&lt;A href="http://www.w3.org/TR/geolocation-API/#position-options"&gt;Geolocation API Specification&lt;/A&gt;&lt;SPAN&gt;. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var locateButton = new esri.dijit.LocateButton({&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map: map,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geolocationOptions:{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&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; enableHighAccuracy: true&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },"locateDiv");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Setting enableHighAccuracy to true tells the browser to try and find the most accurate location. So if a device GPS is available it would theoretically use that. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can't switch the locate button to using watch position so if you'd like to use that option you'll need to write your own code to do so.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2013 18:10:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440839#M40706</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2013-10-31T18:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to add current location button to AGO Web App</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440840#M40707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;To enable high accuracy specify it as a geolocation option when creating the button. For details on how the geolocation options work view the &lt;A href="http://www.w3.org/TR/geolocation-API/#position-options"&gt;Geolocation API Specification&lt;/A&gt;. &lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var locateButton = new esri.dijit.LocateButton({&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map: map,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geolocationOptions:{&lt;BR /&gt;&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; enableHighAccuracy: true&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },"locateDiv");&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Setting enableHighAccuracy to true tells the browser to try and find the most accurate location. So if a device GPS is available it would theoretically use that. &lt;BR /&gt;&lt;BR /&gt;You can't switch the locate button to using watch position so if you'd like to use that option you'll need to write your own code to do so.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've added this code to the layout file. Thank you!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I'm understanding the options correctly should I also set the MaximumAge to zero, that way it looks for a new position everytime, and doesn't use a cached position? Should the timeout option be infinity? Or do these 2 options not matter that much?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for all of your help Kelly!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2013 12:05:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-add-current-location-button-to-ago-web-app/m-p/440840#M40707</guid>
      <dc:creator>RichardLittlefield</dc:creator>
      <dc:date>2013-11-01T12:05:33Z</dc:date>
    </item>
  </channel>
</rss>

