The namespace searchManager defines functions that allow you to use the
Places search service to search for places and to obtain search suggestions.
Searches for places can be viewed as a preliminary step to selecting a particular
place for which to retrieve detailed information, using the functions defined on
nokia.places.placesManager.
findPlaces
(params)
|
This function searches for places on the basis of the parameters specified by the caller. |
findPlacesByCategory
(params)
|
This function searches for places by category. |
findRecommendations
(params, includeRichContent)
|
This function retrieves recommendations for the location indicated by the caller. |
getCategories
(params)
|
This function retrieves the available (main) categories. |
reverseGeoCode
(params)
|
This method runs a reverse geocoding query based on the coordinates provided by the caller. |
suggestPlaces
(params)
|
This function retrieves suggestions that can be used with nokia.places.placesManager.findPlaces().
|
findPlaces
(params)
params
{String} searchTerm - search term, required
{Function} onComplete - a function to be called when the request has been completed, required;
the function must accept as arguments responseData, which is a place object
containing data returned by the Places back-end, and status, which is a {String}
constant with the value of 'OK' to indicate success or 'ERROR' to indicate request failure or
time-out
{Object} searchCenter - an object containing the latitude and longitude
of the starting point for the search ({latitude:'',longitude:''}); optional, if
provided, useGeoLocation is ignored
{Boolean} useGeoLocation - if true and searchCenter is not
provided, Places search tries to use the W3C Geolocation API to get the client location and use
it as the search center; if this parameter is false and searchCenter
is not provided, a global search is executed
{Number} start - the starting offset for results, optional
{Number} limit - maximum number of results to be returned, optional
onComplete handler; the responseData argument
contains a response view (nokia.places.objects.SearchResponseView)
findPlacesByCategory
(params)
params
{String} category - required; a string constant containing the valid name of a category
or a category id; you can obtain category names and ids from the list of available categories
returned by the method nokia.places.searchManager.getCategories()
{Function} onComplete - required; a function to be called when the request has been completed;
the function must accept as arguments responseData, which is a place object
containing data returned by the Places back-end, and status, which is a {String}
constant with the value of 'OK' to indicate success or 'ERROR' to indicate request failure or
time-out
{Object} searchCenter - optional; an object containing the latitude and longitude
of the starting point for the search ({latitude:'',longitude:''}); if this parameter is
provided, useGeoLocation is ignored
{Boolean} useGeoLocation - if true and searchCenter is not
provided, Places search tries to use the W3C Geolocation API to get the client location and use
it as the search center; if this parameter is false and searchCenter
is not provided, a global search is executed
{Number} start - optional; the starting offset for results
{Number} limit - optional; the maximum number of results to be returned
onComplete handler; the responseData argument
contains a response view nokia.places.objects.SearchResponseView
findRecommendations
(params, includeRichContent)
params
{String} placeId - id of a place (from nokia.places.objects.Place)
{Function} onComplete - a function to be called when the request has been
completed, required; the function must accept as arguments responseData
and status described below
{Object} searchCenter - an object containing the latitude and longitude
of the starting point for the search ({latitude:'',longitude:''}); the
parameter is required if boundingBox is not provided and vice versa
{Number} radius - radius in kilometers (default 3)
{Number} limit - maximum number of recommended places to return (default 3)
{Array | String} categories - an array of {String} objects containing category ids or
one {String} containing a category id; you can get category ids via the function
nokia.places.searchManager.getCategories()
{Object} boundingBox - can be specified instead of searchCenter;
it is an object with the structure: {topLeft: {latitude:'', longitude:''} ,
bottomRight: {latitude: '', longitude:''}}
includeRichContent
true, rich content for the recommended
places is retrieved provided that rich content is available and limit is lower
than 15 items; if false no attempt to retrieve rich content is made
onComplete handler; the responseData argument
contains a response view, which is an instance of nokia.places.objects.SearchResponseView
getCategories
(params)
nokia.places.objects.Category.
params
{Function} onComplete - a caller-defined function to handle incoming results
onComplete handler; the responseData argument
contains a tree like hash-map of instances of nokia.places.objects.Category
each object may have additional field categories where subcategories might be found
reverseGeoCode
(params)
params
latitude - {Number}, latitude in degrees in the range [-90 .. 90]; values outside
this range result in failed queries
longitude - {Number}, longitude in degrees in the range [-180 .. 180]; values outside
this range result in failed queries
onComplete - {Function}, a function to be called when the request has completed, required;
the function must accept as arguments:
responseData - an instance of nokia.places.objects.Place
containing data returned by the Places back-end
status - {String}, a constant, with the value of 'OK' to indicate success or 'ERROR'
to indicate request failure or time-out
onComplete handler; when status is 'OK', the argument
responseData contains a place object, which is an instance of nokia.places.objects.Place
suggestPlaces
(params)
nokia.places.placesManager.findPlaces().
params
{String} searchTerm - required; a suggestion query term
{Function} onComplete - required; a function to be called when the request has been completed;
the function must accept as arguments responseData, which is a place object
containing data returned by the Places back-end, and status, which is a {String}
constant with the value of 'OK' to indicate success or 'ERROR' to indicate request failure or
time-out
{Object} searchCenter - optional; an object containing the latitude and longitude
of the starting point for the search ({latitude:'',longitude:''}); if this parameter is
provided, useGeoLocation is ignored
{Boolean} useGeoLocation - if true and searchCenter is not
provided, Places search tries to use the W3C Geolocation API to get the client location and use
it as the search center; if this parameter is false and searchCenter
is not provided, a global search is executed
{Number} start - optional; the starting offset for results
{Number} limit - optional; the maximum number of results to be returned
responseData
passed to the handler function onComplete as a response view object
(nokia.places.objects.SearchResponseView)
Copyright © 2011 Nokia. All rights reserved. Terms and Conditions