It is the same for 2D and 3D.
See: MapImageLayer | ArcGIS API for JavaScript 4.12
Section: Reference an ArcGIS portal Item ID
// references an ArcGIS Online item pointing to a Map Service Layer
var layer = new MapImageLayer({
portalItem: { // autocasts as esri/portal/PortalItem
id: "d7892b3c13b44391992ecd42bfa92d01"
}
});
map.add(layer); // adds the layer to the map
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