Maps API for JavaScript Developer's Guide

H.service.GeocodingService

Class Summary

Extends: H.service.AbstractRestService

This class encapsulates the Geocoding REST API in a service stub, providing methods to access its resources.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

geocode (geocodingParams, onResult, onError) : {H.service.JsonpRequestHandle}

This method sends a geocoding request to the Geocoder REST API and calls the onResult callback function once the service response becomes available (providing a H.service.ServiceResult object) or the onError callback if a communication error occurs.

reverseGeocode (reverseGeocodingParams, onResult, onError) : {H.service.JsonpRequestHandle}

This method sends a reverse geocoding request to Geocoder REST API and calls the onResult callback function once the service response becomes available (providing a H.service.ServiceResult object) or the onError callback if a communication error occurs.

search (searchParams, onResult, onError) : {H.service.JsonpRequestHandle}

This method sends a landmark search request to the Geocoder REST API and calls the onResult callback function once the service response becomes available (providing a H.service.ServiceResult object) or the onError callback if a communication error occurs.

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.

Class Description

This class encapsulates the Geocoding REST API in a service stub, providing methods to access its resources.

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

Example

// Assumption: the platform is instantiated
geocoder = platform.getGeocodingService();

var geocodingParams = {
    searchText: '425 W Randolph Street, Chicago'
  },
  onResult = function(result) {
    console.log(result.Response.View[0].Result[0].Location.DisplayPosition);
  },
  onError = function(error) {
     console.log(error);
  };
geocoder.geocode(geocodingParams, onResult, onError);

Constructor Details

H.service.GeocodingService(opt_options)

Parameters:
 
opt_options:
{H.service.GeocodingService.Options=} [optional]
 
An object containing configuration options for GeocodingService

Method Details

geocode (geocodingParams, onResult, onError) : {H.service.JsonpRequestHandle}

This method sends a geocoding request to the Geocoder REST API and calls the onResult callback function once the service response becomes available (providing a H.service.ServiceResult object) or the onError callback if a communication error occurs.

Please refer to the Geocoder REST API documentation for information on available parameters and the response object structure.

Parameters:
 
geocodingParams:
{H.service.ServiceParameters}
 
An object containing the service parameters to be sent with the geocoding request.
onResult:
{function(H.service.ServiceResult)}
 
A callback function to be called once the Geocoder REST API provides a response to the request.
onError:
{function(Error)}
 
A callback function to be called if a communication error occurs during the JSON-P request
Returns:
 
{H.service.JsonpRequestHandle}
A JSON-P request handle

reverseGeocode (reverseGeocodingParams, onResult, onError) : {H.service.JsonpRequestHandle}

This method sends a reverse geocoding request to Geocoder REST API and calls the onResult callback function once the service response becomes available (providing a H.service.ServiceResult object) or the onError callback if a communication error occurs.

Please refer to the Geocoder REST API documentation for information on available parameters and the response object structure.

Parameters:
 
reverseGeocodingParams:
{H.service.ServiceParameters}
 
An object containing the service parameters to be sent with the reverse geocoding request
onResult:
{function(H.service.ServiceResult)}
 
A callback function to be called once the Geocoder REST API provides a response to the request.
onError:
{function(Error)}
 
A callback function to be called if a communication error occurs during the JSON-P request
Returns:
 
{H.service.JsonpRequestHandle}
A JSON-P request handle

This method sends a landmark search request to the Geocoder REST API and calls the onResult callback function once the service response becomes available (providing a H.service.ServiceResult object) or the onError callback if a communication error occurs.

Please refer to the Geocoder REST API documentation for information on available parameters and the response object structure.

Parameters:
 
searchParams:
{H.service.ServiceParameters}
 
An object containing the service parameters to be sent with the landmark search request
onResult:
{function(H.service.ServiceResult)}
 
A callback function to be called once the Geocoder REST API provides a response to the request
onError:
{function(Error)}
 
A callback function to be called if a communication error occurs during the JSON-P request
Returns:
 
{H.service.JsonpRequestHandle}
A JSON-P request handle

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)
appCode:
{string}
 
The application code to identify the client against the platform (mandatory)
useHTTPS:
{boolean}
 
A value indicating whether secure communication should be used (true), the default is false
useCIT:
{boolean}
 
A value indicating whether Customer Integration Testing should be 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 provided, 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

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.