Nokia Maps API Reference

Contents

Class nokia.places.ui.modules.CategorySearch

Class Summary

This class represents a module that provides access to the Places API category-based search. The user interface allows the Web site user to select a category, and run a search for places that match the chosen category.

The template elements targeted by CategorySearch may have the attribute rel containing the valid category id, which must be set to one of the following values:

  • eat-drink
  • going-out
  • sights-museums
  • transport
  • accommodation
  • shopping
  • leisure-outdoor
  • administrative-areas-buildings
  • natural-geographical

CategorySearch supports the following parameters that can be specified via the nokia.places.Place initialization property "moduleParams":

  • onResults - a caller-defined callback function to be invoked after the search results become available; the function is invoked only if onSelect is not defined; the function receives the results of a search based on the user-selected search term as an array of data structures; these can be wrapped in instances of nokia.places.models.PlaceModel) and you can then use a Place instance to retrieve place data, using the ids of the items in the received array
  • onSearchStart" - a caller-defined callback function to be invoked when the search is being fired
  • searchCenter - a caller-defined function that retrieves an object containing the geographical coordinates of the search center (searches are conducted in widening circles around this location and the results are ordered by relevance to the search criteria); if provided, useGeoLocation is ignored; the function is expected to return an object with the following properties:
    • latitude - latitude of the center point for the search
    • longitude - latitude of the center point for the search
  • maxResults - {Number}, maximum number of results returned by the categorysearch module, by default it is set to 20
  • useGeoLocation - {Boolean}, if true and the browser supports the W3C Geolocation API 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 (default) and searchCenter is not provided, a global search is executed

Constructor Detail

This class represents a module that provides access to the Places API category-based search. The user interface allows the Web site user to select a category, and run a search for places that match the chosen category.

The template elements targeted by CategorySearch may have the attribute rel containing the valid category id, which must be set to one of the following values:

  • eat-drink
  • going-out
  • sights-museums
  • transport
  • accommodation
  • shopping
  • leisure-outdoor
  • administrative-areas-buildings
  • natural-geographical

CategorySearch supports the following parameters that can be specified via the nokia.places.Place initialization property "moduleParams":

  • onResults - a caller-defined callback function to be invoked after the search results become available; the function is invoked only if onSelect is not defined; the function receives the results of a search based on the user-selected search term as an array of data structures; these can be wrapped in instances of nokia.places.models.PlaceModel) and you can then use a Place instance to retrieve place data, using the ids of the items in the received array
  • onSearchStart" - a caller-defined callback function to be invoked when the search is being fired
  • searchCenter - a caller-defined function that retrieves an object containing the geographical coordinates of the search center (searches are conducted in widening circles around this location and the results are ordered by relevance to the search criteria); if provided, useGeoLocation is ignored; the function is expected to return an object with the following properties:
    • latitude - latitude of the center point for the search
    • longitude - latitude of the center point for the search
  • maxResults - {Number}, maximum number of results returned by the categorysearch module, by default it is set to 20
  • useGeoLocation - {Boolean}, if true and the browser supports the W3C Geolocation API 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 (default) and searchCenter is not provided, a global search is executed

new nokia.places.ui.modules.CategorySearch()
Documentation generated on Tue May 08 2012 10:23:57 GMT+0200 (CEST).