<?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: MapImageLayer search widget in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1151602#M76590</link>
    <description>&lt;P&gt;I wonder if I can just add the whole MapImageLayer as a source to Search? It seems to be possible, but I don't understand how to choose the fields when there is multiple sublayers on MapImageLayer.&amp;nbsp;&lt;BR /&gt;Here it is mentioned that MapImageLayer can be used. Any ideas?&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#layer" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#layer&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Mar 2022 08:06:30 GMT</pubDate>
    <dc:creator>KristianTuusjärvi</dc:creator>
    <dc:date>2022-03-08T08:06:30Z</dc:date>
    <item>
      <title>MapImageLayer search widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1142103#M76295</link>
      <description>&lt;P&gt;Hello, is it possible to search from all of the MapImageLayer sublayers?&lt;/P&gt;&lt;P&gt;Should I use a collection of LayerSearchSource to iterate through all of the sublayers and then add the collection to Search widget's 'sources' property.&lt;/P&gt;&lt;P&gt;const sources = new Collection&amp;lt;LayerSearchSource&amp;gt;();&lt;/P&gt;&lt;P&gt;//Loop through MapImageLayer and add to sources??&lt;/P&gt;&lt;P&gt;const search = new Search({&lt;BR /&gt;view: view,&lt;BR /&gt;&amp;nbsp; sources: sources,&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 14:56:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1142103#M76295</guid>
      <dc:creator>KristianTuusjärvi</dc:creator>
      <dc:date>2022-02-09T14:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer search widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1142124#M76297</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/484779"&gt;@KristianTuusjärvi&lt;/a&gt;,&amp;nbsp;yes, you can use a Sublayer just like a FeatureLayer as a LayerSearchSource.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#layer" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#layer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I would recommend pulling out all the sublayers first, then add them as&amp;nbsp;a LayerSearchSource individually so you can configure the settings like in this sample:&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-multiplesource/" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/sample-code/widgets-search-multiplesource/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 16:50:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1142124#M76297</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-02-09T16:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer search widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1142143#M76299</link>
      <description>&lt;P&gt;That sample is unreachable, but are there any updates to the existing sample?&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-search-multiplesource" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-search-multiplesource&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 15:43:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1142143#M76299</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2022-02-09T15:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer search widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1142192#M76301</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/2839"&gt;@KenBuja&lt;/a&gt;. I updated the link. No updates to report.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 16:47:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1142192#M76301</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-02-09T16:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer search widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1151602#M76590</link>
      <description>&lt;P&gt;I wonder if I can just add the whole MapImageLayer as a source to Search? It seems to be possible, but I don't understand how to choose the fields when there is multiple sublayers on MapImageLayer.&amp;nbsp;&lt;BR /&gt;Here it is mentioned that MapImageLayer can be used. Any ideas?&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#layer" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search-LayerSearchSource.html#layer&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Mar 2022 08:06:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1151602#M76590</guid>
      <dc:creator>KristianTuusjärvi</dc:creator>
      <dc:date>2022-03-08T08:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer search widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1221191#M78985</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/169842"&gt;@Noah-Sager&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure if the sample code has been modified, but there is no sample of a sublayer of a MapImageLayer in above sample code. I'm wondering how do you "pull out all the sublayers first"? Thank you for your answer.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/484779"&gt;@KristianTuusjärvi&lt;/a&gt;&amp;nbsp;Have you managed to include the entire MapImageLayer as a source to Search?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;BR /&gt;Nadja&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 17:21:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1221191#M78985</guid>
      <dc:creator>nadja</dc:creator>
      <dc:date>2022-10-12T17:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer search widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1221529#M79002</link>
      <description>&lt;P&gt;Correct&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/205210"&gt;@nadja&lt;/a&gt;,&amp;nbsp;the sample I linked to shows how to set-up individual feature layers for use with the LayerSearchSource, like for example the searchFields and the outFields. It wouldn't work with just adding all Sublayers from a MapImageLayer without knowing more about the Sublayers. Does that make sense? So I don't think a programmatic approach would simplify things. I would just add the the Sublayers as individual&amp;nbsp;LayerSearchSources.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 14:08:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1221529#M79002</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-10-13T14:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer search widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1221544#M79003</link>
      <description>&lt;P&gt;Yes, thanks&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/169842"&gt;@Noah-Sager&lt;/a&gt;, this makes sense. However, I wonder how I would add the Sublayers as individual LayerSearchSource? Let's take the first Sublayer as an example. I tried several approaches to access the first Sublayer:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt;&amp;nbsp;My&lt;SPAN&gt;LayerSearchSource&lt;/SPAN&gt;&lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;LayerSearchSource&lt;/SPAN&gt;&lt;SPAN&gt;({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;layer&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;MyMapImageLayer&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;findSublayerById&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&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; [&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;"*"&lt;/SPAN&gt;&lt;SPAN&gt;],&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;outFields&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN&gt;"*"&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; });&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This code-snippet throws the error "Uncaught (in promise) TypeError: a.load is not a function". How do I access the sublayer correctly?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 13 Oct 2022 14:23:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1221544#M79003</guid>
      <dc:creator>nadja</dc:creator>
      <dc:date>2022-10-13T14:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer search widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1221677#M79010</link>
      <description>&lt;P&gt;Yeah, unfortunately you can't load a Sublayer directly, it needs to be a FeatureLayer or one of the other approved layer types in the doc:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#sources&lt;/A&gt;&lt;/P&gt;&lt;P&gt;What you can do is flatten the collection of Sublayers in the MapServer, then create FeatureLayers (and get the relevant LayerSearchSource attributes) out of each Sublayer.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#allSublayers" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MapImageLayer.html#allSublayers&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You should be able to also use the Sublayer.createFeatureLayer() method, but I had trouble with the synchronicity of the requests.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer" target="_blank" rel="noopener"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;After creating the FeatureLayer and the LayerSearchSource attributes, add them to an object, and then add that object to the Search widget sources Collection.&lt;/P&gt;&lt;P&gt;Here is a proof-of-concept app that should help clarify a potential workflow:&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/noash/pen/VwxgQzv?editors=1000" target="_blank" rel="noopener"&gt;https://codepen.io/noash/pen/VwxgQzv?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Try searching for a simple word here, like "new" or "yo".&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 17:38:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1221677#M79010</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-10-13T17:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: MapImageLayer search widget</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1222465#M79043</link>
      <description>&lt;P&gt;Sorry&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/484779"&gt;@KristianTuusjärvi&lt;/a&gt;,&amp;nbsp;I just noticed this question. Unfortunately, MapImageLayer is not listed there. Perhaps we could improve the wording to make this more clear. What it means is that a FeatureLayer from a MapServer or a FeatureServer is usable. So if you had a MapServer like this:&lt;/P&gt;&lt;P&gt;&lt;A href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;You could also just use each Sublayer URL (effectively consuming it as a FeatureLayer) as a source for the Search widget:&lt;/P&gt;&lt;P&gt;&lt;A href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/0" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/1" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/2&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 13:13:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mapimagelayer-search-widget/m-p/1222465#M79043</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-10-17T13:13:00Z</dc:date>
    </item>
  </channel>
</rss>

