Maps API for Javascript

China specific
Maps API for JavaScript Developer's Guide

H.service.PlacesService

Class Summary

Extends: H.service.AbstractRestService

This service implements a low-level Places (Search) API access. Please refer to API documentation for providing parameters and handling response objects.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

search (searchParams, onResult, onError) : {H.util.ICancelable}

This method triggers the Places API 'search' entry point. Please refer to documentation for parameter specification and response handling.

Class Description

This service implements a low-level Places (Search) API access. Please refer to API documentation for providing parameters and handling response objects.

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

Example

// Assumption: platform is instantiated
platform.getPlacesService().search({
 'at': '31.20293879498189,121.37597626686392',
 'q': 'pizza',
}, console.log, console.error);

Constructor Details

H.service.PlacesService(opt_options)

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

Method Details

This method triggers the Places API 'search' entry point. Please refer to documentation for parameter specification and response handling.

Parameters:
 
searchParams:
{H.service.ServiceParameters}
 
An object containing Places API search entry point parameters, please refer to Places API documentation
onResult:
{function(H.service.ServiceResult)}
 
A callback which is called when result is available
onError:
{function(Error)}
 
A callback which is called when an error occurs
Returns:
 
{H.util.ICancelable}
a handle that allows to cancel the request.