[Qt] expose NorthOrientation
This commit is contained in:
committed by
Thiago Marcos P. Santos
parent
cb52a78542
commit
41dd14d208
@@ -61,6 +61,14 @@ public:
|
||||
typedef QPair<CoordinateSegments, QString> ShapeAnnotation;
|
||||
typedef QList<ShapeAnnotation> ShapeAnnotations;
|
||||
|
||||
// Determines the orientation of the map.
|
||||
enum NorthOrientation {
|
||||
NorthUpwards, // Default
|
||||
NorthRightwards,
|
||||
NorthDownwards,
|
||||
NorthLeftwards,
|
||||
};
|
||||
|
||||
QMapboxGL(QObject *parent = 0, const QMapboxGLSettings& = QMapboxGLSettings());
|
||||
virtual ~QMapboxGL();
|
||||
|
||||
@@ -94,6 +102,9 @@ public:
|
||||
double pitch() const;
|
||||
void setPitch(double pitch, int milliseconds = 0);
|
||||
|
||||
NorthOrientation northOrientation() const;
|
||||
void setNorthOrientation(NorthOrientation);
|
||||
|
||||
Coordinate coordinate() const;
|
||||
void setCoordinate(const Coordinate &, int milliseconds = 0);
|
||||
void setCoordinateZoom(const Coordinate &, double zoom, int milliseconds = 0);
|
||||
|
||||
@@ -198,6 +198,28 @@ void QMapboxGL::setPitch(double pitch_, int milliseconds)
|
||||
d_ptr->mapObj->setPitch(pitch_, std::chrono::milliseconds(milliseconds));
|
||||
}
|
||||
|
||||
QMapboxGL::NorthOrientation QMapboxGL::northOrientation() const
|
||||
{
|
||||
using NO = mbgl::NorthOrientation;
|
||||
switch (d_ptr->mapObj->getNorthOrientation()) {
|
||||
case NO::Rightwards: return NorthRightwards;
|
||||
case NO::Downwards: return NorthDownwards;
|
||||
case NO::Leftwards: return NorthLeftwards;
|
||||
default: return NorthUpwards;
|
||||
}
|
||||
}
|
||||
|
||||
void QMapboxGL::setNorthOrientation(NorthOrientation orientation)
|
||||
{
|
||||
using NO = mbgl::NorthOrientation;
|
||||
switch (orientation) {
|
||||
case NorthRightwards: d_ptr->mapObj->setNorthOrientation(NO::Rightwards); break;
|
||||
case NorthDownwards: d_ptr->mapObj->setNorthOrientation(NO::Downwards); break;
|
||||
case NorthLeftwards: d_ptr->mapObj->setNorthOrientation(NO::Leftwards); break;
|
||||
default: d_ptr->mapObj->setNorthOrientation(NO::Upwards); break;
|
||||
}
|
||||
}
|
||||
|
||||
void QMapboxGL::setGestureInProgress(bool inProgress)
|
||||
{
|
||||
d_ptr->mapObj->setGestureInProgress(inProgress);
|
||||
|
||||
Reference in New Issue
Block a user