<?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 Is there something similar to the District Lookup Widget for JavaScript Maps SDK? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-something-similar-to-the-district-lookup/m-p/1339566#M82514</link>
    <description>&lt;P&gt;Is there something similar to the &lt;A href="https://doc.arcgis.com/en/web-appbuilder/latest/create-apps/widget-district-lookup.htm" target="_self"&gt;District Lookup Widget&lt;/A&gt; you can use with the JavaScript SDK?&lt;/P&gt;&lt;P&gt;I'd like to search an address and display the features of a hosted feature layer.&amp;nbsp; Using the &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-multiplesource/" target="_self"&gt;Search widget with multiple sources example&lt;/A&gt;&amp;nbsp;, it allows me to search by features of a feature layer, however this requires the user to know what to look for. I'm looking enter an address to get the feature and its attributes--something similar to the District Lookup Widget.&lt;/P&gt;&lt;P&gt;This is what I currently have using the search widget.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;html lang="en"&amp;gt;

&amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8" /&amp;gt;
    &amp;lt;meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /&amp;gt;
    &amp;lt;title&amp;gt;Access Will County&amp;lt;/title&amp;gt;

    &amp;lt;style&amp;gt;
        html,
        body,
        #viewDiv {
            padding: 0;
            margin: 0;
            height: 100%;
            width: 100%;
        }
    &amp;lt;/style&amp;gt;

    &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.27/esri/themes/light/main.css" /&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.27/"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;script&amp;gt;
        require(["esri/Map", "esri/views/MapView", "esri/layers/FeatureLayer", "esri/widgets/Search"], (
            Map,
            MapView,
            FeatureLayer,
            Search
        ) =&amp;gt; {
            const map = new Map({
                basemap: "dark-gray-vector"
            });

            const view = new MapView({
                container: "viewDiv",
                map: map,
                center: [-88, 41.5], // lon, lat
                scale: 1000000
            });

            const featureLayerService = new FeatureLayer({
                url:
                    "https://services.arcgis.com/fGsbyIOAuxHnF97m/arcgis/rest/services/DialARide_Service_Areas/FeatureServer",
                popupTemplate: {
                    // autocasts as new PopupTemplate()
                    title: "Service Area: {Service}",
                    overwriteActions: true
                }
            });

            const searchWidget = new Search({
                view: view,
                //   allPlaceholder: "Search",
                searchAllEnabled: false,
                includeDefaultSources: false,
                sources: [
                    {
                        name: "Search by address",
                        placeholder: "search by address",
                        apiKey: "Your API Key Here",
                        singleLineFieldName: "SingleLine",
                        url: "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer"
                    },
                    {
                        layer: featureLayerService,
                        searchFields: ["Service"],
                        displayField: "Service",
                        exactMatch: false,
                        outFields: ["Service"],
                        name: "Search by Service Area",
                        placeholder: "example: Will Ride"
                    }
                ]
            });

            // Add the search widget to the top left corner of the view
            view.ui.add(searchWidget, {
                position: "top-right"
            });
        });
    &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
    &amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&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>Thu, 19 Oct 2023 21:07:40 GMT</pubDate>
    <dc:creator>JaredPilbeam2</dc:creator>
    <dc:date>2023-10-19T21:07:40Z</dc:date>
    <item>
      <title>Is there something similar to the District Lookup Widget for JavaScript Maps SDK?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-something-similar-to-the-district-lookup/m-p/1339566#M82514</link>
      <description>&lt;P&gt;Is there something similar to the &lt;A href="https://doc.arcgis.com/en/web-appbuilder/latest/create-apps/widget-district-lookup.htm" target="_self"&gt;District Lookup Widget&lt;/A&gt; you can use with the JavaScript SDK?&lt;/P&gt;&lt;P&gt;I'd like to search an address and display the features of a hosted feature layer.&amp;nbsp; Using the &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-multiplesource/" target="_self"&gt;Search widget with multiple sources example&lt;/A&gt;&amp;nbsp;, it allows me to search by features of a feature layer, however this requires the user to know what to look for. I'm looking enter an address to get the feature and its attributes--something similar to the District Lookup Widget.&lt;/P&gt;&lt;P&gt;This is what I currently have using the search widget.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;html lang="en"&amp;gt;

