FeaturelayerServiceBrowser class

The FeaturelayerServiceBrowser class allows you to filter layers by feature layer from a map service or feature service, and construct the service tree by specified service URL.

AMD Module Require

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

Constructor

new FeaturelayerServiceBrowser (params, srcNodeRef)

Creates a new FeaturelayerServiceBrowser dijit.

Parameters:

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

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

params properties:

<String> url—Optional. The URL to the filter. It must be a REST service URL.

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

<String>[] types—Optional. FeaturelayerServiceBrowser 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> isSupportQuery—Optional. By default, only query-enabled services show.

Example:

require(['jimu/dijit/FeaturelayerServiceBrowser'], function(FeaturelayerServiceBrowser){
					var url = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services";
					//it also supports the following format urls
				    //folder url:  http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics
				    //service url: http://tryitlive.arcgis.com/arcgis/rest/services/GeneralPurpose/MapServer
				    //group layer url: http://tryitlive.arcgis.com/arcgis/rest/services/GeneralPurpose/MapServer/0
				    //group layer url: http://tryitlive.arcgis.com/arcgis/rest/services/GeneralPurpose/MapServer/1
				    //layer url: http://tryitlive.arcgis.com/arcgis/rest/services/GeneralPurpose/MapServer/2
					var browser = new FeaturelayerServiceBrowser({
						url: url,
						multiple: true,
				  		types: ["point"]
					}, srcNodeRef);
					...
				});

Methods

setUrl(url)

Uses the specified URL to filter feature layers.

Parameters:

<String> url: Required. The REST service URL to the filter.

getSelectedItems()

Gets information for selected layers.

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