Class: Service2

H.venues.Service2

new H.venues.Service2 (opt_options)

This class provides interface to the venue platform service

Name Type Description
opt_options H.venues.Service2.Options

Options used for venues API.

Example
let venuesService = platform.getVenuesService({ apikey: 'APIKEY', hrn:'HRN'}, 2);

venuesService.loadVenue(VENUE_ID).then((venue) => {
  console.log(venue);
});

Members

H.venues.Service2.CONFIG_KEY string staticconstant

The property name to use when specifying options for this service within the H.service.Platform.Options#servicesConfig.

H.venues.Service2.LABEL_TEXT_PREFERENCE_OVERRIDE string static

This property can be used to set priorities for labels to display. See H.venues.Service2#loadVenue.

Properties:
Name Description
OCCUPANT_NAMES

To display only occupant names on map as a label text. Example: Boutique Du Chocolat, Caviar House & Prunier, Sound & Vision

SPACE_NAME

To display only space names on map as a label text. Example: Family Services/First Aid, Zurich Airport Lost Property (Swissport), Lost & Found 2 DNATA Air IB

SPACE_TYPE_NAME

To display only space types on map as a label text. Example: DEFIBRILLATOR, HALL_AREA, INACCESSIBLE_SPACE

SPACE_CATEGORY_NAME

To display only space categories on map as a label text. Example: SAFETY, STRUCTURE, FACILITY

INTERNAL_ADDRESS

To display only internal addresses on map as a label text. Example: "51/D, E 53, A82/A83"

Example
let venuesService = platform.getVenuesService({ apikey: 'APIKEY', hrn:'HRN'}, 2);

// It implies that, if both space name and address are available for a given space, they will take priority over the rest of labels, in the given order.
const labelTextPreferenceOverride = [
   H.venues.Service2.LABEL_TEXT_PREFERENCE_OVERRIDE.SPACE_NAME,
   H.venues.Service2.LABEL_TEXT_PREFERENCE_OVERRIDE.INTERNAL_ADDRESS
]

venuesService.loadVenue(VENUE_ID, { labelTextPreferenceOverride }).then((venue) => {
  console.log(venue);
});

Methods

getMapInfoList ()Promise.<Array.<Object>>

To retrieve the list of Indoor maps from the given HRN.

Returns:
Type Description
Promise.<Array.<Object>> Promise resolves with an array of objects representing the list of Indoor maps. If no maps are found, then an empty array is returned.

loadVenue (venueId, opt_options)Promise.<(H.venues.Venue|never|never)>

Load a venue from server

Name Type Description
venueId string

Venue ID to load

opt_options Object

Options to use for venue loading

Name Type Default Description
isMetaEnabled boolean true optional

Set to false to disable metadata

isIconsEnabled boolean true optional

Set to false to disable icons

labelTextPreferenceOverride Array.<{H.venues.Service2.LABEL_TEXT_PREFERENCE_OVERRIDE}> null optional

Options to override label text preference. If the value for label preference is not set at all, it would imply that the default label preferences should be used. An empty array implies that no venue labels need to be displayed. The order in which the label preferences are provided decides which label to be displayed when there is more than one option.

Returns:
Type Description
Promise.<(H.venues.Venue|never|never)> Promise resolves the loaded venue object

Type Definitions

H.venues.Service2.Options

H.venues.Service2.Options This type encapsulates configuration (initialization) options for an instance of venues Service2.

Properties:
Name Type Argument Description
apikey string <optional>

The API key to use venuesService2. Optional, if token is provided

baseUrl H.service.Url <optional>

The base URL of the Venues service. If supplied, it overrides the default

hrn string <optional>

Indoor Map catalog HRN. Optional, if token is provided. If hrn is not provided, it would be set to the default indoor map collection

token string <optional>

The token to a Indoor platform app. Optional, if apikey is provided