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

atriusmaps-node-sdk

v3.3.344

Published

This project provides an API to Atrius Personal Wayfinder maps within a Node environment. See the README.md for more information

Downloads

1,315

Readme

atriusmaps-node-sdk

To Install:

npm install atriusmaps-node-sdk

Or with yarn:

yarn add atriusmaps-node-sdk

Then within your code, import the map initializer via:

import Init from 'atriusmaps-node-sdk'

or use require

const Init = require("atriusmaps-node-sdk")

To Use

The Init object contains 3 methods:

  • Init.setLogging(boolean logging) : To turn on/off the logging
  • Init.getVersion() : Returns the current version of the library
  • Init.newMap(Object configuration) : This is how your initialize a new map. This returns a Promise that resolves to your map.

The configuration object recognizes the following properties:

  • accountId: This is the customer account against which you wish to display a map. Each account is associated with a list of 1 or more venues that it is authorized to display.
  • venueId: The venue ID you wish the map to render.
  • agent (optional): An instance of the http.agent to handle network fetches. See https://github.com/node-fetch/node-fetch#custom-agent for more information.
  • proxy (optional): An object containing a host and port property to utilize a forwarding proxy for all network requests. (see example below)

At a minimum, a configuration would contain an accountId and a venueId:

const config = {
			venueId: '<venueId>',
			accountId: '<accountId>'
		}

An example of utilizing a proxy:

const config = {
			venueId: '<venueId>',
			accountId: '<accountId>',
			proxy: {
				host: 'example.com',
				port: 9108
			}
		}

You then initialize your map:

const map = await Init.newMap(config)

Your map function is ready to receive commands – of which the following are currently supported:

  • help : Returns a string indicating all available commands and their arguments
  • getDirections: Get time, distance and navigation steps from one point to another
  • getPOIDetails: Get detailed information about a POI by ID
  • getAllPOIs: Get a list of all POIs for the venue
  • getStructures: Returns a list of structures (buildings) within the venue along with their properties
  • getVenueData: Returns a complete venue object containing all venue details
  • search: Performs a search against a term specified

For details on these commands, including their arguments, return value formats, and examples, see https://locusmapsjs.readme.io/docs/commands

Note that all these commands are asynchronous, and return a promise. So use them with await or a then clause.

Examples:

const poi = await map.getPOIDetails(11)
console.log(`Got POI details for ${poi.name}.`)

Or

map.getPOIDetails(11)
  .then(poi => console.log(`Got POI Details for ${poi.name}.`))

For example:

node main.js

© 2024 ACUITY BRANDS, INC. ALL RIGHTS RESERVED