&amp;lt;head&amp;gt;
    &amp;lt;meta charset="utf-8" /&amp;gt;
    &amp;lt;meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" /&amp;gt;
    &amp;lt;title&amp;gt;Access Will County&amp;lt;/title&amp;gt;

    &amp;lt;style&amp;gt;
        html,
        body,
        #viewDiv {
            padding: 0;
            margin: 0;
            height: 100%;
            width: 100%;
        }
    &amp;lt;/style&amp;gt;

    &amp;lt;link rel="stylesheet" href="https://js.arcgis.com/4.27/esri/themes/light/main.css" /&amp;gt;
    &amp;lt;script src="https://js.arcgis.com/4.27/"&amp;gt;&amp;lt;/script&amp;gt;

    &amp;lt;script&amp;gt;
        require(["esri/Map", "esri/views/MapView", "esri/layers/FeatureLayer", "esri/widgets/Search"], (
            Map,
            MapView,
            FeatureLayer,
            Search
        ) =&amp;gt; {
            const map = new Map({
                basemap: "dark-gray-vector"
            });

            const view = new MapView({
                container: "viewDiv",
                map: map,
                center: [-88, 41.5], // lon, lat
                scale: 1000000
            });

            const featureLayerService = new FeatureLayer({
                url:
                    "https://services.arcgis.com/fGsbyIOAuxHnF97m/arcgis/rest/services/DialARide_Service_Areas/FeatureServer",
                popupTemplate: {
                    // autocasts as new PopupTemplate()
                    title: "Service Area: {Service}",
                    overwriteActions: true
                }
            });

            const searchWidget = new Search({
                view: view,
                //   allPlaceholder: "Search",
                searchAllEnabled: false,
                includeDefaultSources: false,
                sources: [
                    {
                        name: "Search by address",
                        placeholder: "search by address",
                        apiKey: "Your API Key Here",
                        singleLineFieldName: "SingleLine",
                        url: "https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer"
                    },
                    {
                        layer: featureLayerService,
                        searchFields: ["Service"],
                        displayField: "Service",
                        exactMatch: false,
                        outFields: ["Service"],
                        name: "Search by Service Area",
                        placeholder: "example: Will Ride"
                    }
                ]
            });

            // Add the search widget to the top left corner of the view
            view.ui.add(searchWidget, {
                position: "top-right"
            });
        });
    &amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
    &amp;lt;div id="viewDiv"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;&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>Thu, 19 Oct 2023 21:07:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-something-similar-to-the-district-lookup/m-p/1339566#M82514</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2023-10-19T21:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Is there something similar to the District Lookup Widget for JavaScript Maps SDK?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-something-similar-to-the-district-lookup/m-p/1339881#M82517</link>
      <description>&lt;P&gt;Try this one code&lt;/P&gt;&lt;P&gt;const searchWidget = new Search({&lt;BR /&gt;view: view,&lt;BR /&gt;includeDefaultSources: false,&lt;BR /&gt;sources: [{&lt;BR /&gt;url: "https://__________/arcgis/rest/services/GeocodeServer",&lt;BR /&gt;name: "LocatorSearchSource",&lt;BR /&gt;singleLineFieldName: "street",&lt;BR /&gt;autoComplete: true,&lt;BR /&gt;zoomScale: 2000,&lt;BR /&gt;placeholder: "***************",&lt;BR /&gt;locationEnabled: false,&lt;BR /&gt;exactMatch: false,&lt;BR /&gt;maxResults: 3,&lt;BR /&gt;maxSuggestions: 10,&lt;BR /&gt;suggestionsEnabled: true,&lt;BR /&gt;minSuggestCharacters: 0,&lt;BR /&gt;displayField: "Street",&lt;BR /&gt;outFields: ["Street", "Score"],&lt;BR /&gt;//prefix: '%',&lt;BR /&gt;//suffix: '',&lt;BR /&gt;resultSymbol: {&lt;BR /&gt;type: "picture-marker",&lt;BR /&gt;url: "https:/PIN.png",&lt;BR /&gt;height: 20&lt;BR /&gt;}&lt;BR /&gt;}]&lt;BR /&gt;});&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 01:10:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-something-similar-to-the-district-lookup/m-p/1339881#M82517</guid>
      <dc:creator>vmvargas</dc:creator>
      <dc:date>2023-10-20T01:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there something similar to the District Lookup Widget for JavaScript Maps SDK?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-something-similar-to-the-district-lookup/m-p/1554705#M86016</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294090"&gt;@JaredPilbeam2&lt;/a&gt;&amp;nbsp;were you able to accomplish this? I'm trying to do the something, and cannot figure out how to do that. I'm very new to SDK, and coding in general.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate if you can share your script, if you have it working. Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Nov 2024 15:03:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-something-similar-to-the-district-lookup/m-p/1554705#M86016</guid>
      <dc:creator>NataliyaLys</dc:creator>
      <dc:date>2024-11-01T15:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is there something similar to the District Lookup Widget for JavaScript Maps SDK?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-something-similar-to-the-district-lookup/m-p/1555077#M86024</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/119651"&gt;@NataliyaLys&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No, i put it on the back burner while I unknowningly wait for it to be added to ExB. The app that uses that widget is still in WAB, which is set to be retired at the end of 2025. I'm subscribed to the &lt;A href="https://community.esri.com/t5/arcgis-experience-builder-ideas/add-district-lookup-widget-to-exb/idi-p/1235695" target="_self"&gt;Idea page&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2024 14:56:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/is-there-something-similar-to-the-district-lookup/m-p/1555077#M86024</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2024-11-04T14:56:10Z</dc:date>
    </item>
  </channel>
</rss>

