In MVC architecture, this is the controller for the corresponding Scalebar view. More...
|  Header |  #include <Scalebar | 
|  Inherits | QObject | 
Properties
- mapView : QObject*
 - unitSystem : Esri::ArcGISRuntime::UnitSystem
 
Public Functions
| Scalebar | |
| virtual | ~ | 
| double | calculate | 
| double | calculate | 
| double | calculate | 
| double | calculate | 
| QString | calculate | 
| QObject * | map | 
| void | set | 
| void | set | 
|  Esri | unit | 
Signals
| void | map | 
| void | unit | 
| void | viewpoint | 
Detailed Description
This controller object handles the Scalebar calculations for a Scalebar's width and display units, based on a given mapview and owning scalebar's bounds.
Property Documentation
mapView  : QObject*
This property holds the MapView object which scalebar calculations are based on.
Access functions:
| QObject * | map | 
| void | set | 
Notifier signal:
| void | map | 
unitSystem  : Esri::ArcGISRuntime::UnitSystem    
This property holds the current units system of this controller. Can be imperial or metric.
Access functions:
|  Esri | unit | 
| void | set | 
Notifier signal:
| void | unit | 
Member Function Documentation
ScalebarController::ScalebarController (QObject *parent = nullptr)  
Constructor
- parent Parent owning 
QObject. 
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
[signal] void ScalebarController::mapViewChanged  ()  
Emitted when the geoView changes.
Note: Notifier signal for property mapView.
[signal] void ScalebarController::unitSystemChanged  ()  
Emitted when the unitsSystem changes.
Note: Notifier signal for property unitSystem.
[signal] void ScalebarController::viewpointChanged ()  
Emitted when the viewpoint changes.
[virtual] ScalebarController::~ScalebarController  ()  
Destructor.
double ScalebarController::calculateBestScalebarLength   (double maxLength , Esri::ArcGISRuntime::LinearUnit     unit)  
Given a maximum length maxLength and unit system unit, calculate the best length value to display, which will be equal to or less than maxLength, rounded appropriately.
double ScalebarController::calculateBestScalebarLength   (double maxLength )  
Given a maximum length maxLength, calculate the appropriate length value to display, which will be equal to or less than maxLength, rounded appropriately.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
double ScalebarController::calculateDisplayWidth  (double displayDistance , double maximumDistance , double availableWidth )  
Returns the width a scalebar should be, based on a fraction of availableWidth calculated by the ratio of displayDistance by maximumDistance.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
double ScalebarController::calculateDistance (double width)  
Given the width of a scalebar in screen coordinates, returns the distance the width represents by projecting that width onto the mapView and returning the result.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
QString ScalebarController::calculateDistanceInDisplayUnits    (double distance, Esri::ArcGISRuntime::UnitSystem     unitSystem )  
Returns the distance text to display in a scaleBar, given a distance and unitSystem.
If unitSystem is metric, distance is assumed to be in meters, if unitSystem is imperial, distance is assumed to be in feet.
Will appropriately return miles/feet or kilometers/meters based on size of distance given.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.
QObject *ScalebarController::mapView () const   
Returns the MapView as a QObject.
Note: Getter function for property mapView.
See also setMapView().
void ScalebarController::setMapView  (QObject *mapView )  
Set the MapView object this Controller uses.
Internally this is cast to a MapView using qobject_cast.
- mapView MapView Object.
 
Note: Setter function for property mapView.
See also mapView().
void ScalebarController::setUnitSystem  (Esri::ArcGISRuntime::UnitSystem     unitSystem )  
Sets the active UnitSystem to unitSystem. This affects width and distance calculations.
Note: Setter function for property unitSystem.
See also unitSystem().
Esri::ArcGISRuntime::UnitSystem     ScalebarController::unitSystem ()  
Returns thee UnitSystem this controller uses for calculations.
Note: Getter function for property unitSystem.
See also setUnitSystem().