<?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: search widget source options in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-source-problems/m-p/1212015#M78691</link>
    <description>&lt;P&gt;hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/169842"&gt;@Noah-Sager&lt;/a&gt;,&lt;BR /&gt;so this is a GIF i made to show my problem,&lt;BR /&gt;i called the&amp;nbsp;&lt;SPAN&gt;AddSearchWidget function from the previous post 3 times, each time calling a different layer.&lt;BR /&gt;first call was the search widget with &lt;STRONG&gt;a feaureLayer added in the webmap&lt;/STRONG&gt;,(add a url from the web option).&lt;BR /&gt;second call was&amp;nbsp;&lt;SPAN&gt;"search this name in my layer list", its the same layer from the webmap(&lt;STRONG&gt;sublayer of an item&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;which added a mapImageLayer&lt;/STRONG&gt;).&lt;BR /&gt;the third call is what you suggested, i created a &lt;STRONG&gt;featureLayer outside the webmap&lt;/STRONG&gt;(same url as the first featurelayer added to the webmap).&lt;BR /&gt;&lt;BR /&gt;this gif is the result, the code is the same for all the layers but the &lt;STRONG&gt;mapimagelayer is slow&lt;/STRONG&gt;(not even responsive in this short gif) and also even tho the code is the same(same function running all the layers) the search result is different every time(same feature but &lt;STRONG&gt;the popup change&lt;/STRONG&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;im trying to get the full popup, and the speedy search suggestions.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  const niturService= list.items.find(function(layer:Layer) {
      return layer.title === "SearchTest";
    })
    AddSearchWidget(view, niturService);
  /////////////////////////////////////////////////////////////////////////////////////
  
  const niturService2= list.items.find(function(layer:Layer) {
    return layer.title === "סטטוס זיהום נחלים";
  })
  AddSearchWidget(view, niturService2);
/////////////////////////////////////////////////////////////////////////////////////
  const testFL = new FeatureLayer({
    url: "https://prd-esri.sviva.gov.il/arcgis/rest/services/rivers/Layers1/MapServer/2",
    outFields: ["*"]
  });
  AddSearchWidget(view, testFL);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="search widget test(Same code diffrent sources)" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/51031i62A8E11569E9AF5A/image-size/large?v=v2&amp;amp;px=999" role="button" title="searchWidgetProblem.gif" alt="search widget test(Same code diffrent sources)" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;search widget test(Same code diffrent sources)&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2022 15:35:15 GMT</pubDate>
    <dc:creator>litch</dc:creator>
    <dc:date>2022-09-13T15:35:15Z</dc:date>
    <item>
      <title>search widget source problems</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-source-problems/m-p/1210431#M78616</link>
      <description>&lt;P&gt;&lt;SPAN&gt;hey im trying to use a search widget, with the ESRI JS API 4. the source im using is a layer in the webmap.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;using the layer (find by name) is painfully slow but it only have 250 features. adding the layer as a feature layer to the webmap(instead of an item) solves the problem but then its not grouped and is above relevant layers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;am i using the widget wrong? can i do anything to better the search time?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if not- is there a way to move feature layers under items in the webmap?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;can i group the layer myself?(the other layer grouped is huge and wont draw fully as a featureLayer so i want to group it as a mapImageLayer while keeping the source as a feature layer) heres the code i use:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;import Layer from "@arcgis/core/layers/Layer";
import MapView from "@arcgis/core/views/MapView";
import Search from "@arcgis/core/widgets/Search";

export default function AddSearchWidget(view: MapView, layer: Layer) {
  const source = {
    name: "river status",
    layer: layer,
    searchFields: ["label"],
    displayField: "label",
    exactMatch: false,
    outFields: ["label"],
    placeholder: "For example: Nile river"
  };


  const searchWidget = new Search({
    view: view,
    //activeSourceIndex:-1,
    allPlaceholder: "address river name",
    sources: [source]
  });
  // Adds the search widget below other elements in
  // the top left corner of the view
  view.ui.add(searchWidget, {
    position: "top-right",
    index: 2
  });
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 17:49:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-source-problems/m-p/1210431#M78616</guid>
      <dc:creator>litch</dc:creator>
      <dc:date>2022-09-13T17:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: search widget source options</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-source-problems/m-p/1210826#M78637</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/440581"&gt;@litch&lt;/a&gt;,&amp;nbsp;can you just add the layer to the search widget (and not add it to the map), and use the webmap to add to the map for visualization? Finding the layer from the webmap to use shouldn't be painfully slow, so maybe there is something else going on.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 16:00:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-source-problems/m-p/1210826#M78637</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-09-08T16:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: search widget source options</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-source-problems/m-p/1212015#M78691</link>
      <description>&lt;P&gt;hey&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/169842"&gt;@Noah-Sager&lt;/a&gt;,&lt;BR /&gt;so this is a GIF i made to show my problem,&lt;BR /&gt;i called the&amp;nbsp;&lt;SPAN&gt;AddSearchWidget function from the previous post 3 times, each time calling a different layer.&lt;BR /&gt;first call was the search widget with &lt;STRONG&gt;a feaureLayer added in the webmap&lt;/STRONG&gt;,(add a url from the web option).&lt;BR /&gt;second call was&amp;nbsp;&lt;SPAN&gt;"search this name in my layer list", its the same layer from the webmap(&lt;STRONG&gt;sublayer of an item&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;which added a mapImageLayer&lt;/STRONG&gt;).&lt;BR /&gt;the third call is what you suggested, i created a &lt;STRONG&gt;featureLayer outside the webmap&lt;/STRONG&gt;(same url as the first featurelayer added to the webmap).&lt;BR /&gt;&lt;BR /&gt;this gif is the result, the code is the same for all the layers but the &lt;STRONG&gt;mapimagelayer is slow&lt;/STRONG&gt;(not even responsive in this short gif) and also even tho the code is the same(same function running all the layers) the search result is different every time(same feature but &lt;STRONG&gt;the popup change&lt;/STRONG&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;im trying to get the full popup, and the speedy search suggestions.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;  const niturService= list.items.find(function(layer:Layer) {
      return layer.title === "SearchTest";
    })
    AddSearchWidget(view, niturService);
  /////////////////////////////////////////////////////////////////////////////////////
  
  const niturService2= list.items.find(function(layer:Layer) {
    return layer.title === "סטטוס זיהום נחלים";
  })
  AddSearchWidget(view, niturService2);
