Class: Service

H.venues.Service

new H.venues.Service (opt_options) Deprecated : since 3.1.32.0

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

H.venues.Service.CONFIG_KEY string staticconstant

The property name to use when specifying options for this service within the H.service.Platform.Options#servicesConfig.

Methods

calculateRoute (options)Promise.<Object> Deprecated : since 3.1.30.15

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
options H.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
venueId number

Venue ID to load

opt_options Object

Options to use for venue loading

Name Type Default Description
isMetaEnabled boolean true optional

Set to false to disable metadata

isIconsEnabled boolean 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

H.venues.Service.IndoorWaypoint

This type encapsulates waypoint information for indoor routing calculation.

Properties:
Name Type Description
coordinates array

Latitude and Longitude of the location

venueId number

The HERE Venue id, if the point is located indoor

levelId number

The HERE Level id, if the point is located indoor

H.venues.Service.Options

This type encapsulates configuration (initialization) options for an instance of venues Service.

Properties:
Name Type Argument Default Description
apikey string

The API key to use venues Service

baseUrl H.service.Url <optional>

The base URL of the Venues service. If supplied, it overrides the default

useLegacy boolean <optional>
false

Whether to use legacy venue services

hrn string

Venues Map catalog HRN

H.venues.Service.RoutingOptions

This type encapsulates routing options for indoor routing calculation.

Properties:
Name Type Description
origin H.venues.Service.IndoorWaypoint

Location to use as origin for the route

destination H.venues.Service.IndoorWaypoint

Location to use as destination

transportMode string

Mode of transport to be used for route calculation. Available values: "bicycle", "car", "pedestrian", "truck".

routingMode string

Specifies which optimization is applied during route calculation. Available values: "fast", "short". Default is "fast".

pedestrian object

Specifies options for pedestrian routing. Available option is "speed" with values between 0 to 2. Ex. { "speed": 0 }. Default is 1.

avoid object

Avoid routes that use certain features. Available for avoid: "elevator", "stairs", "escalator", "ramp", "moving-walkway", "transition" Ex. { avoid: { features: "elevator,ramp" }}