The Venue class provides access to the venue information, including venue's drawings (buildings), levels, geometries and other data. It provides access and control of the information.
| Name | Type | Description |
|---|---|---|
venueModel |
Object |
Venue model is wrapper for all venue related row data loaded from Venues API. |
Extends
Members
-
Venue events available on venue object
Properties:
Name Description ACTIVE_VENUE_CHANGEThe event is triggered on venue change
DRAWING_CHANGEThe event is triggered on drawing change
LEVEL_CHANGEThe event is triggered on level interaction
GEOMETRY_HIGHLIGHTThe event is triggered on geometry highlight
Example
const venue = venuesProvider.getActiveVenue(); venue.addEventListener(H.venues.Venue.EVENTS.LEVEL_CHANGE, (event) => { console.log(event); });
Methods
-
This method adds a listener for a specific event.
Note that to prevent potential memory leaks, you must either call
removeEventListenerordisposeon the given object when you no longer need it.Name Type Description typestring The name of the event
handlerfunction An event handler function
opt_captureboolean optional trueindicates that the method should listen in the capture phase (bubble otherwise)opt_scopeObject optional An object defining the scope for the handler function
-
addOnDisposeCallback (callback, opt_scope) inherited
-
This method adds a callback which is triggered when the
EventTargetobject is being disposed.Name Type Description callbackfunction The callback function.
opt_scopeObject optional An optional scope for the callback function
-
dispatchEvent (evt) inherited
-
This method dispatches an event on the
EventTargetobject.Name Type Description evtH.util.Event | string An object representing the event or a string with the event name
-
dispose () inherited
-
This method removes listeners from the given object. Classes that extend
EventTargetmay need to override this method in order to remove references to DOM Elements and additional listeners. -
getActiveDrawing ()H.venues.Drawing
-
Get active Drawing object
Returns:
Type Description H.venues.Drawing The active drawing object. -
Get currently active level index of the venue
Returns:
Type Description number The active level index of the venue. -
getActiveLevels ()Array.<H.venues.Level>
-
Get array of active level objects
Returns:
Type Description Array.<H.venues.Level> Array of active level objects. -
getBoundingBox ()H.geo.Rect
-
Get bounding box of the venue
Returns:
Type Description H.geo.Rect The venue bounds. -
getCenter ()H.geo.Point
-
Get center point of the venue
Returns:
Type Description H.geo.Point The venue center. -
Get the raw data model for the Venue
Returns:
Type Description Object The row venue data model. -
getDrawing (id)H.venues.Drawing
-
Get a drawing by id
Name Type Description idnumber | string The drawing id
Returns:
Type Description H.venues.Drawing The corresponding drawing object. -
getDrawings ()Array.<H.venues.Drawing>
-
Get all venue drawings
Returns:
Type Description Array.<H.venues.Drawing> Array of venue's drawing objects. -
getGeometries ()Array.<H.venues.Geometry>
-
Get all venue geometries from all venue levels
Returns:
Type Description Array.<H.venues.Geometry> Array of venue's geometry objects. -
getGeometry (id)H.venues.Geometry
-
Get a venue geometry by its. Will search through all venue geometries
Name Type Description idnumber | string The geometry id
Returns:
Type Description H.venues.Geometry The corresponding geometry object. -
getHighlightedGeometries ()Array.<H.venues.Geometry>
-
Get currently highlighted geometries
Returns:
Type Description Array.<H.venues.Geometry> Array of currently highlighted geometries. -
Get id of the venue
Returns:
Type Description number The venue id. -
Get id of the venue in string format
Returns:
Type Description string The venue id. -
getLevel (id)H.venues.Level Deprecated : since 3.1.34.2
-
Get a venue level by its id. Will search through all venue drawings
Name Type Description idnumber | string The level id
Returns:
Type Description H.venues.Level The corresponding level object. -
getLevels ()Array.<H.venues.Level>
-
Get all venue levels across all drawings
Returns:
Type Description Array.<H.venues.Level> Array of venue's level objects. -
getMapObjects (levelIndex, drawing)Array.<H.map.Object>
-
Get map objects associated with the venue
Name Type Description levelIndexnumber The level index of the objects
drawingH.venues.Drawing The drawing of the objects
Returns:
Type Description Array.<H.map.Object> The associated map objects. -
Get name of the venue
Returns:
Type Description string The venue name. -
The method indicates whether the venue is currently active.
Returns:
Type Description boolean The active state of the venue -
This method removes a previously added listener from the
EventTargetinstance.Name Type Description typestring The name of the event
handlerfunction A previously added event handler
opt_captureboolean optional trueindicates that the method should listen in the capture phase (bubble otherwise)opt_scopeObject optional An object defining the scope for the handler function
-
search (query)Array.<H.venues.Geometry>
-
This method performs a search within venue data which is already loaded. The search will be performed on geometry data where names and address are taken into account
Name Type Description querystring Value to search for
Returns:
Type Description Array.<H.venues.Geometry> Array of resulting geometry objects Example
const venue = venuesProvider.getActiveVenue(); venue.search('Bathroom'); -
Set the active drawing. Will also dispatch DRAWING_CHANGE event
Name Type Description drawingIdnumber The drawing id
-
Set active level index for the venue. It will also dispatch LEVEL_CHANGE event
Name Type Description levelIndexnumber The level index
-
Set geometry highlight state and style to apply
Name Type Default Description highlightboolean true The highlight state. If
truegeometry will be highlightedgeometriesArray.<H.venues.Geometry> Array of geometries to highlight
opt_styleObject The style to apply
Name Type Description fillColorstring The fill color
outlineColorstring The outline color
outlineWidthnumber The outline width
opt_exclusiveboolean A flag indicating whether the highlighting must be mutual exclusive or not. Default is
false. -
Associate map objects with a venue level & drawing. Visibility of the objects will update automatically based on active level & drawing. Previously associated objects need to be changed manually.
Name Type Description mapObjectsArray.<H.map.Object> The map objects to associate
levelIndexnumber The level to associate the objects with
drawingH.venues.Drawing The drawing to associate the objects with