summaryrefslogtreecommitdiff
path: root/src/location/doc/src/plugins/mapbox.qdoc
blob: 8f83ae552fdc6add241a7e3f102a4ad5c3f4355f (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
141
142
143
144
145
146
147
148
149
150
151
152
153
/****************************************************************************
**
** Copyright (C) 2014 Canonical Ltd.
** 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-mapbox.html
\title Qt Location Mapbox Plugin
\ingroup QtLocation-plugins

\brief Uses Mapbox for location services.

\section1 Overview

This geo services plugin allows applications to access
\l {http://mapbox.com}{Mapbox} location based services using the Qt Location API.
The use of these services is governed by the \l {https://www.mapbox.com/tos}{Mapbox terms of service}.
An access token is required to use these services.
Data is provided by \l {https://www.mapbox.com/about/maps}{OpenStreetMap and others}.

The Mapbox geo services plugin can be loaded by using the plugin key "mapbox".

\section1 Parameters

\section2 Mandatory parameters
The following table lists mandatory parameters that \e must be passed to the Mapbox plugin.
\table
\header
    \li Parameter
    \li Description
\row
    \li mapbox.access_token
    \li \l{https://www.mapbox.com/help/define-access-token/}{Access token} provided by Mapbox.
\endtable

The Mapbox geo services plugin requires an access token and map ID to use the
Mapbox services.  To create a Mapbox account visit
\l{https://www.mapbox.com/#signup}.

\section2 Optional parameters
The following table lists optional parameters that can be passed to the Mapbox plugin.
\table
\header
    \li Parameter
    \li Description
\row
    \li mapbox.mapping.map_id, mapbox.map_id (\b deprecated)
    \li \l{https://www.mapbox.com/help/define-map-id/}{ID} of the Mapbox map to show. An example ID is "examples.map-zr0njcqy".
    If this parameter is present, the specified map type will be used by default, unless another is selected.
    If not present, the default Mapbox map ID is "mapbox.streets".
    \b{Note:} neither in this parameter nor in \b{mapbox.mapping.additional_map_ids} it is allowed to use repeated map_ids.
    This includes the map_ids bundled in the plugin by default (documented \l{https://www.mapbox.com/api-documentation/#maps}{here} under
    \b{Mapbox classic map IDs}). Failing to do so will cause tile cache corruption.
\row
    \li mapbox.mapping.additional_map_ids
    \li Additional, comma separated, Mapbox map IDs to be added to the available map types.
\row
    \li mapbox.mapping.format, mapbox.format (\b deprecated)
    \li Data format to download tiles in, available values are "png", "png32",
        "png64", "png128", "png256", (PNG with full, 32, 64, 128 and 256 color palette)
        "jpg70", "jpg80", "jpg90" (JPEG with 70%, 80% and 90% compression).
        Defaults to "png".
\row
    \li mapbox.mapping.highdpi_tiles
    \li Whether or not to request high dpi tiles. Valid values are \b true and \b false. The default value is \b false.
\row
    \li useragent
    \li User agent string set when making network requests.
\row
    \li mapbox.mapping.cache.directory
    \li Absolute path to map tile cache directory used as network disk cache.

    The default place for the cache is the \c{QtLocation/mapbox} subdirectory in the location returned by
    QStandardPaths::writableLocation(), called with QStandardPaths::GenericCacheLocation as a parameter.
    On systems that have no concept of a shared cache, the application-specific \l{QStandardPaths::CacheLocation}
    is used instead.
\row
    \li mapbox.mapping.cache.disk.cost_strategy
    \li The cost strategy to use to cache map tiles on disk.
    Valid values are \b bytesize and \b unitary.
    Using \b bytesize, the related size parameter (\b mapbox.mapping.cache.disk.size) will
    be interpreted as bytes.
    Using \b unitary, they will be interpreted as number of tiles.
    The default value for this parameter is \b unitary.
\row
    \li mapbox.mapping.cache.disk.size
    \li Disk cache size for map tiles.
    The default size of this cache is 6000 if \b unitary is used as cost strategy,
    or 50 MiB, if \b bytesize is used as cost strategy.
    Note that 6000 is the maximum amount of tiles that the Mapbox free plan allows to cache.
    Make sure to comply with Mapbox Terms of Service before increasing this value.
\row
    \li mapbox.mapping.cache.memory.cost_strategy
    \li The cost strategy to use to cache map tiles in memory.
    Valid values are \b bytesize and \b unitary.
    Using \b bytesize, the related size parameter (\b mapbox.mapping.cache.memory.size) will
    be interpreted as bytes.
    Using \b unitary, they will be interpreted as number of tiles.
    The default value for this parameter is \b bytesize.
\row
    \li mapbox.mapping.cache.memory.size
    \li Memory cache size for map tiles.
    The Default size of this cache is 100 if \b unitary is used as cost strategy, or
    3 MiB, if \b bytesize is used as cost strategy.
\row
    \li mapbox.mapping.cache.texture.cost_strategy
    \li The cost strategy to use to cache decompressed map tiles in memory.
    Valid values are \b bytesize and \b unitary.
    Using \b bytesize, the related size parameter (\b mapbox.mapping.cache.texture.size) will
    be interpreted as bytes.
    Using \b unitary, they will be interpreted as number of tiles.
    The default value for this parameter is \b bytesize.
\row
    \li mapbox.mapping.cache.texture.size
    \li Texture cache size for map tiles.
    The Default size of this cache is 30 if \b unitary is used as cost strategy, or
    6 MiB, if \b bytesize is used as cost strategy.
    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 tiles to be cached in addition to the bare minimum.
\row
    \li mapbox.mapping.prefetching_style
    \li This parameter allows to provide a hint how tile prefetching is to be performed by the engine. The default value,
    \tt{TwoNeighbourLayers}, makes the engine prefetch tiles for the layer above and the one below the current tile
    layer, providing ready tiles when zooming in or out from the current zoom level.
    \tt{OneNeighbourLayer} only prefetches the one layer closest to the current zoom level.
    Finally, \tt{NoPrefetching} allows to disable the prefetching, so only tiles that are visible will be fetched.
    Note that, depending on the active map type, this hint might be ignored.
\endtable
*/