Class: Service

Class: Service

Class: Service

H.venues.Service

new H.venues.Service (regionCode, opt_options)

This class provides interface to the venue platform service

Name Type Description
regionCode string

The region code to use for the Service's default configuration.

opt_options H.venues.Service.Options

Options used for venues API.

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

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

Members

H.venues.Service.CONFIG_KEY string staticconstant

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

H.venues.Service.LABEL_TEXT_PREFERENCE_OVERRIDE string static

This property can be used to set priorities for labels to display. See H.venues.Service#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'});

// 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.Service.LABEL_TEXT_PREFERENCE_OVERRIDE.SPACE_NAME,
   H.venues.Service.LABEL_TEXT_PREFERENCE_OVERRIDE.INTERNAL_ADDRESS
]

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

H.venues.Service.NON_DEFAULT_FEATURES string static

This property can be used to specify non default features to display. See H.venues.Service#loadVenue.

Properties:
Name Description
TOPOLOGY

To load Topology features for the venue

LEVELCONNECTOR

To load Level Connector features for the venue

CROSSWALK

To load Crosswalk features for the venue

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

// It implies that, crosswalk and topology features will be loaded and displayed for the venue
const nonDefaultFeaturesToLoad = [
   H.venues.Service.NON_DEFAULT_FEATURES.TOPOLOGY
   H.venues.Service.NON_DEFAULT_FEATURES.CROSSWALK,
]

venuesService.loadVenue(VENUE_ID, { nonDefaultFeaturesToLoad }).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.Service.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.

nonDefaultFeaturesToLoad Array.<{H.venues.Service2.NON_DEFAULT_FEATURES}> null optional

Options to load non default features for the venue. If the value for is not set at all, it would imply that topology, level connector and crosswalk features will not be loaded. The value provided decides which non default features to be loaded for the venue.

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

Type Definitions

H.venues.Service.Options

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

Properties:
Name Type Argument Description
apikey string <optional>

The API key to use venuesService. 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