# Layer Modules

## Layer Class

Extends Opener.

## FeatureLayer Class

Extends Layer. FeatureLayer responses for rendering FeatureSource with styles.

## LayerFactory Class

 * 2. Create a FeatureLayer with a ShapefileFeatureSource with rs+ flag.
* typescript
* let layer = FeatureLayerFactory.create(new URL('shp://./cntry02.shp?flag=rs+'));
* 
* 3. Create a FeatureLayer with a MemoryFeatureSource with name = 'dynamic' and fields = ['name', 'recid'].
* typescript
* let layer = FeatureLayerFactory.create(new URL('mem://dynamic?fields=name|c,recid|n,landlocked|b'));
* 
* @returns {FeatureLayer} The feature layer with specified feature source.
*/
static create(sourceURL: URL): FeatureLayer;

}


## LayerGroup Class
This class represents a collection of a layers. It is used for organize the layer better in the app implementation. For instance, we usually have a set of layers that are stable and not change very often; while another set of layers are stored in memory and change very often, just like dynamic editing or highlighting features. Then we could maintain the two sets of layers in two LayerGroup; then it is easier to manage their rendering or caching.

javascript
export declare class LayerGroup {
/**
* ID of this group. Default value is group-\${uuid()}.
*/
id: string;
/**
* Name of this group. Default value is Unknown.
*/
name: string;
/**
* Indicates whether this group is visible or not.
*/
visible: boolean;
/**
* The FeatureLayer array.
*/
layers: Array<FeatureLayer>;
/**
* Constructs an instance of LayerGroup.
* @param {Array<FeatureLayer>} layers The layers that are about to add into this group. Pass undefined to initiate an empty array.
* @param {string} name The name of this group.
*/
constructor(layers?: Array<FeatureLayer>, name?: string);
/**
* Gets the envelope of this group.
* This function unions the envelope of each layers as a minimum envelope to contains all layers.
* @returns {Envelope} A minimum envelope to contains all the layers inside.
*/
envelope(): Promise<Envelope>;`