npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jibestream-dev/jmap-asset-kit

v1.0.2

Published

Plugin for Jibestream JMap.js SDK to manage assets

Downloads

12

Readme

AssetKit

Jibestream plugin for using Devices

Documentation

Classes

Typedefs

Asset

Kind: global class
Access: public

new Asset([assetConfig])

Creates a new Asset

| Param | Type | Description | | --- | --- | --- | | [assetConfig] | assetConfig | The 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

| Param | Type | Description | | --- | --- | --- | | control | jmap.JController | The 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

| Param | Type | Description | | --- | --- | --- | | assetConfig | assetConfig | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The asset that will be updated | | config | assetConfig | An object containing any properties that you wish to update | | [animation] | jmap.Animation | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The asset which will be moved | | jMapPoint | jMapPoint | The new position and map ID for the asset | | animation | jmap.Animation | How 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

| Param | Type | Description | | --- | --- | --- | | jMapPoint | jMapPoint | The point that you are searching with | | [assets] | Array.<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

| Param | Type | Description | | --- | --- | --- | | type | string | The type of assets that we're searching for | | jMapPoint | jMapPoint | The 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

| Param | Type | Description | | --- | --- | --- | | type | string | The 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

| Param | Type | Description | | --- | --- | --- | | type | string | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The 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

| Param | Type | Description | | --- | --- | --- | | id | Number | The 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

| Param | Type | Description | | --- | --- | --- | | type | string | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The asset that we are wayfinding to | | jMapPoint | jMapPoint | The point on the map that we're wayfinding from | | pathStyle | jmap.Style | The 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

| Param | Type | Default | Description | | --- | --- | --- | --- | | asset | Asset | | The asset that we are wayfinding to | | pathStyle | pathStyle | | The path style | | [rerouteInterval] | Number | | How 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

| Param | Type | Description | | --- | --- | --- | | type | String | The type of asset that we want to route to | | jMapPoint | jMapPoint | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Name | Type | Description | | --- | --- | --- | | x | number | The X coordinate of the point | | y | number | The y coordinate of the point | | mapId | number | The 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

| Name | Type | Default | Description | | --- | --- | --- | --- | | map | Map | | The map the asset will be placed on | | position | Array.<number> | | Coordinates of the asset (as [x, y]) | | id | number | 0 | The ID of the asset | | name | string | "''" | The name of the asset | | speed | number | 100 | How quickly the asset should move to new coordinates (pixels per second) | | orientation | number | 0 | The orientation of the asset's icon | | type | string | "&quot;_default&quot;" | The type of asset | | snapToGrid | boolean | false | Whether the asset should follow the waypoint grid | | snapToWaypoint | boolean | false | Whether the asset should snap to waypoints when repositioning | | width | number | 20 | The width of the icon | | height | number | 20 | The height of the icon | | url | string | | The URL of the image to be used as the asset's icon | | scaleWithMap | boolean | true | Whether the asset's icon should scale with the map | | rotateWithMap | boolean | true | Whether the asset's icon should rotate with the map | | anchor | Array.<number> | | The origin point of the icon, with the two values being percentages of the sprite's dimensions (between 0 and 1) | | iconColor | string | | If no url is provided for the icon, the colour of the default icon | | confidenceMax | number | | The maximum radius of the confidence circle (in pixels) | | confidencePercent | number | | The confidence in the position of the item (between 0 and 1). 0 will hide the confidence circle; 1 will display the full circle | | confidenceColor | string | | The color of the confidence circle in hexadecimal format | | confidenceAlpha | number | | The transparency of the confidence circle (between 0 and 1) | | pulseColor | string | | The color of the pulse circle | | pulseStartAlpha | number | | The starting opacity of the pulse circle (between 0 and 1) | | pulseEndAlpha | number | | The ending opacity of the pulse circle (between 0 and 1) | | pulseDuration | number | | The length of time of the pulse animation (in seconds) | | pulseDelay | number | | The delay between pulse animation (in seconds) | | pulseVisible | boolean | | Whether the pulse should be visible |

Classes

Typedefs

Asset

Kind: global class
Access: public

new Asset([assetConfig])

Creates a new Asset

| Param | Type | Description | | --- | --- | --- | | [assetConfig] | assetConfig | The 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

| Param | Type | Description | | --- | --- | --- | | control | jmap.JController | The 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

| Param | Type | Description | | --- | --- | --- | | assetConfig | assetConfig | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The asset that will be updated | | config | assetConfig | An object containing any properties that you wish to update | | [animation] | jmap.Animation | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The asset which will be moved | | jMapPoint | jMapPoint | The new position and map ID for the asset | | animation | jmap.Animation | How 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

