Skip to content

Commit 21ab55a

Browse files
authored
Revert "Revert "Updated indoor-map example to add code for venuesService.getMapInfoList() (#143)" (#144)"
This reverts commit fdfe8bc.
1 parent fdfe8bc commit 21ab55a

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

indoor-map/demo.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ <h1>Show an Indoor Map</h1>
5555
<div id="map"></div>
5656
<h3>Code</h3>
5757
<p>
58-
The example shows loading the Indoor Map using <code>H.venues.Service</code> and renders the indoor map using an instance of <code>H.venues.Provider</code>.<br>
58+
The example shows loading the Indoor Map using <code>H.venues.Service2</code> and renders the indoor map using an instance of <code>H.venues.Provider</code>.<br>
5959
The example also shows how to:
6060
<ul>
61-
<li>disable the base map while loading a indoor map using <code>H.Map.setBaseLayer (layer)</code></li>
62-
<li>switch to an indoor map level other than the default using <code>H.venues.Venue.setActiveLevelIndex (levelIndex)</code></li>
61+
<li>get the list of indoor maps from the given HRN using <code>H.venues.Service2.getMapInfoList()</code></li>
62+
<li>disable the base map while loading a indoor map using <code>H.Map.setBaseLayer(layer)</code></li>
63+
<li>switch to an indoor map level other than the default using <code>H.venues.Venue.setActiveLevelIndex(levelIndex)</code></li>
6364
<li>override default indoor map label text preferences using <code>H.venues.Service2.LABEL_TEXT_PREFERENCE_OVERRIDE</code></li>
6465
</ul>
6566
</p>

indoor-map/demo.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ function addVenueToMap(map) {
3838
// Get an instance of the Indoor Maps service using a valid apikey for Indoor Maps
3939
const venuesService = platform.getVenuesService({ apikey: yourApikey, hrn: indoorMapHrn }, 2);
4040

41+
// Use venuesService.getMapInfoList to retrieve the list of Indoor maps from the given HRN
42+
venuesService.getMapInfoList().then(mapInfoList => {
43+
mapInfoList.forEach(mapInfo => {
44+
console.log("Indoor map id: " + mapInfo.mapId + ", map name: " + mapInfo.mapName);
45+
});
46+
});
47+
4148
// Indoor Maps service provides a loadVenue method. Optionally, overriding the label preferences
4249
venuesService.loadVenue(venueId, { labelTextPreferenceOverride }).then((venue) => {
4350
// add Indoor Maps data to the Indoor Maps provider

0 commit comments

Comments
 (0)