1.0.2 • Published 7 years ago

@jibestream-dev/jmap-asset-kit v1.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
7 years ago

AssetKit

Jibestream plugin for using Devices

Documentation

Classes

Typedefs

Asset

Kind: global class
Access: public

new Asset(assetConfig)

Creates a new Asset

ParamTypeDescription
assetConfigassetConfigThe configuration object for the asset

AssetKit

Kind: global class
Access: public

new AssetKit(control)

  • Creates a new AssetKit, where users can create, read, update and remove Assets
ParamTypeDescription
controljmap.JControllerThe controller for the map instance where assets are to be placed

assetKit.createAsset(assetConfig) ⇒ Asset

  • Create an asset based on the configuration passed in

Kind: instance method of AssetKit
Returns: Asset - - The created asset
Access: public

ParamTypeDescription
assetConfigassetConfigThe configuration object for the asset

assetKit.updateAsset(asset, config, animation) ⇒ AssetKit

  • Update any properties of the asset that are passed in, animated using the animation passed in

Kind: instance method of AssetKit
Returns: AssetKit - - The current asset kit
Access: public

ParamTypeDescription
assetAssetThe asset that will be updated
configassetConfigAn object containing any properties that you wish to update
animationjmap.AnimationThe way in which these properties should be animated, if it's possible to animate them

assetKit.updateAssetWithPosition(asset, jMapPoint, animation) ⇒ Asset

  • Update the position of an asset, using the provided animation

Kind: instance method of AssetKit
Returns: Asset - - The asset which has been moved
Access: public

ParamTypeDescription
assetAssetThe asset which will be moved
jMapPointjMapPointThe new position and map ID for the asset
animationjmap.AnimationHow the asset should be animated as its updated

assetKit.getNearestAssetToPoint(jMapPoint, assets) ⇒ Asset

  • Return the nearest asset to a given point on a map. Accepts an optional parameter of an array of assets to search through. If not provided, search through all assets in given building

Kind: instance method of AssetKit
Returns: Asset - - The closest asset to the provided jMapPoint
Access: public

ParamTypeDescription
jMapPointjMapPointThe point that you are searching with
assetsArray.<Asset>A subset of the building's assets to search through Defaults to using all assets

assetKit.getNearestAssetOfTypeToPoint(type, jMapPoint) ⇒ Asset

  • Return the nearest asset of a specific type to a given point on a map.

Kind: instance method of AssetKit
Returns: Asset - - The closest asset of the specific type to the provided jMapPoint
Access: public

ParamTypeDescription
typestringThe type of assets that we're searching for
jMapPointjMapPointThe point that you are searching with

assetKit.showAssetsOfType(type) ⇒ AssetKit

  • Show all assets of a specific type

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
typestringThe type of assets that will be shown

assetKit.hideAssetsOfType(type) ⇒ AssetKit

  • Hide all assets of a specific type

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
typestringThe type of assets that will be hidden

assetKit.removeAsset(asset) ⇒ AssetKit

  • Remove a specific asset

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
assetAssetThe asset to be removed

assetKit.getAssetById(id) ⇒ Asset

  • Return a specific asset by its ID

Kind: instance method of AssetKit
Returns: Asset - - The asset with the matching ID
Access: public

ParamTypeDescription
idNumberThe ID to search for

assetKit.getAssetsByType(type) ⇒ Array.<Asset>

  • Return all assets of a specific type

Kind: instance method of AssetKit
Returns: Array.<Asset> - - All assets with the matching type
Access: public

ParamTypeDescription
typestringThe asset type to search for

assetKit.wayfindToAssetFromPoint(asset, jMapPoint, pathStyle) ⇒ AssetKit

  • Wayfind to a specific asset, given a point on the map

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
assetAssetThe asset that we are wayfinding to
jMapPointjMapPointThe point on the map that we're wayfinding from
pathStylejmap.StyleThe path style

