Maps API for JavaScript Developer's Guide

H.service.PlacesService

Class Summary

Extends: H.service.AbstractRestService

Places service implements a low level places RestApi access. Please refer to Restful API documentation for providing parameters and handling response objects.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

request (entryPoint, entryPointParams, onResult, onError) : {H.service.JsonpRequestHandle}

This is generic method to query places RestAPI.

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

Function triggers places api 'search' entry point. Please refer to documentation for parameter specification and response handling.

suggest (suggestParams, onResult, onError) : {H.service.JsonpRequestHandle}

Function triggers places api 'suggestions' entry point. Please refer to documentation for parameter specification and response handling.

explore (exploreParams, onResult, onError) : {H.service.JsonpRequestHandle}

Function triggers places api 'explore' entry point. Please refer to documentation for parameter specification and response handling.

around (aroundParams, onResult, onError) : {H.service.JsonpRequestHandle}

Function triggers places api 'around' entry point. Please refer to documentation for parameter specification and response handling.

here (hereParams, onResult, onError) : {H.service.JsonpRequestHandle}

Function triggers places api 'here' entry point. Please refer to documentation for parameter specification and response handling.

categories (categoriesParams, onResult, onError) : {H.service.JsonpRequestHandle}

Function triggers places api 'categories' entry point. Please refer to documentation for parameter specification and response handling.

follow (hyperlink, onResult, onError, opt_additionalParameters) : {H.service.JsonpRequestHandle}

This method should be used to follow hyperlinks available in results returned by dicovery queries.

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

Places service implements a low level places RestApi access. Please refer to Restful API documentation for providing parameters and handling response objects.

Entry point parameters are specified as objects as key:value pairs which are transformed to URL parameters. Request headers can be specified along with entry point parameters.

Example

// assuming that platform was already instantiated
var places = platform.getPlacesService();
places.search({
 'at': '52.5044,13.3909',
 'q': 'pizza',
 'Accept-Language': 'de'
}, function(resp) {
 //handle response
 console.log(resp);
}, function(resp) {
 //handle network error
 console.log('ERROR: '+resp);
});

Constructor Details

H.service.PlacesService(opt_options)

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

Method Details

request (entryPoint, entryPointParams, onResult, onError) : {H.service.JsonpRequestHandle}

This is generic method to query places RestAPI.

Example

// assuming that platform was already instantiated
var places = platform.getPlacesService(),
  entryPoint = H.service.PlacesService.EntryPoint;
places.request(entryPoint.SEARCH, { 'at': '52.5044,13.3909', 'q': 'pizza'}, function(resp) {
 console.log(resp);
}, function(resp) {
 console.log('ERROR: '+resp);
});
Parameters:
 
entryPoint:
{string}
 
can be one of available entry points H.service.PlacesService.EntryPoint i.e value of H.service.PlacesService.EntryPoint.SEARCH
entryPointParams:
{Object}
 
parameter map key value pairs will be transformed into the url key=value parametes. For entry point parameters description please refer to places restful api documentation documentation for available parameters for chose entry point
onResult:
{Function}
 
callback which is called when result is returned
onError:
{Function}
 
callback which is called when error occured (i.e request timeout)
Returns:
 
{H.service.JsonpRequestHandle}
jsonp request handle

Function triggers places api 'search' entry point. Please refer to documentation for parameter specification and response handling.

Parameters:
 
searchParams:
{H.service.ServiceParameters}
 
places api search entry point parameters please refer to places api documentation
onResult:
{Function}
 
onError:
{Function}
 
Returns:
 
{H.service.JsonpRequestHandle}
jsonp request handle

suggest (suggestParams, onResult, onError) : {H.service.JsonpRequestHandle}

Function triggers places api 'suggestions' entry point. Please refer to documentation for parameter specification and response handling.

Parameters:
 
suggestParams:
{H.service.ServiceParameters}
 
places api suggest entry point parameters please refer to places api documentation
onResult:
{Function}
 
onError:
{Function}
 
Returns:
 
{H.service.JsonpRequestHandle}
jsonp request handle

explore (exploreParams, onResult, onError) : {H.service.JsonpRequestHandle}

Function triggers places api 'explore' entry point. Please refer to documentation for parameter specification and response handling.

Parameters:
 
exploreParams:
{H.service.ServiceParameters}
 
places api explore entry point parameters please refer to places api documentation
onResult:
{Function}
 
onError:
{Function}
 
Returns:
 
{H.service.JsonpRequestHandle}
jsonp request handle

around (aroundParams, onResult, onError) : {H.service.JsonpRequestHandle}

Function triggers places api 'around' entry point. Please refer to documentation for parameter specification and response handling.

Parameters:
 
aroundParams:
{H.service.ServiceParameters}
 
places api around entry point parameters please refer to places api documentation
onResult:
{Function}
 
onError:
{Function}
 
Returns:
 
{H.service.JsonpRequestHandle}
jsonp request handle

here (hereParams, onResult, onError) : {H.service.JsonpRequestHandle}

Function triggers places api 'here' entry point. Please refer to documentation for parameter specification and response handling.

Parameters:
 
hereParams:
{H.service.ServiceParameters}
 
places api here entry point parameters please refer to places api documentation
onResult:
{Function}
 
onError:
{Function}
 
Returns:
 
{H.service.JsonpRequestHandle}
jsonp request handle

categories (categoriesParams, onResult, onError) : {H.service.JsonpRequestHandle}

Function triggers places api 'categories' entry point. Please refer to documentation for parameter specification and response handling.

Parameters:
 
categoriesParams:
{H.service.ServiceParameters}
 
places api here entry point parameters please refer to places api documentation
onResult:
{Function}
 
onError:
{Function}
 
Returns:
 
{H.service.JsonpRequestHandle}
jsonp request handle

follow (hyperlink, onResult, onError, opt_additionalParameters) : {H.service.JsonpRequestHandle}

This method should be used to follow hyperlinks available in results returned by dicovery queries.

Example

// assuming that platform was already instantiated
var places = platform.getPlacesService(),
  entryPoint = H.service.PlacesService.EntryPoint;
places.request(entryPoint.SEARCH, { 'at': '52.5044,13.3909', 'q': 'pizza'}, function(response) {
   var items = response.results.items;
   places.follow(items[0].href, function(resp) {
   console.log(resp);
   },
   function(resp) {
   console.log('ERROR: '+resp);
   });
}, function(resp) {
 console.log('ERROR: '+resp);
});
Parameters:
 
hyperlink:
{string}
 
onResult:
{Function}
 
onError:
{Function}
 
opt_additionalParameters:
{Object=} [optional]
 
additional parameters to send with request
Returns:
 
{H.service.JsonpRequestHandle}
jsonp resquest 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 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.