Maps API for JavaScript Developer's Guide

H.service.extension.geofencing.Service

Class Summary

Extends: H.service.AbstractRestService

This class encapsulates the Geofencing Extension API in a service stub, providing methods to access its resources. Refer to the REST service documentation for the description of service parameters and response objects.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

request (entryPoint, params, onResult, onError) : {H.util.ICancelable}

This method fetches resource with the provided name from the Geofencing Extension API.

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

This class encapsulates the Geofencing Extension API in a service stub, providing methods to access its resources. Refer to the REST service documentation for the description of service parameters and response objects.

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

Example

// Assumption: the platform is instantiated
geofencingService = platform.getGeofencingService();

Constructor Details

H.service.extension.geofencing.Service(opt_options)

Parameters:
 
opt_options:
{H.service.extension.geofencing.Service.Options=} [optional]
 
An optional service parameters

Method Details

request (entryPoint, params, onResult, onError) : {H.util.ICancelable}

This method fetches resource with the provided name from the Geofencing Extension API.

Example

// Search for geo fence geometries within a given radius around the asset position
// Assumption: the platform is instantiated
var service = platform.getGeofencingService();
service.request(
  H.service.extension.geofencing.Service.EntryPoint.SEARCH_PROXIMITY,
  {
    'layer_ids': ['LAYER1', 'LAYER2'],
    'proximity': '52.53,13.38,100',
    'key_attributes': ['NAME']
  },
  console.log, console.error);
Parameters:
 
entryPoint:
{H.service.extension.geofencing.Service.EntryPoint}
 
The entry point of the GFE API.
params:
{H.service.ServiceParameters}
 
A key-value map of query parameters to use for the request.
onResult:
{function(H.service.ServiceResult)}
 
The callback which is called when result is returned
onError:
{function(Error)}
 
The callback which is called when error occurred (i.e request timeout, or server error)
Returns:
 
{H.util.ICancelable}
a handle that allows to cancel the request.
Throws:
 
{H.lang.InvalidArgumentError}
 
If passed arguments are invalid

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