<?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: portalitem=new PortalItem in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/portalitem-new-portalitem/m-p/749679#M69348</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Users work without the Internet&lt;/P&gt;&lt;P&gt;for this reason, I placed the library locally on the server&lt;/P&gt;&lt;P&gt;My Web map&amp;nbsp;&lt;A class="link-titled" href="https://gis.kgp.kz/portal/home/webmap/viewer.html?webmap=0ce4b182600b4ea78afdcda6ec8428e8" title="https://gis.kgp.kz/portal/home/webmap/viewer.html?webmap=0ce4b182600b4ea78afdcda6ec8428e8"&gt;https://gis.kgp.kz/portal/home/webmap/viewer.html?webmap=0ce4b182600b4ea78afdcda6ec8428e8&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My test html&amp;nbsp;&lt;A class="link-titled" href="https://gis.kgp.kz/test_kz.html" title="http://localhost/test_kz.html"&gt;https://gis.kgp.kz/test_kz.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 27 Jul 2020 03:05:07 GMT</pubDate>
    <dc:creator>DidarBultanov</dc:creator>
    <dc:date>2020-07-27T03:05:07Z</dc:date>
    <item>
      <title>portalitem=new PortalItem</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/portalitem-new-portalitem/m-p/749677#M69346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to load&amp;nbsp;maps from my portal&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;lt;link&lt;BR /&gt; rel="stylesheet"&lt;BR /&gt; href="https://gis.kgp.kz/arcgis_js_api/library/4.16/esri/themes/light/main.css"&lt;BR /&gt; /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script src="https://gis.kgp.kz/arcgis_js_api/library/4.16/dojo/dojo.js""&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;BR /&gt; &lt;BR /&gt; require([&lt;BR /&gt;"https://gis.kgp.kz/arcgis_js_api/library/4.16/esri/portal/PortalItem.js",&lt;BR /&gt;"https://gis.kgp.kz/arcgis_js_api/library/4.16/esri/views/MapView.js", &lt;BR /&gt;"https://gis.kgp.kz/arcgis_js_api/library/4.16/esri/WebMap.js"&lt;/P&gt;&lt;P&gt;], function (&lt;BR /&gt; PortalItem, &lt;BR /&gt; MapView,&lt;BR /&gt; WebMap&lt;BR /&gt; ) {&lt;/P&gt;&lt;P&gt;var portalitem= new PortalItem({&lt;BR /&gt; id:"0ce4b182600b4ea78afdcda6ec8428e8",&lt;BR /&gt; portal:"https://gis.kgp.kz/portal",&lt;BR /&gt; type:"Web Map" &lt;BR /&gt; });&lt;BR /&gt; var webmap = new WebMap({&lt;BR /&gt; portalItem:portalitem &lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;//console.log(webmap.portalItem+" "+esriConfig.PortalUrl);&lt;BR /&gt; var view = new MapView({&lt;BR /&gt; map: webmap,&lt;BR /&gt; container: "viewDiv"&lt;BR /&gt; });&lt;BR /&gt; });&lt;BR /&gt; &amp;lt;/script&amp;gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I get an error:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;dojo.js:115 [esri.core.Accessor] Accessor#set Assigning an instance of 'esri.portal.PortalItem' which is not a subclass of 'esri.portal.PortalItem'&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 10:13:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/portalitem-new-portalitem/m-p/749677#M69346</guid>
      <dc:creator>DidarBultanov</dc:creator>
      <dc:date>2020-07-24T10:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: portalitem=new PortalItem</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/portalitem-new-portalitem/m-p/749678#M69347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure about your specific error... I've seen something similar when the order of function arguments does not match the order of require arguments. But that seems to be&amp;nbsp;correct. Is there a reason why you can't reference the CDN version of JSAPI?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I try the following, which is similar &amp;nbsp;to your&amp;nbsp;examples, it works"&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;html&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;head&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// Reference the JSAPI here &lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;script src&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"https://js.arcgis.com/4.16/"&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;script&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;

&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;script&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// Only reference module names not the full path like you did&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;require&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"esri/portal/PortalItem"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"esri/WebMap"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;"esri/views/MapView"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;

&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
PortalItem&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
WebMap&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
MapView
&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// Grab anitem from your Portal&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; portalitem &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;PortalItem&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  id&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"&amp;lt; some item Id &amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
  portal&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"&amp;lt;my own portal URL &amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
portalitem&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;load&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// Create a web map with that item&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; webmap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;WebMap&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  portalItem&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; portalitem
  
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;// Crwate  a view to hold the map&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; view &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;MapView&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  map&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; webmap&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="comment token"&gt;// The WebMap instance created above&lt;/SPAN&gt;
  &lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;script&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;head&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;

&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;body&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
  &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;div id&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"viewDiv"&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;div&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;body&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;

&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;html&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
  ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&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;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&l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&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;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not saying what you tried can't work but&amp;nbsp;the above looks more familiar to me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:51:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/portalitem-new-portalitem/m-p/749678#M69347</guid>
      <dc:creator>Arne_Gelfert</dc:creator>
      <dc:date>2021-12-12T07:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: portalitem=new PortalItem</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/portalitem-new-portalitem/m-p/749679#M69348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Users work without the Internet&lt;/P&gt;&lt;P&gt;for this reason, I placed the library locally on the server&lt;/P&gt;&lt;P&gt;My Web map&amp;nbsp;&lt;A class="link-titled" href="https://gis.kgp.kz/portal/home/webmap/viewer.html?webmap=0ce4b182600b4ea78afdcda6ec8428e8" title="https://gis.kgp.kz/portal/home/webmap/viewer.html?webmap=0ce4b182600b4ea78afdcda6ec8428e8"&gt;https://gis.kgp.kz/portal/home/webmap/viewer.html?webmap=0ce4b182600b4ea78afdcda6ec8428e8&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My test html&amp;nbsp;&lt;A class="link-titled" href="https://gis.kgp.kz/test_kz.html" title="http://localhost/test_kz.html"&gt;https://gis.kgp.kz/test_kz.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Jul 2020 03:05:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/portalitem-new-portalitem/m-p/749679#M69348</guid>
      <dc:creator>DidarBultanov</dc:creator>
      <dc:date>2020-07-27T03:05:07Z</dc:date>
    </item>
  </channel>
</rss>

