FeaturelayerChooserFromMap class

The FeaturelayerChooserFromMap class displays the feature layers from the map and constructs a UI tree to show the feature layers. It inherits LayerChooserFromMap and overrides the filter method to only show the feature layers.

AMD Module Require

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

Constructor

new FeaturelayerChooserFromMap(params, srcNodeRef)

Creates a new FeaturelayerChooserFromMap dijit.

Parameters:

<Object> params—Required. Parameters for the FeaturelayerChooserFromMap dijit.

<DOMNode | String> srcNodeRef—Optional. HTML element where FeaturelayerChooserFromMap is rendered.

params properties:

<Object> createMapResponse—Required. The callback response of the esri.arcgis.utils#createmap method. You can get this object using the webMapResponse property of the map.

<Boolean> multiple—Optional. Default is false. By default, a user can only select one feature layer. If set to true, a user can select multiple feature layers.

<String>[] types—Optional. The FeaturelayerChooserFromMap class supports filtering a feature layer by geometry type. The available values are point, polyline, and polygon. By default, the value types are ['point','polyline','polygon'], and the dijit doesn't filter a feature layer by geometry type.

<Boolean> showLayerFromFeatureSet—Optional. The default value is false. By default, the FeaturelayerChooserFromMap class doesn’t show feature layers created by FeatureCollection.

Example:

require(['jimu/dijit/FeaturelayerChooserFromMap'], function(FeaturelayerChooserFromMap){
          var layerChooser = new FeaturelayerChooserFromMap({
            createMapResponse: map.webMapResponse,
            multiple: false,
            types: ['point'],
            showLayerFromFeatureSet: true
          }, srcNodeRef);
          ...
        });

Methods

getSelectedItems ()

Gets information for selected layers.

Return type: Object array. Each element is in the form {name, layerInfo}.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.