Skip to content

Commit

Permalink
Fixed Google Satellite
Browse files Browse the repository at this point in the history
Download Speed Tweaks (+2 squashed commits)
Squashed commits:
[ff0ef7e] Cleanup (remove OpenStreetMap)
[370fa1d] Done (+25 squashed commits)
Squashed commits:
[9f3368f] Need to check how many instances of MapEngine are active.
[d557eac] Download Optimization
[392f50a] Almost there.
Trying to optimize download.
[a49d1d2] Settings
[a94be97] Mostly there. Needs to finish options and map thumbnail.
[38d5a0b] Downloading tiles and deleting sets
[81101b9] More UI Work
[c597d4b] Downloading tiles
[a815e35] Get rid of OpenMaps
[7e177ea] More reorg
[fa6b671] Start handling create tile set
Fix signal order when creating fetch tile task
[2a31f4d] Refactoring
[268b906] Renaming things
[947d66e] Fix resource load error.
[19e2de8] Adding MapBox
[c73e627] Preparing download
[87bbf22] UI Tweaks
[3c32a86] A lot of UI code done.
[ece8ce2] Starting to deal with tiles
[7f387bc] Save tile set
[f66f343] Adding more code
[4de3418] Working
[f0cc25d] Done for the night.
[2d1d86e] Added SQL database for holding out own tile cache.
[d405a87] Convert to camel case as this has been driving me nuts.
  • Loading branch information
dogmaphobic committed Feb 18, 2016
1 parent 7891f53 commit 8624fb7
Show file tree
Hide file tree
Showing 44 changed files with 5,136 additions and 1,278 deletions.
1 change: 1 addition & 0 deletions qgcresources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
<file alias="buttonRight.svg">resources/buttonRight.svg</file>
<file alias="JoystickBezel.png">resources/JoystickBezel.png</file>
<file alias="JoystickBezelLight.png">resources/JoystickBezelLight.png</file>
<file alias="notile.png">resources/notile.png</file>
<file alias="Pause">resources/Pause.svg</file>
<file alias="Play">resources/Play.svg</file>
<file alias="PowerButton">resources/PowerButton.svg</file>
Expand Down
8 changes: 6 additions & 2 deletions qgroundcontrol.pro
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ INCLUDEPATH += \
src/ui/uas \
src/VehicleSetup \
src/ViewWidgets \
src/QtLocationPlugin \
src/QtLocationPlugin/QMLControl \

FORMS += \
src/ui/MainWindow.ui \
Expand Down Expand Up @@ -284,7 +286,8 @@ HEADERS += \
src/AutoPilotPlugins/PX4/PX4AirframeLoader.h \
src/AutoPilotPlugins/APM/APMAirframeLoader.h \
src/QmlControls/QGCImageProvider.h \
src/AutoPilotPlugins/APM/APMRemoteParamsDownloader.h
src/AutoPilotPlugins/APM/APMRemoteParamsDownloader.h \
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h \

