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
adaa9da8
Commit
adaa9da8
authored
Jul 12, 2011
by
LM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on 3D lines in Google Earth
parent
99d25403
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
2 deletions
+54
-2
earth.html
images/earth.html
+53
-1
QGCMapWidget.cc
src/ui/map/QGCMapWidget.cc
+1
-1
No files found.
images/earth.html
View file @
adaa9da8
...
@@ -65,6 +65,10 @@ var trailPlacemarks = [];
...
@@ -65,6 +65,10 @@ var trailPlacemarks = [];
var
trailsVisible
=
[];
var
trailsVisible
=
[];
var
trailColors
=
[];
var
trailColors
=
[];
var
waypoints
=
[];
var
waypoints
=
[];
var
waypointLines
=
[];
var
waypointLinePlacemarks
=
[];
var
waypointLineColors
=
[];
//var waypointLines = [];
//var waypointLines = [];
//var trailPlacemarks[id];
//var trailPlacemarks[id];
var
lineStyle
;
var
lineStyle
;
...
@@ -362,6 +366,8 @@ function updateWaypoint(id, index, lat, lon, alt, action)
...
@@ -362,6 +366,8 @@ function updateWaypoint(id, index, lat, lon, alt, action)
location
.
setAltitude
(
alt
);
location
.
setAltitude
(
alt
);
waypoints
[
index
].
setGeometry
(
location
);
waypoints
[
index
].
setGeometry
(
location
);
waypoints
[
index
].
setDescription
(
index
+
""
);
waypoints
[
index
].
setDescription
(
index
+
""
);
}
}
else
else
{
{
...
@@ -389,6 +395,25 @@ function updateWaypoint(id, index, lat, lon, alt, action)
...
@@ -389,6 +395,25 @@ function updateWaypoint(id, index, lat, lon, alt, action)
ge
.
getFeatures
().
appendChild
(
placemark
);
ge
.
getFeatures
().
appendChild
(
placemark
);
waypoints
[
index
]
=
placemark
;
waypoints
[
index
]
=
placemark
;
}
}
// Add waypoint line
waypointLines
[
id
].
setExtrude
(
false
);
waypointLines
[
id
].
setAltitudeMode
(
ge
.
ALTITUDE_ABSOLUTE
);
// Add LineString points
waypointLines
[
id
].
getCoordinates
().
pushLatLngAlt
(
lat
,
lon
,
alt
);
// Create a style and set width and color of line
waypointLinePlacemarks
[
id
].
setStyleSelector
(
ge
.
createStyle
(
''
));
lineStyle
=
waypointLinePlacemarks
[
id
].
getStyleSelector
().
getLineStyle
();
lineStyle
.
setWidth
(
5
);
lineStyle
.
getColor
().
set
(
waypointLineColors
[
id
]);
// aabbggrr format
//lineStyle.getColor().set(color); // aabbggrr format
// Add the feature to Earth
//if (waypointLinesVisible[id] == true)
ge
.
getFeatures
().
replaceChild
(
waypointLinePlacemarks
[
id
],
waypointLinePlacemarks
[
id
]);
// Add connecting line
// Add connecting line
}
}
...
@@ -423,6 +448,7 @@ function createAircraft(id, type, color)
...
@@ -423,6 +448,7 @@ function createAircraft(id, type, color)
//planeColor = color;
//planeColor = color;
createTrail
(
id
,
color
);
createTrail
(
id
,
color
);
createWaypointLine
(
id
,
color
);
//console.log(color);
//console.log(color);
}
}
...
@@ -454,6 +480,32 @@ trailsVisible[id] = false;
...
@@ -454,6 +480,32 @@ trailsVisible[id] = false;
}
}
function
createWaypointLine
(
id
,
color
)
{
waypointLinePlacemarks
[
id
]
=
ge
.
createPlacemark
(
''
);
// Create the placemark
// Create the LineString; set it to extend down to the ground
// and set the altitude mode
waypointLines
[
id
]
=
ge
.
createLineString
(
''
);
waypointLinePlacemarks
[
id
].
setGeometry
(
waypointLines
[
id
]);
waypointLines
[
id
].
setExtrude
(
false
);
waypointLines
[
id
].
setAltitudeMode
(
ge
.
ALTITUDE_ABSOLUTE
);
// Add LineString points
//lineString.getCoordinates().pushLatLngAlt(48.754, -121.835, 700);
// Create a style and set width and color of line
waypointLinePlacemarks
[
id
].
setStyleSelector
(
ge
.
createStyle
(
''
));
lineStyle
=
waypointLinePlacemarks
[
id
].
getStyleSelector
().
getLineStyle
();
lineStyle
.
setWidth
(
10
);
waypointLineColors
[
id
]
=
color
;
lineStyle
.
getColor
().
set
(
'
00000000
'
);
// aabbggrr format
// Add the feature to Earth
//ge.getFeatures().appendChild(trailPlacemarks[id]);
}
function
clearTrail
(
id
)
function
clearTrail
(
id
)
{
{
ge
.
getFeatures
().
removeChild
(
trailPlacemarks
[
id
]);
ge
.
getFeatures
().
removeChild
(
trailPlacemarks
[
id
]);
...
...
src/ui/map/QGCMapWidget.cc
View file @
adaa9da8
...
@@ -112,7 +112,7 @@ void QGCMapWidget::showEvent(QShowEvent* event)
...
@@ -112,7 +112,7 @@ void QGCMapWidget::showEvent(QShowEvent* event)
connect
(
&
updateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
updateGlobalPosition
()));
connect
(
&
updateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
updateGlobalPosition
()));
updateTimer
.
start
(
maxUpdateInterval
*
1000
);
updateTimer
.
start
(
maxUpdateInterval
*
1000
);
updateGlobalPosition
();
updateGlobalPosition
();
QTimer
::
singleShot
(
300
,
this
,
SLOT
(
loadSettings
()));
QTimer
::
singleShot
(
1
,
this
,
SLOT
(
loadSettings
()));
}
}
void
QGCMapWidget
::
hideEvent
(
QHideEvent
*
event
)
void
QGCMapWidget
::
hideEvent
(
QHideEvent
*
event
)
...
...
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