×
Namespaces

Variants
Actions
Revision as of 14:30, 14 April 2011 by hbattke (Talk | contribs)

Qt Location API

From Nokia Developer Wiki
Jump to: navigation, search

Contents

Introduction

Qt Location API is part of QtMobility (version 1.1.0 and higher). It provides a map widget, routing, geocoding and reverse geocoding functionality. In addition to this QtMobility provides positioning and landmark functionality.

Installation process

  1. Install the latest Qt SDK (version 1.1 and higher)
  2. When installing the SDK you have to accept the T&C for the Location APIs
  3. Start developing software
  4. Register your application before deploying it to the store or launching your service.

For more information on the business options please read our FAQs.

Functionality: maps, routing, geocoding and reverse geocoding

The Maps and Navigation API is based on plugins.

Since most providers of mapping, geocoding and routing information offer no guarantees that their data is interoperable with the data provided by other services, the plugins are used to group the functionality per service provider.

The plugins are accessed via QGeoServiceProvider, and a Nokia based plugin is part of Qt Mobility. See the section The Nokia plugin for more details.

     QGeoMappingManager *mappingManager = 0;
QGeoRoutingManager *routingManager = 0;
QGeoSearchManager *searchManager = 0;
 
QGeoServiceProvider serviceProvider("plugin name");
 
if (serviceProvider.error() == QGeoServiceProvider::NoError) {
mappingManager = serviceProvider.mappingManager();
routingManager = serviceProvider.routingManager();
searchManager = serviceProvider.searchManager();
}

Common classes

QGeoBoundingArea Defines a geographic area
QGeoBoundingBox Defines a rectangular geographic area
QGeoBoundingCircle Defines a circular geographic area
QGeoServiceProvider Aggregates access to services which provide geographical information

Mapping

The QGraphicsGeoMap class is the main class used for displaying and interacting with maps. It is designed for use within the Graphics View Framework, and is a subclass of QGraphicsWidget.

The QGeoMappingManager provides most of the functionality required by QGraphicsGeoMap. The details of QGeoMappingManager are mostly only important to plugin implementers, as regular users should not need to make use of QGeoMappingManager outside of the QGraphicsGeoMap constructor:

     QGraphicsGeoMap *map = new QGraphicsGeoMap(mappingManager);
QGeoMapOverlay Used to draw overlays on the map
QGeoMappingManager Support for displaying and interacting with maps
QGraphicsGeoMap Used to display a map and manager the interactions between the user and the map
101 page views in the last 30 days.
×