Packagecom.afcomponents.umap.gui
Classpublic class ScaleControl
InheritanceScaleControl Inheritance UIMapControl Inheritance fl.core.UIComponent

MapTypeControl



Public Properties
 PropertyDefined by
 Inheritedalign : Align
Gets or sets the control's alignment.
UIMapControl
 InheritedasDisplayObject : DisplayObject
Returns reference to the object as a DisplayObject instance.
UIMapControl
 Inheritedcore : UMap
Returns reference to the core UMap object.
UIMapControl
 Inheriteddisplay : String
UIMapControl
 InheritedDISPLAY_COMPACT : String = "compact"
[static]
UIMapControl
 InheritedDISPLAY_EXPANDED : String = "expanded"
[static]
UIMapControl
 Inheritedid : uint
Gets or sets the ID of the object.
UIMapControl
 InheritedminSize : Size
Gets or sets control's minimum size.
UIMapControl
 Inheritedname : String
UIMapControl
 Inheritedoffset : Offset
Gets or sets the control's offset position.
UIMapControl
 Inheritedowner : IMapObjectContainer
Returns reference to the owner container object.
UIMapControl
 Inheritedpadding : Point
Gets or sets the control's padding value.
UIMapControl
 InheritedstackAlignment : String
Gets or sets control's stack alignment.
UIMapControl
 InheritedSTACK_HORIZONTAL : String = "horizontal"
[static]
UIMapControl
 InheritedstackPadding : Point
Gets or sets control's stack padding value.
UIMapControl
 InheritedSTACK_VERTICAL : String = "vertical"
[static]
UIMapControl
  units : String
Defines the unit system to use for calculations and display.
ScaleControl
  UNIT_SYSTEMS : XML
[static] Defines the unit systems, that are used by the scale control.
ScaleControl
Public Methods
 MethodDefined by
  
ScaleControl(param:Object = null)
ScaleControl
 Inherited
cancelDoubleClick(event:MouseEvent = null):void
UIMapControl
 Inherited
cancelDragging(event:MouseEvent = null):void
UIMapControl
  
dispose():void
Releases all the resources accuired by the object.
ScaleControl
 Inherited
UIMapControl
  
getResolution(latlng:LatLng, zoom:Number, dpi:Number = 0):Number
[static] Returns map resolution for the specified point on the map, zoom level and screen DPI.
ScaleControl
  
getScale(latlng:LatLng, zoom:Number):Number
[static] Returns map scale for the specified point on the map and a zoom level.
ScaleControl
  
getZoomFromResolution(latlng:LatLng, resolution:Number, dpi:Number = 0):Number
[static] Returns map zoom level, for the specified point on the map, resolution and screen DPI.
ScaleControl
  
getZoomFromScale(latlng:LatLng, scale:Number):Number
[static] Returns map zoom level, for the specified point on the map, and scale.
ScaleControl
 Inherited
init():void
Invoked when control has been attached to GuiManager, or when UMap has been initialized.
UIMapControl
 Inherited
ready():void
Invoked when UMap enters ready() state.
UIMapControl
 Inherited
refresh():void
Refreshes the control.
UIMapControl
 Inherited
remove():void
Removes the object from the owner container object.
UIMapControl
 Inherited
Invoked by GuiManager to report the available space this control can occupy.
UIMapControl
 Inherited
Adds the object to the specified IMapObjectContainer.
UIMapControl
 Inherited
setRefreshCallback(refresh:Function):void
Sets the callback function which should be called by the control after it's size has been updated.
UIMapControl
  
updateMapType(mapType:IMapType):void
Invoked when map type has been updated.
ScaleControl
  
updatePosition(latlng:LatLng):void
Invoked when map center has been updated.
ScaleControl
 Inherited
updateSize(width:Number, height:Number):void
Invoked when the UMap Component size has been updated.
UIMapControl
  
updateZoom(zoom:Number):void
Invoked when map zoom level has been updated.
ScaleControl
Protected Methods
 MethodDefined by
 Inherited
UIMapControl
  
