summaryrefslogtreecommitdiff
path: root/src/imports/location/qdeclarativegeomapgesturearea.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/location/qdeclarativegeomapgesturearea.cpp')
-rw-r--r--src/imports/location/qdeclarativegeomapgesturearea.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/imports/location/qdeclarativegeomapgesturearea.cpp b/src/imports/location/qdeclarativegeomapgesturearea.cpp
index 1d161036..0fbf5557 100644
--- a/src/imports/location/qdeclarativegeomapgesturearea.cpp
+++ b/src/imports/location/qdeclarativegeomapgesturearea.cpp
@@ -748,7 +748,7 @@ void QDeclarativeGeoMapGestureArea::touchPointStateMachine()
if (touchPoints_.count() == 0) {
touchPointState_ = touchPoints0;
} else if (touchPoints_.count() == 2) {
- touchCenterCoord_ = map_->screenPositionToCoordinate(QDoubleVector2D(sceneCenter_), false);
+ touchCenterCoord_ = map_->itemPositionToCoordinate(QDoubleVector2D(sceneCenter_), false);
startTwoTouchPoints();
touchPointState_ = touchPoints2;
}
@@ -757,7 +757,7 @@ void QDeclarativeGeoMapGestureArea::touchPointStateMachine()
if (touchPoints_.count() == 0) {
touchPointState_ = touchPoints0;
} else if (touchPoints_.count() == 1) {
- touchCenterCoord_ = map_->screenPositionToCoordinate(QDoubleVector2D(sceneCenter_), false);
+ touchCenterCoord_ = map_->itemPositionToCoordinate(QDoubleVector2D(sceneCenter_), false);
startOneTouchPoint();
touchPointState_ = touchPoints1;
}
@@ -785,7 +785,7 @@ void QDeclarativeGeoMapGestureArea::startOneTouchPoint()
sceneStartPoint1_ = declarativeMap_->mapFromScene(touchPoints_.at(0).scenePos());
lastPos_ = sceneStartPoint1_;
lastPosTime_.start();
- QGeoCoordinate startCoord = map_->screenPositionToCoordinate(QDoubleVector2D(sceneStartPoint1_), false);
+ QGeoCoordinate startCoord = map_->itemPositionToCoordinate(QDoubleVector2D(sceneStartPoint1_), false);
// ensures a smooth transition for panning
startCoord_.setLongitude(startCoord_.longitude() + startCoord.longitude() -
touchCenterCoord_.longitude());
@@ -813,7 +813,7 @@ void QDeclarativeGeoMapGestureArea::startTwoTouchPoints()
QPointF startPos = (sceneStartPoint1_ + sceneStartPoint2_) * 0.5;
lastPos_ = startPos;
lastPosTime_.start();
- QGeoCoordinate startCoord = map_->screenPositionToCoordinate(QDoubleVector2D(startPos), false);
+ QGeoCoordinate startCoord = map_->itemPositionToCoordinate(QDoubleVector2D(startPos), false);
startCoord_.setLongitude(startCoord_.longitude() + startCoord.longitude() -
touchCenterCoord_.longitude());
startCoord_.setLatitude(startCoord_.latitude() + startCoord.latitude() -
@@ -999,7 +999,7 @@ void QDeclarativeGeoMapGestureArea::panStateMachine()
case panInactive:
if (canStartPan()) {
// Update startCoord_ to ensure smooth start for panning when going over startDragDistance
- QGeoCoordinate newStartCoord = map_->screenPositionToCoordinate(QDoubleVector2D(lastPos_), false);
+ QGeoCoordinate newStartCoord = map_->itemPositionToCoordinate(QDoubleVector2D(lastPos_), false);
startCoord_.setLongitude(newStartCoord.longitude());
startCoord_.setLatitude(newStartCoord.latitude());
panState_ = panActive;
@@ -1064,13 +1064,13 @@ bool QDeclarativeGeoMapGestureArea::canStartPan()
*/
void QDeclarativeGeoMapGestureArea::updatePan()
{
- QPointF startPoint = map_->coordinateToScreenPosition(startCoord_, false).toPointF();
+ QPointF startPoint = map_->coordinateToItemPosition(startCoord_, false).toPointF();
int dx = static_cast<int>(sceneCenter_.x() - startPoint.x());
int dy = static_cast<int>(sceneCenter_.y() - startPoint.y());
QPointF mapCenterPoint;
mapCenterPoint.setY(map_->height() / 2.0 - dy);
mapCenterPoint.setX(map_->width() / 2.0 - dx);
- QGeoCoordinate animationStartCoordinate = map_->screenPositionToCoordinate(QDoubleVector2D(mapCenterPoint), false);
+ QGeoCoordinate animationStartCoordinate = map_->itemPositionToCoordinate(QDoubleVector2D(mapCenterPoint), false);
map_->mapController()->setCenter(animationStartCoordinate);
}