File

map/map.service.ts

Index

Properties
Methods

Methods

Async getAllDevicesBounds
getAllDevicesBounds()

Determines a rectangular geographical area based on the positions of all devices.

Returns : Promise<L.LatLngBounds>

A [[LatLngBounds]] object fitting all devices' geo positions.

Async getAllPositionMOs
getAllPositionMOs(byGroupIdMO?: IManagedObject, pageSize: number)

Returns all managed object with a c8y_Position fragment.

Parameters :
Name Type Optional Default value Description
byGroupIdMO IManagedObject Yes

The group managed object of which direct children should be searched for.

pageSize number No 500

Defines how many results should be returned.

The managed objects with position.

Async getClusterSize
getClusterSize(bound: L.LatLngBounds)

Returns the cluster size for clustered maps. Counting the position MOs in a bounding and if it reach a threshold, returning a [[ClusterSize]].

Parameters :
Name Type Optional Description
bound L.LatLngBounds No

The bounding to check for cluster size.

Returns : unknown

The cluster size, can be NONE, FOUR or SIXTEEN.

getDefaultConfig
getDefaultConfig()

Returns the map configuration configured on the tenant.

Returns : Observable<MapDefaultConfig>

The configuration. If not set in tenant options the default configuration.

getDefaultLayers
getDefaultLayers()

Returns the layers configured in the current platform via tenant options.

Returns : Observable<MapTileLayer[]>

The layers. If not set in tenant options the default layers.

Async getLeaflet
getLeaflet()

Returns the leaflet instance used by the cumulocity core.

Returns : unknown
getMapTileLayerProviders
getMapTileLayerProviders()
getMapTileLayers$
getMapTileLayers$()

Returns the layers available in this application. Layers are taken from plugins installed to this application. In case none of the plugins override the default layers, the default layers are also considered.

Returns : Observable<MapTileLayer[]>

The layers.

getMapTileLayersFromHookedProviders$
getMapTileLayersFromHookedProviders$(layerProviders: CumulocityServiceRegistry.MapTileLayerProvider[])
Parameters :
Name Type Optional
layerProviders CumulocityServiceRegistry.MapTileLayerProvider[] No
Returns : Observable<MapTileLayer[]>
Async getPositionDevices
getPositionDevices()

Returns all devices with c8y_Position.

Async getPositionDevices
getPositionDevices(pageSize: number)

Returns all devices with c8y_Position.

Parameters :
Name Type Optional Description
pageSize number No

The page size to return.

Async getPositionDevices
getPositionDevices(pageSize: number, count)

Returns all devices with c8y_Position.

Parameters :
Name Type Optional Description
pageSize number No

The page size to return.

count No

Counting is disabled

Async getPositionDevices
getPositionDevices(pageSize: number, count)

Returns the number of all devices with c8y_Position.

Parameters :
Name Type Optional Description
pageSize number No

The page size to return.

count No

Counting is enabled

Returns : Promise<number>
Async getPositionDevices
getPositionDevices(pageSize, count?: boolean)

Returns all devices with c8y_Position.

Parameters :
Name Type Optional Default value Description
pageSize No this.MAX_DEVICE_PER_CLUSTER

The page size to return.

count boolean Yes

Switches to counting only.

Returns : Promise<number | []>

All devices or the device count with a c8y_Position fragment.

Async getPositionMOsFromBound
getPositionMOsFromBound(bound: L.LatLngBounds)

Returns all managed objects with a c8y_Position fragment in a certain boundary.

Parameters :
Name Type Optional Description
bound L.LatLngBounds No

The lat lng bound to request the managed objects for.

All position managed objects in the given bound.

Async getPositionMOsFromBound
getPositionMOsFromBound(bound: L.LatLngBounds, byGroupIdMO: IManagedObject)

Returns all managed objects with a c8y_Position fragment in a certain boundary that belongs to a certain group.

Parameters :
Name Type Optional Description
bound L.LatLngBounds No

The lat lng bound to request the managed objects for.

byGroupIdMO IManagedObject No

The group managed object of which direct children should be searched for.

All position managed objects in the given bound that are children of the given group.

Async getPositionMOsFromBound
getPositionMOsFromBound(bound: L.LatLngBounds, byGroupIdMO: IManagedObject, count)

Counts the managed objects in a certain boundary belonging to a group.

Parameters :
Name Type Optional Description
bound L.LatLngBounds No

The lat lng bound to request the managed objects for.

byGroupIdMO IManagedObject No

The group managed object of which direct children should be searched for.

count No
Returns : Promise<number>

The count of the managed objects.

Async getPositionMOsFromBound
getPositionMOsFromBound(bound: L.LatLngBounds, byGroupIdMO?: IManagedObject, count)
Parameters :
Name Type Optional Default value
bound L.LatLngBounds No
byGroupIdMO IManagedObject Yes
count No false
Returns : Promise<[] | number>
Async getPositionMOsFromBoundCount
getPositionMOsFromBoundCount(bound: L.LatLngBounds, byGroupIdMO?: IManagedObject)

Counts all managed objects in a given bound with a c8y_Position fragment.

Parameters :
Name Type Optional Description
bound L.LatLngBounds No

The lat lng bound to request the managed objects for.

byGroupIdMO IManagedObject Yes

The group managed object of which direct children should be searched for.

Returns : Promise<number>

The number of all position managed objects in the given bound (and group).

Static getStatus
getStatus(device: PositionManagedObject)

Returns asset icon status for highest alarm severity found in device object.

Parameters :
Name Type Optional Description
device PositionManagedObject No

Device that contains alarms information.

Returns : "text-muted" | "status critical" | "status major" | "status minor" | "status warning"

Status string according to alarm severity

hasPosition
hasPosition(mo: IManagedObject)

Verifies if a given managed object has a position fragment.

Parameters :
Name Type Optional Description
mo IManagedObject No

The given managed object.

Returns : any
isPositionedDevice
isPositionedDevice(mo: IManagedObject)

Verifies if a given managed object is a device with a position fragment.

Parameters :
Name Type Optional Description
mo IManagedObject No

The given managed object.

Returns : boolean

Properties

CLUSTER_LEVEL_THRESHOLD
Type : number
Default value : 500

The count until the cluster is sized. There are a maximum of three clusters: 1, 4 or 16.

MAX_DEVICE_PER_CLUSTER
Type : number
Default value : 200

The devices that are maximal displayed in one cluster.

results matching ""

    No results matching ""