Setting Feature Layer mode when retrieving map from ArcGIS Online

718
2
Jump to solution
01-08-2013 05:43 AM
RobertoPepato_Mellado
New Contributor II
Hello all,

The namespace esri.arcgis.utils provides a convenient method for retrieving maps stored on ArcGIS OnLine. You just call createMap passing the itemId and the target html div as arguments. You can optionally pass in some additional options (see http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm#jsapi/namespace_esri.arcgis....).

My question is:

For an ArcGISOnline map that has some feature services within, is it possible do set the mode (ON_DEMAND, SNAPSHOT, etc [see http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi_start.htm]) to the feature layers when retrieving the map ?

I know that I can do this by creating a map object and loading individual Feature Layers into it, but I'd like to know if is it possible to do this through createMap. I'd like to retrieve a map from ArcGISOnline (with some Feature Services configured) with SNAPSHOT mode for its Feature Layers (It looks like the createMap returns the layers in ON_DEMAND mode).

Regards,

Roberto Pepato
0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor
No it is not possible to change the mode of the feature layers and you are correct that by default they are in OnDemand mode. One solution might be to leave the layers you want in Snapshot mode out of the arcgis.com map. Then after createMap you can use map.addLayer to add the additional feature layers in Snapshot mode.

View solution in original post

0 Kudos
2 Replies
KellyHutchins
Esri Frequent Contributor
No it is not possible to change the mode of the feature layers and you are correct that by default they are in OnDemand mode. One solution might be to leave the layers you want in Snapshot mode out of the arcgis.com map. Then after createMap you can use map.addLayer to add the additional feature layers in Snapshot mode.
0 Kudos
RobertoPepato_Mellado
New Contributor II
No it is not possible to change the mode of the feature layers and you are correct that by default they are in OnDemand mode. One solution might be to leave the layers you want in Snapshot mode out of the arcgis.com map. Then after createMap you can use map.addLayer to add the additional feature layers in Snapshot mode.


Thanks for the explanation. The solution you have proposed is exactly what I'm using right now, I've just wondering if we can have something more out-of-the-box (maybe a new parameter to createMap to specify the default mode for included feature services ?). I'll post this as a suggestion at http://ideas.esri.com.
0 Kudos