Places API Reference

Contents

UI API

 
nokia

Data API

 
nokia

jsMotif

 
jsMotif

Namespace nokia.places.placesManager

Namespace Summary

The namespace placesManager defines functions that communicate with the Places server to get and post place-related data. The functions require a place id that can be obtained by performing searches via nokia.places.searchManager.

Method Summary

getMedia (params)
This function retrieves images for place.
getPlaceData (params)
This function retrieves place data for the given place id.
getRating (params)
This function retrieves place ratings for the given place id.
getReviews (params)
This function retrieves reviews for the given place id.
postRating (params)
This function posts rating for a given place.

Method Detail

getMedia (params)
This function retrieves images for place.
Parameters:
{Object} params
An object containing the following request parameters:
  • placeId {String} - id of a place (from nokia.places.objects.Place), required
  • onComplete {Function} - a function to be called when the request has been completed, required; the function must accept as arguments responseData and status described under Returns below
  • start {Number} - the starting offset for results, optional
  • limit {Number} - maximum number of results to be returned, optional
Returns:
The return value is made available asynchronously as an argument passed to the onComplete handler and it is a list (nokia.places.objects.List) of elements of the type nokia.places.objects.Media; onComplete's second argument is status, a {String} constant with the value of 'ok' to indicate success or 'error' to indicate request failure or time-out
getPlaceData (params)
This function retrieves place data for the given place id.
Parameters:
{Object} params
An object containing request parameters:
  • placeId {String} - the id of a place (from nokia.places.objects.Place), required
  • onComplete {Function} - a function to be called when the request has been completed, required; the function must accept as arguments responseData, which is a place object nokia.places.objects.Place 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
  • basicInfo {Boolean} - a flag, if set to true only place core data are returned, otherwise all available data are returned, optional
Returns:
The return value is made available asynchronously as an argument passed to the onComplete handler and it is a place object nokia.places.objects.Place; note that onComplete also receives a second argument indicating the status of the request (see also description of onComplete under getPlaceData() Parameters above)
getRating (params)
This function retrieves place ratings for the given place id.
Parameters:
{Object} params
An object containing request parameters:
  • placeId {String} - id of a place (from nokia.places.objects.Place), required
  • onComplete {Function} - a function to be called when the request has been completed, required; the function must accept two arguments responseData and status described under Returns below
Returns:
The return value is made available asynchronously as an argument passed to the onComplete handler and it is a rating object, for example, {value:4,count: 120} (see also nokia.places.objects.Review); onComplete also receives a second argument, status, which is a {String} constant with the value of 'ok' to indicate success or 'error' to indicate request failure or time-out
getReviews (params)
This function retrieves reviews for the given place id.
Parameters:
{Object} params
An object containing the following parameters:
  • placeId {String} - id of a place (from nokia.places.objects.Place), required
  • onComplete {Function} - a function to be called when the request has been completed, required; the function must accept as arguments responseData and status described under Returns below
  • start {Number} - optional result start offset
  • limit {Number} - optional limit of returned results
Returns:
The return value is made available asynchronously as an argument passed to the onComplete handler and it is a list (nokia.places.objects.List) of elements of the type nokia.places.objects.Review; onComplete also receives a second argument, status, which is a {String} constant with the value of 'ok' to indicate success or 'error' to indicate request failure or time-out
postRating (params)
This function posts rating for a given place.
Parameters:
{Object} params
An object containing the following parameters:
  • placeId {String} - id of a place (from nokia.places.objects.Place), required
  • ratingValue {Number} - a rating value, required
  • onComplete {Function} - a function to be called when the request has been completed, required; the function must accept as arguments responseData and status described under Returns below
Returns:
The return value is made available asynchronously as an argument passed to the onComplete handler and it is a rating object containing the calculated rating for a place, for example, {value:4,count: 120} (see also nokia.places.objects.Review); onComplete also receives a second argument, status, which is a {String} constant with the value of 'ok' to indicate success or 'error' to indicate request failure or time-out

Copyright © 2011 Nokia. All rights reserved. Terms and Conditions