Commit 1407ccb4 authored by lm's avatar lm

Fixed waypoint in Google Earth

parent 7d68c7b6
......@@ -142,7 +142,8 @@ function updateWaypoint(id, index, lat, lon, alt, action)
location.setLatitude(lat);
location.setLongitude(lon);
location.setAltitude(alt);
waypoints[index].setGeometry(location);
waypoints[index].setGeometry(location);
console.log('WP LOC:' + lat + lon + alt);
}
else
{
......@@ -152,7 +153,8 @@ function updateWaypoint(id, index, lat, lon, alt, action)
var numberstring = index;
if (index < 10) numberstring = '0' + numberstring
icon.setHref('http://google-maps-icons.googlecode.com/files/red' + numberstring +'.png');
var style = ge.createStyle('');
var style = ge.createStyle('');
console.log('WP ICON created:' + 'http://google-maps-icons.googlecode.com/files/red' + numberstring +'.png');
style.getIconStyle().setIcon(icon);
//style.getIconStyle().setScale(0.5);
placemark.setStyleSelector(style);
......
......@@ -181,7 +181,8 @@ void QGCGoogleEarthView::updateWaypoint(int uas, Waypoint* wp)
}
else
{
javaScript(QString("updateWaypoint(%1,%2,%3,%4,%5,%6);").arg(uas).arg(wpindex).arg(wp->getY()).arg(wp->getX()).arg(wp->getZ()).arg(wp->getAction()));
javaScript(QString("updateWaypoint(%1,%2,%3,%4,%5,%6);").arg(uas).arg(wpindex).arg(wp->getLatitude(), 0, 'f', 18).arg(wp->getLongitude(), 0, 'f', 18).arg(wp->getAltitude(), 0, 'f', 18).arg(wp->getAction()));
qDebug() << QString("updateWaypoint(%1,%2,%3,%4,%5,%6);").arg(uas).arg(wpindex).arg(wp->getLatitude(), 0, 'f', 18).arg(wp->getLongitude(), 0, 'f', 18).arg(wp->getAltitude(), 0, 'f', 18).arg(wp->getAction());
}
}
}
......@@ -203,6 +204,8 @@ void QGCGoogleEarthView::updateWaypointList(int uas)
// Trim internal list to number of global waypoints in the waypoint manager list
javaScript(QString("updateWaypointListLength(%1,%2);").arg(uas).arg(wpList.count()));
qDebug() << QString("updateWaypointListLength(%1,%2);").arg(uas).arg(wpList.count());
// Load all existing waypoints into map view
foreach (Waypoint* wp, wpList)
{
......@@ -216,7 +219,7 @@ void QGCGoogleEarthView::updateGlobalPosition(UASInterface* uas, double lat, dou
Q_UNUSED(usec);
javaScript(QString("addTrailPosition(%1, %2, %3, %4);").arg(uas->getUASID()).arg(lat, 0, 'f', 18).arg(lon, 0, 'f', 18).arg(alt, 0, 'f', 15));
qDebug() << QString("addTrailPosition(%1, %2, %3, %4);").arg(uas->getUASID()).arg(lat, 0, 'f', 15).arg(lon, 0, 'f', 15).arg(alt, 0, 'f', 15);
//qDebug() << QString("addTrailPosition(%1, %2, %3, %4);").arg(uas->getUASID()).arg(lat, 0, 'f', 15).arg(lon, 0, 'f', 15).arg(alt, 0, 'f', 15);
}
void QGCGoogleEarthView::showTrail(bool state)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment