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

@minmaps-dev/jmap-geofence-kit

v1.0.4

Published

Kit for the MinuteMaps SDK to utilize Geofences plotted in the CMS

Downloads

58

Readme

Classes

Geofence

Kind: global class

new Geofence()

Class representing a Geofence

geofence.name : String

Kind: instance property of Geofence

geofence.description : String

Kind: instance property of Geofence

geofence.color : String

Kind: instance property of Geofence

geofence.geofenceInstances : Array.<GeofenceInstance>

Kind: instance property of Geofence

geofence.geofenceInstances : Array.<String>

Kind: instance property of Geofence

GeofenceCollection ⇐ jmap.core.BaseCollection

Class representing a collection of geofences

Kind: global class
Extends: jmap.core.BaseCollection

new GeofenceCollection()

Create a collection of geofences

geofenceCollection.getByName(name) ⇒ Array

Get a specific set of geofences by their name

Kind: instance method of GeofenceCollection
Returns: Array - An array of geofences

| Param | Type | Description | | --- | --- | --- | | name | String | A geofence name |

geofenceCollection.getByMap(map) ⇒ Array

Get any geofences which appear on the specific map

Kind: instance method of GeofenceCollection
Returns: Array - An array of geofences

| Param | Type | Description | | --- | --- | --- | | map | jmap.core.Map | Any map to query with |

geofenceCollection.getByFloor(map) ⇒ Array

Get any geofences which appear on the specific map

Kind: instance method of GeofenceCollection
Returns: Array - An array of geofences

| Param | Type | Description | | --- | --- | --- | | map | jmap.core.Map | Any map to query with |

geofenceCollection.isGeofence(item) ⇒ Boolean

Returns a boolean for whather or not argument is constructed as a Geofence object

Kind: instance method of GeofenceCollection
Returns: Boolean - Boolean based on evaluation result

| Param | Type | Description | | --- | --- | --- | | item | Object | Item to evaluate |

GeofenceInstance

Kind: global class

new GeofenceInstance(options)

Class representing a Geofence Instance