assetKit.wayfindFromUserLocationToAssetWithAutoReroute(asset, pathStyle, rerouteInterval) ⇒ AssetKit

  • Wayfind to a specific asset, given a point on the map and reroute if the asset moves

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDefaultDescription
assetAssetThe asset that we are wayfinding to
pathStylepathStyleThe path style
rerouteIntervalNumberHow often the wayfinding path should be redrawn if the asset moves. If nothing is passed in, or null/false is passed in, the wayfinding path will not be redrawn

assetKit.wayfindToNearestAssetOfType(type, jMapPoint) ⇒ AssetKit

  • Wayfind to the nearest asset of the given type, given a point on the map

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
typeStringThe type of asset that we want to route to
jMapPointjMapPointThe point on the map that we're wayfinding from

assetKit.clearWayfindingPath() ⇒ AssetKit

  • Clear any wayfinding paths on the map

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

assetKit.enableAssetTap(cb) ⇒ AssetKit

  • Enable a tap handler on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe callback that will be run on tap Accepts two parameters: asset, event

assetKit.enableAssetDoubleTap(cb) ⇒ AssetKit

  • Enable a double tap handler on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe callback that will be run on tap Accepts two parameters: asset, event

assetKit.disableAssetTap(cb) ⇒ AssetKit

  • Disable the specified tap handlers on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe specific function to remove

assetKit.disableAssetDoubleTap(cb) ⇒ AssetKit

  • Disable the specified double tap handler on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe specific function to remove

assetKit.wayfindAssetUpdated(cb) ⇒ AssetKit

  • Add a callback for every time an asset's position is updated

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe callback that will be run on update of asset Accepts one parameters: asset

JMapPoint : Object

A point that describes an x, y coordinate with the mapId that it's on

Kind: global typedef
Properties

NameTypeDescription
xnumberThe X coordinate of the point
ynumberThe y coordinate of the point
mapIdnumberThe ID of the map that the coordinates are on

assetConfig : Object

The configuration object for the creation and update of an asset

Kind: global typedef
Properties

NameTypeDefaultDescription
mapMapThe map the asset will be placed on
positionArray.<number>Coordinates of the asset (as x, y)
idnumber0The ID of the asset
namestring"''"The name of the asset
speednumber100How quickly the asset should move to new coordinates (pixels per second)
orientationnumber0The orientation of the asset's icon
typestring"\"_default\""The type of asset
snapToGridbooleanfalseWhether the asset should follow the waypoint grid
snapToWaypointbooleanfalseWhether the asset should snap to waypoints when repositioning
widthnumber20The width of the icon
heightnumber20The height of the icon
urlstringThe URL of the image to be used as the asset's icon
scaleWithMapbooleantrueWhether the asset's icon should scale with the map
rotateWithMapbooleantrueWhether the asset's icon should rotate with the map
anchorArray.<number>The origin point of the icon, with the two values being percentages of the sprite's dimensions (between 0 and 1)
iconColorstringIf no url is provided for the icon, the colour of the default icon
confidenceMaxnumberThe maximum radius of the confidence circle (in pixels)
confidencePercentnumberThe confidence in the position of the item (between 0 and 1). 0 will hide the confidence circle; 1 will display the full circle
confidenceColorstringThe color of the confidence circle in hexadecimal format
confidenceAlphanumberThe transparency of the confidence circle (between 0 and 1)
pulseColorstringThe color of the pulse circle
pulseStartAlphanumberThe starting opacity of the pulse circle (between 0 and 1)
pulseEndAlphanumberThe ending opacity of the pulse circle (between 0 and 1)
pulseDurationnumberThe length of time of the pulse animation (in seconds)
pulseDelaynumberThe delay between pulse animation (in seconds)
pulseVisiblebooleanWhether the pulse should be visible

Classes

Typedefs

Asset

Kind: global class
Access: public

new Asset(assetConfig)

Creates a new Asset

ParamTypeDescription
assetConfigassetConfigThe configuration object for the asset

AssetKit

Kind: global class
Access: public

new AssetKit(control)

  • Creates a new AssetKit, where users can create, read, update and remove Assets
ParamTypeDescription
controljmap.JControllerThe controller for the map instance where assets are to be placed

assetKit.createAsset(assetConfig) ⇒ Asset

  • Create an asset based on the configuration passed in

