Maps API for JavaScript Developer's Guide

H.service.venues.Service

Class Summary

Implements: H.service.IConfigurable

Extends: H.util.EventTarget

This class encapsulates methods to call Venue Maps API endpoints.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

discover (serviceParams, onResult, onError)

This method sends a discovery request to the Venue Maps API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult object, or the onError callback if a communication error occured.

createTileLayer (opt_options) : {H.map.layer.TileLayer}

This method creates a tile layer which can be added to the map in order to see the venues. It uses Interaction Tile endpoint of the Venue Maps API, more at http://developer.here.com/rest-apis/documentation/venue-maps/topics/quick-start-get-interaction-tile.html.

getState () : {H.service.venues.Service.State}

Method returns current state of the service.

configure (appId, appCode, useHTTPS, useCIT, opt_baseUrl) : {H.service.IConfigurable}

This methods receive configuration parameters from the platform, that can be used by the object implementing the interface.

Events Summary

Table 2. Events
Events

statechange : {H.util.Event}

This event is fired once service state changes, see H.service.venues.Service#getState. If state is H.service.venues.Service.State#ERROR, fired event has an errorCode property.

Class Description

This class encapsulates methods to call Venue Maps API endpoints.

An instance of this class can be retrieved by calling the factory method on a platform instance. H.service.Platform#getVenueService.

Example

// assuming that platform was already instantiated
var venueService = platform.getVenueService(),
  venueLayer = venueService.createTileLayer();
map.addLayer(venueLayer);

Constructor Details

H.service.venues.Service(opt_options)

Parameters:
 
opt_options:
{H.service.venues.Service.Options=} [optional]
 
additional service parameters

Method Details

discover (serviceParams, onResult, onError)

This method sends a discovery request to the Venue Maps API and calls the onResult callback function once the service response was received - providing a H.service.ServiceResult object, or the onError callback if a communication error occured.

Please refer to the Venue Maps API Discovery endpoint http://developer.here.com/rest-apis/documentation/venue-maps/topics/request-constructing-discovery.html for information on available parameters and the response object structure.

Example

  // assuming that platform was already instantiated
  venueService = platform.getVenueService();
  // Listen for the event when venue service is "ready"
  venueService.addEventListener('statechange', function() {
  if (venueService.getState() === H.service.venues.Service.State['READY']) {
    // Trigger "discovery" request to find out the venues in the specified bounding box
    venueService.discover({
    at: '48.103030448017215,-93.65234375000001,-3.3445330159738336,143.65234375'
    }, function(result) {
    console.log(result);
    }, function (err) {
    console.log(err);
    });
  }
  });
Parameters:
 
serviceParams:
{H.service.ServiceParameters}
 
the service parameters to be sent with the discovery request
onResult:
{function(H.service.ServiceResult)}
 
this function will be called once the Venue Maps API provides a response to the request
onError:
{function(string)}
 
this function will be called if a communication error occurs during request and error type is passed as an argument

createTileLayer (opt_options) : {H.map.layer.TileLayer}

This method creates a tile layer which can be added to the map in order to see the venues. It uses Interaction Tile endpoint of the Venue Maps API, more at http://developer.here.com/rest-apis/documentation/venue-maps/topics/quick-start-get-interaction-tile.html.

Example

  // assuming that platform was already instantiated
  venueService = platform.getVenueService();

  // Create tile layer and pass function to style the spaces
  customVenueLayer = venueService.createTileLayer({
  onSpaceCreated: function(space) {
    // Note that you can style spaces according to their category, venue category or id

    // Get existing default style of the space and override just the "fillColor" property
    space.setStyle(space.getStyle().getCopy({
    fillColor: 'rgba(100,140,156,0.6)'
    }));
  }
  });

  // Add layer to the map
  map.addLayer(customVenueLayer);
Parameters:
 
opt_options:
{H.service.venues.TileProvider.Options=} [optional]
 
Tile provider options
Returns:
 
{H.map.layer.TileLayer}
the tile layer

getState () : {H.service.venues.Service.State}

Method returns current state of the service.

Returns:
 
{H.service.venues.Service.State}
State of the service

configure (appId, appCode, useHTTPS, useCIT, opt_baseUrl) : {H.service.IConfigurable}

This methods receive configuration parameters from the platform, that can be used by the object implementing the interface.

Parameters:
 
appId:
{string}
 
The application ID to identify the client against the platform (mandatory to provide)
appCode:
{string}
 
The application code to identify the client against the platform (mandatory to provide)
useHTTPS:
{boolean}
 
Indicates whether secure communication should be used, default is false
useCIT:
{boolean}
 
Indicates whether the Customer Integration Testing should be used, default is false
opt_baseUrl:
{H.service.Url=} [optional]
 
The base URL of the platform, default is http://api.here.com. Note that if useHTTPS flag is passed it will override the URL scheme specified in the opt_baseUrl to use HTTPS.
Returns:
 
{H.service.IConfigurable}

Event Details

statechange: {H.util.Event}

This event is fired once service state changes, see H.service.venues.Service#getState. If state is H.service.venues.Service.State#ERROR, fired event has an errorCode property.

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.