<?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: FindNearest api not working in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/findnearest-api-not-working/m-p/214182#M19828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suraj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Analysis Widgets/Dijits work against ArcGIS Spatial Analysis Service, I recommend looking at the&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jshelp/intro_analysiswidgets.html" title="https://developers.arcgis.com/javascript/3/jshelp/intro_analysiswidgets.html"&gt;Working with Analysis Widgets | Guide | ArcGIS API for JavaScript 3.24&lt;/A&gt;&amp;nbsp; Guide to working with Analysis Widgets and Samples on the documentation pages. Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Ganesh Subbiah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 Jun 2018 17:03:06 GMT</pubDate>
    <dc:creator>GaneshSubbiah</dc:creator>
    <dc:date>2018-06-29T17:03:06Z</dc:date>
    <item>
      <title>FindNearest api not working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/findnearest-api-not-working/m-p/214179#M19825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to use the findNearest arcgis javascript api? Is there any sample how to use findnearest api??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have used something like :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #263238; font-size: 13px;"&gt;$scope.findNearest = new www.FindNearest({&lt;/SPAN&gt;&lt;BR style="color: #263238; font-size: 13px;" /&gt;&lt;SPAN style="color: #263238; font-size: 13px;"&gt;analysisLayer: analysisLayer,&amp;nbsp; //this is the graphics layer type: polygon&lt;/SPAN&gt;&lt;BR style="color: #263238; font-size: 13px;" /&gt;&lt;SPAN style="color: #263238; font-size: 13px;"&gt;nearLayers: nearLayers, //this is a feature layer get from quering arcgis url like:&amp;nbsp;&lt;A data-display="https://basisregistraties.arcgisonline.nl/arcgis/rest/services/BAG/BAGv2/MapServer/0?f=pjson" data-sanitized="https://www.google.com/url?q=https://basisregistraties.arcgisonline.nl/arcgis/rest/services/BAG/BAGv2/MapServer/0?f%3Dpjson&amp;amp;sa=D&amp;amp;source=hangouts&amp;amp;ust=1526555307944000&amp;amp;usg=AFQjCNGlmbnPcI5Xl7fq-H8Zn6chCG9SWw" dir="ltr" href="https://www.google.com/url?q=https://basisregistraties.arcgisonline.nl/arcgis/rest/services/BAG/BAGv2/MapServer/0?f%3Dpjson&amp;amp;sa=D&amp;amp;source=hangouts&amp;amp;ust=1526555307944000&amp;amp;usg=AFQjCNGlmbnPcI5Xl7fq-H8Zn6chCG9SWw" rel="nofollow noreferrer noopener" tabindex="-1" target="_blank"&gt;https://something.com/MapServer/0?f=pjson&lt;/A&gt;&lt;/SPAN&gt;&lt;BR style="color: #263238; font-size: 13px;" /&gt;&lt;SPAN style="color: #263238; font-size: 13px;"&gt;map: $scope.map,&lt;/SPAN&gt;&lt;BR style="color: #263238; font-size: 13px;" /&gt;&lt;SPAN style="color: #263238; font-size: 13px;"&gt;portalUrl: "&lt;/SPAN&gt;&lt;A data-display="https://gis.inspectation.com/arcgis/rest/services/Utilities/Geometry/GeometryServer" data-sanitized="https://www.google.com/url?q=https://gis.inspectation.com/arcgis/rest/services/Utilities/Geometry/GeometryServer&amp;amp;sa=D&amp;amp;source=hangouts&amp;amp;ust=1526555215453000&amp;amp;usg=AFQjCNHhYJ5QczR06PYp2ux8WHPHT7WbJA" dir="ltr" href="https://www.google.com/url?q=https://gis.inspectation.com/arcgis/rest/services/Utilities/Geometry/GeometryServer&amp;amp;sa=D&amp;amp;source=hangouts&amp;amp;ust=1526555215453000&amp;amp;usg=AFQjCNHhYJ5QczR06PYp2ux8WHPHT7WbJA" rel="nofollow noreferrer noopener" style="color: #263238; font-size: 13px;" tabindex="-1" target="_blank"&gt;https://domain/arcgis/rest/services/Utilities/Geometry/GeometryServer&lt;/A&gt;&lt;SPAN style="color: #263238; font-size: 13px;"&gt;"&lt;/SPAN&gt;&lt;BR style="color: #263238; font-size: 13px;" /&gt;&lt;SPAN style="color: #263238; font-size: 13px;"&gt;}, "analysis-tool");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #263238; font-size: 13px;"&gt;It does not work.. I hope someone could suggest me on this.&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2018 11:10:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/findnearest-api-not-working/m-p/214179#M19825</guid>
      <dc:creator>SurajShrestha</dc:creator>
      <dc:date>2018-05-16T11:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: FindNearest api not working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/findnearest-api-not-working/m-p/214180#M19826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Suraj,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Some of your code looks strange:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;$scope&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;findNearest &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;www&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;FindNearest&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; analysisLayer&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; analysisLayer&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="comment token"&gt;//this is the graphics layer type: polygon&lt;/SPAN&gt;