Kind: instance method of AssetKit
Returns: Asset - - The created asset
Access: public

ParamTypeDescription
assetConfigassetConfigThe configuration object for the asset

assetKit.updateAsset(asset, config, animation) ⇒ AssetKit

  • Update any properties of the asset that are passed in, animated using the animation passed in

Kind: instance method of AssetKit
Returns: AssetKit - - The current asset kit
Access: public

ParamTypeDescription
assetAssetThe asset that will be updated
configassetConfigAn object containing any properties that you wish to update
animationjmap.AnimationThe way in which these properties should be animated, if it's possible to animate them

assetKit.updateAssetWithPosition(asset, jMapPoint, animation) ⇒ Asset

  • Update the position of an asset, using the provided animation

Kind: instance method of AssetKit
Returns: Asset - - The asset which has been moved
Access: public

ParamTypeDescription
assetAssetThe asset which will be moved
jMapPointjMapPointThe new position and map ID for the asset
animationjmap.AnimationHow the asset should be animated as its updated

assetKit.getNearestAssetToPoint(jMapPoint, assets) ⇒ Asset

  • Return the nearest asset to a given point on a map. Accepts an optional parameter of an array of assets to search through. If not provided, search through all assets in given building

Kind: instance method of AssetKit
Returns: Asset - - The closest asset to the provided jMapPoint
Access: public

ParamTypeDescription
jMapPointjMapPointThe point that you are searching with
assetsArray.<Asset>A subset of the building's assets to search through Defaults to using all assets

assetKit.getNearestAssetOfTypeToPoint(type, jMapPoint) ⇒ Asset

  • Return the nearest asset of a specific type to a given point on a map.

Kind: instance method of AssetKit
Returns: Asset - - The closest asset of the specific type to the provided jMapPoint
Access: public

ParamTypeDescription
typestringThe type of assets that we're searching for
jMapPointjMapPointThe point that you are searching with

assetKit.showAssetsOfType(type) ⇒ AssetKit

  • Show all assets of a specific type

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
typestringThe type of assets that will be shown

assetKit.hideAssetsOfType(type) ⇒ AssetKit

  • Hide all assets of a specific type

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
typestringThe type of assets that will be hidden

assetKit.removeAsset(asset) ⇒ AssetKit

  • Remove a specific asset

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
assetAssetThe asset to be removed

assetKit.getAssetById(id) ⇒ Asset

  • Return a specific asset by its ID

Kind: instance method of AssetKit
Returns: Asset - - The asset with the matching ID
Access: public

ParamTypeDescription
idNumberThe ID to search for

assetKit.getAssetsByType(type) ⇒ Array.<Asset>

  • Return all assets of a specific type

Kind: instance method of AssetKit
Returns: Array.<Asset> - - All assets with the matching type
Access: public

ParamTypeDescription
typestringThe asset type to search for

assetKit.wayfindToAssetFromPoint(asset, jMapPoint, pathStyle) ⇒ AssetKit

  • Wayfind to a specific asset, given a point on the map

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
assetAssetThe asset that we are wayfinding to
jMapPointjMapPointThe point on the map that we're wayfinding from
pathStylejmap.StyleThe path style

assetKit.wayfindFromUserLocationToAssetWithAutoReroute(asset, pathStyle, rerouteInterval) ⇒ AssetKit

  • Wayfind to a specific asset, given a point on the map and reroute if the asset moves

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDefaultDescription
assetAssetThe asset that we are wayfinding to
pathStylepathStyleThe path style
rerouteIntervalNumberHow often the wayfinding path should be redrawn if the asset moves. If nothing is passed in, or null/false is passed in, the wayfinding path will not be redrawn

assetKit.wayfindToNearestAssetOfType(type, jMapPoint) ⇒ AssetKit

  • Wayfind to the nearest asset of the given type, given a point on the map

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
typeStringThe type of asset that we want to route to
jMapPointjMapPointThe point on the map that we're wayfinding from

assetKit.clearWayfindingPath() ⇒ AssetKit

  • Clear any wayfinding paths on the map

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