/////////////////////////////////////////////////////////////////////////////////////
  const testFL = new FeatureLayer({
    url: "https://prd-esri.sviva.gov.il/arcgis/rest/services/rivers/Layers1/MapServer/2",
    outFields: ["*"]
  });
  AddSearchWidget(view, testFL);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="search widget test(Same code diffrent sources)" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/51031i62A8E11569E9AF5A/image-size/large?v=v2&amp;amp;px=999" role="button" title="searchWidgetProblem.gif" alt="search widget test(Same code diffrent sources)" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;search widget test(Same code diffrent sources)&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 15:35:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-source-problems/m-p/1212015#M78691</guid>
      <dc:creator>litch</dc:creator>
      <dc:date>2022-09-13T15:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: search widget source options</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-source-problems/m-p/1212045#M78693</link>
      <description>&lt;P&gt;Ok, let me see if I understand correctly.&lt;/P&gt;&lt;P&gt;Top Search widget in the gif. The first scenario works as expected. This is adding a FeatureLayer as a LayerSearchSource to the Search widget. This FeatureLayer is being called via URL, and is a layer in the webmap.&lt;/P&gt;&lt;P&gt;Middle&amp;nbsp;Search widget in the gif. The second scenario is not working as expected. There are no suggestions being populated, or the suggestions are populated, but it's very slow. This is searching the webmap for a layer with a specific name (it's a sublayer of a MapImageLayer added to the webmap).&lt;/P&gt;&lt;P&gt;Bottom Search&amp;nbsp;widget in the gif. The third scenario is not working as expected. The popup looks different from the other two scenarios, and the feature that is searched for changes every time. This is adding a FeatureLayer as a LayerSearchSource to the Search widget. This FeatureLayer is being called via URL, and is a layer in the webmap.&lt;/P&gt;&lt;P&gt;Did I understand correctly? Are you using multiple Search widgets in the actual app, or was that to demonstrate the issue?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 16:42:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-source-problems/m-p/1212045#M78693</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-09-13T16:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: search widget source options</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-source-problems/m-p/1212084#M78697</link>
      <description>&lt;P&gt;almost,&lt;BR /&gt;the bottom(third) search widget layer, is a featureLayer&amp;nbsp;&lt;SPAN&gt;LayerSearchSource that is&lt;/SPAN&gt;&amp;nbsp;&lt;STRONG&gt;not a part of the webmap&lt;/STRONG&gt;.&lt;BR /&gt;Also the &lt;STRONG&gt;feature found is the correct one&lt;/STRONG&gt;, my problem is with the different popup.&lt;/P&gt;&lt;P&gt;a big problem with the t&lt;SPAN&gt;he second scenario is i cant really pick the feature, There are no suggestions or they are very slow.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;no multiple search widgets in the actual app.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;here's an image of the webmap, the &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;red&lt;/FONT&gt; &lt;/STRONG&gt;line is for the featureLayer used in the search widget,&lt;BR /&gt;and the &lt;FONT color="#FFCC00"&gt;&lt;STRONG&gt;yellow&lt;/STRONG&gt; &lt;/FONT&gt;is for the sublayer.&lt;BR /&gt;&lt;BR /&gt;just to make sure, &lt;STRONG&gt;they all use the same URL&lt;/STRONG&gt;(source you can see on the third widget in the snippet.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="litch_0-1663090416100.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/51055iA8F7C1C7BC243C4B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="litch_0-1663090416100.png" alt="litch_0-1663090416100.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 17:47:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-source-problems/m-p/1212084#M78697</guid>
      <dc:creator>litch</dc:creator>
      <dc:date>2022-09-13T17:47:10Z</dc:date>
    </item>
  </channel>
</rss>

