UNPKG

@jibestream-dev/jmap-device-kit

Version:

Kit for the Jibestream SDK to utilize Devices plotted in the CMS

2,413 lines (916 loc) 37.5 kB
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Jibestream Device Kit Documentation</title> <meta name="description" content="Documentation for JMap Device Kit" /> <meta name="keywords" content="jmap device kit" /> <meta name="keyword" content="jmap device kit" /> <meta property="og:title" content="Jibestream Device Kit Documentation"/> <meta property="og:type" content="website"/> <meta property="og:image" content=""/> <meta property="og:url" content=""/> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <script src="scripts/jquery.min.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/bootstrap.min.css"> <link type="text/css" rel="stylesheet" href="styles/jaguar.css"> <script> var config = {"monospaceLinks":false,"cleverLinks":false,"applicationName":"Jibestream Device Kit Documentation","disqus":"","googleAnalytics":"","openGraph":{"title":"Jibestream Device Kit Documentation","type":"website","image":"","site_name":"","url":""},"meta":{"title":"Jibestream Device Kit Documentation","description":"Documentation for JMap Device Kit","keyword":"jmap device kit"},"linenums":true,"default":{}}; </script> </head> <body> <div id="wrap" class="clearfix"> <div class="navigation"> <h3 class="applicationName"><a href="index.html">Jibestream Device Kit Documentation</a></h3> <div class="search"> <input id="search" type="text" class="form-control input-sm" placeholder="Search Documentations"> </div> <ul class="list"> <li class="item" data-name="Device"> <span class="title"> <a href="Device.html">Device</a> </span> <ul class="members itemMembers"> <span class="subtitle">Members</span> <li data-name="Device#heading"><a href="Device.html#heading">heading</a></li> <li data-name="Device#mapId"><a href="Device.html#mapId">mapId</a></li> <li data-name="Device#name"><a href="Device.html#name">name</a></li> <li data-name="Device#waypointId"><a href="Device.html#waypointId">waypointId</a></li> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="Device#_getLocation"><a href="Device.html#_getLocation">_getLocation</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="DeviceCollection"> <span class="title"> <a href="DeviceCollection.html">DeviceCollection</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="DeviceCollection#getByMap"><a href="DeviceCollection.html#getByMap">getByMap</a></li> <li data-name="DeviceCollection#getByName"><a href="DeviceCollection.html#getByName">getByName</a></li> <li data-name="DeviceCollection#getByWaypoint"><a href="DeviceCollection.html#getByWaypoint">getByWaypoint</a></li> <li data-name="DeviceCollection#isDevice"><a href="DeviceCollection.html#isDevice">isDevice</a></li> </ul> <ul class="events itemMembers"> </ul> </li> <li class="item" data-name="DeviceKit"> <span class="title"> <a href="DeviceKit.html">DeviceKit</a> </span> <ul class="members itemMembers"> </ul> <ul class="typedefs itemMembers"> </ul> <ul class="methods itemMembers"> <span class="subtitle">Methods</span> <li data-name="DeviceKit#addComponentOverDevice"><a href="DeviceKit.html#addComponentOverDevice">addComponentOverDevice</a></li> <li data-name="DeviceKit#focusToDevice"><a href="DeviceKit.html#focusToDevice">focusToDevice</a></li> <li data-name="DeviceKit#focusToDeviceWithHeading"><a href="DeviceKit.html#focusToDeviceWithHeading">focusToDeviceWithHeading</a></li> <li data-name="DeviceKit#getDevices"><a href="DeviceKit.html#getDevices">getDevices</a></li> <li data-name="DeviceKit#getWaypointFromDevice"><a href="DeviceKit.html#getWaypointFromDevice">getWaypointFromDevice</a></li> <li data-name="DeviceKit#hideAllDevices"><a href="DeviceKit.html#hideAllDevices">hideAllDevices</a></li> <li data-name="DeviceKit#hideDevice"><a href="DeviceKit.html#hideDevice">hideDevice</a></li> <li data-name="DeviceKit#pingDevice"><a href="DeviceKit.html#pingDevice">pingDevice</a></li> <li data-name="DeviceKit#removeComponentFromDevice"><a href="DeviceKit.html#removeComponentFromDevice">removeComponentFromDevice</a></li> <li data-name="DeviceKit#showAllDevices"><a href="DeviceKit.html#showAllDevices">showAllDevices</a></li> <li data-name="DeviceKit#showDevice"><a href="DeviceKit.html#showDevice">showDevice</a></li> <li data-name="DeviceKit#wayfindFromDevice"><a href="DeviceKit.html#wayfindFromDevice">wayfindFromDevice</a></li> <li data-name="DeviceKit#wayfindToDevice"><a href="DeviceKit.html#wayfindToDevice">wayfindToDevice</a></li> </ul> <ul class="events itemMembers"> </ul> </li> </ul> </div> <div class="main"> <h1 class="page-title" data-filename="DeviceKit.html">Class: DeviceKit</h1> <section> <header> <h2> DeviceKit </h2> <div class="class-description">Kit for working with Jibestream Devices</div> </header> <article> <div class="container-overview"> <dt> <div class="nameContainer"> <h4 class="name" id="DeviceKit"> new DeviceKit<span class="signature">(core, control)</span> </h4> <div class="tag-source"> DeviceKit.js, line 6 </div> </div> </dt> <dd> <div class="description"> Create a DeviceKit. </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>core</code></td> <td class="type"> <span class="param-type">JCore</span> </td> <td class="description last"> instanciated JCore</td> </tr> <tr> <td class="name"><code>control</code></td> <td class="type"> <span class="param-type">JController</span> </td> <td class="description last"> instanciated JController</td> </tr> </tbody> </table> <dl class="details"> </dl> </dd> </div> <h3 class="subsection-title">Methods</h3> <dl> <dt> <div class="nameContainer"> <h4 class="name" id="addComponentOverDevice"> addComponentOverDevice<span class="signature">(device, component)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="DeviceKit.html">DeviceKit</a>}</span> </h4> <div class="tag-source"> DeviceKit.js, line 143 </div> </div> </dt> <dd> <div class="description"> Adds an html component ontop of your devoce, commonly used for 'You are here' indicators </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>device</code></td> <td class="type"> <span class="param-type"><a href="Device.html">Device</a></span> </td> <td class="description last"> device model</td> </tr> <tr> <td class="name"><code>component</code></td> <td class="type"> <span class="param-type">DOMElement</span> </td> <td class="description last"> any html element wrapped in a div</td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> <a href="DeviceKit.html">DeviceKit</a> </td> <td class="description last">DeviceKit</td> </tr> </tbody> </table> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="focusToDevice"> focusToDevice<span class="signature">(callback, device, animation)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="DeviceKit.html">DeviceKit</a>}</span> </h4> <div class="tag-source"> DeviceKit.js, line 114 </div> </div> </dt> <dd> <div class="description"> Focuses the view center to the position of the device, changes the mapView if needed </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">jmap.core.Waypoint</span> </td> <td class="description last"> waypoint to wayfind to</td> </tr> <tr> <td class="name"><code>device</code></td> <td class="type"> <span class="param-type"><a href="Device.html">Device</a></span> </td> <td class="description last"> device model</td> </tr> <tr> <td class="name"><code>animation</code></td> <td class="type"> <span class="param-type">jmap.Animation</span> </td> <td class="description last"> animation definition</td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> <a href="DeviceKit.html">DeviceKit</a> </td> <td class="description last">DeviceKit</td> </tr> </tbody> </table> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="focusToDeviceWithHeading"> focusToDeviceWithHeading<span class="signature">(device)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="DeviceKit.html">DeviceKit</a>}</span> </h4> <div class="tag-source"> DeviceKit.js, line 123 </div> </div> </dt> <dd> <div class="description"> Rotates the map to match the device heading </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>device</code></td> <td class="type"> <span class="param-type"><a href="Device.html">Device</a></span> </td> <td class="description last"> device model</td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> <a href="DeviceKit.html">DeviceKit</a> </td> <td class="description last">DeviceKit</td> </tr> </tbody> </table> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="getDevices"> getDevices<span class="signature">(callback)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="DeviceKit.html">DeviceKit</a>}</span> </h4> <div class="tag-source"> DeviceKit.js, line 75 </div> </div> </dt> <dd> <div class="description"> Make request to JACS to populate the DeviceCollection of the ActiveVenue </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"> callback fired when devices are ready, passes error, deviceCollection as arguments</td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> <a href="DeviceKit.html">DeviceKit</a> </td> <td class="description last">DeviceKit</td> </tr> </tbody> </table> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="getWaypointFromDevice"> getWaypointFromDevice<span class="signature">(device)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{jmap.core.Waypoint}</span> </h4> <div class="tag-source"> DeviceKit.js, line 132 </div> </div> </dt> <dd> <div class="description"> Returns the waypoint matching the device waypointId if the waypoint exists in a loaded map </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>device</code></td> <td class="type"> <span class="param-type"><a href="Device.html">Device</a></span> </td> <td class="description last"> device model</td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> jmap.core.Waypoint </td> <td class="description last">waypoint</td> </tr> </tbody> </table> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="hideAllDevices"> hideAllDevices<span class="signature">()</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="DeviceKit.html">DeviceKit</a>}</span> </h4> <div class="tag-source"> DeviceKit.js, line 208 </div> </div> </dt> <dd> <div class="description"> Hides all divices </div> <dl class="details"> </dl> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> <a href="DeviceKit.html">DeviceKit</a> </td> <td class="description last">DeviceKit</td> </tr> </tbody> </table> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="hideDevice"> hideDevice<span class="signature">(device)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="DeviceKit.html">DeviceKit</a>}</span> </h4> <div class="tag-source"> DeviceKit.js, line 185 </div> </div> </dt> <dd> <div class="description"> Hide the divice </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>device</code></td> <td class="type"> <span class="param-type"><a href="Device.html">Device</a></span> </td> <td class="description last"> device model</td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> <a href="DeviceKit.html">DeviceKit</a> </td> <td class="description last">DeviceKit</td> </tr> </tbody> </table> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="pingDevice"> pingDevice<span class="signature">(device, onComplete)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="DeviceKit.html">DeviceKit</a>}</span> </h4> <div class="tag-source"> DeviceKit.js, line 219 </div> </div> </dt> <dd> <div class="description"> Plays a pulse animation for the decive once, fires an onComplete callback when done </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>device</code></td> <td class="type"> <span class="param-type"><a href="Device.html">Device</a></span> </td> <td class="description last"> device model</td> </tr> <tr> <td class="name"><code>onComplete</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"> callback fired once animation is complete</td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> <a href="DeviceKit.html">DeviceKit</a> </td> <td class="description last">DeviceKit</td> </tr> </tbody> </table> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="removeComponentFromDevice"> removeComponentFromDevice<span class="signature">(device)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="DeviceKit.html">DeviceKit</a>}</span> </h4> <div class="tag-source"> DeviceKit.js, line 156 </div> </div> </dt> <dd> <div class="description"> Removes any html component added ontop of your device. </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>device</code></td> <td class="type"> <span class="param-type"><a href="Device.html">Device</a></span> </td> <td class="description last"> device model</td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> <a href="DeviceKit.html">DeviceKit</a> </td> <td class="description last">DeviceKit</td> </tr> </tbody> </table> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="showAllDevices"> showAllDevices<span class="signature">(config)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="DeviceKit.html">DeviceKit</a>}</span> </h4> <div class="tag-source"> DeviceKit.js, line 197 </div> </div> </dt> <dd> <div class="description"> Display all the devices on thier respecive maps </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>config</code></td> <td class="type"> <span class="param-type"><a href="global.html#DeviceViewConfig">DeviceViewConfig</a></span> </td> <td class="description last"> configuration used to generate the appearance of the device. only read the first time a device is shown</td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> <a href="DeviceKit.html">DeviceKit</a> </td> <td class="description last">DeviceKit</td> </tr> </tbody> </table> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="showDevice"> showDevice<span class="signature">(device, config)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{<a href="DeviceKit.html">DeviceKit</a>}</span> </h4> <div class="tag-source"> DeviceKit.js, line 170 </div> </div> </dt> <dd> <div class="description"> Display the device on its respecive map </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>device</code></td> <td class="type"> <span class="param-type"><a href="Device.html">Device</a></span> </td> <td class="description last"> device model</td> </tr> <tr> <td class="name"><code>config</code></td> <td class="type"> <span class="param-type"><a href="global.html#DeviceViewConfig">DeviceViewConfig</a></span> </td> <td class="description last"> configuration used to generate the appearance of the device. only read the first time a device is shown</td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> <a href="DeviceKit.html">DeviceKit</a> </td> <td class="description last">DeviceKit</td> </tr> </tbody> </table> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="wayfindFromDevice"> wayfindFromDevice<span class="signature">(waypoint, device, number)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Array}</span> </h4> <div class="tag-source"> DeviceKit.js, line 103 </div> </div> </dt> <dd> <div class="description"> Draws a path from the selected device </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>waypoint</code></td> <td class="type"> <span class="param-type">jmap.core.Waypoint</span> </td> <td class="description last"> waypoint to wayfind to</td> </tr> <tr> <td class="name"><code>device</code></td> <td class="type"> <span class="param-type"><a href="Device.html">Device</a></span> </td> <td class="description last"> device model</td> </tr> <tr> <td class="name"><code>number</code></td> <td class="type"> <span class="param-type">accessLevel</span> </td> <td class="description last"> level of accessibility of the path</td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> Array </td> <td class="description last">List of path points, seperted by floor</td> </tr> </tbody> </table> </dd> <dt> <div class="nameContainer"> <h4 class="name" id="wayfindToDevice"> wayfindToDevice<span class="signature">(callback, device, number)</span><span class="glyphicon glyphicon-circle-arrow-right"></span><span class="type-signature returnType">{Array}</span> </h4> <div class="tag-source"> DeviceKit.js, line 92 </div> </div> </dt> <dd> <div class="description"> Draws a path to the selected device </div> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>callback</code></td> <td class="type"> <span class="param-type">jmap.core.Waypoint</span> </td> <td class="description last"> waypoint to wayfind from</td> </tr> <tr> <td class="name"><code>device</code></td> <td class="type"> <span class="param-type"><a href="Device.html">Device</a></span> </td> <td class="description last"> device model</td> </tr> <tr> <td class="name"><code>number</code></td> <td class="type"> <span class="param-type">accessLevel</span> </td> <td class="description last"> level of accessibility of the path</td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <table class="params"> <thead> <tr> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="type"> Array </td> <td class="description last">List of path points, seperted by floor</td> </tr> </tbody> </table> </dd> </dl> </article> </section> <footer> Documentation generated by <a target="_blank" href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.3</a> on Mon Jul 17 2017 21:06:02 GMT-0400 (EDT) </footer> </div> </div> <script>prettyPrint();</script> <script src="scripts/linenumber.js"></script> <script src="scripts/main.js"></script> </body> </html>