<?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 transition to components in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-transition-to-components/m-p/1604698#M86892</link>
    <description>&lt;P&gt;Since we have both the component and widget, the doc is pretty much the same for properties, so it's not copied between one and the other. The sources behave the same way. Here is a demo that updates the Search multiple sources sample to components.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/azbgEmB?editors=1000" target="_blank"&gt;https://codepen.io/odoe/pen/azbgEmB?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;arcgis-map basemap="dark-gray" center="-97,38" scale="10000000" all-placeholder="District or Senator" include-default-sources-disabled&amp;gt;
    &amp;lt;arcgis-search&amp;gt;&amp;lt;/arcgis-search&amp;gt;
  &amp;lt;/arcgis-map&amp;gt;
  &amp;lt;script type="module"&amp;gt;
    const FeatureLayer = await $arcgis.import("@arcgis/core/layers/FeatureLayer.js");
    const searchElement = document.querySelector("arcgis-search");
    const featureLayerDistricts = new FeatureLayer({
      url: "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_117th_Congressional_Districts_all/FeatureServer/0",
      popupTemplate: {
        title: "Congressional District {DISTRICTID} &amp;lt;/br&amp;gt;{NAME}, ({PARTY})",
        overwriteActions: true
      }
    });
    const featureLayerSenators = new FeatureLayer({
      url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/US_Senators_2020/FeatureServer/0",
      popupTemplate: {
        title: "&amp;lt;a href={Web_Page} target='_blank'&amp;gt; {Name}&amp;lt;/a&amp;gt;, ({Party}-{State}) ",
        overwriteActions: true
      }
    });
    searchElement.sources = [{
        layer: featureLayerDistricts,
        searchFields: ["DISTRICTID"],
        displayField: "DISTRICTID",
        exactMatch: false,
        outFields: ["DISTRICTID", "NAME", "PARTY"],
        name: "Congressional Districts",
        placeholder: "example: 3708"
      },
      {
        layer: featureLayerSenators,
        searchFields: ["Name", "Party"],
        suggestionTemplate: "{Name}, Party: {Party}",
        exactMatch: false,
        outFields: ["*"],
        placeholder: "example: Casey",
        name: "Senators",
        zoomScale: 500000,
        resultSymbol: {
          type: "picture-marker",
          url: "https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-multiplesource/live/images/senate.png",
          height: 36,
          width: 36
        }
      },
      {
        name: "ArcGIS World Geocoding Service",
        placeholder: "example: Nuuk, GRL",
        apiKey: "%YOUR_ACCESS_TOKEN%",
        singleLineFieldName: "SingleLine",
        url: "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer"
      }
    ];
  &amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 10 Apr 2025 14:32:20 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2025-04-10T14:32:20Z</dc:date>
    <item>
      <title>Search widget transition to components</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-transition-to-components/m-p/1604377#M86865</link>
      <description>&lt;P&gt;After finding out about the transition to components, I'm wondering how I should proceed with the search widget? I'm about to build an app template (that will be followed by many) that includes searching a feature layer. As of now that's only possible with the widget as far as I can tell?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2025 20:27:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-transition-to-components/m-p/1604377#M86865</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2025-04-09T20:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget transition to components</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-transition-to-components/m-p/1604386#M86866</link>
      <description>&lt;P&gt;Apologies, I think I've found the right documentation. Sometimes it's hard to know where to look.&lt;/P&gt;&lt;P&gt;&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;</description>
      <pubDate>Wed, 09 Apr 2025 20:43:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-transition-to-components/m-p/1604386#M86866</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2025-04-09T20:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget transition to components</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-transition-to-components/m-p/1604391#M86867</link>
      <description>&lt;P data-unlink="true"&gt;I take it back. &lt;A href="https://developers.arcgis.com/javascript/latest/references/map-components/arcgis-search/#allSources" target="_self"&gt;This components page&lt;/A&gt;&amp;nbsp;takes me to that widgets page... confusing.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Apr 2025 20:55:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-transition-to-components/m-p/1604391#M86867</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2025-04-09T20:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Search widget transition to components</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-transition-to-components/m-p/1604698#M86892</link>
      <description>&lt;P&gt;Since we have both the component and widget, the doc is pretty much the same for properties, so it's not copied between one and the other. The sources behave the same way. Here is a demo that updates the Search multiple sources sample to components.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/azbgEmB?editors=1000" target="_blank"&gt;https://codepen.io/odoe/pen/azbgEmB?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;  &amp;lt;arcgis-map basemap="dark-gray" center="-97,38" scale="10000000" all-placeholder="District or Senator" include-default-sources-disabled&amp;gt;
    &amp;lt;arcgis-search&amp;gt;&amp;lt;/arcgis-search&amp;gt;
  &amp;lt;/arcgis-map&amp;gt;
  &amp;lt;script type="module"&amp;gt;
    const FeatureLayer = await $arcgis.import("@arcgis/core/layers/FeatureLayer.js");
    const searchElement = document.querySelector("arcgis-search");
    const featureLayerDistricts = new FeatureLayer({
      url: "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_117th_Congressional_Districts_all/FeatureServer/0",
      popupTemplate: {
        title: "Congressional District {DISTRICTID} &amp;lt;/br&amp;gt;{NAME}, ({PARTY})",
        overwriteActions: true
      }
    });
    const featureLayerSenators = new FeatureLayer({
      url: "https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/US_Senators_2020/FeatureServer/0",
      popupTemplate: {
        title: "&amp;lt;a href={Web_Page} target='_blank'&amp;gt; {Name}&amp;lt;/a&amp;gt;, ({Party}-{State}) ",
        overwriteActions: true
      }
    });
    searchElement.sources = [{
        layer: featureLayerDistricts,
        searchFields: ["DISTRICTID"],
        displayField: "DISTRICTID",
        exactMatch: false,
        outFields: ["DISTRICTID", "NAME", "PARTY"],
        name: "Congressional Districts",
        placeholder: "example: 3708"
      },
      {
        layer: featureLayerSenators,
        searchFields: ["Name", "Party"],
        suggestionTemplate: "{Name}, Party: {Party}",
        exactMatch: false,
        outFields: ["*"],
        placeholder: "example: Casey",
        name: "Senators",
        zoomScale: 500000,
        resultSymbol: {
          type: "picture-marker",
          url: "https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-multiplesource/live/images/senate.png",
          height: 36,
          width: 36
        }
      },
      {
        name: "ArcGIS World Geocoding Service",
        placeholder: "example: Nuuk, GRL",
        apiKey: "%YOUR_ACCESS_TOKEN%",
        singleLineFieldName: "SingleLine",
        url: "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer"
      }
    ];
  &amp;lt;/script&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 10 Apr 2025 14:32:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/search-widget-transition-to-components/m-p/1604698#M86892</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2025-04-10T14:32:20Z</dc:date>
    </item>
  </channel>
</rss>