| Param | Type | Description | | --- | --- | --- | | jMapPoint | jMapPoint | The point that you are searching with | | [assets] | Array.<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

| Param | Type | Description | | --- | --- | --- | | type | string | The type of assets that we're searching for | | jMapPoint | jMapPoint | The 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

| Param | Type | Description | | --- | --- | --- | | type | string | The 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

| Param | Type | Description | | --- | --- | --- | | type | string | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The 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

| Param | Type | Description | | --- | --- | --- | | id | Number | The 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

| Param | Type | Description | | --- | --- | --- | | type | string | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The asset that we are wayfinding to | | jMapPoint | jMapPoint | The point on the map that we're wayfinding from | | pathStyle | jmap.Style | The 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

| Param | Type | Default | Description | | --- | --- | --- | --- | | asset | Asset | | The asset that we are wayfinding to | | pathStyle | pathStyle | | The path style | | [rerouteInterval] | Number | | How 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

| Param | Type | Description | | --- | --- | --- | | type | String | The type of asset that we want to route to | | jMapPoint | jMapPoint | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Name | Type | Description | | --- | --- | --- | | x | number | The X coordinate of the point | | y | number | The y coordinate of the point | | mapId | number | The 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

| Name | Type | Default | Description | | --- | --- | --- | --- | | map | Map | | The map the asset will be placed on | | position | Array.<number> | | Coordinates of the asset (as [x, y]) | | id | number | 0 | The ID of the asset | | name | string | "''" | The name of the asset | | speed | number | 100 | How quickly the asset should move to new coordinates (pixels per second) | | orientation | number | 0 | The orientation of the asset's icon | | type | string | "&quot;_default&quot;" | The type of asset | | snapToGrid | boolean | false | Whether the asset should follow the waypoint grid | | snapToWaypoint | boolean | false | Whether the asset should snap to waypoints when repositioning | | width | number | 20 | The width of the icon | | height | number | 20 | The height of the icon | | url | string | | The URL of the image to be used as the asset's icon | | scaleWithMap | boolean | true | Whether the asset's icon should scale with the map | | rotateWithMap | boolean | true | Whether the asset's icon should rotate with the map | | anchor | Array.<number> | | The origin point of the icon, with the two values being percentages of the sprite's dimensions (between 0 and 1) | | iconColor | string | | If no url is provided for the icon, the colour of the default icon | | confidenceMax | number | | The maximum radius of the confidence circle (in pixels) | | confidencePercent | number | | The confidence in the position of the item (between 0 and 1). 0 will hide the confidence circle; 1 will display the full circle | | confidenceColor | string | | The color of the confidence circle in hexadecimal format | | confidenceAlpha | number | | The transparency of the confidence circle (between 0 and 1) | | pulseColor | string | | The color of the pulse circle | | pulseStartAlpha | number | | The starting opacity of the pulse circle (between 0 and 1) | | pulseEndAlpha | number | | The ending opacity of the pulse circle (between 0 and 1) | | pulseDuration | number | | The length of time of the pulse animation (in seconds) | | pulseDelay | number | | The delay between pulse animation (in seconds) | | pulseVisible | boolean | | Whether the pulse should be visible |

Classes

Typedefs

Asset

Kind: global class
Access: public

new Asset([assetConfig])

Creates a new Asset

| Param | Type | Description | | --- | --- | --- | | [assetConfig] | assetConfig | The 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

| Param | Type | Description | | --- | --- | --- | | control | jmap.JController | The 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

| Param | Type | Description | | --- | --- | --- | | assetConfig | assetConfig | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The asset that will be updated | | config | assetConfig | An object containing any properties that you wish to update | | [animation] | jmap.Animation | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The asset which will be moved | | jMapPoint | jMapPoint | The new position and map ID for the asset | | animation | jmap.Animation | How 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

| Param | Type | Description | | --- | --- | --- | | jMapPoint | jMapPoint | The point that you are searching with | | [assets] | Array.<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

| Param | Type | Description | | --- | --- | --- | | type | string | The type of assets that we're searching for | | jMapPoint | jMapPoint | The 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

| Param | Type | Description | | --- | --- | --- | | type | string | The 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

| Param | Type | Description | | --- | --- | --- | | type | string | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The 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

| Param | Type | Description | | --- | --- | --- | | id | Number | The 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

| Param | Type | Description | | --- | --- | --- | | type | string | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The asset that we are wayfinding to | | jMapPoint | jMapPoint | The point on the map that we're wayfinding from | | pathStyle | jmap.Style | The 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

| Param | Type | Default | Description | | --- | --- | --- | --- | | asset | Asset | | The asset that we are wayfinding to | | pathStyle | pathStyle | | The path style | | [rerouteInterval] | Number | | How 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

