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
-
The property name to use when specifying options for this service within the
H.service.Platform.Options#servicesConfig. -
This property can be used to set priorities for labels to display. See
H.venues.Service2#loadVenue.Properties:
Name Description OCCUPANT_NAMESTo display only occupant names on map as a label text. Example: Boutique Du Chocolat, Caviar House & Prunier, Sound & Vision
SPACE_NAMETo 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_NAMETo display only space types on map as a label text. Example: DEFIBRILLATOR, HALL_AREA, INACCESSIBLE_SPACE
SPACE_CATEGORY_NAMETo display only space categories on map as a label text. Example: SAFETY, STRUCTURE, FACILITY
INTERNAL_ADDRESSTo 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
-
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 venueIdstring Venue ID to load
opt_optionsObject Options to use for venue loading
Name Type Default Description isMetaEnabledboolean true optional Set to false to disable metadata
isIconsEnabledboolean true optional Set to false to disable icons
labelTextPreferenceOverrideArray.<{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 This type encapsulates configuration (initialization) options for an instance of venues
Service2.Properties:
Name Type Argument Description apikeystring <optional>
The API key to use venues
Service2. Optional, iftokenis providedbaseUrlH.service.Url <optional>
The base URL of the Venues service. If supplied, it overrides the default
hrnstring <optional>
Indoor Map catalog HRN. Optional, if
tokenis provided. If hrn is not provided, it would be set to the default indoor map collectiontokenstring <optional>
The token to a Indoor platform app. Optional, if
apikeyis provided