poi

poi

Contains constants and functions for a POI Object.

The structure for a POI Object is as follows:

{
  latitude: <number>,
  libraryid: <string>,
  longitude: <number>,
  regionname: <string>,
  regionmetadata: {
    category: <string>,
    city: <string>,
    country: <string>,
    state: <string>,
    street: <string>,
  },
  radius: <number>,
  regionid: <string>,
  useriswithin: <boolean>,
  weight: <number>,
}
Source:

Members

(static, constant) group

A grouping for this object

Source:

(static, constant) label

A label that can be used when describing this object

Source:

(static, constant) parentDepth

Describes the number of parents this object has based off schema references. When checking for matches for example, we want to use a schema that is more specific over a more generic schema

Source:

(static, constant) path :string

Paths for the keys on a POI Object

Properties:
Name Type Description
latitude string

The POI latitude.
Path is latitude.

libraryId string

The Places library the POI belongs to.
Path is libraryid.

longitude string

The POI longitude.
Path is longitude.

name string

The POI name.
Path is regionname.

metadata string

An object with some defined items and custom data items..
Path is regionmetadata.

category string

The POI category.
Path is regionmetadata.category.

city string

The POI city.
Path is regionmetadata.city.

country string

The POI country.
Path is regionmetadata.country.

state string

The POI state.
Path is regionmetadata.state.

street string

The POI street.
Path is regionmetadata.street.

radius string

The POI radius.
Path is radius.

id string

The unique region id.
Path is regionid.

within string

Is the user currently in the POI.
Path is useriswithin.

weight string

The weight of the POI. It is used to prioritze POIs when a user is inside multile POIS.
Path is weight.

Source:

Methods

(static) get(alias, data) → {*}

Retrieves a value from the object. You can provide either a path or an alias.

Parameters:
Name Type Description
alias string

Path or alias

data *

Data to search

Source:

(static) getCategory(source) → {string}

Returns the category from the POI Object. This is the the POI category.

Path is regionmetadata,category.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getCity(source) → {string}

Returns the city from the POI Object. This is the the POI city.

Path is regionmetadata,city.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getCountry(source) → {string}

Returns the country from the POI Object. This is the the POI country.

Path is regionmetadata,country.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getCustomMetadata(source) → {object}

Returns the metadata without any known values. Scrubs items like category, state, etc

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getId(source) → {string}

Returns the id from the POI Object. This is the the unique region id.

Path is regionid.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getLatitude(source) → {number}

Returns the latitude from the POI Object. This is the the POI latitude.

Path is latitude.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getLibraryId(source) → {string}

Returns the libraryId from the POI Object. This is the the Places library the POI belongs to.

Path is libraryid.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getLongitude(source) → {number}

Returns the longitude from the POI Object. This is the the POI longitude.

Path is longitude.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getMetadata(source) → {object}

Returns the metadata from the POI Object. This is the an object with some defined items and custom data items..

Path is regionmetadata.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getMetadataKey(…path, source) → {*}

Returns the data using the specified path from the metadata of the POI Object.

Parameters:
Name Type Attributes Description
path string <repeatable>

key in object

source object

The POI Object instance

Source:

(static) getName(source) → {string}

Returns the name from the POI Object. This is the the POI name.

Path is regionname.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getRadius(source) → {number}

Returns the radius from the POI Object. This is the the POI radius.

Path is radius.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getState(source) → {string}

Returns the state from the POI Object. This is the the POI state.

Path is regionmetadata,state.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getStreet(source) → {string}

Returns the street from the POI Object. This is the the POI street.

Path is regionmetadata,street.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getWeight(source) → {number}

Returns the weight from the POI Object. This is the the weight of the POI. It is used to prioritze POIs when a user is inside multile POIS.

Path is weight.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) getWithin(source) → {boolean}

Returns the within from the POI Object. This is the is the user currently in the POI.

Path is useriswithin.

Parameters:
Name Type Description
source object

The POI Object instance

Source:

(static) make(…input) → {object}

Generates a POI Object with the const values set. Can be useful in testing. Can provide additional data by providing a flat object of paths and values.

Parameters:
Name Type Attributes Description
input function <repeatable>

Overrides

Source:

(static) mock(…input) → {object}

Generates a POI Object with some default values set. Can be useful in testing. Can override defaults and provide additional data by providing a flat object of paths and values.

Parameters:
Name Type Attributes Description
input function <repeatable>

Overrides

Source: