Load Feature Layer inside webmap in Snapshot mode

3834
8
01-20-2016 09:46 AM
MohamedNabil1
New Contributor II

hi,

I have features layer inside a webmap on ArcGIS Online, I want to load this feature layer in Snapshot Mode not in on demand mode.

How can I do this without adding the feature layer again, and losing all its configuration saved in the web map.

Thanks.

8 Replies
RickeyFight
MVP Regular Contributor

Are you using a javascript application or ArcGIS Online​?

0 Kudos
MohamedNabil1
New Contributor II

Javascript Application

0 Kudos
RickeyFight
MVP Regular Contributor

Try:

  var featureLayer = new FeatureLayer("http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Hydrography/Watershed173811/FeatureServer...", {
    mode: FeatureLayer.MODE_ONDEMAND,
    tileWidth: 200,
    tileHeight: 200
  });

https://developers.arcgis.com/javascript/jsapi/featurelayer-amd.html

0 Kudos
MohamedNabil1
New Contributor II

true, but I am accessing webmap object which include the feature layer, so I don't initialize the feature layer

0 Kudos
NiklasKöhn
Esri Contributor

Hey all,

I know this is an old question, but I'd like to revive the discussion, because I'm having the exact same problem.

Use case: I'm using ArcGIS webappbuilder‌ with the brand new dashboard theme‌ andinfographic widget. The customer wants the "Filter by extent" option to be configurable, and therefore, I need to load the FeatureLayer in Snapshot Mode
The customer wants no programming, which means, no instantiating the FeatureLayer in the code and defining Snapshot mode there. I need to configure this setting in the WebMap or the WebApp, but I didn't find a switch for that.

Can someone help?

Thanks, Nik

0 Kudos
NiklasKöhn
Esri Contributor

Just in case someone's interested: No, it's not possible to do that in a WebMap.

I've solved the issue for my use case by adding the same layer again as an additional data source in the Web AppBuilder. This way, you can use it as input for the Dashboard Infographic Widget and the queries are not restricted to the map extent.

MarkCooper5
Occasional Contributor II

This is exactly the issue I am having. Unfortunately, when I add data that way, you dont appear to be able to filter by selection, unless I am doing something wrong.

Basically, I want to show the data for our whole district, unless someone selects a ward within it. As this doesnt appear possible, I cannot see how the widget can be of any use to me.

0 Kudos
NiklasKöhn
Esri Contributor

That's right. You can configure it one way or the other, but you cannot switch on the fly.

0 Kudos