defineScale(latlng:LatLng = null, zoom:Number = 0):void
Defines the scale.
ScaleControl
Public Constants
 ConstantDefined by
  IMPERIAL : String = "imperial"
[static] Defines the value for the imperial unit system.
ScaleControl
  METRIC : String = "metric"
[static] Defines the value for the metric unit system.
ScaleControl
  RUSSIAN : String = "russian"
[static] Defines the value for the russian unit system.
ScaleControl
Property detail
unitsproperty
units:String  [read-write]

Defines the unit system to use for calculations and display.

Implementation
    public function get units():String
    public function set units(value:String):void
UNIT_SYSTEMSproperty 
public static var UNIT_SYSTEMS:XML

Defines the unit systems, that are used by the scale control.

Each system should have a name, defined in the name attribute. Then the list of units should be defined in the ascending order (from lowest to highest). The label and value attributes should be defined for each unit. Label attribute defines the text that will be displayed next to the resulting number. Value attribure defines how much meters are contained in 1 uint.


Example
Here is the sample XML:
  <systems>
    <system name="metric">
      <unit label="meters" value="1"/>
      <unit label="km" value="1000"/>
    </system>
  

Constructor detail
ScaleControl()constructor
public function ScaleControl(param:Object = null)

Parameters
param:Object (default = null)
Method detail
defineScale()method
protected function defineScale(latlng:LatLng = null, zoom:Number = 0):void

Defines the scale.

Parameters
latlng:LatLng (default = null)
 
zoom:Number (default = 0)
dispose()method 
public override function dispose():void

Releases all the resources accuired by the object.

getResolution()method 
public static function getResolution(latlng:LatLng, zoom:Number, dpi:Number = 0):Number

Returns map resolution for the specified point on the map, zoom level and screen DPI. If you ommit DPI, the Capabilities.screenDPI value will be used (may be wrong).

Parameters
latlng:LatLng — LatLng object which specifies a point on the map.
 
zoom:Number — Map zoom level.
 
dpi:Number (default = 0) — Screen dpi.

Returns
Number — Map resolution.
getScale()method 
public static function getScale(latlng:LatLng, zoom:Number):Number

Returns map scale for the specified point on the map and a zoom level. Scale is measured in meters/pixel.

Parameters
latlng:LatLng — LatLng object which specifies a point on the map.
 
zoom:Number — Map zoom level.

Returns
Number — Map scale in meters/pixel.
getZoomFromResolution()method 
public static function getZoomFromResolution(latlng:LatLng, resolution:Number, dpi:Number = 0):Number

Returns map zoom level, for the specified point on the map, resolution and screen DPI. If you ommit DPI, the Capabilities.screenDPI value will be used (may be wrong).

Parameters
latlng:LatLng — LatLng object which specifies a point on the map.
 
resolution:Number — Target map resolution.
 
dpi:Number (default = 0)

Returns
Number — Map zoom level at the specified point and map resolution.
getZoomFromScale()method 
public static function getZoomFromScale(latlng:LatLng, scale:Number):Number

Returns map zoom level, for the specified point on the map, and scale. Scale should be specified in meter/pixel.

Parameters
latlng:LatLng — LatLng object which specifies a point on the map.
 
scale:Number — Map scale in meter/pixel.

Returns
Number — Map zoom level at the specified point and map scale.
updateMapType()method 
public override function updateMapType(mapType:IMapType):void

Invoked when map type has been updated.

Parameters
mapType:IMapType — Reference to the new map type.
updatePosition()method 
public override function updatePosition(latlng:LatLng):void

Invoked when map center has been updated.

Parameters
latlng:LatLng — Geographical coordinates of the new map center.
updateZoom()method 
public override function updateZoom(zoom:Number):void

Invoked when map zoom level has been updated.

Parameters
zoom:Number — New zoom level.
Constant detail
IMPERIALconstant
public static const IMPERIAL:String = "imperial"

Defines the value for the imperial unit system.

METRICconstant 
public static const METRIC:String = "metric"

Defines the value for the metric unit system.

RUSSIANconstant 
public static const RUSSIAN:String = "russian"

Defines the value for the russian unit system.