summaryrefslogtreecommitdiff
path: root/doc/src/maps.qdoc
blob: 630dedbc52bfdafe7572df9140cac304046f6886 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** GNU Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms
** and conditions contained in a signed written agreement between you
** and Nokia.
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/


/*!
\page location-maps.html
\title Maps
\previouspage {qtlocation-cpp.html}{QtLocation}

\brief Maps is the part of the Location API that deals with maps,
their contents and navigation through the maps.

\section1 Maps and Navigation

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.

\code
    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();
    }
\endcode

\bold {Important notice:} \e {The map data provided by the offline plug-in is
place-shifted for the area of the People’s Republic of China. To provide
un-shifted maps of China in an application, the application developer must
first obtain permission from Chinese officials. The Qt Location
API cannot offer this on the API level.}

\section2 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:
\code
    QGraphicsGeoMap *map = new QGraphicsGeoMap(mappingManager);
\endcode

\annotatedlist QtLocation-maps

\section3 \bold{Map objects}

QGeoMapObject and its subclasses provide the ability to add graphics to the map
specified in terms of coordinates and distances. QGeoMapObject instances can
also be grouped into hierarchies in order to simplify the process of creating
compound objects and managing groups of objects.

\annotatedlist maps-mapping-objects

\section2 Routing

QGeoRoutingManager handles requests for routing information.

The requests are created as QGeoRouteRequest instances, which are
passed to QGeoRoutingManager::calculateRoute().  The returned
QGeoRouteReply instance will contain the result of the request when
it is completed.

The QGeoRoute class describes the resulting route.  Each route is
broken up into a number of QGeoRouteSegment instances, with the division
usually occurring at either user specified waypoints or at changes in the
mode of transport, like when changing from a train to a bus.

Each QGeoRouteSegment has a QGeoNavigationInstruction instance which
describes the instructions that would be issued to a user attempting
to follow a route.  These instructions a location, which is typically
somewhere near the end of the associated QGeoRouteSegment, and
instruction text describing how the next QGeoRouteSegment should be reached.

\annotatedlist QtLocation-routing

\section2 Geocoding

QGeoSearchManager handles geocoding, reverse geocoding.

\annotatedlist QtLocation-geocoding

\section1 Map Examples

\l {Declarative Map Viewer Example}

\l {LightMaps Example}

*/