assetKit.enableAssetTap(cb) ⇒ AssetKit

  • Enable a tap handler on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe callback that will be run on tap Accepts two parameters: asset, event

assetKit.enableAssetDoubleTap(cb) ⇒ AssetKit

  • Enable a double tap handler on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe callback that will be run on tap Accepts two parameters: asset, event

assetKit.disableAssetTap(cb) ⇒ AssetKit

  • Disable the specified tap handlers on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe specific function to remove

assetKit.disableAssetDoubleTap(cb) ⇒ AssetKit

  • Disable the specified double tap handler on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe specific function to remove

assetKit.wayfindAssetUpdated(cb) ⇒ AssetKit

  • Add a callback for every time an asset's position is updated

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe callback that will be run on update of asset Accepts one parameters: asset

JMapPoint : Object

A point that describes an x, y coordinate with the mapId that it's on

Kind: global typedef
Properties

NameTypeDescription
xnumberThe X coordinate of the point
ynumberThe y coordinate of the point
mapIdnumberThe ID of the map that the coordinates are on

assetConfig : Object

The configuration object for the creation and update of an asset

Kind: global typedef
Properties

NameTypeDefaultDescription
mapMapThe map the asset will be placed on
positionArray.<number>Coordinates of the asset (as x, y)
idnumber0The ID of the asset
namestring"''"The name of the asset
speednumber100How quickly the asset should move to new coordinates (pixels per second)
orientationnumber0The orientation of the asset's icon
typestring"\"_default\""The type of asset
snapToGridbooleanfalseWhether the asset should follow the waypoint grid
snapToWaypointbooleanfalseWhether the asset should snap to waypoints when repositioning
widthnumber20The width of the icon
heightnumber20The height of the icon
urlstringThe URL of the image to be used as the asset's icon
scaleWithMapbooleantrueWhether the asset's icon should scale with the map
rotateWithMapbooleantrueWhether the asset's icon should rotate with the map
anchorArray.<number>The origin point of the icon, with the two values being percentages of the sprite's dimensions (between 0 and 1)
iconColorstringIf no url is provided for the icon, the colour of the default icon
confidenceMaxnumberThe maximum radius of the confidence circle (in pixels)
confidencePercentnumberThe confidence in the position of the item (between 0 and 1). 0 will hide the confidence circle; 1 will display the full circle
confidenceColorstringThe color of the confidence circle in hexadecimal format
confidenceAlphanumberThe transparency of the confidence circle (between 0 and 1)
pulseColorstringThe color of the pulse circle
pulseStartAlphanumberThe starting opacity of the pulse circle (between 0 and 1)
pulseEndAlphanumberThe ending opacity of the pulse circle (between 0 and 1)
pulseDurationnumberThe length of time of the pulse animation (in seconds)
pulseDelaynumberThe delay between pulse animation (in seconds)
pulseVisiblebooleanWhether the pulse should be visible

Classes

Typedefs

Asset

Kind: global class
Access: public

new Asset(assetConfig)

Creates a new Asset

ParamTypeDescription
assetConfigassetConfigThe configuration object for the asset

AssetKit

Kind: global class
Access: public

new AssetKit(control)

  • Creates a new AssetKit, where users can create, read, update and remove Assets
ParamTypeDescription
controljmap.JControllerThe controller for the map instance where assets are to be placed

assetKit.createAsset(assetConfig) ⇒ Asset

  • Create an asset based on the configuration passed in

Kind: instance method of AssetKit
Returns: Asset - - The created asset
Access: public

ParamTypeDescription
assetConfigassetConfigThe configuration object for the asset

assetKit.updateAsset(asset, config, animation) ⇒ AssetKit

  • Update any properties of the asset that are passed in, animated using the animation passed in

Kind: instance method of AssetKit
Returns: AssetKit - - The current asset kit
Access: public

ParamTypeDescription
assetAssetThe asset that will be updated
configassetConfigAn object containing any properties that you wish to update
animationjmap.AnimationThe way in which these properties should be animated, if it's possible to animate them

assetKit.updateAssetWithPosition(asset, jMapPoint, animation) ⇒ Asset

  • Update the position of an asset, using the provided animation

