Landmarks API

From Qt Wiki
Jump to navigation Jump to search
This article may require cleanup to meet the Qt Wiki's quality standards. Reason: Auto-imported from ExpressionEngine.
Please improve this article if you can. Remove the {{cleanup}} tag and add this page to Updated pages list after it's clean.

English Spanish

Qt Mobility 1.1 Features

News

Qt Mobility 1.1.3 Release is available now for commercial app development and deployment on Ovi store. Qt Mobility 1.2.0 release is available now.

Landmarks API

Summary

One of the new elements of the Qt Mobility Location library is the Landmarks API. What is a landmark? A landmark is a particular location which holds some significance. It could be a favorite restaurant, a friend's house or the Sydney Opera house. The landmarks API is designed to make the searching and management of such landmarks simple and easy to use.

Key features

  • Save Landmark
  • Save Category
  • Retrieve landmarks based on a filter and sort order
  • Retrieve categories
  • Delete landmarks
  • Delete categories
  • Import landmarks (GPX version 1.1 currently supported)
  • Export landmarks
  • Both asynchronous and synchronous API's to perform the above operations
  • Generic attributes assignable to landmarks and categories.
  • Plugin based backend allowing developers to create their own datastore back ends.
  • Notifications of added/modified/deleted landmarks
  • Notifications of added/modified/deleted categories

(Features in italics have yet to be implemented on the currently supported platforms)

Parts of the API that are still unstable:

Paging/QLandmarkFetchHint: Currently paging is facilitated through the QLandmarkFetchHint class which may be used to specify the maximum number of items to return and an offset. The QLandmarkFetchHint is intended to be an extendable catch-all part of the API. One of the possible use cases is to retrieve partial landmark data, e.g. only retrieve the icon and coordinates. The QLandmarkFetchHint would allow this specification to be made. For the sake of not having an empty class, the offset and maximum limit have been placed in the QLandmarkFetchHint. There may be a more elegant way to handling paging; we are open to suggestions on how this should be done.

If there is demand for the partial landmark retrieval case we would also like to hear that. That particular use case may be important for situations where landmarks are retrieved over a network connection.

Synchronization: To facilitate synchronization between datastores it may be necessary to add new uid fields to each landmark and category. This differs from the local id field which should be unique per datastore but is not universally unique.

Multiple database instances per plugin: The API as it currently stands only allows a single datastore instance per plugin. All applications using a particular plugin will effectively be sharing those landmarks. It may be desirable for each application to have it's own separate landmark datastore. Please provide feedback if you want this functionality.

LandmarkBrowser Example

The LandmarkBrowser is a simple application that displays a list of landmark coordinates and names.

4829712737_a934e11864_b_d.jpg

To add a new landmark click the add landmark button and a dialog box is shown allowing you to fill in the lattude, longitude and name fields.

To delete landmarks select which landmark(s) are to be deleted and press the delete landmarks button.

To import landmarks click the import button and a dialog will be displayed allowing you to choose a GPX file (only version 1.1 is supported). A sample file called places.gpx already accompanies the LandmarkBrowser.