| Param | Type | Description | | --- | --- | --- | | type | String | The type of asset that we want to route to | | jMapPoint | jMapPoint | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Name | Type | Description | | --- | --- | --- | | x | number | The X coordinate of the point | | y | number | The y coordinate of the point | | mapId | number | The 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

| Name | Type | Default | Description | | --- | --- | --- | --- | | map | Map | | The map the asset will be placed on | | position | Array.<number> | | Coordinates of the asset (as [x, y]) | | id | number | 0 | The ID of the asset | | name | string | "''" | The name of the asset | | speed | number | 100 | How quickly the asset should move to new coordinates (pixels per second) | | orientation | number | 0 | The orientation of the asset's icon | | type | string | "&quot;_default&quot;" | The type of asset | | snapToGrid | boolean | false | Whether the asset should follow the waypoint grid | | snapToWaypoint | boolean | false | Whether the asset should snap to waypoints when repositioning | | width | number | 20 | The width of the icon | | height | number | 20 | The height of the icon | | url | string | | The URL of the image to be used as the asset's icon | | scaleWithMap | boolean | true | Whether the asset's icon should scale with the map | | rotateWithMap | boolean | true | Whether the asset's icon should rotate with the map | | anchor | Array.<number> | | The origin point of the icon, with the two values being percentages of the sprite's dimensions (between 0 and 1) | | iconColor | string | | If no url is provided for the icon, the colour of the default icon | | confidenceMax | number | | The maximum radius of the confidence circle (in pixels) | | confidencePercent | number | | The confidence in the position of the item (between 0 and 1). 0 will hide the confidence circle; 1 will display the full circle | | confidenceColor | string | | The color of the confidence circle in hexadecimal format | | confidenceAlpha | number | | The transparency of the confidence circle (between 0 and 1) | | pulseColor | string | | The color of the pulse circle | | pulseStartAlpha | number | | The starting opacity of the pulse circle (between 0 and 1) | | pulseEndAlpha | number | | The ending opacity of the pulse circle (between 0 and 1) | | pulseDuration | number | | The length of time of the pulse animation (in seconds) | | pulseDelay | number | | The delay between pulse animation (in seconds) | | pulseVisible | boolean | | Whether the pulse should be visible |

Classes

Typedefs

Asset

Kind: global class
Access: public

new Asset([assetConfig])

Creates a new Asset

| Param | Type | Description | | --- | --- | --- | | [assetConfig] | assetConfig | The 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

| Param | Type | Description | | --- | --- | --- | | control | jmap.JController | The 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

| Param | Type | Description | | --- | --- | --- | | assetConfig | assetConfig | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The asset that will be updated | | config | assetConfig | An object containing any properties that you wish to update | | [animation] | jmap.Animation | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The asset which will be moved | | jMapPoint | jMapPoint | The new position and map ID for the asset | | animation | jmap.Animation | How 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

| Param | Type | Description | | --- | --- | --- | | jMapPoint | jMapPoint | The point that you are searching with | | [assets] | Array.<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

| Param | Type | Description | | --- | --- | --- | | type | string | The type of assets that we're searching for | | jMapPoint | jMapPoint | The 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

| Param | Type | Description | | --- | --- | --- | | type | string | The 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

| Param | Type | Description | | --- | --- | --- | | type | string | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The 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

| Param | Type | Description | | --- | --- | --- | | id | Number | The 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

| Param | Type | Description | | --- | --- | --- | | type | string | The 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

| Param | Type | Description | | --- | --- | --- | | asset | Asset | The asset that we are wayfinding to | | jMapPoint | jMapPoint | The point on the map that we're wayfinding from | | pathStyle | jmap.Style | The 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

| Param | Type | Default | Description | | --- | --- | --- | --- | | asset | Asset | | The asset that we are wayfinding to | | pathStyle | pathStyle | | The path style | | [rerouteInterval] | Number | | How 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

| Param | Type | Description | | --- | --- | --- | | type | String | The type of asset that we want to route to | | jMapPoint | jMapPoint | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Param | Type | Description | | --- | --- | --- | | cb | function | The 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

| Name | Type | Description | | --- | --- | --- | | x | number | The X coordinate of the point | | y | number | The y coordinate of the point | | mapId | number | The 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

| Name | Type | Default | Description | | --- | --- | --- | --- | | map | Map | | The map the asset will be placed on | | position | Array.<number> | | Coordinates of the asset (as [x, y]) | | id | number | 0 | The ID of the asset | | name | string | "''" | The name of the asset | | speed | number | 100 | How quickly the asset should move to new coordinates (pixels