Kind: instance method of AssetKit
Returns: Asset - - The asset which has been moved
Access: public

ParamTypeDescription
assetAssetThe asset which will be moved
jMapPointjMapPointThe new position and map ID for the asset
animationjmap.AnimationHow the asset should be animated as its updated

assetKit.getNearestAssetToPoint(jMapPoint, assets) ⇒ Asset

  • Return the nearest asset to a given point on a map. Accepts an optional parameter of an array of assets to search through. If not provided, search through all assets in given building

Kind: instance method of AssetKit
Returns: Asset - - The closest asset to the provided jMapPoint
Access: public

ParamTypeDescription
jMapPointjMapPointThe point that you are searching with
assetsArray.<Asset>A subset of the building's assets to search through Defaults to using all assets

assetKit.getNearestAssetOfTypeToPoint(type, jMapPoint) ⇒ Asset

  • Return the nearest asset of a specific type to a given point on a map.

Kind: instance method of AssetKit
Returns: Asset - - The closest asset of the specific type to the provided jMapPoint
Access: public

ParamTypeDescription
typestringThe type of assets that we're searching for
jMapPointjMapPointThe point that you are searching with

assetKit.showAssetsOfType(type) ⇒ AssetKit

  • Show all assets of a specific type

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
typestringThe type of assets that will be shown

assetKit.hideAssetsOfType(type) ⇒ AssetKit

  • Hide all assets of a specific type

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
typestringThe type of assets that will be hidden

assetKit.removeAsset(asset) ⇒ AssetKit

  • Remove a specific asset

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
assetAssetThe asset to be removed

assetKit.getAssetById(id) ⇒ Asset

  • Return a specific asset by its ID

Kind: instance method of AssetKit
Returns: Asset - - The asset with the matching ID
Access: public

ParamTypeDescription
idNumberThe ID to search for

assetKit.getAssetsByType(type) ⇒ Array.<Asset>

  • Return all assets of a specific type

Kind: instance method of AssetKit
Returns: Array.<Asset> - - All assets with the matching type
Access: public

ParamTypeDescription
typestringThe asset type to search for

assetKit.wayfindToAssetFromPoint(asset, jMapPoint, pathStyle) ⇒ AssetKit

  • Wayfind to a specific asset, given a point on the map

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
assetAssetThe asset that we are wayfinding to
jMapPointjMapPointThe point on the map that we're wayfinding from
pathStylejmap.StyleThe path style

assetKit.wayfindFromUserLocationToAssetWithAutoReroute(asset, pathStyle, rerouteInterval) ⇒ AssetKit

  • Wayfind to a specific asset, given a point on the map and reroute if the asset moves

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDefaultDescription
assetAssetThe asset that we are wayfinding to
pathStylepathStyleThe path style
rerouteIntervalNumberHow often the wayfinding path should be redrawn if the asset moves. If nothing is passed in, or null/false is passed in, the wayfinding path will not be redrawn

assetKit.wayfindToNearestAssetOfType(type, jMapPoint) ⇒ AssetKit

  • Wayfind to the nearest asset of the given type, given a point on the map

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
typeStringThe type of asset that we want to route to
jMapPointjMapPointThe point on the map that we're wayfinding from

assetKit.clearWayfindingPath() ⇒ AssetKit

  • Clear any wayfinding paths on the map

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

assetKit.enableAssetTap(cb) ⇒ AssetKit

  • Enable a tap handler on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe callback that will be run on tap Accepts two parameters: asset, event

assetKit.enableAssetDoubleTap(cb) ⇒ AssetKit

  • Enable a double tap handler on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe callback that will be run on tap Accepts two parameters: asset, event

assetKit.disableAssetTap(cb) ⇒ AssetKit

  • Disable the specified tap handlers on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe specific function to remove

assetKit.disableAssetDoubleTap(cb) ⇒ AssetKit

  • Disable the specified double tap handler on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe specific function to remove

assetKit.wayfindAssetUpdated(cb) ⇒ AssetKit

  • Add a callback for every time an asset's position is updated

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe callback that will be run on update of asset Accepts one parameters: asset

JMapPoint : Object

