<?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 add a FeatureLayer to the Search widget as a source in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-a-featurelayer-to-the-search-widget-as/m-p/1253567#M80121</link>
    <description>&lt;P&gt;That is a TypeScript typing issue. TypeScript doesn't type autocasted properties, so you need to instantiate it as an instance of the SearchSource.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;sources: [new SearchSource({ layer, ...otherstuff })]&lt;/LI-CODE&gt;&lt;P&gt;Might need to instantiate some other stuff to make TypeScript happy.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 31 Jan 2023 21:51:48 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2023-01-31T21:51:48Z</dc:date>
    <item>
      <title>Cannot add a FeatureLayer to the Search widget as a source</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-a-featurelayer-to-the-search-widget-as/m-p/1253542#M80120</link>
      <description>&lt;P&gt;I try to follow the doc to add a layer as custom source for the Search widget:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources&lt;/A&gt;&lt;/P&gt;&lt;P&gt;But I get:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-01-31 at 16.04.01.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/61763iD0B8CA3AC8390A97/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-01-31 at 16.04.01.png" alt="Screenshot 2023-01-31 at 16.04.01.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The full error is -&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Type '{ layer: FeatureLayer; }' is not assignable to type 'SearchSourceProperties'.&lt;BR /&gt;Object literal may only specify known properties, and 'layer' does not exist in type 'SearchSourceProperties'.&lt;/SPAN&gt;&lt;SPAN&gt;ts(2322)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How should I add a&amp;nbsp; FeatureLayer as source to the Search widget? I am using 4.25.5 ES module version.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 21:14:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-a-featurelayer-to-the-search-widget-as/m-p/1253542#M80120</guid>
      <dc:creator>noah</dc:creator>
      <dc:date>2023-01-31T21:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot add a FeatureLayer to the Search widget as a source</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-a-featurelayer-to-the-search-widget-as/m-p/1253567#M80121</link>
      <description>&lt;P&gt;That is a TypeScript typing issue. TypeScript doesn't type autocasted properties, so you need to instantiate it as an instance of the SearchSource.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-SearchSource.html&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;sources: [new SearchSource({ layer, ...otherstuff })]&lt;/LI-CODE&gt;&lt;P&gt;Might need to instantiate some other stuff to make TypeScript happy.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 21:51:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-a-featurelayer-to-the-search-widget-as/m-p/1253567#M80121</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2023-01-31T21:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot add a FeatureLayer to the Search widget as a source</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-a-featurelayer-to-the-search-widget-as/m-p/1253654#M80124</link>
      <description>&lt;P&gt;Thanks. But would you show me some code for a working JavaScript version? The code compiled regardlessly but the search did not show me any result from the layer.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 04:18:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-a-featurelayer-to-the-search-widget-as/m-p/1253654#M80124</guid>
      <dc:creator>noah</dc:creator>
      <dc:date>2023-02-01T04:18:46Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot add a FeatureLayer to the Search widget as a source</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-a-featurelayer-to-the-search-widget-as/m-p/1253858#M80132</link>
      <description>&lt;P&gt;This sample shows how to use the layer as a search source. There are other options you need to set, like what fields to search and stuff.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-multiplesource/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-multiplesource/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Feb 2023 15:24:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/cannot-add-a-featurelayer-to-the-search-widget-as/m-p/1253858#M80132</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2023-02-01T15:24:09Z</dc:date>
    </item>
  </channel>
</rss>

