class sap.ui.vbm.GeoJsonLayer

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

GeoJsonLayer aggregation container. A GeoJsonLayer 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.
The GeoJSON can be given as a URL using property srcURL, directly as object using property data, or as a combination of both.


Constructor

Constructor for a new GeoJsonLayer.

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.GeoJsonLayer(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


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


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
addData

Add GeoJSON object to the layer

addItem

Adds some item to the aggregation items.

attachClick

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

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.GeoJsonLayer 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.GeoJsonLayer.

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.GeoJsonLayer 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.GeoJsonLayer.

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.GeoJsonLayer.

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

sap.ui.vbm.GeoJsonLayer.extend

Creates a new subclass of class sap.ui.vbm.GeoJsonLayer 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.core.Element.extend.

fireClick

Fires event click to attached listeners.

fireContextMenu

Fires event contextMenu to attached listeners.

getData

Gets current value of property data.

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

getDefaultBorderColor

Gets current value of property defaultBorderColor.

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

Default value is "rgba(255, 255, 255, 1.0)".

getDefaultFillColor

Gets current value of property defaultFillColor.

Default Fill color for GeoJSON features (Polygons and LineStrings)

Default value is "rgba(186, 193, 196, 0.5)".

getDefaultLineWidth

Gets current value of property defaultLineWidth.

Default line width for LineStrings

Default value is 5.

getFeaturesInfo

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

getItems

Gets content of aggregation items.

Feature object aggregation

sap.ui.vbm.GeoJsonLayer.getMetadata

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

getSrcURL

Gets current value of property srcURL.

Source URL for GeoJSON

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.

openContextMenu

open the context menu

openDetailWindow

open a Detail Window

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.

setData

Sets a new value for property data.

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

When called with a value of null or undefined, the default value of the property will be restored.

setDefaultBorderColor

Sets a new value for property defaultBorderColor.

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

When called with a value of null or undefined, the default value of the property will be restored.

Default value is "rgba(255, 255, 255, 1.0)".

setDefaultFillColor

Sets a new value for property defaultFillColor.

Default Fill color for GeoJSON features (Polygons and LineStrings)

When called with a value of null or undefined, the default value of the property will be restored.

Default value is "rgba(186, 193, 196, 0.5)".

setDefaultLineWidth

Sets a new value for property defaultLineWidth.

Default line width for LineStrings

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 5.

setSrcURL

Sets a new value for property srcURL.

Source URL for GeoJSON

When called with a value of null or undefined, the default value of the property will be restored.

addData

Add GeoJSON object to the layer

Param Type DefaultValue Description
aData object

GeoJSON object or an array of those

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.GeoJsonLayer.

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.GeoJsonLayer 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.GeoJsonLayer itself

attachContextMenu

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

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.GeoJsonLayer 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.GeoJsonLayer itself

destroyItems

Destroys all the items in the aggregation items.

detachClick

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

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.GeoJsonLayer.

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.GeoJsonLayer.extend

Creates a new subclass of class sap.ui.vbm.GeoJsonLayer 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.core.Element.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

getData

Gets current value of property data.

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

getDefaultBorderColor

Gets current value of property defaultBorderColor.

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

Default value is "rgba(255, 255, 255, 1.0)".

getDefaultFillColor

Gets current value of property defaultFillColor.

Default Fill color for GeoJSON features (Polygons and LineStrings)

Default value is "rgba(186, 193, 196, 0.5)".

getDefaultLineWidth

Gets current value of property defaultLineWidth.

Default line width for LineStrings

Default value is 5.

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.GeoJsonLayer.getMetadata

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

getSrcURL

Gets current value of property srcURL.

Source URL for GeoJSON

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

openContextMenu

open the context menu

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

VO instance for which the Detail Window should be opened

oMenu object

the context menu to be opened

openDetailWindow

open a Detail Window

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

VO instance for which the Detail Window should be opened

oParams object

Parameter object

caption string

Text for Detail Window caption

offsetX string

position offset in x-direction from the anchor point

offsetY string

position offset in y-direction from the anchor point

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

setData

Sets a new value for property data.

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

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
oData object

New value for property data

setDefaultBorderColor

Sets a new value for property defaultBorderColor.

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

When called with a value of null or undefined, the default value of the property will be restored.

Default value is "rgba(255, 255, 255, 1.0)".

Param Type DefaultValue Description
sDefaultBorderColor sap.ui.core.CSSColor "rgba(255, 255, 255, 1.0)"

New value for property defaultBorderColor

setDefaultFillColor

Sets a new value for property defaultFillColor.

Default Fill color for GeoJSON features (Polygons and LineStrings)

When called with a value of null or undefined, the default value of the property will be restored.

Default value is "rgba(186, 193, 196, 0.5)".

Param Type DefaultValue Description
sDefaultFillColor sap.ui.core.CSSColor "rgba(186, 193, 196, 0.5)"

New value for property defaultFillColor

setDefaultLineWidth

Sets a new value for property defaultLineWidth.

Default line width for LineStrings

When called with a value of null or undefined, the default value of the property will be restored.

Default value is 5.

Param Type DefaultValue Description
iDefaultLineWidth int 5

New value for property defaultLineWidth

setSrcURL

Sets a new value for property srcURL.

Source URL for GeoJSON

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sSrcURL string

New value for property srcURL