A point that describes an x, y coordinate with the mapId that it's on

Kind: global typedef
Properties

NameTypeDescription
xnumberThe X coordinate of the point
ynumberThe y coordinate of the point
mapIdnumberThe ID of the map that the coordinates are on

assetConfig : Object

The configuration object for the creation and update of an asset

Kind: global typedef
Properties

NameTypeDefaultDescription
mapMapThe map the asset will be placed on
positionArray.<number>Coordinates of the asset (as x, y)
idnumber0The ID of the asset
namestring"''"The name of the asset
speednumber100How quickly the asset should move to new coordinates (pixels per second)
orientationnumber0The orientation of the asset's icon
typestring"\"_default\""The type of asset
snapToGridbooleanfalseWhether the asset should follow the waypoint grid
snapToWaypointbooleanfalseWhether the asset should snap to waypoints when repositioning
widthnumber20The width of the icon
heightnumber20The height of the icon
urlstringThe URL of the image to be used as the asset's icon
scaleWithMapbooleantrueWhether the asset's icon should scale with the map
rotateWithMapbooleantrueWhether the asset's icon should rotate with the map
anchorArray.<number>The origin point of the icon, with the two values being percentages of the sprite's dimensions (between 0 and 1)
iconColorstringIf no url is provided for the icon, the colour of the default icon
confidenceMaxnumberThe maximum radius of the confidence circle (in pixels)
confidencePercentnumberThe confidence in the position of the item (between 0 and 1). 0 will hide the confidence circle; 1 will display the full circle
confidenceColorstringThe color of the confidence circle in hexadecimal format
confidenceAlphanumberThe transparency of the confidence circle (between 0 and 1)
pulseColorstringThe color of the pulse circle
pulseStartAlphanumberThe starting opacity of the pulse circle (between 0 and 1)
pulseEndAlphanumberThe ending opacity of the pulse circle (between 0 and 1)
pulseDurationnumberThe length of time of the pulse animation (in seconds)
pulseDelaynumberThe delay between pulse animation (in seconds)
pulseVisiblebooleanWhether the pulse should be visible

Classes

Typedefs

Asset

Kind: global class
Access: public

new Asset(assetConfig)

Creates a new Asset

ParamTypeDescription
assetConfigassetConfigThe configuration object for the asset

AssetKit

Kind: global class
Access: public

new AssetKit(control)

  • Creates a new AssetKit, where users can create, read, update and remove Assets
ParamTypeDescription
controljmap.JControllerThe controller for the map instance where assets are to be placed

assetKit.createAsset(assetConfig) ⇒ Asset

  • Create an asset based on the configuration passed in

Kind: instance method of AssetKit
Returns: Asset - - The created asset
Access: public

ParamTypeDescription
assetConfigassetConfigThe configuration object for the asset

assetKit.updateAsset(asset, config, animation) ⇒ AssetKit

  • Update any properties of the asset that are passed in, animated using the animation passed in

Kind: instance method of AssetKit
Returns: AssetKit - - The current asset kit
Access: public

ParamTypeDescription
assetAssetThe asset that will be updated
configassetConfigAn object containing any properties that you wish to update
animationjmap.AnimationThe way in which these properties should be animated, if it's possible to animate them

assetKit.updateAssetWithPosition(asset, jMapPoint, animation) ⇒ Asset

  • Update the position of an asset, using the provided animation

Kind: instance method of AssetKit
Returns: Asset - - The asset which has been moved
Access: public

ParamTypeDescription
assetAssetThe asset which will be moved
jMapPointjMapPointThe new position and map ID for the asset
animationjmap.AnimationHow the asset should be animated as its updated

assetKit.getNearestAssetToPoint(jMapPoint, assets) ⇒ Asset

  • Return the nearest asset to a given point on a map. Accepts an optional parameter of an array of assets to search through. If not provided, search through all assets in given building

Kind: instance method of AssetKit
Returns: Asset - - The closest asset to the provided jMapPoint
Access: public

ParamTypeDescription
jMapPointjMapPointThe point that you are searching with
assetsArray.<Asset>A subset of the building's assets to search through Defaults to using all assets

