This service is no longer being actively developed.
The H.service.SearchService could be used instead.
This service implements a low-level Places REST API access. Please refer to Restful 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.
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#getPlacesService on a platform instance.
| Name | Type | Description |
|---|---|---|
opt_options |
H.service.Options |
optional
Configuration options for places service |
Throws:
Example
// Assumption: platform is instantiated
platform.getPlacesService().search({
'at': '52.5044,13.3909',
'q': 'pizza',
'Accept-Language': 'de'
}, console.log, console.error);
Extends
Members
-
The property name to use when specifying options for this service within the
H.service.Platform.Options#servicesConfig. -
This object contains a list of available entry points.
Properties:
Name Description SEARCHSUGGESTEXPLOREAROUNDHERECATEGORIES
Methods
-
addEventListener (type, handler, opt_capture, opt_scope) inherited
-
This method adds a listener for a specific event.
Note that to prevent potential memory leaks, you must either call
removeEventListenerordisposeon the given object when you no longer need it.Name Type Description typestring The name of the event
handlerfunction An event handler function
opt_captureboolean optional trueindicates that the method should listen in the capture phase (bubble otherwise)opt_scopeObject optional An object defining the scope for the handler function
-
addOnDisposeCallback (callback, opt_scope) inherited
-
This method adds a callback which is triggered when the
EventTargetobject is being disposed.Name Type Description callbackfunction The callback function.
opt_scopeObject optional An optional scope for the callback function
-
around (aroundParams, onResult, onError)H.util.ICancelable
-
This method triggers the Places API 'around' entry point. Please refer to documentation for parameter specification and response handling.
Name Type Description aroundParamsH.service.ServiceParameters Contains Places API 'around' entry point parameters, please refer to Places API documentation
onResultfunction(H.service.ServiceResult) A callback which is called when result is available
onErrorfunction(Error) A callback which is called when an error occurs
Returns:
Type Description H.util.ICancelable A request handle -
categories (categoriesParams, onResult, onError)H.util.ICancelable
-
This method triggers the Places API 'categories' entry point. Please refer to documentation for parameter specification and response handling.
Name Type Description categoriesParamsH.service.ServiceParameters Contains Places API 'categories' entry point parameters, please refer to Places API documentation
onResultfunction(H.service.ServiceResult) A callback which is called when result is available
onErrorfunction(Error) A callback which is called when an error occurs
Returns:
Type Description H.util.ICancelable A request handle -
dispatchEvent (evt) inherited
-
This method dispatches an event on the
EventTargetobject.Name Type Description evtH.util.Event | string An object representing the event or a string with the event name
-
dispose () inherited
-
This method removes listeners from the given object. Classes that extend
EventTargetmay need to override this method in order to remove references to DOM Elements and additional listeners. -
explore (exploreParams, onResult, onError)H.util.ICancelable
-
This method triggers the Places API 'explore' entry point. Please refer to documentation for parameter specification and response handling.
Name Type Description exploreParamsH.service.ServiceParameters Contains Places API 'explore' entry point parameters, please refer to Places API documentation
onResultfunction(H.service.ServiceResult) A callback which is called when result is available
onErrorfunction(Error) A callback which is called when an error occurs
Returns:
Type Description H.util.ICancelable A request handle -
follow (hyperlink, onResult, onError, opt_additionalParameters)H.util.ICancelable
-
This method is used to follow hyperlinks in the results returned by discovery queries.
Name Type Description hyperlinkstring A string containing a hyperlink to follow
onResultfunction(H.service.ServiceResult) A callback which is called when result is available
onErrorfunction(Error) A callback which is called when an error occurs
opt_additionalParametersObject optional Contains additional parameters to send with the request
Returns:
Type Description H.util.ICancelable A request handle Example
// Assumption: the platform is instantiated var places = platform.getPlacesService(); places.request( H.service.PlacesService.EntryPoint.SEARCH, { 'at': '52.5044,13.3909', 'q': 'pizza' }, (response) => { places.follow(response.results.items[0].href, console.log, console.error); }, console.error); -
getUrl ()H.service.Url inherited
-
This method returns the configured service URL.
Returns:
Type Description H.service.Url -
here (hereParams, onResult, onError)H.util.ICancelable
-
This method triggers the Places API 'here' entry point. Please refer to documentation for parameter specification and response handling.
Name Type Description hereParamsH.service.ServiceParameters Contains Places API 'here' entry point parameters, please refer to Places API documentation
onResultfunction(H.service.ServiceResult) A callback which is called when result is available
onErrorfunction(Error) A callback which is called when an error occurs
Returns:
Type Description H.util.ICancelable A request handle -
removeEventListener (type, handler, opt_capture, opt_scope) inherited
-
This method removes a previously added listener from the
EventTargetinstance.Name Type Description typestring The name of the event
handlerfunction A previously added event handler
opt_captureboolean optional trueindicates that the method should listen in the capture phase (bubble otherwise)opt_scopeObject optional An object defining the scope for the handler function
-
request (entryPoint, entryPointParams, onResult, onError)H.util.ICancelable
-
This method implements a generic means of querying the Places REST API.
Name Type Description entryPointstring An identifier indicating one of the available entry points (
H.service.PlacesService.EntryPoint), for example,H.service.PlacesService.EntryPoint.SEARCHentryPointParamsObject Contains map key value pairs to be transformed into the URL parameters. For entry point parameters description, please refer to Places RESTful API documentation
onResultfunction(H.service.ServiceResult) A callback which is called when result is available
onErrorfunction(Error) A callback which is called when an error occurs (for example request timeout)
Returns:
Type Description H.util.ICancelable A request handle Example
// Assumption: the platform is instantiated platform.getPlacesService().request( H.service.PlacesService.EntryPoint.SEARCH, {'at': '52.5044,13.3909', 'q': 'pizza'}, console.log, console.error); -
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.
Name Type Description searchParamsH.service.ServiceParameters Contains Places API search entry point parameters, please refer to Places API documentation
onResultfunction(H.service.ServiceResult) A callback which is called when result is available
onErrorfunction(Error) A callback which is called when an error occurs
Returns:
Type Description H.util.ICancelable A request handle -
suggest (suggestParams, onResult, onError)H.util.ICancelable
-
This method triggers the Places API 'suggestions' entry point. Please refer to documentation for parameter specification and response handling.
Name Type Description suggestParamsH.service.ServiceParameters Contains Places API 'suggest' entry point parameters, please refer to Places API documentation
onResultfunction(H.service.ServiceResult) A callback which is called when result is available
onErrorfunction(Error) A callback which is called when an error occurs
Returns:
Type Description H.util.ICancelable A request handle