FeatureSetChooserForSingleLayer class

The FeatureSetChooserForSingleLayer class allows you to select features from a feature layer by interacting with the map. It also supports shortcut keys. Using the Shift key, you can add selected features to a currently selected feature set. Using the Ctrl key, or the Command key on a Mac, you can remove selected features from a currently selected feature set.

AMD Module Require

require(["jimu/dijit/FeatureSetChooserForSingleLayer"], function(FeatureSetChooserForSingleLayer) { /* code goes here */ });

Constructor

new FeatureSetChooserForSingleLayer(params, srcNodeRef)

Creates a new FeatureSetChooserForSingleLayer dijit.

Parameters:

  • <Object> params—Required. Parameters for the FeatureSetChooserForSingleLayer dijit. See the options table below for details on the parameters.
  • <DOMNode | String> srcNodeRef—Optional. HTML element where FeatureSetChooserForSingleLayer is rendered.

params properties:

  • <Map> map—Required. The map instance.
  • <FeatureLayer> featureLayer—Required. The feature layer the dijit interacts with.
  • <Boolean> updateSelection—Optional. The default value is false. If set to true, the dijit updates the selection set of the original feature layer. If set to false, it creates another layer to show the selected feature set and doesn't influence the original feature layer.

Example:

Sample:
require(['jimu/dijit/FeatureSetChooserForSingleLayer], function(FeatureSetChooserForSingleLayer){
  var dijit = new FeatureSetChooserForSingleLayer({
    map: map,
    featureLayer: layer,
    updateSelection: false
  }, srcNodeRef);
  ...
});

Methods

disable()

Disables the dijit. When disabled, you can't interact with the dijit.

Return type: Undefined.

enable()

Enables the dijit.

Return type: Undefined.

clearAllGraphics()

It depends on the updateSelection parameter of the class constructor. When updateSelection is true, the class updates the selection set of the original feature layer, and the clearAllGraphics() method clears the drawing graphics created by the DrawBox dijit; when updateSelection is false, the class creates a temporary layer to show the selected feature set, not affecting the original feature layer, and the clearAllGraphics() method clears the temporary layer and the drawing graphics created by DrawBox dijit.

Return type: Undefined.

getFeatures()

Gets the selected features.

Return type: Deferred. The deferred object resolves the feature array.

Events

loading

Fires when you begin selecting features.

Event Object: Undefined.

unloading

Fires when you finish selecting features.

Event Object: Undefined.