|
|
@ -34,7 +34,13 @@ QGCMapWidget::QGCMapWidget(QWidget *parent) : |
|
|
|
//this->SetShowTileGridLines(true);
|
|
|
|
//this->SetShowTileGridLines(true);
|
|
|
|
|
|
|
|
|
|
|
|
//default appears to be Google Hybrid, and is broken currently
|
|
|
|
//default appears to be Google Hybrid, and is broken currently
|
|
|
|
|
|
|
|
#if defined MAP_DEFAULT_TYPE_BING |
|
|
|
this->SetMapType(MapType::BingHybrid); |
|
|
|
this->SetMapType(MapType::BingHybrid); |
|
|
|
|
|
|
|
#elif defined MAP_DEFAULT_TYPE_GOOGLE |
|
|
|
|
|
|
|
this->SetMapType(MapType::GoogleHybrid); |
|
|
|
|
|
|
|
#else |
|
|
|
|
|
|
|
this->SetMapType(MapType::OpenStreetMap); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
this->setContextMenuPolicy(Qt::ActionsContextMenu); |
|
|
|
this->setContextMenuPolicy(Qt::ActionsContextMenu); |
|
|
|
|
|
|
|
|
|
|
@ -75,7 +81,7 @@ void QGCMapWidget::guidedActionTriggered() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// Create new waypoint and send it to the WPManager to send out.
|
|
|
|
// Create new waypoint and send it to the WPManager to send out.
|
|
|
|
internals::PointLatLng pos = map->FromLocalToLatLng(mousePressPos.x(), mousePressPos.y()); |
|
|
|
internals::PointLatLng pos = map->FromLocalToLatLng(contextMousePressPos.x(), contextMousePressPos.y()); |
|
|
|
qDebug() << "Guided action requested. Lat:" << pos.Lat() << "Lon:" << pos.Lng(); |
|
|
|
qDebug() << "Guided action requested. Lat:" << pos.Lat() << "Lon:" << pos.Lng(); |
|
|
|
Waypoint wp; |
|
|
|
Waypoint wp; |
|
|
|
wp.setLatitude(pos.Lat()); |
|
|
|
wp.setLatitude(pos.Lat()); |
|
|
@ -113,7 +119,7 @@ void QGCMapWidget::cameraActionTriggered() |
|
|
|
if (newmav) |
|
|
|
if (newmav) |
|
|
|
{ |
|
|
|
{ |
|
|
|
newmav->setMountConfigure(4,true,true,true); |
|
|
|
newmav->setMountConfigure(4,true,true,true); |
|
|
|
internals::PointLatLng pos = map->FromLocalToLatLng(mousePressPos.x(), mousePressPos.y()); |
|
|
|
internals::PointLatLng pos = map->FromLocalToLatLng(contextMousePressPos.x(), contextMousePressPos.y()); |
|
|
|
newmav->setMountControl(pos.Lat(),pos.Lng(),100,true); |
|
|
|
newmav->setMountControl(pos.Lat(),pos.Lng(),100,true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -165,15 +171,6 @@ void QGCMapWidget::mouseReleaseEvent(QMouseEvent *event) |
|
|
|
mapcontrol::OPMapWidget::mouseReleaseEvent(event); |
|
|
|
mapcontrol::OPMapWidget::mouseReleaseEvent(event); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
void QGCMapWidget::contextMenuEvent(QContextMenuEvent *event) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// TODO Remove this method
|
|
|
|
|
|
|
|
qDebug() << "Context menu event triggered."; |
|
|
|
|
|
|
|
mapcontrol::OPMapWidget::contextMenuEvent(event); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCMapWidget::~QGCMapWidget() |
|
|
|
QGCMapWidget::~QGCMapWidget() |
|
|
|
{ |
|
|
|
{ |
|
|
|
SetShowHome(false); // doing this appears to stop the map lib crashing on exit
|
|
|
|
SetShowHome(false); // doing this appears to stop the map lib crashing on exit
|
|
|
|