nokia.maps.map.component.ScaleBar

Extends: nokia.maps.map.component.Component

Class Summary

This components shows a scale bar.

[ For full details, see nokia.maps.map.component.ScaleBar ]

Table 1. Property Summary
Properties

showImperialUnits: {Boolean}

This property indicates whether imperial rather than metric units of measurements are to be used.

Directly Inherited Properties

Inherited from class nokia.maps.map.component.Component :

mapDisplay

Table 2. Method Summary
Methods

calculateMPP () : {Number}

This method calculates a value representing how many meters correspond to each pixel in the map view.

switchUnit ()

This method toggles the measurement units, in which the distance is displayed.

updateScale ()

This method is called, when the scale of the map view was changed.

Directly Inherited Methods

Inherited from class nokia.maps.map.component.Component :

attach, destroy, detach, getId

Inherited from class nokia.maps.util.OObject :

addObserver, get, remove, removeObserver, set

Class Description

This component defines a panel that holds the scale bar. The scale bar is a ruler showing map distances relative to the current zoom level of the map. The measurement type can be changed from metric to imperial, which will be reflected in the distance measurements.

Constructor Details

nokia.maps.map.component.ScaleBar()

This method initializes a new instance of ScaleBar

Property Details

showImperialUnits: {Boolean}

This property indicates whether imperial rather than metric units of measurements are to be used. true indicates imperial units, false indicates metric units.

Method Details

calculateMPP(): {Number}

This method calculates a value representing how many meters correspond to each pixel in the map view.

Returns:
 
{Number}
A value indicating how many meters correspond to each pixel in the map view.

 

switchUnit()

This method toggles the measurement units, in which the distance is displayed.

 

updateScale()

This method is called, when the scale of the map view was changed. It updates the map component to reflect these changes.