Defining the display mode
When creating an instance of FeatureLayer
, you need to specify a mode for retrieving features. Because the mode determines when and how features are brought from the server to the client, your choice can affect the behavior and performance of your application.
You can choose from the following modes:
- Snapshot mode:
MODE_SNAPSHOT
- On-demand mode:
MODE_ONDEMAND
- Selection mode:
MODE_SELECTION
- Auto mode:
MODE_AUTO
- Snapshot mode:
The snapshot mode
The snapshot mode retrieves all the feature from the map service layer and streams them to the client browser in one go. For this reason, you must carefully consider the size of your layer before using this mode. Generally, you should use this mode only with small datasets. Large datasets in snapshot mode can significantly degrade the performance of your application. The benefit of the snapshot mode is that since all features from the layer are sent to the client when the layer loads, there is no need to return to the server for additional data....