Maps API for JavaScript Developer's Guide

H.service.TrafficIncidentsService

Class Summary

Extends: H.service.AbstractRestService

TrafficIncindentsService provides functionality to the low level traffic incidents api Traffic API documentation where it is possible to retrieve traffic incident information on a tile basis

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

requestIncidents (serviceParams, onResult, onError) : {H.service.JsonpRequestHandle}

This method requests traffic incidents based on the service parameters provided.

requestIncidentsByTile (x, y, z, onResult, onError, opt_serviceParams) : {H.service.JsonpRequestHandle}

This method requests traffic incident information by tile coordinates

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

This method receives configuration parameters from the platform, that can be used by the object implementing the interface. The method must not be invoked directly.

Class Description

TrafficIncindentsService provides functionality to the low level traffic incidents api Traffic API documentation where it is possible to retrieve traffic incident information on a tile basis

Constructor Details

H.service.TrafficIncidentsService(opt_options)

Parameters:
 
opt_options:
{H.service.TrafficIncidentsService.Options=} [optional]
 

Method Details

requestIncidents (serviceParams, onResult, onError) : {H.service.JsonpRequestHandle}

This method requests traffic incidents based on the service parameters provided.

Parameters:
 
serviceParams:
{H.service.ServiceParameters}
 
onResult:
{function(H.service.ServiceResult)}
 
onError:
{function(Error)}
 

requestIncidentsByTile (x, y, z, onResult, onError, opt_serviceParams) : {H.service.JsonpRequestHandle}

This method requests traffic incident information by tile coordinates

Parameters:
 
x:
{number}
 
tile column number
y:
{number}
 
tile row number
z:
{number}
 
zoom level
onResult:
{function(H.service.ServiceResult)}
 
callback to handle service response
onError:
{function(Error)}
 
callback to handle communication error
opt_serviceParams:
{H.service.ServiceParameters=} [optional]
 
optional service parameters to be added to the request

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

This method receives configuration parameters from the platform, that can be used by the object implementing the interface. The method must not be invoked directly.

Example

// assuming that the configurable object exists and the variable name is "configurable"
var platform = new H.service.Platform({
  'app_id': [your app_id],
  'app_code': [your app_code],
})
platform.configure(configurable);
Parameters:
 
appId:
{string}
 
The application ID to identify the client against the platform (mandatory)
appCode:
{string}
 
The application code to identify the client against the platform (mandatory)
useHTTPS:
{boolean}
 
The indicator whether secure communication is used (true), the default is false
useCIT:
{boolean}
 
A value indicating whether Customer Integration Testing ("CIT") is used (true), the default is false
opt_baseUrl:
{H.service.Url=} [optional]
 
The base URL of the platform, the default is http://api.here.com. Note that if the useHTTPS flag is set to true, the URL scheme specified in the opt_baseUrl is overridden to use HTTPS.
Returns:
 
{H.service.IConfigurable}
An instance of IConfigurable reflecting the new configuration