diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-12-22 18:03:21 -0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2017-01-03 16:52:24 -0200 |
commit | 4bee81dd21688abdd9ea67b6fc8cb691fa06a7a9 (patch) | |
tree | f95a9c33c3bbf7b6ba2aa533256fa11ff000caa1 /platform | |
parent | 003eec633e93ddea3638e4f77f01079640bed492 (diff) | |
download | qtlocation-mapboxgl-4bee81dd21688abdd9ea67b6fc8cb691fa06a7a9.tar.gz |
[Qt] Added docs for QMapboxGLSettings
Diffstat (limited to 'platform')
-rw-r--r-- | platform/qt/src/qmapboxgl.cpp | 108 |
1 files changed, 107 insertions, 1 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp index cf6b930d4a..63a91386fa 100644 --- a/platform/qt/src/qmapboxgl.cpp +++ b/platform/qt/src/qmapboxgl.cpp @@ -141,7 +141,7 @@ std::unique_ptr<const mbgl::SpriteImage> toSpriteImage(const QImage &sprite) { /*! \enum QMapboxGLSettings::GLContextMode - This enum set the expectations towards the GL state. + This enum sets the expectations towards the GL state. \value UniqueGLContext The GL context is only used by QMapboxGL, so it is not reset before each rendering. Use this mode if the intention is to only draw a @@ -155,6 +155,36 @@ std::unique_ptr<const mbgl::SpriteImage> toSpriteImage(const QImage &sprite) { */ /*! + \enum QMapboxGLSettings::ConstrainMode + + This enum sets whenever a map should wrap. + + \value NoConstrain The map will wrap on the horizontal axis. Since it doesn't + make sense to wrap on the vertical axis in a Mercator projection, the map will simply scroll + and show some empty space. + + \value ConstrainHeightOnly The map will wrap around the horizontal axis, like a spinning + globe. This is usually what you want. + + \value ConstrainWidthAndHeight The map won't wrap and panning is restrict to the boundaries + of the map. + + \sa constrainMode() +*/ + +/*! + \enum QMapboxGLSettings::ViewportMode + + This enum is used for flipping the map vertically. + + \value DefaultViewport Native horientation. + + \value FlippedYViewport Mirrored vertically. + + \sa viewportMode() +*/ + +/*! Constructs a QMapboxGLSettings object with the default values. The default configuration is valid for initializing a QMapboxGL. */ @@ -169,70 +199,146 @@ QMapboxGLSettings::QMapboxGLSettings() { } +/*! + Returns the OpenGL context mode. This is specially important when mixing + with other GL draw calls. + + By default, it is set to QMapboxGLSettings::SharedGLContext. +*/ QMapboxGLSettings::GLContextMode QMapboxGLSettings::contextMode() const { return m_contextMode; } +/*! + Sets the OpenGL context \a mode. +*/ void QMapboxGLSettings::setContextMode(GLContextMode mode) { m_contextMode = mode; } +/*! + Returns the constrain mode. This is used to limit the map to wrap + around the globe horizontally. + + By default, it is set to QMapboxGLSettings::ConstrainHeightOnly. +*/ QMapboxGLSettings::ConstrainMode QMapboxGLSettings::constrainMode() const { return m_constrainMode; } +/*! + Sets the map constrain \a mode. +*/ void QMapboxGLSettings::setConstrainMode(ConstrainMode mode) { m_constrainMode = mode; } +/*! + Returns the viewport mode. This is used to flip the vertical + orientation of the map as some devices may use inverted orientation. + + By default, it is set to QMapboxGLSettings::DefaultViewport. +*/ QMapboxGLSettings::ViewportMode QMapboxGLSettings::viewportMode() const { return m_viewportMode; } +/*! + Sets the viewport \a mode. +*/ void QMapboxGLSettings::setViewportMode(ViewportMode mode) { m_viewportMode = mode; } +/*! + Returns the cache database maximum hard size in bytes. The database + will grow until the limit is reached. Setting a maximum size smaller + than the current size of an existing database is undefined. + + By default, it is set to 50 MB. +*/ unsigned QMapboxGLSettings::cacheDatabaseMaximumSize() const { return m_cacheMaximumSize; } +/*! + Returns the maximum allowed cache database \a size in bytes. +*/ void QMapboxGLSettings::setCacheDatabaseMaximumSize(unsigned size) { m_cacheMaximumSize = size; } +/*! + Returns the cache database path. The cache is used for storing + recently used resources like tiles and also an offline tile database + pre-populated by the + \l {https://github.com/mapbox/mapbox-gl-native/blob/master/bin/offline.sh} + {Offline Tool}. + + By default, it is set to \b :memory: meaning it will create a in-memory + cache instead of a file in the disk. +*/ QString QMapboxGLSettings::cacheDatabasePath() const { return m_cacheDatabasePath; } +/*! + Sets the cache database \a path. + + Setting the \a path to \b :memory: will create an in-memory cache. +*/ void QMapboxGLSettings::setCacheDatabasePath(const QString &path) { m_cacheDatabasePath = path; } +/*! + Returns the asset path, which is the root directory from where + the \b asset:// scheme gets resolved in a style. \b asset:// can be used + for loading a resource from the disk in a style rather than fetching + it from the network. + + By default, it is set to the value returned by QCoreApplication::applicationDirPath(). +*/ QString QMapboxGLSettings::assetPath() const { return m_assetPath; } +/*! + Sets the asset \a path. +*/ void QMapboxGLSettings::setAssetPath(const QString &path) { m_assetPath = path; } +/*! + Returns the access token. + + By default, it is taken from the environment variable \b MAPBOX_ACCESS_TOKEN + or empty if the variable is not set. +*/ QString QMapboxGLSettings::accessToken() const { return m_accessToken; } +/*! + Sets the access \a token. An access token is required for styles and tiles + hosted at Mapbox servers. + + An access token for the Starter plan can be created free of charge at the + \l {https://www.mapbox.com/pricing/}{Mapbox website}. +*/ void QMapboxGLSettings::setAccessToken(const QString &token) { m_accessToken = token; |