Maps API for JavaScript Developer's Guide

H.service.extension.geofencing.Service

Class Summary

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 ]

Property Summary

Table 1. Properties
Properties

static CONFIG_KEY : {string}

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

Method Summary

Table 2. Methods
Methods

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

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

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.

It's not allowed to call the constructor directly (an IllegalOperationError is thrown). Instead an instance of this Service can be retrieved by calling the factory method H.service.Platform#getGeofencingService on a platform instance.

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]
 
Configuration options for geofencing service

Property Details

static CONFIG_KEY: {string}

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

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