<?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 Add portal item failed in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-portal-item-failed/m-p/117984#M10986</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I saw a portal item &lt;A class="link-titled" href="https://www.arcgis.com/home/item.html?id=690d7aecc9d643b2825e75587992040e" title="https://www.arcgis.com/home/item.html?id=690d7aecc9d643b2825e75587992040e" rel="nofollow noopener noreferrer" target="_blank"&gt;https://www.arcgis.com/home/item.html?id=690d7aecc9d643b2825e75587992040e&lt;/A&gt; and want to add it to my map (arcgis javascript API 4.11) using the following codes but it failed:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Layer.fromPortalItem({&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;&lt;SPAN&gt;                portalItem: item               }).then(function(layer) {                 webmap.add(layer);
&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;});&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;P&gt;I think this is due to the portal item has layer index in the URL and the Javascript API &lt;SPAN&gt;Layer.fromPortalItem function cannot handle this. The portal item display fine in arcgis online map viewer.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can anyone help with this? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:02:14 GMT</pubDate>
    <dc:creator>XiaowenHuang</dc:creator>
    <dc:date>2021-12-12T16:02:14Z</dc:date>
    <item>
      <title>Add portal item failed</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-portal-item-failed/m-p/117984#M10986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I saw a portal item &lt;A class="link-titled" href="https://www.arcgis.com/home/item.html?id=690d7aecc9d643b2825e75587992040e" title="https://www.arcgis.com/home/item.html?id=690d7aecc9d643b2825e75587992040e" rel="nofollow noopener noreferrer" target="_blank"&gt;https://www.arcgis.com/home/item.html?id=690d7aecc9d643b2825e75587992040e&lt;/A&gt; and want to add it to my map (arcgis javascript API 4.11) using the following codes but it failed:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Layer.fromPortalItem({&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;&lt;SPAN&gt;                portalItem: item               }).then(function(layer) {                 webmap.add(layer);
&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN&gt;});&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;/PRE&gt;&lt;P&gt;I think this is due to the portal item has layer index in the URL and the Javascript API &lt;SPAN&gt;Layer.fromPortalItem function cannot handle this. The portal item display fine in arcgis online map viewer.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can anyone help with this? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:02:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-portal-item-failed/m-p/117984#M10986</guid>
      <dc:creator>XiaowenHuang</dc:creator>
      <dc:date>2021-12-12T16:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Add portal item failed</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-portal-item-failed/m-p/117985#M10987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting. It looks like there might be an issue with consuming a MapImageLayer (with dynamic layers enabled) as a portal item. Will bear more investigation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Edit: This might be wrong. We can consume&amp;nbsp;a MapImageLayer (with dynamic layers enabled) as a portal item. Not sure what is going on here. Maybe data specific. Cannot reproduce yet with a different item.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the meantime, you can still consume the data via URL instead of portal item, as seen here:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://codepen.io/noash/pen/LYYdzKE" title="https://codepen.io/noash/pen/LYYdzKE"&gt;https://codepen.io/noash/pen/LYYdzKE&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Nov 2019 22:28:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-portal-item-failed/m-p/117985#M10987</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2019-11-05T22:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: Add portal item failed</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-portal-item-failed/m-p/117986#M10988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have search arcgis online function and need to add search result (portal item) to map. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2019 13:58:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-portal-item-failed/m-p/117986#M10988</guid>
      <dc:creator>XiaowenHuang</dc:creator>
      <dc:date>2019-11-06T13:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Add portal item failed</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-portal-item-failed/m-p/117987#M10989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok. Will investigate further.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2019 17:12:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-portal-item-failed/m-p/117987#M10989</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2019-11-06T17:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: Add portal item failed</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-portal-item-failed/m-p/117988#M10990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Update: looks like this is an issue with the API. We will address it and get it fixed at a release in the near future.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Dec 2019 18:27:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-portal-item-failed/m-p/117988#M10990</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2019-12-05T18:27:36Z</dc:date>
    </item>
  </channel>
</rss>

