Class: QgsMapToolPan

class qgis.gui.QgsMapToolPan(canvas: QgsMapCanvas)

Bases: QgsMapTool

constructor

A map tool for panning the map.

See also

QgsMapTool

Methods

activate

canvasDoubleClickEvent

param e

canvasMoveEvent

param e

canvasPressEvent

param e

canvasReleaseEvent

param e

childEvent

connectNotify

customEvent

deactivate

disconnectNotify

flags

rtype

QgsMapTool.Flags

gestureEvent

param e

isDragging

Returns True if a drag operation is in progress.

isSignalConnected

receivers

sender

senderSignalIndex

timerEvent

toCanvasCoordinates

transformation from map coordinates to screen coordinates

toLayerCoordinates

transformation from screen coordinates to layer's coordinates

toMapCoordinates

transformation from screen coordinates to map coordinates

toMapCoordinatesV2

transformation from layer's coordinates to map coordinates (which is different in case reprojection is used)

Signals

panDistanceBearingChanged

Emitted whenever the distance or bearing of an in-progress panning operation is changed.

activate(self)
canvasDoubleClickEvent(self, e: QgsMapMouseEvent)
Parameters

e (QgsMapMouseEvent) –

canvasMoveEvent(self, e: QgsMapMouseEvent)
Parameters

e (QgsMapMouseEvent) –

canvasPressEvent(self, e: QgsMapMouseEvent)
Parameters

e (QgsMapMouseEvent) –

canvasReleaseEvent(self, e: QgsMapMouseEvent)
Parameters

e (QgsMapMouseEvent) –

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
deactivate(self)
disconnectNotify(self, QMetaMethod)
flags(self) QgsMapTool.Flags
Return type

QgsMapTool.Flags

gestureEvent(self, e: QGestureEvent) bool
Parameters

e (QGestureEvent) –

Return type

bool

isDragging(self) bool

Returns True if a drag operation is in progress.

New in version 3.12.

Return type

bool

isSignalConnected(self, QMetaMethod) bool
panDistanceBearingChanged

Emitted whenever the distance or bearing of an in-progress panning operation is changed.

This signal will be emitted during a pan operation as the user moves the map, giving the total distance and bearing between the map position at the start of the pan and the current pan position.

New in version 3.12: [signal]

Parameters
receivers(self, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
timerEvent(self, QTimerEvent)
toCanvasCoordinates(self, point: QgsPointXY) QPoint

transformation from map coordinates to screen coordinates

toLayerCoordinates(self, layer: QgsMapLayer, point: QPoint) QgsPointXY

transformation from screen coordinates to layer’s coordinates

toLayerCoordinates(self, layer: QgsMapLayer, point: QgsPointXY) -> QgsPointXY transformation from map coordinates to layer’s coordinates

toLayerCoordinates(self, layer: QgsMapLayer, rect: QgsRectangle) -> QgsRectangle trnasformation of the rect from map coordinates to layer’s coordinates

toMapCoordinates(self, point: QPoint) QgsPointXY

transformation from screen coordinates to map coordinates

toMapCoordinates(self, layer: QgsMapLayer, point: QgsPointXY) -> QgsPointXY transformation from layer’s coordinates to map coordinates (which is different in case reprojection is used)

toMapCoordinatesV2(self, layer: QgsMapLayer, point: QgsPoint) QgsPoint

transformation from layer’s coordinates to map coordinates (which is different in case reprojection is used)

Note

available in Python bindings as toMapCoordinatesV2