Class: FeatureOverlayMgr service:ngeoFeatureOverlayMgr

ngeo.FeatureOverlayMgr

new 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);

Methods

(protected) addFeature(feature, groupIndex)

Parameters:
Name Type Description
feature ol.Feature

The feature to add.

groupIndex number

The group groupIndex.

(protected) clear(groupIndex)

Parameters:
Name Type Description
groupIndex number

The group groupIndex.

getFeatureOverlay()

Returns:
ngeo.FeatureOverlay

Feature overlay.

getLayer()

Returns:
ol.layer.Vector

The vector layer used internally.

init(map)

Parameters:
Name Type Description
map ol.Map

Map.

(protected) removeFeature(feature, groupIndex)

Parameters:
Name Type Description
feature ol.Feature

The feature to add.

groupIndex number

The group groupIndex.

(protected) setStyle(style, groupIndex)

Parameters:
Name Type Description
style ol.style.Style|Array.|ol.StyleFunction

Style.

groupIndex number

Group index.