DebugBuild {
HEADERS += \
Expand Down Expand Up @@ -405,7 +408,8 @@ SOURCES += \
src/AutoPilotPlugins/PX4/PX4AirframeLoader.cc \
src/AutoPilotPlugins/APM/APMAirframeLoader.cc \
src/QmlControls/QGCImageProvider.cc \
src/AutoPilotPlugins/APM/APMRemoteParamsDownloader.cc
src/AutoPilotPlugins/APM/APMRemoteParamsDownloader.cc \
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc \

DebugBuild {
SOURCES += \
Expand Down
2 changes: 2 additions & 0 deletions qgroundcontrol.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<file alias="MavlinkSettings.qml">src/ui/preferences/MavlinkSettings.qml</file>
<file alias="MockLink.qml">src/ui/preferences/MockLink.qml</file>
<file alias="MockLinkSettings.qml">src/ui/preferences/MockLinkSettings.qml</file>
<file alias="OfflineMap.qml">src/QtLocationPlugin/QMLControl/OfflineMap.qml</file>
<file alias="SerialSettings.qml">src/ui/preferences/SerialSettings.qml</file>
<file alias="TcpSettings.qml">src/ui/preferences/TcpSettings.qml</file>
<file alias="UdpSettings.qml">src/ui/preferences/UdpSettings.qml</file>
Expand Down Expand Up @@ -139,6 +140,7 @@
<file alias="SetupView.qml">src/VehicleSetup/SetupView.qml</file>
<file alias="test.qml">src/test.qml</file>
<file alias="VehicleSummary.qml">src/VehicleSetup/VehicleSummary.qml</file>
<file alias="QGroundControl/Controls/OfflineMapButton.qml">src/QmlControls/OfflineMapButton.qml</file>
</qresource>
<qresource prefix="/json">
<file alias="MavCmdInfoCommon.json">src/MissionManager/MavCmdInfoCommon.json</file>
Expand Down
Binary file added resources/notile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion src/FlightMap/FlightMapSettings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void FlightMapSettings::setToolbox(QGCToolbox *toolbox)

qmlRegisterUncreatableType<FlightMapSettings> ("QGroundControl", 1, 0, "FlightMapSetting", "Reference only");

_supportedMapProviders << "Bing" << "Google" << "OpenStreetMap";
_supportedMapProviders << "Bing" << "Google"; // << "OpenStreetMap";

_loadSettings();
}
Expand Down Expand Up @@ -93,8 +93,10 @@ void FlightMapSettings::_setMapTypesForCurrentProvider(void)
_mapTypes << "Street Map" << "Satellite Map" << "Hybrid Map";
} else if (_mapProvider == "Google") {
_mapTypes << "Street Map" << "Satellite Map" << "Terrain Map";
/*
} else if (_mapProvider == "OpenStreetMap") {
_mapTypes << "Street Map";
*/
}

emit mapTypesChanged(_mapTypes);
Expand Down
5 changes: 5 additions & 0 deletions src/QGCToolbox.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "MultiVehicleManager.h"
#include "QGCImageProvider.h"
#include "UASMessageHandler.h"
#include "QGCMapEngineManager.h"

QGCToolbox::QGCToolbox(QGCApplication* app)
: _audioOutput(NULL)
Expand All @@ -48,6 +49,7 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
, _mavlinkProtocol(NULL)
, _missionCommands(NULL)
, _multiVehicleManager(NULL)
, _mapEngineManager(NULL)
, _uasMessageHandler(NULL)
{
_audioOutput = new GAudioOutput(app);
Expand All @@ -62,6 +64,7 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
_mavlinkProtocol = new MAVLinkProtocol(app);
_missionCommands = new MissionCommands(app);
_multiVehicleManager = new MultiVehicleManager(app);
_mapEngineManager = new QGCMapEngineManager(app);
_uasMessageHandler = new UASMessageHandler(app);

_audioOutput->setToolbox(this);
Expand All @@ -76,6 +79,7 @@ QGCToolbox::QGCToolbox(QGCApplication* app)
_mavlinkProtocol->setToolbox(this);
_missionCommands->setToolbox(this);
_multiVehicleManager->setToolbox(this);
_mapEngineManager->setToolbox(this);
_uasMessageHandler->setToolbox(this);
}

