diff --git a/ground/src/libs/opmapcontrol/src/internals/core.cpp b/ground/src/libs/opmapcontrol/src/internals/core.cpp index fd59e7f8e..4b6d4cbc7 100644 --- a/ground/src/libs/opmapcontrol/src/internals/core.cpp +++ b/ground/src/libs/opmapcontrol/src/internals/core.cpp @@ -34,7 +34,7 @@ using namespace projections; namespace internals { Core::Core():MouseWheelZooming(false),currentPosition(0,0),currentPositionPixel(0,0),LastLocationInBounds(-1,-1),sizeOfMapArea(0,0) - ,minOfTiles(0,0),maxOfTiles(0,0),zoom(0),isDragging(false),TooltipTextPadding(10,10),loaderLimit(5),started(false) + ,minOfTiles(0,0),maxOfTiles(0,0),zoom(0),isDragging(false),TooltipTextPadding(10,10),loaderLimit(5),maxzoom(17),started(false) { mousewheelzoomtype=MouseWheelZoomType::MousePositionAndCenter; SetProjection(new MercatorProjection()); @@ -286,6 +286,7 @@ namespace internals { if(Projection()->Type()!="PlateCarreeProjection") { SetProjection(new PlateCarreeProjection()); + maxzoom=13; } } break; @@ -298,6 +299,7 @@ namespace internals { if(Projection()->Type()!="LKS94Projection") { SetProjection(new LKS94Projection()); + maxzoom=11; } } break; @@ -307,6 +309,7 @@ namespace internals { if(Projection()->Type()!="PlateCarreeProjectionPergo") { SetProjection(new PlateCarreeProjectionPergo()); + maxzoom=17; } } break; @@ -316,6 +319,7 @@ namespace internals { if(Projection()->Type()!="MercatorProjectionYandex") { SetProjection(new MercatorProjectionYandex()); + maxzoom=13; } } break; @@ -325,6 +329,7 @@ namespace internals { if(Projection()->Type()!="MercatorProjection") { SetProjection(new MercatorProjection()); + maxzoom=17; } } break; @@ -433,7 +438,7 @@ namespace internals { { int zoom = 0; - for(int i = 1; i <= OPMaps::Instance()->MaxZoom; i++) + for(int i = 1; i <= MaxZoom(); i++) { Point p1 = Projection()->FromLatLngToPixel(rect.LocationTopLeft(), i); Point p2 = Projection()->FromLatLngToPixel(rect.Bottom(), rect.Right(), i); diff --git a/ground/src/libs/opmapcontrol/src/internals/core.h b/ground/src/libs/opmapcontrol/src/internals/core.h index 7f6f7eaff..931adbd7f 100644 --- a/ground/src/libs/opmapcontrol/src/internals/core.h +++ b/ground/src/libs/opmapcontrol/src/internals/core.h @@ -73,35 +73,36 @@ public: Core(); ~Core(); void run(); - PointLatLng CurrentPosition()const{return currentPosition;}; + PointLatLng CurrentPosition()const{return currentPosition;} + void SetCurrentPosition(const PointLatLng &value); - core::Point GetcurrentPositionGPixel(){return currentPositionPixel;}; - void SetcurrentPositionGPixel(const core::Point &value){currentPositionPixel=value;}; + core::Point GetcurrentPositionGPixel(){return currentPositionPixel;} + void SetcurrentPositionGPixel(const core::Point &value){currentPositionPixel=value;} - core::Point GetrenderOffset(){return renderOffset;}; - void SetrenderOffset(const core::Point &value){renderOffset=value;}; + core::Point GetrenderOffset(){return renderOffset;} + void SetrenderOffset(const core::Point &value){renderOffset=value;} - core::Point GetcenterTileXYLocation(){return centerTileXYLocation;}; - void SetcenterTileXYLocation(const core::Point &value){centerTileXYLocation=value;}; + core::Point GetcenterTileXYLocation(){return centerTileXYLocation;} + void SetcenterTileXYLocation(const core::Point &value){centerTileXYLocation=value;} - core::Point GetcenterTileXYLocationLast(){return centerTileXYLocationLast;}; - void SetcenterTileXYLocationLast(const core::Point &value){centerTileXYLocationLast=value;}; + core::Point GetcenterTileXYLocationLast(){return centerTileXYLocationLast;} + void SetcenterTileXYLocationLast(const core::Point &value){centerTileXYLocationLast=value;} - core::Point GetdragPoint(){return dragPoint;}; - void SetdragPoint(const core::Point &value){dragPoint=value;}; + core::Point GetdragPoint(){return dragPoint;} + void SetdragPoint(const core::Point &value){dragPoint=value;} - core::Point GetmouseDown(){return mouseDown;}; - void SetmouseDown(const core::Point &value){mouseDown=value;}; + core::Point GetmouseDown(){return mouseDown;} + void SetmouseDown(const core::Point &value){mouseDown=value;} - core::Point GetmouseCurrent(){return mouseCurrent;}; - void SetmouseCurrent(const core::Point &value){mouseCurrent=value;}; + core::Point GetmouseCurrent(){return mouseCurrent;} + void SetmouseCurrent(const core::Point &value){mouseCurrent=value;} - core::Point GetmouseLastZoom(){return mouseLastZoom;}; - void SetmouseLastZoom(const core::Point &value){mouseLastZoom=value;}; + core::Point GetmouseLastZoom(){return mouseLastZoom;} + void SetmouseLastZoom(const core::Point &value){mouseLastZoom=value;} - MouseWheelZoomType::Types GetMouseWheelZoomType(){return mousewheelzoomtype;}; - void SetMouseWheelZoomType(const MouseWheelZoomType::Types &value){mousewheelzoomtype=value;}; + MouseWheelZoomType::Types GetMouseWheelZoomType(){return mousewheelzoomtype;} + void SetMouseWheelZoomType(const MouseWheelZoomType::Types &value){mousewheelzoomtype=value;} PointLatLng GetLastLocationInBounds(){return LastLocationInBounds;} void SetLastLocationInBounds(const PointLatLng &value){LastLocationInBounds=value;} @@ -140,6 +141,8 @@ public: int Zoom()const{return zoom;} void SetZoom(int const& value); + int MaxZoom()const{return maxzoom;} + void UpdateBounds(); MapType::Types GetMapType(){return mapType;} @@ -253,6 +256,8 @@ private: QMutex MtileToload; int tilesToload; + int maxzoom; + protected: bool started; diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp b/ground/src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp index b70e67b2d..5479da400 100644 --- a/ground/src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp +++ b/ground/src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.cpp @@ -171,32 +171,51 @@ namespace mapcontrol } } + else if(isSelected && !selectionStart.IsEmpty() && (event->modifiers() == Qt::AltModifier || event->modifiers() == Qt::ShiftModifier)) + { + selectionEnd = FromLocalToLatLng(event->pos().x(), event->pos().y()); + { + internals::PointLatLng p1 = selectionStart; + internals::PointLatLng p2 = selectionEnd; + + double x1 = qMin(p1.Lng(), p2.Lng()); + double y1 = qMax(p1.Lat(), p2.Lat()); + double x2 = qMax(p1.Lng(), p2.Lng()); + double y2 = qMin(p1.Lat(), p2.Lat()); + + SetSelectedArea(internals::RectLatLng(y1, x1, x2 - x1, y1 - y2)); + } + } QGraphicsItem::mouseMoveEvent(event); } void MapGraphicItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { - if(!IsMouseOverMarker()) - { - if(event->button() == config->DragButton && CanDragMap()) + + + + if(!IsMouseOverMarker()) { - core->mouseDown.SetX(event->pos().x()); - core->mouseDown.SetY(event->pos().y()); + if(event->button() == config->DragButton && CanDragMap()&& !((event->modifiers()==Qt::AltModifier)||(event->modifiers()==Qt::ShiftModifier))) + { + core->mouseDown.SetX(event->pos().x()); + core->mouseDown.SetY(event->pos().y()); - this->setCursor(Qt::SizeAllCursor); + this->setCursor(Qt::SizeAllCursor); - core->BeginDrag(core->mouseDown); - this->update(); + core->BeginDrag(core->mouseDown); + this->update(); + } + else if(!isSelected && ((event->modifiers()==Qt::AltModifier)||(event->modifiers()==Qt::ShiftModifier))) + { + isSelected = true; + SetSelectedArea (internals::RectLatLng::Empty); + selectionEnd = internals::PointLatLng::Empty; + selectionStart = FromLocalToLatLng(event->pos().x(), event->pos().y()); + } } - else if(!isSelected) - { - isSelected = true; - SetSelectedArea (internals::RectLatLng::Empty); - selectionEnd = internals::PointLatLng::Empty; - selectionStart = FromLocalToLatLng(event->pos().x(), event->pos().y()); - } - } + } void MapGraphicItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { @@ -224,12 +243,35 @@ namespace mapcontrol { if(!selectedArea.IsEmpty() && event->modifiers() == Qt::ShiftModifier) { - // SetZoomToFitRect(SelectedArea());TODO + SetZoomToFitRect(SelectedArea()); } } } } + bool MapGraphicItem::SetZoomToFitRect(internals::RectLatLng const& rect) + { + int maxZoom = core->GetMaxZoomToFitRect(rect); + if(maxZoom > 0) + { + internals::PointLatLng center=internals::PointLatLng(rect.Lat()-(rect.HeightLat()/2), rect.Lng()+(rect.WidthLng()/2)); + core->SetCurrentPosition(center); + + if(maxZoom > MaxZoom()) + { + maxZoom = MaxZoom(); + } + + if((int) Zoom() != maxZoom) + { + SetZoom(maxZoom); + } + + return true; + } + return false; + } + void MapGraphicItem::wheelEvent(QGraphicsSceneWheelEvent *event) { if(!IsMouseOverMarker() && !IsDragging()) @@ -354,6 +396,18 @@ namespace mapcontrol // raise error } + if(!SelectedArea().IsEmpty()) + { + core::Point p1 = FromLatLngToLocal(SelectedArea().LocationTopLeft()); + core::Point p2 = FromLatLngToLocal(SelectedArea().LocationRightBottom()); + int x1 = p1.X(); + int y1 = p1.Y(); + int x2 = p2.X(); + int y2 = p2.Y(); + painter->setPen(Qt::black); + painter->setBrush(QBrush(QColor(50,50,100,20))); + painter->drawRect(x1,y1,x2-x1,y2-y1); + } } } } diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.h b/ground/src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.h index 7879144e6..82f8e7406 100644 --- a/ground/src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.h +++ b/ground/src/libs/opmapcontrol/src/mapwidget/mapgraphicitem.h @@ -120,7 +120,7 @@ namespace mapcontrol private: - + bool SetZoomToFitRect(internals::RectLatLng const& rect); internals::Core *core; Configuration *config; bool showTileGridLines; @@ -162,7 +162,7 @@ namespace mapcontrol * * @return int */ - int MaxZoom()const{return maxZoom;} + int MaxZoom()const{return core->MaxZoom();} /** * @brief Returns the minimum allowed zoom * @@ -171,6 +171,7 @@ namespace mapcontrol int MinZoom()const{return minZoom;} internals::MouseWheelZoomType::Types GetMouseWheelZoomType(){return core->GetMouseWheelZoomType();} void SetSelectedArea(internals::RectLatLng const& value){selectedArea = value;this->update();} + internals::RectLatLng SelectedArea()const{return selectedArea;} internals::RectLatLng BoundsOfMap; void Offset(int const& x, int const& y); bool CanDragMap()const{return core->CanDragMap;} @@ -183,7 +184,6 @@ namespace mapcontrol GeoCoderStatusCode::Types SetCurrentPositionByKeywords(QString const& keys){return core->SetCurrentPositionByKeywords(keys);} MapType::Types GetMapType(){return core->GetMapType();} void SetMapType(MapType::Types const& value){core->SetMapType(value);} - private slots: void Core_OnNeedInvalidation(); void ChildPosRefresh(); diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.cpp b/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.cpp new file mode 100644 index 000000000..150aa5c38 --- /dev/null +++ b/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.cpp @@ -0,0 +1,54 @@ +/** +****************************************************************************** +* +* @file mapripform.cpp +* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. +* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. +* @brief The main graphicsItem used on the widget, contains the map and map logic +* @see The GNU Public License (GPL) Version 3 +* @defgroup OPMapWidget +* @{ +* +*****************************************************************************/ +/* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +* for more details. +* +* You should have received a copy of the GNU General Public License along +* with this program; if not, write to the Free Software Foundation, Inc., +* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "mapripform.h" +#include "ui_mapripform.h" + +MapRipForm::MapRipForm(QWidget *parent) : + QWidget(parent), + ui(new Ui::MapRipForm) +{ + ui->setupUi(this); +} + +MapRipForm::~MapRipForm() +{ + delete ui; +} +void MapRipForm::SetPercentage(const int &perc) +{ + ui->progressBar->setValue(perc); +} +void MapRipForm::SetProvider(const QString &prov,const int &zoom) +{ + ui->mainlabel->setText(QString("Currently ripping from:%1 at Zoom level %2").arg(prov).arg(zoom)); +} +void MapRipForm::SetNumberOfTiles(const int &total, const int &actual) +{ + ui->statuslabel->setText(QString("Downloading tile %1 of %2").arg(actual).arg(total)); +} diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.h b/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.h new file mode 100644 index 000000000..fa53a8e47 --- /dev/null +++ b/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.h @@ -0,0 +1,52 @@ +/** +****************************************************************************** +* +* @file mapripform.h +* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. +* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. +* @brief The main graphicsItem used on the widget, contains the map and map logic +* @see The GNU Public License (GPL) Version 3 +* @defgroup OPMapWidget +* @{ +* +*****************************************************************************/ +/* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +* for more details. +* +* You should have received a copy of the GNU General Public License along +* with this program; if not, write to the Free Software Foundation, Inc., +* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef MAPRIPFORM_H +#define MAPRIPFORM_H + +#include + +namespace Ui { + class MapRipForm; +} + +class MapRipForm : public QWidget +{ + Q_OBJECT + +public: + explicit MapRipForm(QWidget *parent = 0); + ~MapRipForm(); +public slots: + void SetPercentage(int const& perc); + void SetProvider(QString const& prov,int const& zoom); + void SetNumberOfTiles(int const& total,int const& actual); +private: + Ui::MapRipForm *ui; +}; + +#endif // MAPRIPFORM_H diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.ui b/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.ui new file mode 100644 index 000000000..8100f8651 --- /dev/null +++ b/ground/src/libs/opmapcontrol/src/mapwidget/mapripform.ui @@ -0,0 +1,71 @@ + + + MapRipForm + + + + 0 + 0 + 392 + 133 + + + + MapRipper + + + + + 20 + 60 + 371 + 23 + + + + 0 + + + + + + 30 + 10 + 321 + 16 + + + + Currently ripping from: + + + + + + 30 + 40 + 341 + 16 + + + + Downloading tile + + + + + + 280 + 100 + 75 + 23 + + + + Cancel + + + + + + diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.cpp b/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.cpp new file mode 100644 index 000000000..72226546e --- /dev/null +++ b/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.cpp @@ -0,0 +1,123 @@ +/** +****************************************************************************** +* +* @file mapripper.cpp +* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. +* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. +* @brief The main graphicsItem used on the widget, contains the map and map logic +* @see The GNU Public License (GPL) Version 3 +* @defgroup OPMapWidget +* @{ +* +*****************************************************************************/ +/* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +* for more details. +* +* You should have received a copy of the GNU General Public License along +* with this program; if not, write to the Free Software Foundation, Inc., +* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#include "mapripper.h" +namespace mapcontrol +{ + + MapRipper::MapRipper(internals::Core * core, const internals::RectLatLng & rect):sleep(100),cancel(false),progressForm(0),core(core) + { + if(!rect.IsEmpty()) + { + type=core->GetMapType(); + progressForm=new MapRipForm; + area=rect; + zoom=core->Zoom(); + maxzoom=core->MaxZoom(); + points=core->Projection()->GetAreaTileList(area,zoom,0); + this->start(); + progressForm->show(); + connect(this,SIGNAL(percentageChanged(int)),progressForm,SLOT(SetPercentage(int))); + connect(this,SIGNAL(numberOfTilesChanged(int,int)),progressForm,SLOT(SetNumberOfTiles(int,int))); + connect(this,SIGNAL(providerChanged(QString,int)),progressForm,SLOT(SetProvider(QString,int))); + connect(this,SIGNAL(finished()),this,SLOT(finish())); + emit numberOfTilesChanged(0,0); + } + } + void MapRipper::finish() + { + if(zoomProjection()->GetAreaTileList(area,zoom,0); + this->start(); + } + else + { + progressForm->close(); + delete progressForm; + this->deleteLater(); + } + } + } + + + void MapRipper::run() + { + int countOk = 0; + bool goodtile=false; + // Stuff.Shuffle(ref list); + QVector types = OPMaps::Instance()->GetAllLayersOfType(type); + int all=points.count(); + for(int i = 0; i < all; i++) + { + emit numberOfTilesChanged(all,i+1); + if(cancel) + break; + + core::Point p = points[i]; + { + //qDebug()<<"offline fetching:"<GetImageFrom(type, p, zoom); + if(img.length()!=0) + { + goodtile=true; + img=NULL; + } + else + goodtile=false; + } + if(goodtile) + { + countOk++; + } + else + { + i--; + QThread::msleep(1000); + continue; + } + } + emit percentageChanged((int) ((i+1)*100/all));//, i+1); + // worker.ReportProgress((int) ((i+1)*100/all), i+1); + + QThread::msleep(sleep); + } + } +} diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.h b/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.h new file mode 100644 index 000000000..ad19c34a2 --- /dev/null +++ b/ground/src/libs/opmapcontrol/src/mapwidget/mapripper.h @@ -0,0 +1,65 @@ +/** +****************************************************************************** +* +* @file mapripper.h +* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. +* Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. +* @brief The main graphicsItem used on the widget, contains the map and map logic +* @see The GNU Public License (GPL) Version 3 +* @defgroup OPMapWidget +* @{ +* +*****************************************************************************/ +/* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +* for more details. +* +* You should have received a copy of the GNU General Public License along +* with this program; if not, write to the Free Software Foundation, Inc., +* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ +#ifndef MAPRIPPER_H +#define MAPRIPPER_H + +#include +#include "../internals/core.h" +#include "mapripform.h" +#include +#include +namespace mapcontrol +{ + class MapRipper:public QThread + { + Q_OBJECT + public: + MapRipper(internals::Core *,internals::RectLatLng const&); + void run(); + private: + QList points; + int zoom; + core::MapType::Types type; + int sleep; + internals::RectLatLng area; + bool cancel; + MapRipForm * progressForm; + int maxzoom; + internals::Core * core; + + signals: + void percentageChanged(int const& perc); + void numberOfTilesChanged(int const& total,int const& actual); + void providerChanged(QString const& prov,int const& zoom); + + + public slots: + void finish(); + }; +} +#endif // MAPRIPPER_H diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/mapwidget.pro b/ground/src/libs/opmapcontrol/src/mapwidget/mapwidget.pro index c1abdf65e..24a9af6c4 100644 --- a/ground/src/libs/opmapcontrol/src/mapwidget/mapwidget.pro +++ b/ground/src/libs/opmapcontrol/src/mapwidget/mapwidget.pro @@ -10,7 +10,9 @@ SOURCES += mapgraphicitem.cpp \ waypointitem.cpp \ uavitem.cpp \ trailitem.cpp \ - homeitem.cpp + homeitem.cpp \ + mapripform.cpp \ + mapripper.cpp LIBS += -L../build \ -lcore \ -linternals \ @@ -23,9 +25,14 @@ HEADERS += mapgraphicitem.h \ uavmapfollowtype.h \ uavtrailtype.h \ trailitem.h \ - homeitem.h + homeitem.h \ + mapripform.h \ + mapripper.h QT += opengl QT += network QT += sql QT += svg RESOURCES += mapresources.qrc + +FORMS += \ + mapripform.ui diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp b/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp index 1833bab07..298ede87b 100644 --- a/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp +++ b/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.cpp @@ -277,4 +277,8 @@ namespace mapcontrol if(compass) compass->setRotation(value); } + void OPMapWidget::RipMap() + { + new MapRipper(core,map->SelectedArea()); + } } diff --git a/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.h b/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.h index b955b690c..0fe7a8742 100644 --- a/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.h +++ b/ground/src/libs/opmapcontrol/src/mapwidget/opmapwidget.h @@ -38,6 +38,7 @@ #include "QtSvg/QGraphicsSvgItem" #include "uavitem.h" #include "homeitem.h" +#include "mapripper.h" namespace mapcontrol { class UAVItem; @@ -147,7 +148,7 @@ namespace mapcontrol { Q_OBJECT - Q_PROPERTY(int MaxZoom READ MaxZoom WRITE SetMaxZoom) + // Q_PROPERTY(int MaxZoom READ MaxZoom WRITE SetMaxZoom) Q_PROPERTY(int MinZoom READ MinZoom WRITE SetMinZoom) Q_PROPERTY(bool ShowTileGridLines READ ShowTileGridLines WRITE SetShowTileGridLines) Q_PROPERTY(double Zoom READ Zoom WRITE SetZoom) @@ -186,9 +187,9 @@ namespace mapcontrol * @brief Returns the maximum zoom for the map * */ - int MaxZoom()const{return map->maxZoom;} + int MaxZoom()const{return map->MaxZoom();} - void SetMaxZoom(int const& value){map->maxZoom = value;} + // void SetMaxZoom(int const& value){map->maxZoom = value;} /** * @brief @@ -433,7 +434,11 @@ namespace mapcontrol * @param number the number of tiles still in the queue */ void OnTilesStillToLoad(int number); - + public slots: + /** + * @brief Ripps the current selection to the DB + */ + void RipMap(); }; }