Stellarium  HEAD
Data Structures | Signals | Public Member Functions | Protected Member Functions
MapWidget Class Reference

Special widget that shows a world map. More...

#include <MapWidget.hpp>

Data Structures

struct  LonLat
 
struct  MapPoint
 

Signals

void positionChanged (double longitude, double latitude, const QColor &color)
 Signal emitted when we click on the map. It also delivers the color value at the clicked point.
 

Public Member Functions

 MapWidget (QWidget *parent=nullptr)
 
void setMarkerPos (double longitude, double latitude)
 Set the current marker position. More...
 
void setMarkerVisible (bool visible)
 allow hiding the location arrow (if sitting on an observer)
 
void setLocationFilter (double longitude, double latitude, double searchRadius)
 Set the search circle to mark the locations available. More...
 
void setMap (const QPixmap &map)
 

Protected Member Functions

void mousePressEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void wheelEvent (QWheelEvent *event) override
 
void paintEvent (QPaintEvent *event) override
 
void resizeEvent (QResizeEvent *event) override
 
LonLat mapPointToLonLat (const QPointF &mapPoint) const
 
MapPoint lonLatToMapPoint (double lon, double lat) const
 

Detailed Description

Special widget that shows a world map.


Data Structure Documentation

◆ MapWidget::LonLat

struct MapWidget::LonLat
Data Fields
double latitude
double longitude

◆ MapWidget::MapPoint

struct MapWidget::MapPoint
Data Fields
double x
double y

Member Function Documentation

◆ setLocationFilter()

void MapWidget::setLocationFilter ( double  longitude,
double  latitude,
double  searchRadius 
)

Set the search circle to mark the locations available.

Parameters
longitudelongitude in degrees in the range [-180;180[
latitudelatitude in degrees in the range [-90;90]
searchRadiussearch radius in degrees in the range ]0;180]. If searchRadius is set to 180, filtering is considered disabled.

◆ setMarkerPos()

void MapWidget::setMarkerPos ( double  longitude,
double  latitude 
)

Set the current marker position.

Parameters
longitudelongitude in degree in range [-180;180[
latitudelatitude in degree in range [-90;90]