Expand All @@ -91,6 +95,7 @@ QGCToolbox::~QGCToolbox()
delete _linkManager;
delete _mavlinkProtocol;
delete _missionCommands;
delete _mapEngineManager;
delete _multiVehicleManager;
delete _uasMessageHandler;
}
Expand Down
3 changes: 3 additions & 0 deletions src/QGCToolbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class LinkManager;
class MAVLinkProtocol;
class MissionCommands;
class MultiVehicleManager;
class QGCMapEngineManager;
class QGCApplication;
class QGCImageProvider;
class UASMessageHandler;
Expand All @@ -58,6 +59,7 @@ class QGCToolbox {
MAVLinkProtocol* mavlinkProtocol(void) { return _mavlinkProtocol; }
MissionCommands* missionCommands(void) { return _missionCommands; }
MultiVehicleManager* multiVehicleManager(void) { return _multiVehicleManager; }
QGCMapEngineManager* mapEngineManager(void) { return _mapEngineManager; }
QGCImageProvider* imageProvider() { return _imageProvider; }
UASMessageHandler* uasMessageHandler(void) { return _uasMessageHandler; }

Expand All @@ -74,6 +76,7 @@ class QGCToolbox {
MAVLinkProtocol* _mavlinkProtocol;
MissionCommands* _missionCommands;
MultiVehicleManager* _multiVehicleManager;
QGCMapEngineManager* _mapEngineManager;
UASMessageHandler* _uasMessageHandler;
};

Expand Down
103 changes: 103 additions & 0 deletions src/QmlControls/OfflineMapButton.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import QtQuick 2.5
import QtQuick.Controls 1.2

import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0

Rectangle
{
id: __mapButton

property var __qgcPal: QGCPalette { colorGroupEnabled: enabled }
property bool __showHighlight: (__pressed | __hovered | checked) && !__forceHoverOff

property bool __forceHoverOff: false
property int __lastGlobalMouseX: 0
property int __lastGlobalMouseY: 0
property bool __pressed: false
property bool __hovered: false

property bool checked: false
property bool complete: false
property alias text: nameLabel.text
property alias size: sizeLabel.text

signal clicked()

color: __showHighlight ? __qgcPal.buttonHighlight : __qgcPal.button
anchors.margins: ScreenTools.defaultFontPixelWidth
Row {
anchors.centerIn: parent
QGCLabel {
id: nameLabel
width: __mapButton.width * 0.4
color: __showHighlight ? __qgcPal.buttonHighlightText : __qgcPal.buttonText
anchors.verticalCenter: parent.verticalCenter
}
QGCLabel {
id: sizeLabel
width: __mapButton.width * 0.4
horizontalAlignment: Text.AlignRight
anchors.verticalCenter: parent.verticalCenter
color: __showHighlight ? __qgcPal.buttonHighlightText : __qgcPal.buttonText
}
Item {
width: ScreenTools.defaultFontPixelWidth * 2
height: 1
}
Rectangle {
width: sizeLabel.height * 0.5
height: sizeLabel.height * 0.5
radius: width / 2
color: complete ? "#31f55b" : "#fc5656"
opacity: sizeLabel.text.length > 0 ? 1 : 0
anchors.verticalCenter: parent.verticalCenter
}
Item {
width: ScreenTools.defaultFontPixelWidth * 2
height: 1
}
QGCColoredImage {
width: sizeLabel.height * 0.8
height: sizeLabel.height * 0.8
source: "/res/buttonRight.svg"
mipmap: true
fillMode: Image.PreserveAspectFit
color: __showHighlight ? __qgcPal.buttonHighlightText : __qgcPal.buttonText
anchors.verticalCenter: parent.verticalCenter
}
}

MouseArea {
anchors.fill: parent
hoverEnabled: true
onMouseXChanged: {
__lastGlobalMouseX = ScreenTools.mouseX()
__lastGlobalMouseY = ScreenTools.mouseY()
}
onMouseYChanged: {
__lastGlobalMouseX = ScreenTools.mouseX()
__lastGlobalMouseY = ScreenTools.mouseY()
}
onEntered: { __hovered = true; __forceHoverOff = false; hoverTimer.start() }
onExited: { __hovered = false; __forceHoverOff = false; hoverTimer.stop() }
onPressed: { __pressed = true; }
onReleased: { __pressed = false; }
onClicked: {
__mapButton.clicked()
}
}

Timer {
id: hoverTimer
interval: 250
repeat: true
onTriggered: {
if (__lastGlobalMouseX !== ScreenTools.mouseX() || __lastGlobalMouseY !== ScreenTools.mouseY()) {
__forceHoverOff = true
} else {
__forceHoverOff = false
}
}
}
}
1 change: 1 addition & 0 deletions src/QmlControls/QGroundControl.Controls.qmldir
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ SubMenuButton 1.0 SubMenuButton.qml
VehicleRotationCal 1.0 VehicleRotationCal.qml
VehicleSummaryRow 1.0 VehicleSummaryRow.qml
ViewWidget 1.0 ViewWidget.qml
OfflineMapButton 1.0 OfflineMapButton.qml
13 changes: 7 additions & 6 deletions src/QmlControls/QGroundControlQmlGlobal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ QGroundControlQmlGlobal::QGroundControlQmlGlobal(QGCApplication* app)
, _linkManager(NULL)
, _missionCommands(NULL)
, _multiVehicleManager(NULL)
, _mapEngineManager(NULL)
, _virtualTabletJoystick(false)
, _offlineEditingFirmwareTypeFact(QString(), "OfflineEditingFirmwareType", FactMetaData::valueTypeUint32, (uint32_t)MAV_AUTOPILOT_ARDUPILOTMEGA)
, _offlineEditingFirmwareTypeMetaData(FactMetaData::valueTypeUint32)
Expand All @@ -65,12 +66,12 @@ QGroundControlQmlGlobal::~QGroundControlQmlGlobal()
void QGroundControlQmlGlobal::setToolbox(QGCToolbox* toolbox)
{
QGCTool::setToolbox(toolbox);

_flightMapSettings = toolbox->flightMapSettings();
_homePositionManager = toolbox->homePositionManager();
_linkManager = toolbox->linkManager();
_missionCommands = toolbox->missionCommands();
_multiVehicleManager = toolbox->multiVehicleManager();
_flightMapSettings = toolbox->flightMapSettings();
_homePositionManager = toolbox->homePositionManager();
_linkManager = toolbox->linkManager();
_missionCommands = toolbox->missionCommands();
_multiVehicleManager = toolbox->multiVehicleManager();
_mapEngineManager = toolbox->mapEngineManager();
}


Expand Down
7 changes: 5 additions & 2 deletions src/QmlControls/QGroundControlQmlGlobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class QGroundControlQmlGlobal : public QGCTool
Q_PROPERTY(LinkManager* linkManager READ linkManager CONSTANT)
Q_PROPERTY(MissionCommands* missionCommands READ missionCommands CONSTANT)
Q_PROPERTY(MultiVehicleManager* multiVehicleManager READ multiVehicleManager CONSTANT)
Q_PROPERTY(QGCMapEngineManager* mapEngineManager READ mapEngineManager CONSTANT)

Q_PROPERTY(qreal zOrderTopMost READ zOrderTopMost CONSTANT) ///< z order for top most items, toolbar, main window sub view
Q_PROPERTY(qreal zOrderWidgets READ zOrderWidgets CONSTANT) ///< z order value to widgets, for example: zoom controls, hud widgetss
Expand Down Expand Up @@ -95,9 +96,10 @@ class QGroundControlQmlGlobal : public QGCTool

FlightMapSettings* flightMapSettings () { return _flightMapSettings; }
HomePositionManager* homePositionManager () { return _homePositionManager; }
LinkManager* linkManager () { return _linkManager; }
MissionCommands* missionCommands () { return _missionCommands; }
LinkManager* linkManager () { return _linkManager; }
MissionCommands* missionCommands () { return _missionCommands; }
MultiVehicleManager* multiVehicleManager () { return _multiVehicleManager; }
QGCMapEngineManager* mapEngineManager () { return _mapEngineManager; }

qreal zOrderTopMost () { return 1000; }
qreal zOrderWidgets () { return 100; }
Expand Down Expand Up @@ -149,6 +151,7 @@ class QGroundControlQmlGlobal : public QGCTool
LinkManager* _linkManager;
MissionCommands* _missionCommands;
MultiVehicleManager* _multiVehicleManager;
QGCMapEngineManager* _mapEngineManager;

bool _virtualTabletJoystick;

Expand Down
Loading

0 comments on commit 8624fb7

Please sign in to comment.