[Qt] Implement pan() method

This commit is contained in:
Thiago Marcos P. Santos
2016-05-02 17:51:05 +03:00
parent d3f08f1442
commit 91cdcbebf4
3 changed files with 31 additions and 0 deletions

View File

@@ -159,6 +159,14 @@ QColor QQuickMapboxGL::color() const
return QColor();
}
void QQuickMapboxGL::pan(int dx, int dy)
{
m_pan += QPointF(dx, dy);
m_syncState |= PanNeedsSync;
update();
}
void QQuickMapboxGL::setStyle(const QString &styleUrl)
{
if (m_style == styleUrl) {
@@ -178,6 +186,15 @@ QString QQuickMapboxGL::style() const
return m_style;
}
QPointF QQuickMapboxGL::swapPan()
{
QPointF oldPan = m_pan;
m_pan = QPointF(0, 0);
return oldPan;
}
int QQuickMapboxGL::swapSyncState()
{
int oldState = m_syncState;