Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/FlightMap/FlightMap.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ Map {
property bool firstVehiclePositionReceived: false ///< true: first vehicle position update was responded to
property bool planView: false ///< true: map being using for Plan view, items should be draggable

readonly property real maxZoomLevel: 20

property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _activeVehicleCoordinate: _activeVehicle ? _activeVehicle.coordinate : QtPositioning.coordinate()

Expand All @@ -49,6 +47,7 @@ Map {
// This works around a bug on Qt where if you set a visibleRegion and then the user moves or zooms the map
// and then you set the same visibleRegion the map will not move/scale appropriately since it thinks there
// is nothing to do.
let maxZoomLevel = 20
_map.visibleRegion = QtPositioning.rectangle(QtPositioning.coordinate(0, 0), QtPositioning.coordinate(0, 0))
_map.visibleRegion = region
if (_map.zoomLevel > maxZoomLevel) {
Expand Down Expand Up @@ -135,7 +134,7 @@ Map {
}
}
onScaleChanged: (delta) => {
let newZoomLevel = Math.min(Math.max(_map.zoomLevel + Math.log2(delta), 0), maxZoomLevel)
let newZoomLevel = Math.max(_map.zoomLevel + Math.log2(delta), 0)
_map.zoomLevel = newZoomLevel
_map.alignCoordinateToPoint(pinchStartCentroid, pinchHandler.centroid.position)
}
Expand All @@ -152,11 +151,6 @@ Map {

}

BoundaryRule on zoomLevel {
minimum: 0
maximum: maxZoomLevel
}

// We specifically do not use a DragHandler for panning. It just causes too many problems if you overlay anything else like a Flickable above it.
// Causes all sorts of crazy problems where dragging/scrolling no longerr works on items above in the hierarchy.
// Since we are using a MouseArea we also can't use TapHandler for clicks. So we handle that here as well.
Expand Down
Loading