|
|
|
@ -41,7 +41,7 @@ Item {
@@ -41,7 +41,7 @@ Item {
|
|
|
|
|
|
|
|
|
|
/// Normalize longitude to range: 0 to 360, W to E |
|
|
|
|
function normalizeLon(lon) { |
|
|
|
|
return lon + 180.0 |
|
|
|
|
return lon + 180.0 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Fits the visible region of the map to inclues all of the specified coordinates. If no coordinates |
|
|
|
@ -69,7 +69,7 @@ Item {
@@ -69,7 +69,7 @@ Item {
|
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
lat = normalizeLat(lat) |
|
|
|
|
lon = normalizeLon(lat) |
|
|
|
|
lon = normalizeLon(lon) |
|
|
|
|
north = Math.max(north, lat) |
|
|
|
|
south = Math.min(south, lat) |
|
|
|
|
east = Math.max(east, lon) |
|
|
|
@ -77,8 +77,8 @@ Item {
@@ -77,8 +77,8 @@ Item {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Expand the coordinate bounding rect to make room for the tools around the edge of the map |
|
|
|
|
var latDegreesPerPixel = (north - south) / mapFitViewport.width |
|
|
|
|
var lonDegreesPerPixel = (east - west) / mapFitViewport.height |
|
|
|
|
var latDegreesPerPixel = (north - south) / mapFitViewport.height |
|
|
|
|
var lonDegreesPerPixel = (east - west) / mapFitViewport.width |
|
|
|
|
north = Math.min(north + (mapFitViewport.y * latDegreesPerPixel), 180) |
|
|
|
|
south = Math.max(south - ((map.height - mapFitViewport.bottom) * latDegreesPerPixel), 0) |
|
|
|
|
west = Math.max(west - (mapFitViewport.x * lonDegreesPerPixel), 0) |
|
|
|
@ -94,7 +94,6 @@ Item {
@@ -94,7 +94,6 @@ Item {
|
|
|
|
|
var topLeftCoord = QtPositioning.coordinate(north - 90.0, west - 180.0) |
|
|
|
|
var bottomRightCoord = QtPositioning.coordinate(south - 90.0, east - 180.0) |
|
|
|
|
map.setVisibleRegion(QtPositioning.rectangle(topLeftCoord, bottomRightCoord)) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function addMissionItemCoordsForFit(coordList) { |
|
|
|
|