Skip to content

Class MapToScreen

ClassList > MapToScreen

The MapToScreen class transform a map point to screen coordinates. The map point CRS is the one from the map settings. Screen point will be automatically updated on map extent changes.

  • #include <maptoscreen.h>

Inherits the following classes: QObject

Public Properties

Type Name
property double mapDistance
the distance in map unit
property QgsPoint mapPoint
the point in map coordinates
property QgsQuickMapSettings * mapSettings
Map settings is used to define the map canvas CRS and detect any extent change.
property double screenDistance
the distance in screen coordinates (read-only)
property QPointF screenPoint
the point in screen coordinates (read-only)

Public Signals

Type Name
signal void mapDistanceChanged
the distance in map unit
signal void mapPointChanged
the point in map coordinates
signal void mapSettingsChanged
Map settings is used to define the map canvas CRS and detect any extent change.
signal void screenDistanceChanged
the distance in screen coordinates (read-only)
signal void screenPointChanged
the point in screen coordinates (read-only)

Public Functions

Type Name
MapToScreen (QObject * parent=nullptr)
double mapDistance () const
the distance in map unit
QgsPoint mapPoint () const
the point in map coordinates
QgsQuickMapSettings * mapSettings () const
Map settings is used to define the map canvas CRS and detect any extent change.
double screenDistance () const
the distance in screen coordinates (read-only)
QPointF screenPoint () const
the point in screen coordinates (read-only)
void setMapDistance (const double distance)
the distance in map unit
void setMapPoint (const QgsPoint & point)
the point in map coordinates
void setMapSettings (QgsQuickMapSettings * mapSettings)
Map settings is used to define the map canvas CRS and detect any extent change.

Public Properties Documentation

property mapDistance [1/2]

the distance in map unit

double MapToScreen::mapDistance;

property mapPoint [1/2]

the point in map coordinates

QgsPoint MapToScreen::mapPoint;

property mapSettings [1/2]

Map settings is used to define the map canvas CRS and detect any extent change.

QgsQuickMapSettings * MapToScreen::mapSettings;

property screenDistance [1/2]

the distance in screen coordinates (read-only)

double MapToScreen::screenDistance;

property screenPoint [1/2]

the point in screen coordinates (read-only)

QPointF MapToScreen::screenPoint;

Public Signals Documentation

signal mapDistanceChanged

the distance in map unit

void MapToScreen::mapDistanceChanged;

signal mapPointChanged

the point in map coordinates

void MapToScreen::mapPointChanged;

signal mapSettingsChanged

Map settings is used to define the map canvas CRS and detect any extent change.

void MapToScreen::mapSettingsChanged;

signal screenDistanceChanged

the distance in screen coordinates (read-only)

void MapToScreen::screenDistanceChanged;

signal screenPointChanged

the point in screen coordinates (read-only)

void MapToScreen::screenPointChanged;

Public Functions Documentation

function MapToScreen

explicit MapToScreen::MapToScreen (
    QObject * parent=nullptr
) 

function mapDistance [2/2]

the distance in map unit

double MapToScreen::mapDistance () const

function mapPoint [2/2]

the point in map coordinates

QgsPoint MapToScreen::mapPoint () const

function mapSettings [2/2]

Map settings is used to define the map canvas CRS and detect any extent change.

QgsQuickMapSettings * MapToScreen::mapSettings () const

function screenDistance [2/2]

the distance in screen coordinates (read-only)

double MapToScreen::screenDistance () const

function screenPoint [2/2]

the point in screen coordinates (read-only)

QPointF MapToScreen::screenPoint () const

function setMapDistance

the distance in map unit

void MapToScreen::setMapDistance (
    const double distance
) 

function setMapPoint

the point in map coordinates

void MapToScreen::setMapPoint (
    const QgsPoint & point
) 

function setMapSettings

Map settings is used to define the map canvas CRS and detect any extent change.

void MapToScreen::setMapSettings (
    QgsQuickMapSettings * mapSettings
) 


The documentation for this class was generated from the following file src/core/maptoscreen.h