&amp;nbsp; nearLayers&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; nearLayers&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;&lt;SPAN&gt;//this is a feature layer get from quering arcgis url like: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fsomething.com%2FMapServer%2F0%3Ff%3Dpjson" target="_blank"&gt;https://something.com/MapServer/0?f=pjson&lt;/A&gt;&lt;/SPAN&gt;
&amp;nbsp; map&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; $scope&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;map&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp; portalUrl&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdomain%2Farcgis%2Frest%2Fservices%2FUtilities%2FGeometry%2FGeometryServer" target="_blank"&gt;https://domain/arcgis/rest/services/Utilities/Geometry/GeometryServer&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"analysis-tool"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;OL&gt;&lt;LI&gt;PortalUrl should be "&lt;A class="unlinked" target="_blank"&gt;https://www.arcgis.com"&lt;/A&gt;&amp;nbsp;not a Geometry server url.&lt;/LI&gt;&lt;LI&gt;analysisLayer should be a FeatureLayer object not a GraphicsLayer&lt;/LI&gt;&lt;LI&gt;nearLayer should be a FeatureLayer object not a map server query result (unless you are constructing a FeatureLayer from the result graphics).&lt;/LI&gt;&lt;LI&gt;Also new &lt;A href="http://www.FindNearest&amp;nbsp;looks" target="_blank"&gt;www.FindNearest&amp;nbsp;looks&lt;/A&gt; strange to me it normally would be new FindNearest()&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find the expected/required properties in the help doc:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jsapi/findnearest-amd.html#properties" title="https://developers.arcgis.com/javascript/3/jsapi/findnearest-amd.html#properties" rel="nofollow noopener noreferrer" target="_blank"&gt;FindNearest | API Reference | ArcGIS API for JavaScript 3.24&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:30:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/findnearest-api-not-working/m-p/214180#M19826</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-11T10:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: FindNearest api not working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/findnearest-api-not-working/m-p/214181#M19827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. I have copied code sample from my project directly, so it looks bit strange. From your suggestions, it seems incorrect to use graphics layer to search nearest feature layer using FindNearest esri api.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you suggest us right esri api to use in order to find nearest feature layer by using polygon graphics? Currently, we only get result from FindNearest api if the drawn polygon graphics contains feature layer, but if the polygon lies outside the layer, we get no result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 May 2018 06:52:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/findnearest-api-not-working/m-p/214181#M19827</guid>
      <dc:creator>SurajShrestha</dc:creator>
      <dc:date>2018-05-17T06:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: FindNearest api not working</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/findnearest-api-not-working/m-p/214182#M19828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suraj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Analysis Widgets/Dijits work against ArcGIS Spatial Analysis Service, I recommend looking at the&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/3/jshelp/intro_analysiswidgets.html" title="https://developers.arcgis.com/javascript/3/jshelp/intro_analysiswidgets.html"&gt;Working with Analysis Widgets | Guide | ArcGIS API for JavaScript 3.24&lt;/A&gt;&amp;nbsp; Guide to working with Analysis Widgets and Samples on the documentation pages. Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards&lt;/P&gt;&lt;P&gt;Ganesh Subbiah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2018 17:03:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/findnearest-api-not-working/m-p/214182#M19828</guid>
      <dc:creator>GaneshSubbiah</dc:creator>
      <dc:date>2018-06-29T17:03:06Z</dc:date>
    </item>
  </channel>
</rss>

