AnsweredAssumed Answered

Layer.fromPortalItem doesnt work when the portalitem id is a webmap

Question asked by torinth on Feb 2, 2017
Latest reply on Feb 6, 2017 by torinth

Hi, we are trying to build a system that work with either ArcGIS server maps and ArcGIS online portal maps.  If I do Layer.fromPortalItem and the id I pass in is a webmap I get the following error.


[esri.layers.Layer] #fromPortalItem() Failed to create layer from portal item (portal: '', id: 'myidhere') [portal:unknown-item-type]: Unknown item type 'Web Map'


Is there a way to query the web map as a layer that needs to be added to map just like we can do with Layer.fromArcGisServerUrl?