Places API Reference

Contents

UI API

 
nokia

Data API

 
nokia

jsMotif

 
jsMotif

Class nokia.places.PlaceList

Class Summary

This class defines a UI widget capable of displaying data for multiple places. A typical use case for this class is to display an interactive list of search results (see also nokia.places.SearchBox). If the data are rendered on more than one page, the class provides a means of navigating the pages. The class uses the template nokia.general.placelist to render the places data.

new nokia.places.PlaceList (params)

Method Summary

displayOnMap ([map, onIconClick])
This method renders current page results as icons on the Map.
This method retrieves the current page number from the PlaceList widget.
This method retrieves the data rendered on current page.
renderPage (page)
This method renders a chosen page (from the result set).
setData (data, (optional))
This method associates data with the given widget instance and renders the data using a template.

Constructor Detail

This class defines a UI widget capable of displaying data for multiple places. A typical use case for this class is to display an interactive list of search results (see also nokia.places.SearchBox). If the data are rendered on more than one page, the class provides a means of navigating the pages. The class uses the template nokia.general.placelist to render the places data.

new nokia.places.PlaceList(params)
Parameters:
{Object} params
An initialization object that can include parameters defined for nokia.places.Widget as well as the following optional properties:
  • onRenderPage - a callback function to be invoked when additional processing is required after a page has been rendered
  • perPage - a {Number} indicating how many list elements are to be shown per page (default is 10)
  • data - (optional) an array of place data which are to be rendered; the data typically contain the places search results (see also nokia.places.SearchBox; if you wish to instantiate nokia.places.PlaceList without initially displaying any place data, omit this parameter - you can later call the method nokia.places.PlaceList.setData() to provide data for rendering
  • map - an optional reference to an nokia.maps.map.Display object; when specified, items in the list can be displayed on the map display instance to which it refers (it is then not necessary to pass the argument map to nokia.places.PlaceList.displayOnMap())

Method Detail

displayOnMap ([map, onIconClick])
This method renders current page results as icons on the Map.
Parameters:
{Object} [map]:
A reference to a map (nokia.maps.map.Display) object; if not specified, the implementation attempts to use the class property map
{Function} onIconClick
A caller-defined handler for the icon click event
getCurrentPage ()
This method retrieves the current page number from the PlaceList widget.
Returns:
A value representing the page number
getCurrentPageData ()
This method retrieves the data rendered on current page.
Returns:
A JSON object containing all the data rendered on the current page (see also nokia.places.objects.Place)
renderPage (page)
This method renders a chosen page (from the result set).
Parameters:
{Object} page
An object representing the page to render
setData (data, (optional))
This method associates data with the given widget instance and renders the data using a template.
Parameters:
{Object} data
The data to associate with the widget and to render; the data is an array of instances of nokia.places.Place or an instance of nokia.places.objects.SearchResponseView
{Object} (optional)
the target element in which to render the data

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