1
0
mirror of git://projects.qi-hardware.com/nanomap.git synced 2024-11-24 06:36:16 +02:00

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

View File

@ -143,14 +143,24 @@ void MonavLayer::keyPressed(QKeyEvent *event)
case Qt::Key_S: case Qt::Key_S:
{ {
if (event->modifiers() == Qt::NoModifier) { 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; break;
} }
case Qt::Key_E: case Qt::Key_E:
{ {
if (event->modifiers() == Qt::NoModifier) { 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; break;
} }