Class sap.ui.vbm.AnalyticMapModule: sap/ui/vbm/AnalyticMap

extends GeoMap

The AnalyticMap control. This control renders a Map based on a GeoJSON source. The GeoJSON file is searched in the following places in the given sequence:

  • <server>:<port>/sap/bc/vbi/geojson/L0.json
  • ./media/analyticmap/L0.json
Further it is possible to specify a different URL by setting static attribute sap.ui.vbm.AnalyticMap.GeoJSONURL.
The Features from the GeoJSON get rendered as neutral background in gray. They are not active, but may report a name via tooltip. Each feature is expected to have a property id or id2, where as id2 should be an ISO country according to ISO 3166-2.
By adding Region elements to the regions aggregation it is possible to make feature from the GeoJSON interactive. Region elements need to match by ISO code.

Constructor Summary
new sap.ui.vbm.AnalyticMap(sId?, mSettings?)Constructor for a new AnalyticMap.
Event Summary
regionClick(oControlEvent)The event is raised when there is a click or a tap on a region.
regionContextMenu(oControlEvent)The event is raised when there is a right click or a tap and hold action on a region.
regionDeselect(oControlEvent)Event is raised when regions get deselected
regionSelect(oControlEvent)Raised when regions get selected
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.vbm.AnalyticMap.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.vbm.AnalyticMap with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.vbm.AnalyticMap.getMetadata()Returns a metadata object for class sap.ui.vbm.AnalyticMap.
addRegion(oRegion)Adds some region to the aggregation regions.
attachRegionClick(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the regionClick event of this sap.ui.vbm.AnalyticMap.
attachRegionContextMenu(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the regionContextMenu event of this sap.ui.vbm.AnalyticMap.
attachRegionDeselect(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the regionDeselect event of this sap.ui.vbm.AnalyticMap.
attachRegionSelect(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the regionSelect event of this sap.ui.vbm.AnalyticMap.
destroyRegions()Destroys all the regions in the aggregation regions.
detachRegionClick(fnFunction, oListener)Detaches event handler fnFunction from the regionClick event of this sap.ui.vbm.AnalyticMap.
detachRegionContextMenu(fnFunction, oListener)Detaches event handler fnFunction from the regionContextMenu event of this sap.ui.vbm.AnalyticMap.
detachRegionDeselect(fnFunction, oListener)Detaches event handler fnFunction from the regionDeselect event of this sap.ui.vbm.AnalyticMap.
detachRegionSelect(fnFunction, oListener)Detaches event handler fnFunction from the regionSelect event of this sap.ui.vbm.AnalyticMap.
fireRegionClick(mArguments?)Fires event regionClick to attached listeners.
fireRegionContextMenu(mArguments?)Fires event regionContextMenu to attached listeners.
fireRegionDeselect(mArguments?)Fires event regionDeselect to attached listeners.
fireRegionSelect(mArguments?)Fires event regionSelect to attached listeners.
getRegions()Gets content of aggregation regions.
getRegionsInfo(aCodes)Returns Infos for Regions like name, bounding box and midpoint
indexOfRegion(oRegion)Checks for the provided sap.ui.vbm.Region in the aggregation regions.
insertRegion(oRegion, iIndex)Inserts a region into the aggregation regions.
removeAllRegions()Removes all the controls from the aggregation regions.
removeRegion(vRegion)Removes a region from the aggregation regions.
zoomToRegions(aCodes, oCorr)Zoom to one ore more regions.
Methods borrowed from class sap.ui.vbm.GeoMap
addCluster, addFeatureCollection, addGeoJsonLayer, addResource, addVo, attachCenterChanged, attachClick, attachContextMenu, attachDrop, attachSelect, attachZoomChanged, closeAnyDetailWindow, destroyClusters, destroyFeatureCollections, destroyGeoJsonLayers, destroyLegend, destroyResources, destroyVos, detachCenterChanged, detachClick, detachContextMenu, detachDrop, detachSelect, detachZoomChanged, fireCenterChanged, fireClick, fireContextMenu, fireDrop, fireSelect, fireZoomChanged, getCenterPosition, getClustering, getClusters, getDisablePan, getDisableZoom, getEnableAnimation, getFeatureCollections, getGeoJsonLayers, getInitialPosition, getInitialZoom, getLegend, getLegendVisible, getMapConfiguration, getNavcontrolVisible, getPositionInteractive, getRefMapLayerStack, getResources, getScaleVisible, getVisualFrame, getVoByInternalId, getVos, getZoomlevel, goToStartPosition, indexOfCluster, indexOfFeatureCollection, indexOfGeoJsonLayer, indexOfResource, indexOfVo, insertCluster, insertFeatureCollection, insertGeoJsonLayer, insertResource, insertVo, openDetailWindow, removeAllClusters, removeAllFeatureCollections, removeAllGeoJsonLayers, removeAllResources, removeAllVos, removeCluster, removeFeatureCollection, removeGeoJsonLayer, removeResource, removeVo, setCenterPosition, setClustering, setDisablePan, setDisableZoom, setEnableAnimation, setInitialPosition, setInitialZoom, setLassoSelection, setLegend, setLegendVisible, setMapConfiguration, setNavcontrolVisible, setRectangularSelection, setRectZoom, setRefMapLayerStack, setScaleVisible, setVisualFrame, setZoomlevel
Constructor Detail
new sap.ui.vbm.AnalyticMap(sId?, mSettings?)
Constructor for a new AnalyticMap.

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

The supported settings are:

  • Aggregations
  • Events
    • regionClick : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • regionContextMenu : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • regionSelect : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • regionDeselect : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.vbm.GeoMap can be used as well.

Parameters:
{string}sId? id for the new control, generated automatically if no id is given
{object}mSettings? initial settings for the new control
Event Detail
regionClick(oControlEvent)
The event is raised when there is a click or a tap on a region.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.code The regions code.
regionContextMenu(oControlEvent)
The event is raised when there is a right click or a tap and hold action on a region.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{string}oControlEvent.getParameters.code The regions code.
regionDeselect(oControlEvent)
Event is raised when regions get deselected
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
regionSelect(oControlEvent)
Raised when regions get selected
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
Method Detail
sap.ui.vbm.AnalyticMap.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.vbm.AnalyticMap 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.GeoMap.extend.

Parameters:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.ui.vbm.AnalyticMap.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.vbm.AnalyticMap.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addRegion(oRegion): sap.ui.vbm.AnalyticMap
Adds some region to the aggregation regions.
Parameters:
{sap.ui.vbm.Region}oRegion the region to add; if empty, nothing is inserted
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
attachRegionClick(oData?, fnFunction, oListener?): sap.ui.vbm.AnalyticMap
Attaches event handler fnFunction to the regionClick event of this sap.ui.vbm.AnalyticMap.

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

The event is raised when there is a click or a tap on a region.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.vbm.AnalyticMap itself
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
attachRegionContextMenu(oData?, fnFunction, oListener?): sap.ui.vbm.AnalyticMap
Attaches event handler fnFunction to the regionContextMenu event of this sap.ui.vbm.AnalyticMap.

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

The event is raised when there is a right click or a tap and hold action on a region.

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.vbm.AnalyticMap itself
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
attachRegionDeselect(oData?, fnFunction, oListener?): sap.ui.vbm.AnalyticMap
Attaches event handler fnFunction to the regionDeselect event of this sap.ui.vbm.AnalyticMap.

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

Event is raised when regions get deselected

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.vbm.AnalyticMap itself
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
attachRegionSelect(oData?, fnFunction, oListener?): sap.ui.vbm.AnalyticMap
Attaches event handler fnFunction to the regionSelect event of this sap.ui.vbm.AnalyticMap.

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

Raised when regions get selected

Parameters:
{object}oData? An application-specific payload object that will be passed to the event handler along with the event object when firing the event
{function}fnFunction The function to be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.ui.vbm.AnalyticMap itself
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
destroyRegions(): sap.ui.vbm.AnalyticMap
Destroys all the regions in the aggregation regions.
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
detachRegionClick(fnFunction, oListener): sap.ui.vbm.AnalyticMap
Detaches event handler fnFunction from the regionClick event of this sap.ui.vbm.AnalyticMap.

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

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
detachRegionContextMenu(fnFunction, oListener): sap.ui.vbm.AnalyticMap
Detaches event handler fnFunction from the regionContextMenu event of this sap.ui.vbm.AnalyticMap.

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

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
detachRegionDeselect(fnFunction, oListener): sap.ui.vbm.AnalyticMap
Detaches event handler fnFunction from the regionDeselect event of this sap.ui.vbm.AnalyticMap.

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

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
detachRegionSelect(fnFunction, oListener): sap.ui.vbm.AnalyticMap
Detaches event handler fnFunction from the regionSelect event of this sap.ui.vbm.AnalyticMap.

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

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
fireRegionClick(mArguments?): sap.ui.vbm.AnalyticMap
Fires event regionClick to attached listeners.

Expects the following event parameters:

  • code of type stringThe regions code.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
fireRegionContextMenu(mArguments?): sap.ui.vbm.AnalyticMap
Fires event regionContextMenu to attached listeners.

Expects the following event parameters:

  • code of type stringThe regions code.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
fireRegionDeselect(mArguments?): sap.ui.vbm.AnalyticMap
Fires event regionDeselect to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
fireRegionSelect(mArguments?): sap.ui.vbm.AnalyticMap
Fires event regionSelect to attached listeners.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
getRegions(): sap.ui.vbm.Region[]
Gets content of aggregation regions.

Regions that are different from the defaults. It is possible to specify the tooltip and color for regions. The region code must match the GeoJSON id2 identifier.

Returns:
{sap.ui.vbm.Region[]}
getRegionsInfo(aCodes): array
Returns Infos for Regions like name, bounding box and midpoint
Parameters:
{string[]}aCodes Array of region codes. The region code must match the geo json tag.
Returns:
{array} Array of Region Information Objects. Each object in the array has the properties BBox: Bounding Box for Region in format "lonMin;latMin;lonMax;latMax", Midpoint: Centerpoint for Region in format "lon;lat", Name: Name of the region, and Properties: Array of name-value-pair associated with the region
indexOfRegion(oRegion): int
Checks for the provided sap.ui.vbm.Region in the aggregation regions. and returns its index if found or -1 otherwise.
Parameters:
{sap.ui.vbm.Region}oRegion The region whose index is looked for
Returns:
{int} The index of the provided control in the aggregation if found, or -1 otherwise
insertRegion(oRegion, iIndex): sap.ui.vbm.AnalyticMap
Inserts a region into the aggregation regions.
Parameters:
{sap.ui.vbm.Region}oRegion the region to insert; if empty, nothing is inserted
{int}iIndex the 0-based index the region should be inserted at; for a negative value of iIndex, the region is inserted at position 0; for a value greater than the current size of the aggregation, the region is inserted at the last position
Returns:
{sap.ui.vbm.AnalyticMap} Reference to this in order to allow method chaining
removeAllRegions(): sap.ui.vbm.Region[]
Removes all the controls from the aggregation regions.

Additionally, it unregisters them from the hosting UIArea.

Returns:
{sap.ui.vbm.Region[]} An array of the removed elements (might be empty)
removeRegion(vRegion): sap.ui.vbm.Region
Removes a region from the aggregation regions.
Parameters:
{int|string|sap.ui.vbm.Region}vRegion The regionto remove or its index or id
Returns:
{sap.ui.vbm.Region} The removed region or null
zoomToRegions(aCodes, oCorr): void
Zoom to one ore more regions.
Parameters:
{string[]}aCodes Array of region codes. The region codes must match the geo json tags.
{object}oCorr Correction for the calculated zoom factor. You can either a factor, the calculated zoom is multplied with or a array with pixels to be added as border in the sequence [left, top,right, bottom].