'get a list of locations for indoor routing
I'm trying to add indoor routing to our HERE map. I'm trying to use the example from the sample site to start with. However I don't know the longitude and latitude of the rooms in our building, or the levelId. Is it possible to get this data from api?
below is the code I'm using:
function addRouteToMap(map) {
let venuesRoute = venuesService;
venuesRoute.calculateRoute({
origin: { coordinates: [47.450022, 8.563396]},
destination: { coordinates: [47.451259,8.560136], venueId: 24860, levelId: 9049 },
transportMode: 'pedestrian',
avoid: { features: 'elevator' }
}).then((result) => {
// Get objects for the calculated route
const route = new H.venues.Route(result.routes[0]);
const indoorObjects = route.getIndoorObjects();
// Link route map objects with the Indoor Map levels for automatic visibility updates:
for (let venueId in indoorObjects) {
for (let levelIndex in indoorObjects[venueId]) {
const venue = venuesProvider.getVenue(venueId);
const objectGroup = indoorObjects[venueId][levelIndex];
map.addObject(objectGroup);
venue.setMapObjects(objectGroup.getObjects(), levelIndex);
}
}
// Get H.map.Group that contains map objects representing outdoor segments:
const outdoorObjects = route.getOutdoorObjects();
map.addObject(outdoorObjects);
});
}
Solution 1:[1]
Room coordinates are centre points of an indoor space or geometry, they can be fetched by getCenter() method where you would need the geometry id as an input. A level object of the geometry can be fetched by getLevel() method, if you have the space id, or with getLevels() to fetch them all. You may also use search() method to retrieve geometry arrays.
The addEventListener also is an option. The event listener helps get the geometry on say event ‘tap’.
Please refer to the API references for more help at https://developer.here.com/documentation/maps/3.1.30.13/api_reference/H.venues.Geometry.html
Indoor Routing Service is currently provided as beta version, and we will discontinue that for a while to integrate indoor routing with HERE routing service.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | HERE Developer Support |