Thank you in advance
It is the same for 2D and 3D.
See: MapImageLayer | ArcGIS API for JavaScript 4.12
Section: Reference an ArcGIS portal Item ID
<SPAN class="comment token">// references an ArcGIS Online item pointing to a Map Service Layer</SPAN> <SPAN class="keyword token">var</SPAN> layer <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">MapImageLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">{</SPAN> portalItem<SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN> <SPAN class="comment token">// autocasts as esri/portal/PortalItem</SPAN> id<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"d7892b3c13b44391992ecd42bfa92d01"</SPAN> <SPAN class="punctuation token">}</SPAN> <SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">add</SPAN><SPAN class="punctuation token">(</SPAN>layer<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN> <SPAN class="comment token">// adds the layer to the map</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Hi Sharma,
I create sample code for you, below is the codepen url
https://codepen.io/thanhtetaung/pen/xxKEKoe
map.layers.add(permitsLayer)
or
Initialized map with layers, that will work
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.