class sap.ui.vbm.FeatureCollection

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/vbm/FeatureCollection
Application Component: CA-GTF-VBZ

FeatureCollection aggregation container. A FeatureCollection can render the content of an assigned GeoJSON. The naming is associated to the GeoJSON standard. All features found in the GeoJSON are rendered as separated objects. From the possible feature types only

are supported so far. The feature type support will be extended in the upcoming releases.
All features from the GeoJSON will be rendered with the given default colors and are inactive. They do not react on mouse over, except with tooltip, or raise any events on click or right click.
By adding Feature elements to the items aggregation you can make the match (by id) feature from the GeoJSON interactive and give it alternative colors.


Constructor

Constructor for a new FeatureCollection.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.ui.vbm.FeatureCollection(sId?, mSettings?)
Param Type Default Value Description
sId? string

id for the new control, generated automatically if no id is given

mSettings? object

initial settings for the new control

Borrowed Properties

Name Type Default Value Description
data object

GeoJSON object according to the http://geojson.org/geojson-spec.html#geojson-objects|specification or array of such objects

Visibility: public
defaultBorderColor sap.ui.core.CSSColor rgba(255, 255, 255, 1.0)

Default border color for GeoJSON features, if applicable (Polygons and LineStrings)

Visibility: public
defaultFillColor sap.ui.core.CSSColor rgba(186, 193, 196, 0.5)

Default Fill color for GeoJSON features (Polygons and LineStrings)

Visibility: public
defaultLineWidth int 5

Default line width for LineStrings

Visibility: public
srcURL string

Source URL for GeoJSON

Visibility: public

Aggregations

Default Aggregation: items

Name Cardinality Type Description
items (default) 0..n sap.ui.vbm.Feature

Feature object aggregation

Borrowed Aggregations

Name Cardinality Type Description
items (default) 0..n sap.ui.vbm.Feature

Feature object aggregation


Events Overview

Event Description
click

The event is raised when there is a click action on an aggregated Feature. Clicks on other Features from the GeoJSON are ignored.

contextMenu

The event is raised when there is a right click or a tap and hold action on an aggregated Feature. Clicks on other Features from the GeoJSON are ignored.

click

The event is raised when there is a click action on an aggregated Feature. Clicks on other Features from the GeoJSON are ignored.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
featureId string

Id of clicked Feature

contextMenu

The event is raised when there is a right click or a tap and hold action on an aggregated Feature. Clicks on other Features from the GeoJSON are ignored.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object
featureId string

Id of clicked Feature


Methods Overview

Method Description
addItem

Adds some item to the aggregation items.

attachClick

Attaches event handler fnFunction to the click event of this sap.ui.vbm.FeatureCollection.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vbm.FeatureCollection itself.

The event is raised when there is a click action on an aggregated Feature. Clicks on other Features from the GeoJSON are ignored.

attachContextMenu

Attaches event handler fnFunction to the contextMenu event of this sap.ui.vbm.FeatureCollection.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vbm.FeatureCollection itself.

The event is raised when there is a right click or a tap and hold action on an aggregated Feature. Clicks on other Features from the GeoJSON are ignored.

destroyItems

Destroys all the items in the aggregation items.

detachClick

Detaches event handler fnFunction from the click event of this sap.ui.vbm.FeatureCollection.

The passed function and listener object must match the ones used for event registration.

detachContextMenu

Detaches event handler fnFunction from the contextMenu event of this sap.ui.vbm.FeatureCollection.

The passed function and listener object must match the ones used for event registration.

sap.ui.vbm.FeatureCollection.extend

Creates a new subclass of class sap.ui.vbm.FeatureCollection with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.vbm.GeoJsonLayer.extend.

fireClick

Fires event click to attached listeners.

fireContextMenu

Fires event contextMenu to attached listeners.

getFeaturesInfo

Returns Properties for Features like name, bounding box, and midpoint

getItems

Gets content of aggregation items.

Feature object aggregation

sap.ui.vbm.FeatureCollection.getMetadata

Returns a metadata object for class sap.ui.vbm.FeatureCollection.

indexOfItem

Checks for the provided sap.ui.vbm.Feature in the aggregation items. and returns its index if found or -1 otherwise.

insertItem

Inserts a item into the aggregation items.

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeItem

Removes a item from the aggregation items.

addItem

Adds some item to the aggregation items.

Param Type DefaultValue Description
oItem sap.ui.vbm.Feature

The item to add; if empty, nothing is inserted

attachClick

Attaches event handler fnFunction to the click event of this sap.ui.vbm.FeatureCollection.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vbm.FeatureCollection itself.

The event is raised when there is a click action on an aggregated Feature. Clicks on other Features from the GeoJSON are ignored.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vbm.FeatureCollection itself

attachContextMenu

Attaches event handler fnFunction to the contextMenu event of this sap.ui.vbm.FeatureCollection.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.vbm.FeatureCollection itself.

The event is raised when there is a right click or a tap and hold action on an aggregated Feature. Clicks on other Features from the GeoJSON are ignored.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.ui.vbm.FeatureCollection itself

destroyItems

Destroys all the items in the aggregation items.

detachClick

Detaches event handler fnFunction from the click event of this sap.ui.vbm.FeatureCollection.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

detachContextMenu

Detaches event handler fnFunction from the contextMenu event of this sap.ui.vbm.FeatureCollection.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.ui.vbm.FeatureCollection.extend

Creates a new subclass of class sap.ui.vbm.FeatureCollection with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.vbm.GeoJsonLayer.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

fireClick

Fires event click to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

featureId string

Id of clicked Feature

fireContextMenu

Fires event contextMenu to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

featureId string

Id of clicked Feature

getFeaturesInfo

Returns Properties for Features like name, bounding box, and midpoint

Param Type DefaultValue Description
aFeatureIds string[]

Array of Feature Ids. The Feature Id must match the GeoJSON tag.

getItems

Gets content of aggregation items.

Feature object aggregation

sap.ui.vbm.FeatureCollection.getMetadata

Returns a metadata object for class sap.ui.vbm.FeatureCollection.

indexOfItem

Checks for the provided sap.ui.vbm.Feature in the aggregation items. and returns its index if found or -1 otherwise.

Param Type DefaultValue Description
oItem sap.ui.vbm.Feature

The item whose index is looked for

insertItem

Inserts a item into the aggregation items.

Param Type DefaultValue Description
oItem sap.ui.vbm.Feature

The item to insert; if empty, nothing is inserted

iIndex int

The 0-based index the item should be inserted at; for a negative value of iIndex, the item is inserted at position 0; for a value greater than the current size of the aggregation, the item is inserted at the last position

removeAllItems

Removes all the controls from the aggregation items.

Additionally, it unregisters them from the hosting UIArea.

removeItem

Removes a item from the aggregation items.

Param Type DefaultValue Description
vItem int string sap.ui.vbm.Feature

The item to remove or its index or id