Is there a universal way to draw user's content on web map in 3.x

597
2
Jump to solution
07-21-2017 08:56 AM
YukiHuang
New Contributor II

I am currently working with a web app, which could allow the users to log in with their ArcGIS Online Accounts and draw their contents on the map. The confusing part of this process is that it is really hard to determine which Function should I use to draw the layer. I come up with a matrix about the most used layers, and which function that needed to be used based on item's metadata. This might be incomplete:

typedisplayNameArcGIS FunctionURL(ID) to Use
Web MapWeb MapMapitemid
KMLKMLKMLLayeritemDataUrl
Feature ServiceFeature layerFeatureLayerurl
Feature CollectionFeature layerFeatureLayeritemDataUrl
Image ServiceImagery LayerArcGISImageServiceLayerurl
Vector Tile ServiceTile LayerVectorTileLayerurl
Map ServiceTile LayerArcGISTiledMapServiceLayerurl
Map ServiceMap Image LayerArcGISDynamicMapServiceLayerurl

Any suggestions for the best practice for this problem?

Thanks

0 Kudos
1 Solution

Accepted Solutions
ThomasSolow
Occasional Contributor III

There's a Layer.fromPortalItem function in 4.XX but not in 3.XX as far as I know.  You may just have to call a different function based on the item type for each item in my contents.

View solution in original post

0 Kudos
2 Replies
ThomasSolow
Occasional Contributor III

There's a Layer.fromPortalItem function in 4.XX but not in 3.XX as far as I know.  You may just have to call a different function based on the item type for each item in my contents.

0 Kudos
YukiHuang
New Contributor II

Yep, 4.x beat 3.x in this aspect. I am just so confused about the either "displayName" or "type" of a item cannot determine the resource "Real" type individually.

0 Kudos