Examples and use cases
- Last UpdatedApr 28, 2025
- 6 minute read
Explore practical examples and use cases to effectively utilize indoor maps and venues with the HERE SDK. This section covers a range of topics to help you get the most out of our indoor mapping capabilities.
List all indoor maps
The HERE SDK for iOS (Navigate Edition) allows you to list all private venues that are accessible for your account and the selected collection. VenueMap
contains a list which holds VenueInfo
elements containing venue Identifier, venue ID and venue Name.
For maps with venue identifier as UUID, venueId
would return 0.
Load and show a venue
The HERE SDK for iOS (Navigate Edition) allows you to load and visualize venues by identifier. You must know the venue's identifier for the current set of credentials. There are several ways to load and visualize the venues.
A VenueMap
has two methods to add a venue to the map: selectVenueAsync()
and addVenueAsync()
. Both methods use getVenueService().addVenueToLoad()
to load the venue by Identifier and then add it to the map. The method selectVenueAsync()
also selects the venue:
Note
For legacy maps with an
int
based venue ID,VenueMap
still supportsselectVenueAsync(venueID: Int)
andaddVenueAsync(venueID: Int)
to load the venue by venue ID.
Once the venue is loaded, the VenueService
calls the VenueDelegate.onGetVenueCompleted()
method:
Note
For legacy maps with an
int
based venue ID,VenueService
calls theVenueListener.onGetVenueCompleted(venueID: Int, venueModel: VenueModel?, online: Bool, venueStyle: VenueStyle?)
method.
Once the venue is loaded successfully, if you are using the addVenueAsync()
method, only the VenueLifecycleDelegate.onVenueAdded()
method will be triggered. If you are using the selectVenueAsync()
method, the VenueSelectionDelegate.onSelectedVenueChanged()
method will also be triggered.
A Venue
can also be removed from the VenueMap
, which triggers the VenueLifecycleDelegate.onVenueRemoved(venueIdentifier: String)
method:
Note
For legacy maps with an
int
based venue ID, if you are using theaddVenueAsync()
method, theVenueLifecycleListener.onVenueAdded()
method will be triggered. When removing anint
based venue ID fromVenueMap
, theVenueLifecycleListener.onVenueRemoved(venueID: Int)
is triggered.
Label text preference
You can override the default label text preference for a venue.
Once the VenueEngine
is initialized, a callback is called. From this point on, there is access to the VenueService
. The optional method setLabeltextPreference()
can be called to set the label text preference during rendering. Overriding the default style label text preference provides an opportunity to set the following options as a list where the order defines the preference:
- "OCCUPANT_NAMES"
- "SPACE_NAME"
- "INTERNAL_ADDRESS"
- "SPACE_TYPE_NAME"
- "SPACE_CATEGORY_NAME"
These can be set in any desired order. For example, if the label text preference does not contain "OCCUPANT_NAMES" then it will switch to "SPACE_NAME" and so on, based on the order of the list. Nothing is displayed if no preference is found.
Select venue drawings and levels
A Venue
object allows you to control the state of the venue.
The property Venue.selectedDrawing
allows you to get and set a drawing which is visible on the map. When a new drawing is selected, the VenueDrawingSelectionDelegate.onDrawingSelected()
method is triggered.
The following provides an example of how to select a drawing when an item is clicked in a UITableView
:
The properties Venue.selectedLevel
, Venue.selectedLevelIndex
and Venue.selectedLevelZIndex
allow you to get and set a level which will be visible on the map. If a new level is selected, the VenueLevelSelectionDelegate.onLevelSelected()
method is triggered.
The following provides an example of how to select a level based on a reversed levels list from UITableView
:
A full example of the UI switchers to control drawings and levels is available in the "IndoorMap" example app, available on GitHub.
Customize the style of a venue
You can change the visual style of VenueGeometry
objects. Geometry style and/or label style objects must be created and provided to the Venue.setCustomStyle()
method:
Select space by identifier
The ID of spaces, levels and drawings can be extracted using getIdentifier()
, e.g. for spaces call: spaces.getIdentifier()
. Then, for using those id values, a specific space can be searched in a level or a drawing with getGeometryById(id:)
.
Handle tap gestures on a venue
You can select a venue object by tapping it. First, set the tap delegate:
Inside the tap delegate, you can use the tapped geographic coordinates as parameter for the VenueMap.getGeometry()
and VenueMap.getVenue()
methods:
HERE recommends that you deselect the tapped geometry when the selected venue, drawing, or level has changed:
A full example showing usage of the map tap event with venues is available in the "IndoorMap" example app, available on GitHub.