Class: FeatureOverlayMgr service:ngeoFeatureOverlayMgr

ngeo.map.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);

Members

(static, non-null) module: angular.Module

Methods

addFeature(feature, groupIndex)

Parameters:
Name Type Description
feature ol.Feature

The feature to add.

groupIndex number

The group groupIndex.

clear(groupIndex)

Parameters:
Name Type Description
groupIndex number

The group groupIndex.

getFeatureOverlay()

Returns:
ngeo.map.FeatureOverlay

Feature overlay.

getLayer()

Returns:
ol.layer.Vector

The vector layer used internally.

init(map)

Parameters:
Name Type Description
map ol.Map

Map.

removeFeature(feature, groupIndex)

Parameters:
Name Type Description
feature ol.Feature

The feature to add.

groupIndex number

The group groupIndex.

setStyle(style, groupIndex)

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

Style.

groupIndex number

Group index.