Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
0825be1c
Commit
0825be1c
authored
Sep 01, 2015
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle different vehicle position graphics based on the current map type.
parent
6f295b67
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
3 deletions
+50
-3
qgroundcontrol.qrc
qgroundcontrol.qrc
+2
-0
FlightMap.qml
src/FlightMap/FlightMap.qml
+25
-1
airplaneOpaque.svg
src/FlightMap/Images/airplaneOpaque.svg
+10
-0
airplaneOutline.svg
src/FlightMap/Images/airplaneOutline.svg
+10
-0
VehicleMapItem.qml
src/FlightMap/MapItems/VehicleMapItem.qml
+3
-2
No files found.
qgroundcontrol.qrc
View file @
0825be1c
...
...
@@ -59,6 +59,8 @@
<file alias="rollPointerWhite.svg">src/FlightMap/Images/rollPointerWhite.svg</file>
<file alias="scale.png">src/FlightMap/Images/scale.png</file>
<file alias="scale_end.png">src/FlightMap/Images/scale_end.png</file>
<file alias="airplaneOutline.svg">src/FlightMap/Images/airplaneOutline.svg</file>
<file alias="airplaneOpaque.svg">src/FlightMap/Images/airplaneOpaque.svg</file>
</qresource>
<qresource prefix="/qml">
<file alias="test.qml">src/test.qml</file>
...
...
src/FlightMap/FlightMap.qml
View file @
0825be1c
...
...
@@ -53,6 +53,7 @@ Item {
property
alias
mapMenu
:
mapTypeMenu
property
bool
showVehicles
:
false
property
bool
showMissionItems
:
false
property
bool
isSatelliteMap
:
false
Component.onCompleted
:
{
map
.
zoomLevel
=
18
...
...
@@ -62,6 +63,15 @@ Item {
updateMissionItems
()
}
function
updateMapType
(
type
)
{
var
isSatellite
=
(
type
===
MapType
.
SatelliteMapDay
||
type
===
MapType
.
SatelliteMapNight
)
if
(
isSatelliteMap
!==
isSatellite
)
{
isSatelliteMap
=
isSatellite
;
removeAllVehicles
()
addExistingVehicles
()
}
}
//-- Menu to select supported map types
Menu
{
id
:
mapTypeMenu
...
...
@@ -72,6 +82,7 @@ Item {
for
(
var
i
=
0
;
i
<
map
.
supportedMapTypes
.
length
;
i
++
)
{
if
(
mapID
===
map
.
supportedMapTypes
[
i
].
name
)
{
map
.
activeMapType
=
map
.
supportedMapTypes
[
i
]
updateMapType
(
map
.
supportedMapTypes
[
i
].
style
)
multiVehicleManager
.
saveSetting
(
root
.
mapName
+
"
/currentMapType
"
,
mapID
);
return
;
}
...
...
@@ -164,7 +175,8 @@ Item {
var
qmlItemTemplate
=
"
VehicleMapItem {
"
+
"
coordinate: _vehicles[%1].coordinate;
"
+
"
heading: _vehicles[%1].heading
"
+
"
heading: _vehicles[%1].heading;
"
+
"
isSatellite: root.isSatelliteMap;
"
+
"
}
"
var
i
=
_vehicles
.
length
...
...
@@ -194,6 +206,18 @@ Item {
}
}
function
removeAllVehicles
()
{
if
(
!
showVehicles
)
{
return
}
for
(
var
i
=
0
;
i
<
_vehicles
.
length
;
i
++
)
{
_vehicles
[
i
]
=
undefined
map
.
removeMapItem
(
_vehicleMapItems
[
i
])
_vehicleMapItems
[
i
]
=
undefined
}
}
function
addExistingVehicles
()
{
if
(
!
showVehicles
)
{
return
...
...
src/FlightMap/Images/airplaneOpaque.svg
0 → 100644
View file @
0825be1c
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
viewBox=
"253 705 288 288"
enable-background=
"new 253 705 288 288"
xml:space=
"preserve"
>
<title>
Layer 1
</title>
<polyline
fill=
"#FF460A"
stroke=
"#000000"
stroke-width=
"6"
stroke-linecap=
"round"
stroke-linejoin=
"round"
points=
"
396.982,969.152 338.217,983.998 338.217,969.152 382.136,930.53 375.619,855.19 284.687,887.839 284.687,859.113 375.619,795.107
375.619,763.004 396.982,714.002 396.999,714.002 418.363,763.004 418.363,795.107 509.294,859.113 509.294,887.839 418.363,855.19
411.845,930.53 455.764,969.152 455.764,983.998 396.999,969.152 "
/>
</svg>
src/FlightMap/Images/airplaneOutline.svg
0 → 100644
View file @
0825be1c
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
viewBox=
"253 705 288 288"
enable-background=
"new 253 705 288 288"
xml:space=
"preserve"
>
<title>
Layer 1
</title>
<polyline
fill=
"none"
stroke=
"#000000"
stroke-width=
"8"
stroke-linecap=
"round"
stroke-linejoin=
"round"
points=
"396.991,968.512
338.226,983.357 338.226,968.512 382.145,929.889 375.628,854.549 284.696,887.198 284.696,858.472 375.628,794.466
375.628,762.364 396.991,713.361 397.009,713.361 418.372,762.364 418.372,794.466 509.304,858.472 509.304,887.198
418.372,854.549 411.855,929.889 455.774,968.512 455.774,983.357 397.009,968.512 "
/>
</svg>
src/FlightMap/MapItems/VehicleMapItem.qml
View file @
0825be1c
...
...
@@ -32,15 +32,16 @@ import QGroundControl.ScreenTools 1.0
/// Marker for displaying a vehicle location on the map
MapQuickItem
{
property
real
heading
:
0
property
bool
isSatellite
:
false
anchorPoint.x
:
vehicleIcon
.
width
/
2
anchorPoint.y
:
vehicleIcon
.
height
/
2
sourceItem
:
Image
{
id
:
vehicleIcon
source
:
"
/qmlimages/compassInstrumentAirpla
ne.svg
"
source
:
isSatellite
?
"
/qmlimages/airplaneOpaque.svg
"
:
"
/qmlimages/airplaneOutli
ne.svg
"
mipmap
:
true
width
:
ScreenTools
.
defaultFontPixelHeight
*
4
width
:
ScreenTools
.
defaultFontPixelHeight
*
5
fillMode
:
Image
.
PreserveAspectFit
transform
:
Rotation
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment