This class provides interface to the venue platform service
| Name | Type | Description |
|---|---|---|
opt_options |
H.venues.Service.Options |
Options used for venues API. |
Example
let venuesService = platform.getVenuesService({ apikey: 'APIKEY' });
venuesService.loadVenue(VENUE_ID).then((venue) => {
console.log(venue);
});
Members
-
The property name to use when specifying options for this service within the
H.service.Platform.Options#servicesConfig.
Methods
-
This method sends a request to Indoor Routing API to calculate a route between outdoor or indoor locations. For indoor queries provide HERE Venue and Level ids.
Please refer to the Indoor Routing documentation for information on available parameters and the response object structure.
Name Type Description optionsH.venues.Service.RoutingOptions Options for route calculation.
Returns:
Type Description Promise.<Object> Routing response Example
// Get instance of venue service const venueService = platform.getVenuesService(); // Request a route venueService.calculateRoute({ origin: { coordinates: [52.53,13.38] }, // Provide valid point coordinates, venueId and levelId destination: { coordinates: [52.53,13.39], venueId: VENUE_ID, levelId: LEVEL_ID }, transportMode: 'pedestrian' }).then((result) => { result.routes[0].sections.forEach((section) => { // Create a linestring to use as a point source for the route line let linestring = H.geo.LineString.fromFlexiblePolyline(section.polyline); // Create a polyline to display the route: let routeLine = new H.map.Polyline(linestring, { style: { strokeColor: 'blue', lineWidth: 3 } }); // Create a marker for the start point: let startMarker = new H.map.Marker(section.departure.place.location); // Create a marker for the end point: let endMarker = new H.map.Marker(section.arrival.place.location); // Add the route polyline and the two markers to the map: map.addObjects([routeLine, startMarker, endMarker]); // Set the map's viewport to make the whole route visible: map.getViewModel().setLookAtData({bounds: routeLine.getBoundingBox()}); }); }); -
loadVenue (venueId, opt_options)Promise.<(H.venues.Venue|never|never)> Deprecated : since 3.1.32.0
-
Load a venue from server
Name Type Description venueIdnumber Venue ID to load
opt_optionsObject Options to use for venue loading
Name Type Default Description isMetaEnabledboolean true optional Set to false to disable metadata
isIconsEnabledboolean true optional Set to false to disable icons
Returns:
Type Description Promise.<(H.venues.Venue|never|never)> Promise resolves the loaded venue object
Type Definitions
-
This type encapsulates waypoint information for indoor routing calculation.
Properties:
Name Type Description coordinatesarray Latitude and Longitude of the location
venueIdnumber The HERE Venue id, if the point is located indoor
levelIdnumber The HERE Level id, if the point is located indoor
-
This type encapsulates configuration (initialization) options for an instance of venues
Service.Properties:
Name Type Argument Default Description apikeystring The API key to use venues
ServicebaseUrlH.service.Url <optional>
The base URL of the Venues service. If supplied, it overrides the default
useLegacyboolean <optional>
false Whether to use legacy venue services
hrnstring Venues Map catalog HRN
-
This type encapsulates routing options for indoor routing calculation.
Properties:
Name Type Description originH.venues.Service.IndoorWaypoint Location to use as origin for the route
destinationH.venues.Service.IndoorWaypoint Location to use as destination
transportModestring Mode of transport to be used for route calculation. Available values: "bicycle", "car", "pedestrian", "truck".
routingModestring Specifies which optimization is applied during route calculation. Available values: "fast", "short". Default is "fast".
pedestrianobject Specifies options for pedestrian routing. Available option is "speed" with values between 0 to 2. Ex. { "speed": 0 }. Default is 1.
avoidobject Avoid routes that use certain features. Available for avoid: "elevator", "stairs", "escalator", "ramp", "moving-walkway", "transition" Ex. { avoid: { features: "elevator,ramp" }}