# Class FeatureOverlayMgr

Provides a service that wraps an "unmanaged" vector layer, used as a shared vector layer across the application.

Example:

The application's main component/controller initializes the feature overlay manager with the map:

    ngeoFeatureOverlayMgr.init(map);

Once initialized, components of the application can use the manager to create a feature overlay, configuring it with specific styles:

    let featureOverlay = ngeoFeatureOverlayMgr.getFeatureOverlay();
    featureOverlay.setStyle(myStyle);
    featureOverlay.addFeature(myFeature);

#### Hierarchy

- FeatureOverlayMgr

- Defined in src/map/FeatureOverlayMgr.ts:64

#####
Index

### Constructors

constructor

### Properties

featureUidToGroupIndex_
groups_
layer_
source_

### Methods

addFeature
clear
getFeatureOverlay
getLayer
init
isEmpty
removeFeature
setStyle
styleFunction_

## Constructors

### constructor

- new FeatureOverlayMgr(): FeatureOverlayMgr

- #### Returns FeatureOverlayMgr

  - Defined in src/map/FeatureOverlayMgr.ts:73

## Properties

### featureUidToGroupIndex_

featureUidToGroupIndex_: { [x: string]: number }

#### Type declaration

- ##### [x: string]: number

- Defined in src/map/FeatureOverlayMgr.ts:65

### groups_

groups_: MapFeatureOverlayGroup[]

- Defined in src/map/FeatureOverlayMgr.ts:67

### layer_

layer_: VectorLayer<VectorSource<Geometry>>

- Defined in src/map/FeatureOverlayMgr.ts:71

### source_

source_: VectorSource<Geometry>

- Defined in src/map/FeatureOverlayMgr.ts:69

## Methods

### addFeature

- addFeature(feature: Feature<Geometry>, groupIndex: number): void

- #### Parameters

  - ##### feature: Feature<Geometry>

    The feature to add.

  - ##### groupIndex: number

    The group groupIndex.

  #### Returns void

  - Defined in src/map/FeatureOverlayMgr.ts:101

### clear

- clear(groupIndex: number): void

- #### Parameters

  - ##### groupIndex: number

    The group groupIndex.

  #### Returns void

  - Defined in src/map/FeatureOverlayMgr.ts:126

### getFeatureOverlay

- getFeatureOverlay(): FeatureOverlay

- ### Returns

  Feature overlay.

  #### Returns FeatureOverlay

  - Defined in src/map/FeatureOverlayMgr.ts:146

### getLayer

- getLayer(): VectorLayer<VectorSource<Geometry>>

- ### Returns

  The vector layer used internally.

  #### Returns VectorLayer<VectorSource<Geometry>>

  - Defined in src/map/FeatureOverlayMgr.ts:139

### init

- init(map: Map): void

- #### Parameters

  - ##### map: Map

    Map.

  #### Returns void

  - Defined in src/map/FeatureOverlayMgr.ts:158

### isEmpty

- isEmpty(groupIndex: number): boolean

- ### Returns

  True if the group has no features. False otherwise.

  #### Parameters

  - ##### groupIndex: number

    The group groupIndex.

  #### Returns boolean

  - Defined in src/map/FeatureOverlayMgr.ts:91

### removeFeature

- removeFeature(feature: Feature<Geometry>, groupIndex: number): void

- #### Parameters

  - ##### feature: Feature<Geometry>

    The feature to add.

  - ##### groupIndex: number

    The group groupIndex.

  #### Returns void

  - Defined in src/map/FeatureOverlayMgr.ts:114

### setStyle

- setStyle(style: StyleLike, groupIndex: number): void

- #### Parameters

  - ##### style: StyleLike

    Style to apply.

  - ##### groupIndex: number

    Group index.

  #### Returns void

  - Defined in src/map/FeatureOverlayMgr.ts:166

### styleFunction_

- styleFunction_(feature: Feature<Geometry> | RenderFeature, resolution: number): void | Style | Style[]

- ### Returns

  Styles.

  #### Parameters

  - ##### feature: Feature<Geometry> | RenderFeature

    Feature.

  - ##### resolution: number

    Resolution.

  #### Returns void | Style | Style[]

  - Defined in src/map/FeatureOverlayMgr.ts:177

Generated using TypeDoc