Skip to content

Commit fa4c662

Browse files
Updated indoor-map example to work with latest indoor js maps api changes
1 parent cac98c5 commit fa4c662

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

indoor-map/demo.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,17 @@
4040
<body>
4141
<h1>Show an Indoor Map</h1>
4242
<p>
43-
The Indoor Maps module facilitates access to your private indoor maps including full JSON models as well as routing between indoor and outdoor points. The HERE Indoor Maps API also provides information about indoor spaces, buildings, level geometry and points of interest.
43+
The Indoor Maps module facilitates access to your private indoor maps including full JSON models. The HERE Indoor Maps API also provides information about indoor spaces, buildings, level geometry and points of interest.
4444
</p>
4545

4646
<p>
4747
More information on the use of the HERE Indoor Maps API is available <a href="https://developer.here.com/documentation/maps/dev_guide/topics/venues.html" target="_blank">here</a>.
4848
</p>
4949

50-
<p>This example shows an Indoor Map of the <b>Zurich Airport</b>.
50+
<p>
51+
This example shows an Indoor Map of the <b>Zurich Airport (7348)</b>.
52+
This example also works with Tiefgarage Riem Arcaden APCOA parking garage (27158) and Mall of Berlin (22766)
53+
</p>
5154

5255
<div id="map"></div>
5356
<h3>Code</h3>

indoor-map/demo.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,28 @@
55
*/
66
function addVenueToMap(map) {
77
// Get an instance of the Indoor Maps service using a valid apikey for Indoor Maps
8-
const venuesService = platform.getVenuesService({ apikey: 'QICW7garcjxE7C7sSguJcNolMZXqYCJ9m5o6Qq3ygjg' });
8+
const venuesService = platform.getVenuesService({ apikey: 'ZKBUeAgkzH4JWhg93AA7cIE_kZotbMGhVI0_UYC0COY',
9+
hrn: 'hrn:here:data::org651595200:indoormap-ed6d5667-cfe0-4748-bbf5-88b00e7e3b21-collection' }, 2);
910

1011
// Indoor Maps provider interacts with a tile layer to visualize and control the Indoor Map
1112
const venuesProvider = new H.venues.Provider();
1213

1314
// Indoor Maps service provides a loadVenue method
14-
venuesService.loadVenue(7348).then((venue) => {
15+
// This example works for maps:
16+
// 7348 - Zurich Airport
17+
// 27158 - Tiefgarage Riem Arcaden APCOA Parking garage
18+
// 22766 - Mall of Berlin
19+
venuesService.loadVenue('7348').then((venue) => {
1520
// add Indoor Maps data to the Indoor Maps provider
1621
venuesProvider.addVenue(venue);
1722
venuesProvider.setActiveVenue(venue);
1823

1924
// create a tile layer for the Indoor Maps provider
2025
map.addLayer(new H.map.layer.TileLayer(venuesProvider));
2126

27+
// Set center of the map view to the center of the venue
28+
map.setCenter(venue.getCenter());
29+
2230
// optionally select a different level
2331
venue.setActiveDrawing(7880);
2432

0 commit comments

Comments
 (0)