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 with calls to its various resources implemented.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

geocode (geoodingParams, 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 was received - providing a H.service.ServiceResult object - or the onError callback if a communication error occured.

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 was received - providing a H.service.ServiceResult object - or the onError callback if a communication error occured.

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

This method sends a landmark search request to Geocoder REST 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.

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 with calls to its various resources implemented.

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

Example

// assuming that platform was already 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]
 

Method Details

geocode (geoodingParams, 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 was received - providing a H.service.ServiceResult object - or the onError callback if a communication error occured.

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

Parameters:
 
geoodingParams:
{H.service.ServiceParameters}
 
the service parameters to be sent with the geocoding request.
onResult:
{function(H.service.ServiceResult)}
 
this function will be called once the Geocoder REST API provides a response to the request.
onError:
{function(Error)}
 
this function will be called if a communication error occurs during the JSON-P request

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 was received - providing a H.service.ServiceResult object - or the onError callback if a communication error occured.

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

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

This method sends a landmark search request to Geocoder REST 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 Geocoder REST API documentation for information on available parameters and the response object structure.

Parameters:
 
searchParams:
{H.service.ServiceParameters}
 
the service parameters to be sent with the reverse geocoding request
onResult:
{function(H.service.ServiceResult)}
 
this function will be called once the Geocoder REST API provides a response to the request.
onError:
{function(Error)}
 
this function will be called if a communication error occurs during the JSON-P request

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}

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.