assetKit.getNearestAssetOfTypeToPoint(type, jMapPoint) ⇒ Asset

  • Return the nearest asset of a specific type to a given point on a map.

Kind: instance method of AssetKit
Returns: Asset - - The closest asset of the specific type to the provided jMapPoint
Access: public

ParamTypeDescription
typestringThe type of assets that we're searching for
jMapPointjMapPointThe point that you are searching with

assetKit.showAssetsOfType(type) ⇒ AssetKit

  • Show all assets of a specific type

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
typestringThe type of assets that will be shown

assetKit.hideAssetsOfType(type) ⇒ AssetKit

  • Hide all assets of a specific type

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
typestringThe type of assets that will be hidden

assetKit.removeAsset(asset) ⇒ AssetKit

  • Remove a specific asset

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
assetAssetThe asset to be removed

assetKit.getAssetById(id) ⇒ Asset

  • Return a specific asset by its ID

Kind: instance method of AssetKit
Returns: Asset - - The asset with the matching ID
Access: public

ParamTypeDescription
idNumberThe ID to search for

assetKit.getAssetsByType(type) ⇒ Array.<Asset>

  • Return all assets of a specific type

Kind: instance method of AssetKit
Returns: Array.<Asset> - - All assets with the matching type
Access: public

ParamTypeDescription
typestringThe asset type to search for

assetKit.wayfindToAssetFromPoint(asset, jMapPoint, pathStyle) ⇒ AssetKit

  • Wayfind to a specific asset, given a point on the map

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
assetAssetThe asset that we are wayfinding to
jMapPointjMapPointThe point on the map that we're wayfinding from
pathStylejmap.StyleThe path style

assetKit.wayfindFromUserLocationToAssetWithAutoReroute(asset, pathStyle, rerouteInterval) ⇒ AssetKit

  • Wayfind to a specific asset, given a point on the map and reroute if the asset moves

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDefaultDescription
assetAssetThe asset that we are wayfinding to
pathStylepathStyleThe path style
rerouteIntervalNumberHow often the wayfinding path should be redrawn if the asset moves. If nothing is passed in, or null/false is passed in, the wayfinding path will not be redrawn

assetKit.wayfindToNearestAssetOfType(type, jMapPoint) ⇒ AssetKit

  • Wayfind to the nearest asset of the given type, given a point on the map

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
typeStringThe type of asset that we want to route to
jMapPointjMapPointThe point on the map that we're wayfinding from

assetKit.clearWayfindingPath() ⇒ AssetKit

  • Clear any wayfinding paths on the map

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

assetKit.enableAssetTap(cb) ⇒ AssetKit

  • Enable a tap handler on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe callback that will be run on tap Accepts two parameters: asset, event

assetKit.enableAssetDoubleTap(cb) ⇒ AssetKit

  • Enable a double tap handler on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe callback that will be run on tap Accepts two parameters: asset, event

assetKit.disableAssetTap(cb) ⇒ AssetKit

  • Disable the specified tap handlers on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe specific function to remove

assetKit.disableAssetDoubleTap(cb) ⇒ AssetKit

  • Disable the specified double tap handler on assets

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe specific function to remove

assetKit.wayfindAssetUpdated(cb) ⇒ AssetKit

  • Add a callback for every time an asset's position is updated

Kind: instance method of AssetKit
Returns: AssetKit - - The current AssetKit
Access: public

ParamTypeDescription
cbfunctionThe callback that will be run on update of asset Accepts one parameters: asset

JMapPoint : Object

A point that describes an x, y coordinate with the mapId that it's on

Kind: global typedef
Properties

NameTypeDescription
xnumberThe X coordinate of the point
ynumberThe y coordinate of the point
mapIdnumberThe ID of the map that the coordinates are on

assetConfig : Object

The configuration object for the creation and update of an asset

Kind: global typedef
Properties

NameTypeDefaultDescription
mapMapThe map the asset will be placed on
positionArray.<number>Coordinates of the asset (as x, y)
idnumber0The ID of the asset
namestring"''"The name of the asset
speednumber100How quickly the asset should move to new coordinates (pixels