<?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: The problem with LocatorTask is retrieving all objects within a category in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/the-problem-with-locatortask-is-retrieving-all/m-p/1562134#M13139</link>
    <description>&lt;P&gt;Well, the 1st param for&amp;nbsp;&lt;SPAN&gt;GeocodeAsync() is an address and you're not supplying any.&amp;nbsp;&lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/geocode-service/" target="_blank"&gt;https://developers.arcgis.com/rest/services-reference/enterprise/geocode-service/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Nov 2024 06:41:35 GMT</pubDate>
    <dc:creator>ViktorSafar</dc:creator>
    <dc:date>2024-11-25T06:41:35Z</dc:date>
    <item>
      <title>The problem with LocatorTask is retrieving all objects within a category</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/the-problem-with-locatortask-is-retrieving-all/m-p/1561948#M13138</link>
      <description>&lt;P&gt;Hello! I want to retrieve all objects related to a category, but the search result returns 0 objects.&lt;/P&gt;&lt;P&gt;My code:&lt;/P&gt;&lt;P&gt;var locatorTask = new LocatorTask(new Uri("&lt;A href="https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer" target="_blank"&gt;https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer&lt;/A&gt;"));&lt;BR /&gt;GeocodeParameters param = new GeocodeParameters();&lt;BR /&gt;param.MaxResults = 100;&lt;BR /&gt;if (map.VisibleArea != null)&lt;BR /&gt;param.SearchArea = map.VisibleArea;&lt;BR /&gt;else return;&lt;BR /&gt;param.MinScore = 1;&lt;BR /&gt;param.ResultAttributeNames.Add("*");&lt;BR /&gt;param.Categories.Add("POI");&lt;BR /&gt;param.Categories.Add("13035");&lt;BR /&gt;param.Categories.Add("Coffee");&lt;/P&gt;&lt;P&gt;var res = await locatorTask.GeocodeAsync("", param);&lt;BR /&gt;foreach (var item in res)&lt;BR /&gt;{&lt;BR /&gt;TXTstat.Text = $"{TXTstat.Text}{item.Attributes["PlaceName"]}\n";&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2024 14:36:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/the-problem-with-locatortask-is-retrieving-all/m-p/1561948#M13138</guid>
      <dc:creator>AndreyTsar</dc:creator>
      <dc:date>2024-11-23T14:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: The problem with LocatorTask is retrieving all objects within a category</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/the-problem-with-locatortask-is-retrieving-all/m-p/1562134#M13139</link>
      <description>&lt;P&gt;Well, the 1st param for&amp;nbsp;&lt;SPAN&gt;GeocodeAsync() is an address and you're not supplying any.&amp;nbsp;&lt;A href="https://developers.arcgis.com/rest/services-reference/enterprise/geocode-service/" target="_blank"&gt;https://developers.arcgis.com/rest/services-reference/enterprise/geocode-service/&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 06:41:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/the-problem-with-locatortask-is-retrieving-all/m-p/1562134#M13139</guid>
      <dc:creator>ViktorSafar</dc:creator>
      <dc:date>2024-11-25T06:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: The problem with LocatorTask is retrieving all objects within a category</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/the-problem-with-locatortask-is-retrieving-all/m-p/1562234#M13140</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have edited code from the Find Place sample (MAUI). Code below:&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;GeocodeParameters parameters = new GeocodeParameters();

// Get the current map extent.
Geometry extent = MyMapView.VisibleArea;

// Update the search parameters.
parameters.SearchArea = extent;

var locatorTask = new LocatorTask(new Uri("https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer"));

// Get the location information.
IReadOnlyList&amp;lt;GeocodeResult&amp;gt; locations = await _geocoder.GeocodeAsync("Coffee", parameters);

// Stop gracefully and show a message if the geocoder does not return a result.
if (locations.Count &amp;lt; 1)
{
                    return; // 3. Stop.
}
&lt;/LI-CODE&gt;
&lt;P&gt;It works and returns locations. Sample is here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-maps-sdk-dotnet-samples/tree/main/src/MAUI/Maui.Samples/Samples/Search/FindPlace" target="_self"&gt;https://github.com/Esri/arcgis-maps-sdk-dotnet-samples/tree/main/src/MAUI/Maui.Samples/Samples/Search/FindPlace&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 15:31:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/the-problem-with-locatortask-is-retrieving-all/m-p/1562234#M13140</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2024-11-25T15:31:51Z</dc:date>
    </item>
  </channel>
</rss>

