<?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: 'Cannot locate when disabled.' in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-locate-when-disabled/m-p/1270882#M80641</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/668892"&gt;@Blakearc&lt;/a&gt; most likely the View isn't ready (&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#ready" target="_self"&gt;view.ready&lt;/A&gt; === false) when you try to initialize the Locate widget. If you are still having issues after looking into that, you'll need to provide a focused, working github repo, stackblitz or codesandbox example of your React project. Here a basic troubleshooting guide: &lt;A href="https://github.com/Esri/jsapi-resources/blob/main/TROUBLESHOOTING.md#four-triage-steps" target="_blank"&gt;https://github.com/Esri/jsapi-resources/blob/main/TROUBLESHOOTING.md#four-triage-steps&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Mar 2023 14:30:42 GMT</pubDate>
    <dc:creator>AndyGup</dc:creator>
    <dc:date>2023-03-23T14:30:42Z</dc:date>
    <item>
      <title>'Cannot locate when disabled.'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-locate-when-disabled/m-p/1270786#M80639</link>
      <description>&lt;P&gt;I am using ArcGIS with react. I have successfully displayed a map and now I want to get current location once the map is loaded. I included all the setup inside a useEffect hook. I configured the location widget as below:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;locateWidget&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;ArcGISLocate&lt;/SPAN&gt;&lt;SPAN&gt;({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; view&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; useHeadingEnabled&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;false&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; goToOverride&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;function&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;options&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; options&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;target&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;scale&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;1500&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return&lt;/SPAN&gt; &lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;goTo&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;options&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;target&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; },&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;});&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;locateWidget&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;locate&lt;/SPAN&gt;&lt;SPAN&gt;().&lt;/SPAN&gt;&lt;SPAN&gt;then&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;function&lt;/SPAN&gt;&lt;SPAN&gt; () {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; console&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;log&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"success"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;});&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However I got the following error return:&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; details&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;undefined&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; message&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;"Cannot locate when disabled."&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; name&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;"locate:disabled-state"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;I tried using HTTPS over HTTP but the error still exists. How to solve this problem?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 09:28:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-locate-when-disabled/m-p/1270786#M80639</guid>
      <dc:creator>Blakearc</dc:creator>
      <dc:date>2023-03-23T09:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: 'Cannot locate when disabled.'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-locate-when-disabled/m-p/1270882#M80641</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/668892"&gt;@Blakearc&lt;/a&gt; most likely the View isn't ready (&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#ready" target="_self"&gt;view.ready&lt;/A&gt; === false) when you try to initialize the Locate widget. If you are still having issues after looking into that, you'll need to provide a focused, working github repo, stackblitz or codesandbox example of your React project. Here a basic troubleshooting guide: &lt;A href="https://github.com/Esri/jsapi-resources/blob/main/TROUBLESHOOTING.md#four-triage-steps" target="_blank"&gt;https://github.com/Esri/jsapi-resources/blob/main/TROUBLESHOOTING.md#four-triage-steps&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 14:30:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-locate-when-disabled/m-p/1270882#M80641</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2023-03-23T14:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: 'Cannot locate when disabled.'</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-locate-when-disabled/m-p/1271240#M80657</link>
      <description>&lt;P&gt;Thank you for answering. I put the locate() into view.when() and it works now !&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 01:26:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-locate-when-disabled/m-p/1271240#M80657</guid>
      <dc:creator>Blakearc</dc:creator>
      <dc:date>2023-03-24T01:26:58Z</dc:date>
    </item>
  </channel>
</rss>

