mirror of
git://projects.qi-hardware.com/nanomap.git
synced 2024-11-24 04:01:53 +02:00
move route marker only if routing information is available for that point
This commit is contained in:
parent
a8c63604ae
commit
6c6fabbbda
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user