diff --git a/images/earth.html b/images/earth.html index c82e7c0..ba88b23 100644 --- a/images/earth.html +++ b/images/earth.html @@ -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); diff --git a/src/ui/map3D/QGCGoogleEarthView.cc b/src/ui/map3D/QGCGoogleEarthView.cc index 57f2be0..85a993a 100644 --- a/src/ui/map3D/QGCGoogleEarthView.cc +++ b/src/ui/map3D/QGCGoogleEarthView.cc @@ -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)