|
|
|
@ -104,7 +104,7 @@ QGCView {
@@ -104,7 +104,7 @@ QGCView {
|
|
|
|
|
anchors.right: mapTypeButton.left |
|
|
|
|
anchors.top: mapTypeButton.top |
|
|
|
|
dropDirection: dropDown |
|
|
|
|
label: "C" |
|
|
|
|
buttonImage: "/qmlimages/MapCenter.svg" |
|
|
|
|
viewportMargins: ScreenTools.defaultFontPixelWidth / 2 |
|
|
|
|
|
|
|
|
|
dropDownComponent: Component { |
|
|
|
@ -114,14 +114,48 @@ QGCView {
@@ -114,14 +114,48 @@ QGCView {
|
|
|
|
|
QGCButton { |
|
|
|
|
text: "Home" |
|
|
|
|
|
|
|
|
|
onClicked: centerMapButton.hideDropDown() |
|
|
|
|
onClicked: { |
|
|
|
|
centerMapButton.hideDropDown() |
|
|
|
|
editorMap.center = QtPositioning.coordinate(_homePositionCoordinate.latitude, _homePositionCoordinate.longitude) |
|
|
|
|
_showHomePositionManager = true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
|
|
This code will need to wait for Qml 5.5 support since Map.visibleRegion is only in Qt 5.5 |
|
|
|
|
|
|
|
|
|
QGCButton { |
|
|
|
|
text: "All Items" |
|
|
|
|
|
|
|
|
|
onClicked: centerMapButton.hideDropDown() |
|
|
|
|
onClicked: { |
|
|
|
|
centerMapButton.hideDropDown() |
|
|
|
|
|
|
|
|
|
// Begin with only the home position in the region |
|
|
|
|
var region = QtPositioning.rectangle(QtPositioning.coordinate(_homePositionCoordinate.latitude, _homePositionCoordinate.longitude), |
|
|
|
|
QtPositioning.coordinate(_homePositionCoordinate.latitude, _homePositionCoordinate.longitude)) |
|
|
|
|
|
|
|
|
|
// Now expand the region to include all mission items |
|
|
|
|
for (var i=0; i<_missionItems.count; i++) { |
|
|
|
|
var missionItem = _missionItems.get(i) |
|
|
|
|
|
|
|
|
|
region.topLeft.latitude = Math.max(missionItem.coordinate.latitude, region.topLeft.latitude) |
|
|
|
|
region.topLeft.longitude = Math.min(missionItem.coordinate.longitude, region.topLeft.longitude) |
|
|
|
|
|
|
|
|
|
region.topRight.latitude = Math.max(missionItem.coordinate.latitude, region.topRight.latitude) |
|
|
|
|
region.topRight.longitude = Math.max(missionItem.coordinate.longitude, region.topRight.longitude) |
|
|
|
|
|
|
|
|
|
region.bottomLeft.latitude = Math.min(missionItem.coordinate.latitude, region.bottomLeft.latitude) |
|
|
|
|
region.bottomLeft.longitude = Math.min(missionItem.coordinate.longitude, region.bottomLeft.longitude) |
|
|
|
|
|
|
|
|
|
region.bottomRight.latitude = Math.min(missionItem.coordinate.latitude, region.bottomRight.latitude) |
|
|
|
|
region.bottomRight.longitude = Math.max(missionItem.coordinate.longitude, region.bottomRight.longitude) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
editorMap.visibleRegion = region |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
*/ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -132,29 +166,26 @@ QGCView {
@@ -132,29 +166,26 @@ QGCView {
|
|
|
|
|
anchors.top: parent.top |
|
|
|
|
anchors.right: parent.right |
|
|
|
|
dropDirection: dropDown |
|
|
|
|
label: "M" |
|
|
|
|
buttonImage: "/qmlimages/MapType.svg" |
|
|
|
|
viewportMargins: ScreenTools.defaultFontPixelWidth / 2 |
|
|
|
|
|
|
|
|
|
dropDownComponent: Component { |
|
|
|
|
Row { |
|
|
|
|
spacing: ScreenTools.defaultFontPixelWidth |
|
|
|
|
|
|
|
|
|
QGCButton { |
|
|
|
|
text: "Street" |
|
|
|
|
|
|
|
|
|
onClicked: mapTypeButton.hideDropDown() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
QGCButton { |
|
|
|
|
text: "Satellite" |
|
|
|
|
|
|
|
|
|
onClicked: mapTypeButton.hideDropDown() |
|
|
|
|
} |
|
|
|
|
Repeater { |
|
|
|
|
model: QGroundControl.flightMapSettings.mapTypes |
|
|
|
|
|
|
|
|
|
QGCButton { |
|
|
|
|
text: "Hybrid" |
|
|
|
|
QGCButton { |
|
|
|
|
checkable: true |
|
|
|
|
checked: editorMap.mapType == text |
|
|
|
|
text: modelData |
|
|
|
|
|
|
|
|
|
onClicked: mapTypeButton.hideDropDown() |
|
|
|
|
onClicked: { |
|
|
|
|
editorMap.mapType = text |
|
|
|
|
mapTypeButton.hideDropDown() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|