@@ -4,7 +4,7 @@ include($QT_INSTALL_DOCS/global/compat.qdocconf)
|
||||
include($QT_INSTALL_DOCS/global/fileextensions.qdocconf)
|
||||
include($QT_INSTALL_DOCS/global/qt-html-templates-online.qdocconf)
|
||||
|
||||
Cpp.ignoretokens = Q_DECL_EXPORT
|
||||
Cpp.ignoretokens = Q_MAPBOXGL_EXPORT
|
||||
|
||||
project = QMapboxGL
|
||||
description = Mapbox Qt SDK
|
||||
|
||||
@@ -9,6 +9,12 @@
|
||||
|
||||
// This header follows the Qt coding style: https://wiki.qt.io/Qt_Coding_Style
|
||||
|
||||
#if defined(QT_BUILD_MAPBOXGL_LIB)
|
||||
#define Q_MAPBOXGL_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
#define Q_MAPBOXGL_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
namespace QMapbox {
|
||||
|
||||
typedef QPair<double, double> Coordinate;
|
||||
@@ -20,7 +26,7 @@ typedef QList<Coordinates> CoordinatesCollection;
|
||||
|
||||
typedef QList<CoordinatesCollection> CoordinatesCollections;
|
||||
|
||||
struct Q_DECL_EXPORT Feature {
|
||||
struct Q_MAPBOXGL_EXPORT Feature {
|
||||
enum Type {
|
||||
PointType = 1,
|
||||
LineStringType,
|
||||
@@ -38,7 +44,7 @@ struct Q_DECL_EXPORT Feature {
|
||||
QVariant id;
|
||||
};
|
||||
|
||||
struct Q_DECL_EXPORT ShapeAnnotationGeometry {
|
||||
struct Q_MAPBOXGL_EXPORT ShapeAnnotationGeometry {
|
||||
enum Type {
|
||||
LineStringType = 1,
|
||||
PolygonType,
|
||||
@@ -54,12 +60,12 @@ struct Q_DECL_EXPORT ShapeAnnotationGeometry {
|
||||
CoordinatesCollections geometry;
|
||||
};
|
||||
|
||||
struct Q_DECL_EXPORT SymbolAnnotation {
|
||||
struct Q_MAPBOXGL_EXPORT SymbolAnnotation {
|
||||
Coordinate geometry;
|
||||
QString icon;
|
||||
};
|
||||
|
||||
struct Q_DECL_EXPORT LineAnnotation {
|
||||
struct Q_MAPBOXGL_EXPORT LineAnnotation {
|
||||
/*! Class constructor. */
|
||||
LineAnnotation(const ShapeAnnotationGeometry& geometry_ = ShapeAnnotationGeometry(), float opacity_ = 1.0f,
|
||||
float width_ = 1.0f, const QColor& color_ = Qt::black)
|
||||
@@ -71,7 +77,7 @@ struct Q_DECL_EXPORT LineAnnotation {
|
||||
QColor color;
|
||||
};
|
||||
|
||||
struct Q_DECL_EXPORT FillAnnotation {
|
||||
struct Q_MAPBOXGL_EXPORT FillAnnotation {
|
||||
/*! Class constructor. */
|
||||
FillAnnotation(const ShapeAnnotationGeometry& geometry_ = ShapeAnnotationGeometry(), float opacity_ = 1.0f,
|
||||
const QColor& color_ = Qt::black, const QVariant& outlineColor_ = QVariant())
|
||||
@@ -92,13 +98,13 @@ enum NetworkMode {
|
||||
Offline,
|
||||
};
|
||||
|
||||
Q_DECL_EXPORT QList<QPair<QString, QString> >& defaultStyles();
|
||||
Q_MAPBOXGL_EXPORT QList<QPair<QString, QString> >& defaultStyles();
|
||||
|
||||
Q_DECL_EXPORT NetworkMode networkMode();
|
||||
Q_DECL_EXPORT void setNetworkMode(NetworkMode);
|
||||
Q_MAPBOXGL_EXPORT NetworkMode networkMode();
|
||||
Q_MAPBOXGL_EXPORT void setNetworkMode(NetworkMode);
|
||||
|
||||
// This struct is a 1:1 copy of mbgl::CustomLayerRenderParameters.
|
||||
struct Q_DECL_EXPORT CustomLayerRenderParameters {
|
||||
struct Q_MAPBOXGL_EXPORT CustomLayerRenderParameters {
|
||||
double width;
|
||||
double height;
|
||||
double latitude;
|
||||
|
||||
@@ -16,7 +16,7 @@ class QMapboxGLPrivate;
|
||||
|
||||
// This header follows the Qt coding style: https://wiki.qt.io/Qt_Coding_Style
|
||||
|
||||
class Q_DECL_EXPORT QMapboxGLSettings
|
||||
class Q_MAPBOXGL_EXPORT QMapboxGLSettings
|
||||
{
|
||||
public:
|
||||
QMapboxGLSettings();
|
||||
@@ -77,7 +77,7 @@ private:
|
||||
std::function<std::string(const std::string &&)> m_resourceTransform;
|
||||
};
|
||||
|
||||
struct Q_DECL_EXPORT QMapboxGLCameraOptions {
|
||||
struct Q_MAPBOXGL_EXPORT QMapboxGLCameraOptions {
|
||||
QVariant center; // Coordinate
|
||||
QVariant anchor; // QPointF
|
||||
QVariant zoom; // double
|
||||
@@ -85,7 +85,7 @@ struct Q_DECL_EXPORT QMapboxGLCameraOptions {
|
||||
QVariant pitch; // double
|
||||
};
|
||||
|
||||
class Q_DECL_EXPORT QMapboxGL : public QObject
|
||||
class Q_MAPBOXGL_EXPORT QMapboxGL : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(double latitude READ latitude WRITE setLatitude)
|
||||
|
||||
@@ -70,6 +70,10 @@ target_include_directories(qmapboxgl
|
||||
PUBLIC platform/qt/include
|
||||
)
|
||||
|
||||
target_compile_definitions(qmapboxgl
|
||||
PRIVATE "-DQT_BUILD_MAPBOXGL_LIB"
|
||||
)
|
||||
|
||||
target_link_libraries(qmapboxgl
|
||||
PRIVATE mbgl-core
|
||||
PRIVATE mbgl-filesource
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace QMapbox {
|
||||
|
||||
Returns the current QMapbox::NetworkMode.
|
||||
*/
|
||||
Q_DECL_EXPORT NetworkMode networkMode()
|
||||
NetworkMode networkMode()
|
||||
{
|
||||
return static_cast<NetworkMode>(mbgl::NetworkStatus::Get());
|
||||
}
|
||||
@@ -219,7 +219,7 @@ Q_DECL_EXPORT NetworkMode networkMode()
|
||||
File source requests uses the available network when \a mode is set to \b
|
||||
Online, otherwise scoped to the local cache.
|
||||
*/
|
||||
Q_DECL_EXPORT void setNetworkMode(NetworkMode mode)
|
||||
void setNetworkMode(NetworkMode mode)
|
||||
{
|
||||
mbgl::NetworkStatus::Set(static_cast<mbgl::NetworkStatus::Status>(mode));
|
||||
}
|
||||
@@ -230,7 +230,7 @@ Q_DECL_EXPORT void setNetworkMode(NetworkMode mode)
|
||||
Returns a list containing a pair of string objects, representing the style
|
||||
URL and name, respectively.
|
||||
*/
|
||||
Q_DECL_EXPORT QList<QPair<QString, QString> >& defaultStyles()
|
||||
QList<QPair<QString, QString> >& defaultStyles()
|
||||
{
|
||||
static QList<QPair<QString, QString>> styles;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user