Skip to content

Commit d92378f

Browse files
committed
updated meta.json
1 parent 9b47c42 commit d92378f

File tree

5 files changed

+39
-42
lines changed

5 files changed

+39
-42
lines changed

indoor-map-with-pedestrian-route-from-a-to-b/demo.details renamed to indoor-map-with-route-from-a-to-b/demo.details

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
name: Displaying an Indoor Map
3-
description: Use Here Indoor Maps service to load and visualize an indoor map
2+
name: Indoor Map with Route from A to B
3+
description: Use Here Indoor Maps service to calculate route on a indoor map
44
resources:
55
- https://heremaps.github.io/maps-api-for-javascript-examples/test-credentials.js
66
normalize_css: no

indoor-map-with-pedestrian-route-from-a-to-b/demo.html renamed to indoor-map-with-route-from-a-to-b/demo.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
66
<meta name="description" content="Use the HERE Indoor Maps API to load and visualize an indoor map">
77
<title>Indoor Map with Driving Route from A to B</title>
8-
<link rel="stylesheet" type="text/css" href="https://js.api.here.com/v3/3.1/mapsjs-ui.css" />
9-
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-core.js"></script>
10-
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-mapevents.js"></script>
11-
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-service.js"></script>
12-
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-ui.js"></script>
13-
<script type="text/javascript" src="https://js.api.here.com/v3/3.1/mapsjs-venues.js"></script>
8+
<link rel="stylesheet" type="text/css" href="https://js.api.here.com/v3/3.2/mapsjs-ui.css" />
9+
<script type="text/javascript" src="https://js.api.here.com/v3/3.2/mapsjs-core.js"></script>
10+
<script type="text/javascript" src="https://js.api.here.com/v3/3.2/mapsjs-mapevents.js"></script>
11+
<script type="text/javascript" src="https://js.api.here.com/v3/3.2/mapsjs-service.js"></script>
12+
<script type="text/javascript" src="https://js.api.here.com/v3/3.2/mapsjs-ui.js"></script>
13+
<script type="text/javascript" src="https://js.api.here.com/v3/3.2/mapsjs-venues.js"></script>
1414
<link rel="stylesheet" type="text/css" href="../template.css" />
1515
<link rel="stylesheet" type="text/css" href="demo.css" />
1616
<script type="text/javascript" src='../test-credentials.js'></script>
@@ -45,7 +45,7 @@ <h1>Show routes on Indoor Map</h1>
4545
</p>
4646

4747
<p>
48-
More information on the use of the HERE Indoor Maps API is available <a href="https://www.here.com/docs/bundle/maps-api-for-javascript-developer-guide/page/topics/indoor-maps.html" target="_blank">here</a>.
48+
More information on the use of the HERE Indoor Maps API is available <a href="https://www.here.com/docs/bundle/maps-api-for-javascript-developer-guide-3.2/page/topics/indoor-maps.html" target="_blank">here</a>.
4949
</p>
5050

5151
<p>
@@ -56,8 +56,8 @@ <h1>Show routes on Indoor Map</h1>
5656
<div id="map"></div>
5757
<h3>Code</h3>
5858
<p>
59-
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>
60-
<p>Access to the routing service is obtained from the <code>H.venues.Service2</code> by calling
59+
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>
60+
<p>Access to the routing service is obtained from the <code>H.venues.Service</code> by calling
6161
<code>calculateRoute(routeParams)</code>. The <code>calculateRoute()</code> method is used to calculate the shortest
6262
pedestrian route by passing in the relevant parameters as defined in
6363
<a href="https://www.here.com/docs/bundle/indoor-routing-api-v1-api-reference/page/index.html#tag/Indoor-Routing/operation/getRoute" target="_blank">Indoor Routing API</a>.

indoor-map-with-pedestrian-route-from-a-to-b/demo.js renamed to indoor-map-with-route-from-a-to-b/demo.js

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,26 @@
22
* Example for Indoor Map for JSMapsApi.
33
*/
44