| Param | Type | Description | | --- | --- | --- | | options | Object | GeofenceInstance options | | options.parent | Geofence | The parent geofence | | options.coordinates | Array.<Array.<Array>> | The set of coordinates that define the geofence instance's polygon. Is a triple nested array to allow for holes within polygons, for example: [[[10, 20], [12, 21], [15, 14]], [[22, 43], [30, 21], [33, 23]] | | options.localCoordinates | Array.<Array.<Array>> | The set of local coordinates that define the geofence instance's polygon. Is a triple nested array to allow for holes within polygons, for example: [[[10, 20], [12, 21], [15, 14]], [[22, 43], [30, 21], [33, 23]] | | options.name | String | The name of the geofence instance | | options.id | Number | The ID of the geofence instance | | options.floor | jCore.Floor | The floor that the current geofence instance is placed on |

GeofenceKit

Kit for working with Jibestream Zones

Kind: global class

new GeofenceKit(core, control)

Create a ZoneKit.

| Param | Type | Description | | --- | --- | --- | | core | jmap.core | instantiated JCore | | control | jmap.JController | instantiated JController |

geofenceKit.getGeofences(callback)

Load the geofence data for the current activeVenue and save it to the geofenceKit object

Kind: instance method of GeofenceKit
Access: public

| Param | Type | Description | | --- | --- | --- | | callback | function | The callback that will be fun once the API endpoint has been loaded |

geofenceKit.getBoundsOfGeofenceOnMap(geofence, [map]) ⇒ jmap.Bounds

Calculate the bounds of a given geofence on a specific map Will return null if there are no instances of the geofence on the specified map or if an invalid geofence/map are provided

Kind: instance method of GeofenceKit
Returns: jmap.Bounds - The calculated bounds object (or null if unable to caluclate bounds)
Access: public

| Param | Type | Default | Description | | --- | --- | --- | --- | | geofence | Geofence | | The geofence that we wish to gind the boudns of | | [map] | jcore.Map | this._control.currentMap | The map we will use to calculate bounds Defaults to the currently shown map |

geofenceKit.getPolygonsOfGeofence(geofence, map) ⇒ Array.<jungle.Polygon>

Generates an array of polygons for the instances of the geofence on the specified map If there are no instances of the geofence on the map, this will return an empty array

Kind: instance method of GeofenceKit
Returns: Array.<jungle.Polygon> - An array of polygons
Access: public

| Param | Type | Description | | --- | --- | --- | | geofence | Geofence | The geofence with which we wish to generate polygons | | map | jcore.Map | The map with which we wish to generate polygons |

geofenceKit.drawPolygonsOfGeofence(geofence, map, [style]) ⇒ Array.<jungle.Polygon>

Draw polygons for each instance of the geofence on the specified map with the specified style. If no style is given, use the geofence's color as the style of the polygons

Kind: instance method of GeofenceKit
Returns: Array.<jungle.Polygon> - The generated polygons
Access: public

| Param | Type | Description | | --- | --- | --- | | geofence | Geofence | The geofence with which we wish to generate polygons | | map | jcore.Map | The map on which we wish to place the polygons | | [style] | jmap.Style | How the polygons should be styled |

geofenceKit.drawPolygonOfGeofenceInstance(instance, [style]) ⇒ jungle.Polygon

Draws a polygon for a specific geofence instance on the map where theinstance resides

Kind: instance method of GeofenceKit
Returns: jungle.Polygon - A polygon (or null if a polygon is unable to be created)
Access: public

| Param | Type | Description | | --- | --- | --- | | instance | GeofenceInstance | The instance with which we width to generate a polygon | | [style] | jmap.Style | How the polygon should be styled. Defaults to using the geofence's color |

geofenceKit.getCentroidsOfGeofenceOnMap(geofence, map) ⇒ Array.<Array.<Number>>

Calculate the centroids of all instances of a geofence on a specific map

Kind: instance method of GeofenceKit
Returns: Array.<Array.<Number>> - An array of points ([x, y]) that correspond to the geofence's instances on the specific map. Ordered in the same order as the instances in the geofence object
Access: public

| Param | Type | Description | | --- | --- | --- | | geofence | Geofence | The geofence with which we wish to calculate the centroids | | map | jcore.Map | The map on which we wish to calculate the centroids |

geofenceKit.watchMovingObjects(geoExitedCallback, geoEnteredCallback) ⇒ GeofenceKit

Add event handlers for when moving objects enter or exit geofences

Kind: instance method of GeofenceKit
Returns: GeofenceKit - The current geofence kit
Access: public

| Param | Type | Description | | --- | --- | --- | | geoExitedCallback | function | The function that will be fired when a moving object exits a geofence | | geoEnteredCallback | function | The function that will be fired when a moving object enters a geofence |

geofenceKit.unwatchMovingObjects() ⇒ GeofenceKit

Unsubscribe the event handlers from the moving objects entering/exiting geofences

Kind: instance method of GeofenceKit
Returns: GeofenceKit - The current geofence kit
Access: public

GeofenceKit.getPolygonOfGeofenceInstance(instance) ⇒ jungle.Polygon

Generates a polygon for a specific geofence instance

Kind: static method of GeofenceKit
Returns: jungle.Polygon - A polygon (or null if a polygon is unable to be created)
Access: public

| Param | Type | Description | | --- | --- | --- | | instance | GeofenceInstance | The instance with which we width to generate a polygon |

GeofenceKit.getCentroidOfGeofenceInstance(instance) ⇒ Array.<Number>

Calculate the centroid of a specific geofence instance

Kind: static method of GeofenceKit
Returns: Array.<Number> - A point ([x, y]) that is the centroid of the specified geofence instance. If no centroid is able to be calculated, null will be returned
Access: public

| Param | Type | Description | | --- | --- | --- | | instance | GeofenceInstance | The geofence instance with which we wish to calculate the centroid |