Logo Search packages:      
Sourcecode: qmk-groundstation version File versions  Download package

qmapcontrol::MapControl Class Reference

#include <mapcontrol.h>

List of all members.


Detailed Description

The control element of the widget and also the widget itself.

This is the main widget. To this control layers can be added. A MapControl have to be instantiated with a QSize which sets the size the widget takes in a layout. The given size is also the size, which is asured to be filled with map images.

Author:
Kai Winter <kaiwinter@gmx.de>

Definition at line 53 of file mapcontrol.h.


Public Types

enum  MouseMode { Panning, Dragging, None }
 Declares what actions the mouse move has on the map. More...

Public Slots

void resize (const QSize newSize)
 Resizes the map to the given size.
void scroll (const QPoint scroll)
 scrolls the view by the given point
void scrollDown (int pixel=10)
 scrolls the view down
void scrollLeft (int pixel=10)
 scrolls the view to the left
void scrollRight (int pixel=10)
 scrolls the view to the right
void scrollUp (int pixel=10)
 scrolls the view up
void setZoom (int zoomlevel)
 sets the given zoomlevel
void updateRequest (QRect rect)
 updates the map for the given rect
void updateRequestNew ()
 updates the hole map by creating a new offscreen image
void zoomIn ()
 zooms in one step
void zoomOut ()
 zooms out one step

Signals

void boxDragged (const QRectF)
 Emitted, after a Rectangular is dragged.
void geometryClicked (Geometry *geometry, QPoint coord_px)
 This signal is emitted, when a Geometry is clicked.
void mouseEventCoordinate (const QMouseEvent *evnt, const QPointF coordinate)
 Emitted AFTER a MouseEvent occured.
void viewChanged (const QPointF &coordinate, int zoom)
 This signal is emitted, after the view have changed.

Public Member Functions

void addLayer (Layer *layer)
 adds a layer
QPointF currentCoordinate () const
 returns the coordinate of the center of the map
int currentZoom () const
 returns the current zoom level
void enablePersistentCache (const QDir &path=QDir::homePath()+"/QMapControl.cache")
 Enable persistent caching of map tiles.
void followGeometry (const Geometry *geometry) const
 Keeps the center of the map on the Geometry, even when it moves.
Layerlayer (const QString &layername) const
 returns the layer with the given name
QList< QString > layers () const
 returns the names of all layers
 MapControl (QSize size, MouseMode mousemode=Panning)
 The constructor of MapControl.
MapControl::MouseMode mouseMode ()
 returns the current MouseMode
void moveTo (QPointF coordinate)
 Smoothly moves the center of the view to the given Coordinate.
int numberOfLayers () const
 returns the number of existing layers
void setMouseMode (MouseMode mousemode)
 sets the Mouse Mode of the MapControl
void setProxy (QString host, int port)
 Sets the proxy for HTTP connections.
void setView (const Point *point) const
 sets the view to the given Point
void setView (const QList< QPointF > coordinates) const
 sets the view, so all coordinates are visible
void setView (const QPointF &coordinate) const
 sets the middle of the map to the given coordinate
void setViewAndZoomIn (const QList< QPointF > coordinates) const
 sets the view and zooms in, so all coordinates are visible
void showScale (bool show)
 Displays the scale within the widget.
void stopFollowing (Geometry *geometry)
 Stops the following of a Geometry.

Protected Member Functions

void mouseMoveEvent (QMouseEvent *evnt)
void mousePressEvent (QMouseEvent *evnt)
void mouseReleaseEvent (QMouseEvent *evnt)
void paintEvent (QPaintEvent *evnt)

Private Slots

void loadingFinished ()
void positionChanged (Geometry *geom)
void tick ()

Private Member Functions

QPointF clickToWorldCoordinate (QPoint click)
 MapControl (const MapControl &old)
MapControloperator= (const MapControl &rhs)

Private Attributes

QPoint current_mouse_pos
LayerManagerlayermanager
bool m_loadingFlag
bool mousepressed
QMutex moveMutex
MouseMode mymousemode
QPoint pre_click_px
bool scaleVisible
QPoint screen_middle
QSize size
int steps
QPointF target

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index