5-
// Replace with your HERE platform app api key
6-
const yourApikey = 'ZKBUeAgkzH4JWhg93AA7cIE_kZotbMGhVI0_UYC0COY';
7-
85
// Replace with your indoor map platform collection hrn
9-
const indoorMapHrn = 'hrn:here:data::org651595200:indoormap-ed6d5667-cfe0-4748-bbf5-88b00e7e3b21-collection';
6+
var indoorMapHrn = 'hrn:here:data::org651595200:indoormap-ed6d5667-cfe0-4748-bbf5-88b00e7e3b21-collection';
107

11-
const venuesProvider = null
12-
const venuesService = null
8+
var venuesProvider = null
9+
var venuesService = null
1310
// Specify the venue ID for your map. Examples of the map ID mentioned below.
1411
// For legacy maps, you can continue to use the numeric value.
1512
// Examples:
1613
// indoormap-00000000-0000-4000-a000-000000007348 for Zurich Airport (legacy id 7348)
1714
// indoormap-00000000-0000-4000-a000-000000027158 for Tiefgarage Riem Arcaden APCOA Parking garage (legacy id 27158)
1815
// indoormap-00000000-0000-4000-a000-000000022766 for Mall of Berlin (legacy id 22766)
19-
const venueId = 'indoormap-00000000-0000-4000-a000-000000007348';
16+
var venueId = 'indoormap-00000000-0000-4000-a000-000000022766';
2017

2118
// Set to false if base map is not needed to be displayed.
22-
const showBaseMap = true;
19+
var showBaseMap = true;
2320

