Commit 073295bc authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4823 from DonLakeFlyer/MapFixes

Fix: Initial survey polygon smaller each time you add a survey
parents fc574d45 a831deaa
...@@ -146,7 +146,7 @@ Item { ...@@ -146,7 +146,7 @@ Item {
border.width: 2 border.width: 2
border.color: "orange" border.color: "orange"
color: "transparent" color: "transparent"
center: homePosition ? homePosition : undefined center: homePosition ? homePosition : QtPositioning.coordinate()
radius: myGeoFenceController.circleRadius radius: myGeoFenceController.circleRadius
visible: planView || geoFenceController.circleEnabled visible: planView || geoFenceController.circleEnabled
} }
......
...@@ -72,11 +72,13 @@ Item { ...@@ -72,11 +72,13 @@ Item {
function _addInitialPolygon() { function _addInitialPolygon() {
if (_missionItem.polygonPath.length < 3) { if (_missionItem.polygonPath.length < 3) {
// Initial polygon is inset to take 2/3rds space // Initial polygon is inset to take 2/3rds space
var rect = map.centerViewport var rect = Qt.rect(map.centerViewport.x, map.centerViewport.y, map.centerViewport.width, map.centerViewport.height)
console.log(map.centerViewport)
rect.x += (rect.width * 0.25) / 2 rect.x += (rect.width * 0.25) / 2
rect.y += (rect.height * 0.25) / 2 rect.y += (rect.height * 0.25) / 2
rect.width *= 0.75 rect.width *= 0.75
rect.height *= 0.75 rect.height *= 0.75
console.log(map.centerViewport)
var topLeft = Qt.point(rect.x, rect.y) var topLeft = Qt.point(rect.x, rect.y)
var topRight = Qt.point(rect.x + rect.width, rect.y) var topRight = Qt.point(rect.x + rect.width, rect.y)
var bottomLeft = Qt.point(rect.x, rect.y + rect.height) var bottomLeft = Qt.point(rect.x, rect.y + rect.height)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment