move route marker only if routing information is available for that point

This commit is contained in:
Niels 2010-11-05 09:58:00 +01:00
parent a8c63604ae
commit 6c6fabbbda
1 changed files with 12 additions and 2 deletions

View File

@ -143,14 +143,24 @@ void MonavLayer::keyPressed(QKeyEvent *event)
case Qt::Key_S:
{
if (event->modifiers() == Qt::NoModifier) {
m_routeStart = map()->geoPos();
QPointF p = map()->geoPos();
UnsignedCoordinate coord(GPSCoordinate(p.y(), p.x()));
IGPSLookup::Result pos;
if (m_gpsLookup->GetNearestEdge(&pos, coord, 1000.0)) {
m_routeStart = p;
}
}
break;
}
case Qt::Key_E:
{
if (event->modifiers() == Qt::NoModifier) {
m_routeEnd = map()->geoPos();
QPointF p = map()->geoPos();
UnsignedCoordinate coord(GPSCoordinate(p.y(), p.x()));
IGPSLookup::Result pos;
if (m_gpsLookup->GetNearestEdge(&pos, coord, 1000.0)) {
m_routeEnd = p;
}
}
break;
}