summaryrefslogtreecommitdiffstats
path: root/src/location/doc/src/plugins/osm.qdoc
blob: 9f4979b5a5e462f8725b76099c0de7527b5ee18e (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
128
129
130
131
132
133
134
135
136
137
138
139
140
/****************************************************************************
**
** Copyright (C) 2015 Aaron McCarthy <mccarthy.aaron@gmail.com>
** Contact: http://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** 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. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: http://www.gnu.org/copyleft/fdl.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
\page location-plugin-osm.html
\title Qt Location Open Street Map Plugin
\ingroup QtLocation-plugins

\brief Uses Open Street Map and related services.

\section1 Overview

This geo services plugin allows applications to access
\l {http://openstreetmap.org}{Open Street Map} location based services using the Qt Location API.

Data, imagery and map information provided by \l {http://www.mapquest.com}{MapQuest},
\l {http://www.thunderforest.com/}{ThunderForest}, OpenStreetMap and contributors. The data is
available under the \l {http://www.opendatacommons.org/licenses/odbl}{Open Database License}.

The Open Street Map geo services plugin can be loaded by using the plugin key "osm".

\section1 Parameters

\section2 Optional parameters
The following table lists optional parameters that can be passed to the Open Street Map plugin.

\note Since Qt 5.5 all parameters below must be prefixed with \c osm. Previous versions did not require
a prefix.

\table
\header
    \li Parameter
    \li Description
\row
    \li osm.useragent
    \li User agent string set when making network requests.  This parameter should be set to a
        value that uniquely identifies the application.
\row
    \li osm.mapping.host
    \li Url string set when making network requests to the tile server.  This parameter should be set to a
        valid server url with the correct osm api and the \l{Map::activeMapType} to the corresponding \l{MapType}.CustomMap.
        The CustomMap will only be available if this parameter is set.
        \note Setting the mapping.host parameter to a new server renders the map tile cache useless for the old custommap style.
\row
    \li osm.mapping.copyright
    \li Custom copryright string is used when setting the \l{Map::activeMapType} to \l{MapType}.CustomMap via urlprefix parameter.
        This copyright will only be used when using the CustomMap from above. If empty no copyright will be displayed for the custom map.
\row
    \li osm.routing.host
    \li Url string set when making network requests to the routing server.  This parameter should be set to a
        valid server url with the correct osrm API. If not specified the default \l {http://router.project-osrm.org/viaroute}{url} will be used.
        \note The API documentation and sources are available at \l {http://project-osrm.org/}{Project OSRM}.
\row
    \li osm.geocoding.host
    \li Url string set when making network requests to the geocoding server.  This parameter should be set to a
        valid server url with the correct osm API. If not specified the default \l {http://nominatim.openstreetmap.org/}{url} will be used.
        \note The API documentation is available at \l {https://wiki.openstreetmap.org/wiki/Nominatim}{Project OSM Nominatim}.
\row
    \li osm.places.host
    \li Url string set when making network requests to the places server.
        This parameter should be set to a valid server url with the correct osm API.
        If not specified the default  \l {http://nominatim.openstreetmap.org/search}{url}
        will be used.
        \note The API documentation is available at \l {https://wiki.openstreetmap.org/wiki/Nominatim}{Project OSM Nominatim}.
\row
    \li osm.mapping.cache.directory
    \li Absolute path to map tile cache directory used as network disk cache.

    The default place for the cache is \c{QtLocation/osm} directory in \l {QStandardPaths::writableLocation()} {QStandardPaths::writableLocation}(\l{QStandardPaths::GenericCacheLocation}).
    On systems that have no concept of a shared cache, the application-specific \l{QStandardPaths::CacheLocation} is used instead.
\row
    \li osm.mapping.offline.directory
    \li Absolute path to a directory containing map tiles used as an offline storage. If specified, it will work together with the network disk cache, but tiles won't get automatically
    inserted, removed or updated. The format of the tiles is the same used by the network disk cache.

    There is no default value, and if this property is not set, no directory will be indexed and only the network disk cache will be used
    to reduce network usage or to act as an offline storage for the currently cached tiles.
\row
    \li osm.mapping.cache.disk.size
    \li Map tile disk cache size in bytes. Default size of the cache is 100MB.
\row
    \li osm.mapping.cache.memory.size
    \li Map tile memory cache size in bytes. Default size of the cache is 3MB.
\row
    \li osm.mapping.cache.texture.size
    \li Map tile texture cache size in bytes. Default size of the cache is 6MB. Note that the texture cache has a hard minimum size which depends on the size of the map viewport (it must contain enough data to display the tiles currently visible on the display). This value is the amount of cache to be used in addition to the bare minimum.

\endtable

\section1 Parameter Usage Example

The following example shows how to create an OSM plugin instance with
parameters supplied for an useragent, and if necessary, a custom server url plus the corresponding copyright information for the tile provider.
Additionally, it is possible to choose another routing server than the public osrm one.

\section2 QML

\code
Plugin {
    name: "osm"
    PluginParameter { name: "osm.useragent"; value: "My great Qt OSM application" }
    PluginParameter { name: "osm.mapping.host"; value: "http://osm.tile.server.address/" }
    PluginParameter { name: "osm.mapping.copyright"; value: "All mine" }
    PluginParameter { name: "osm.routing.host"; value: "http://osrm.server.address/viaroute" }
    PluginParameter { name: "osm.geocoding.host"; value: "http://geocoding.server.address" }
}
\endcode

\section1 Other Plugin-specific Information

\section2 Tile cache

The tiles are cached in a \c{QtLocation/osm} directory in \l {QStandardPaths::writableLocation()}{QStandardPaths::writableLocation}
(\l{QStandardPaths::GenericCacheLocation}). On systems that have no concept of a shared cache, the application-specific
\l{QStandardPaths::CacheLocation} is used instead.
*/