2421
// Optional, list of label text preferences to override.
25-
const labelTextPreferenceOverride = [
26-
H.venues.Service2.LABEL_TEXT_PREFERENCE_OVERRIDE.OCCUPANT_NAMES,
27-
H.venues.Service2.LABEL_TEXT_PREFERENCE_OVERRIDE.SPACE_NAME
22+
var labelTextPreferenceOverride = [
23+
H.venues.Service.LABEL_TEXT_PREFERENCE_OVERRIDE.OCCUPANT_NAMES,
24+
H.venues.Service.LABEL_TEXT_PREFERENCE_OVERRIDE.SPACE_NAME
2825
]
2926

3027
/**
@@ -38,14 +35,8 @@ function addVenueToMap(map, platform) {
3835
venuesProvider = new H.venues.Provider();
3936

4037
// Get an instance of the Indoor Maps service using a valid apikey for Indoor Maps
41-
venuesService = platform.getVenuesService({ apikey: yourApikey, hrn: indoorMapHrn }, 2);
42-
43-
// Use venuesService.getMapInfoList to retrieve the list of Indoor maps from the given HRN
44-
venuesService.getMapInfoList().then(mapInfoList => {
45-
mapInfoList.forEach(mapInfo => {
46-
console.log("Indoor map id: " + mapInfo.mapId + ", map name: " + mapInfo.mapName);
47-
});
48-
});
38+
// In your own code, replace variable "yourToken" with your own token to access indoor routing.
39+
venuesService = platform.getVenuesService({ token: "yourToken", hrn: indoorMapHrn });
4940

5041
// Indoor Maps service provides a loadVenue method. Optionally, overriding the label preferences
5142
venuesService.loadVenue(venueId, { labelTextPreferenceOverride }).then((venue) => {
@@ -54,7 +45,7 @@ function addVenueToMap(map, platform) {
5445
venuesProvider.setActiveVenue(venue);
5546

5647
// create a tile layer for the Indoor Maps provider
57-
const venueLayer = new H.map.layer.TileLayer(venuesProvider);
48+
var venueLayer = new H.map.layer.TileLayer(venuesProvider);
5849
if (showBaseMap) {
5950
// Add venueLayer to the base layer
6051
map.addLayer(venueLayer);
@@ -67,11 +58,11 @@ function addVenueToMap(map, platform) {
6758
map.setCenter(venue.getCenter());
6859

6960
// Create a level control
70-
const levelControl = new H.venues.ui.LevelControl(venue);
61+
var levelControl = new H.venues.ui.LevelControl(venue);
7162
ui.addControl('level-control', levelControl);
7263

7364
// Create a drawing control:
74-
const drawingControl = new H.venues.ui.DrawingControl(venue);
65+
var drawingControl = new H.venues.ui.DrawingControl(venue);
7566
ui.addControl('drawing-control', drawingControl);
7667
});
7768
}
@@ -86,11 +77,11 @@ function addVenueToMap(map, platform) {
8677
async function calculateIndoorRouteFromAtoB(map) {
8778

8879
// Instantiate (and display) a map:
89-
const origin = { lat: 47.45146718297871, lng: 8.56116163852909, levelId: "level-9050", venueId: "indoormap-00000000-0000-4000-a000-000000007348" };
90-
const destination = { lat: 47.45264049318705, lng: 8.562764022046945, levelId: "level-9050", venueId: "indoormap-00000000-0000-4000-a000-000000007348" };
80+
var origin = { lat: 47.45146718297871, lng: 8.56116163852909, levelId: "level-9050", venueId: "indoormap-00000000-0000-4000-a000-000000007348" };
81+
var destination = { lat: 47.45264049318705, lng: 8.562764022046945, levelId: "level-9050", venueId: "indoormap-00000000-0000-4000-a000-000000007348" };
9182

9283
// Create the parameters for the indoor routing request:
93-
const routingParameters = {
84+
var routingParameters = {
9485
routingMode: "fast",
9586
transportMode: "pedestrian",
9687
// The start point of the route:
@@ -99,17 +90,17 @@ async function calculateIndoorRouteFromAtoB(map) {
9990
destination: `${destination.lat},${destination.lng},${destination.levelId},${destination.venueId}`,
10091
};
10192
try{
102-
const res = await venuesService.calculateRoute(routingParameters);
93+
var res = await venuesService.calculateRoute(routingParameters);
10394
if (res?.routes && res.routes.length > 0) {
10495
// Create route objects using route response data
105-
const route = new H.venues.Route2(res.routes[0]);
96+
var route = new H.venues.Route(res.routes[0]);
10697
// Link route map objects with venue levels for automatic visibility updates:
107-
const indoorObjects = route.getIndoorObjects();
98+
var indoorObjects = route.getIndoorObjects();
10899

109100
for (let venueId in indoorObjects) {
110101
for (let levelIndex in indoorObjects[venueId]) {
111-
const venue = venuesProvider.getVenue(venueId);
112-
const objectGroup = indoorObjects[venueId][levelIndex];
102+
var venue = venuesProvider.getVenue(venueId);
103+
var objectGroup = indoorObjects[venueId][levelIndex];
113104
map.addObject(objectGroup);
114105
venue.setMapObjects(objectGroup.getObjects(), levelIndex);
115106
}
@@ -127,7 +118,7 @@ async function calculateIndoorRouteFromAtoB(map) {
127118
// Step 1: initialize communication with the platform
128119
// In your own code, replace variable window.apikey with your own apikey
129120
var platform = new H.service.Platform({
130-
apikey: yourApikey
121+
apikey: window.apikey
131122
});
132123
var defaultLayers = platform.createDefaultLayers();
133124

meta.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,12 @@
454454
"title": "Indoor Map - Restrict map movement",
455455
"shortDescription": "Indoor Map - Restrict map movement",
456456
"published": true
457+
},
458+
{
459+
"uid": "indoor-map-with-route-from-a-to-b",
460+
"title": "Indoor Map with Route from A to B",
461+
"shortDescription": "Use Here Indoor Maps service to calculate route on a indoor map",
462+
"published": true
457463
}
458464
]
459465
}

0 commit comments

Comments
 (0)