Calculates scale for a given combination of canvas size, map extent, and monitor dpi.
More...
#include <qgsscalecalculator.h>
Detailed Description
Calculates scale for a given combination of canvas size, map extent, and monitor dpi.
Constructor & Destructor Documentation
Constructor.
- Parameters
-
dpi | Monitor resolution in dots per inch |
mapUnits | Units of the data on the map. Must match a value from the QGis::UnitType enum (Meters, Feet, Degrees) |
QgsScaleCalculator::~QgsScaleCalculator |
( |
| ) |
|
Member Function Documentation
double QgsScaleCalculator::calculate |
( |
const QgsRectangle & |
mapExtent, |
|
|
int |
canvasWidth |
|
) |
| |
Calculate the scale denominator.
- Parameters
-
mapExtent | QgsRectangle containing the current map extent |
canvasWidth | Width of the map canvas in pixel (physical) units |
- Returns
- scale denominator of current map view
double QgsScaleCalculator::calculateGeographicDistance |
( |
const QgsRectangle & |
mapExtent | ) |
|
Calculate the distance between two points in geographic coordinates.
Used to calculate scale for map views with geographic (decimal degree) data.
- Parameters
-
double QgsScaleCalculator::dpi |
( |
| ) |
|
Accessor for dpi used in scale calculations.
- Returns
- int the dpi used for scale calculations.
Returns current map units.
void QgsScaleCalculator::setDpi |
( |
double |
dpi | ) |
|
Set the dpi to be used in scale calculations.
- Parameters
-
dpi | Dots per inch of monitor resolution |
Set the map units.
- Parameters
-
mapUnits | Units of the data on the map. Must match a value from the |
The documentation for this class was generated from the following files: