Packageorg.openscales.core.control
Classpublic class Zoom
InheritanceZoom Inheritance Control Inheritance flash.display.Sprite
Subclasses ZoomBar

Control showing some arrows to be able to pan the map and zoom in/out. This Zoom class represents a component to add to the map.

View the examples



Public Properties
 PropertyDefined By
 Inheritedactive : Boolean
Control
  buttons : Vector.<Button>
Zoom
 InheritedisReduced : Boolean
Indicates if the control display is normal or reduced
Control
 Inheritedmap : Map
Control
 Inheritedposition : Pixel
Control
  slideFactor : int
The list of buttons of this pan component
Zoom
Protected Properties
 PropertyDefined By
 Inherited_active : Boolean = false
Control
 Inherited_isReduced : Boolean
Control
 Inherited_map : Map = null
Control
  sliderImg : Class
Zoom
  zoombarImg : Class
Zoom
  zoomMinusMiniImg : Class
Zoom
  zoomPlusMiniImg : Class
Zoom
  zoomWorldMiniImg : Class
Zoom
Public Methods
 MethodDefined By
  
Zoom(position:Pixel = null)
Zoom
  
addButton(name:String, image:Bitmap, xy:Pixel, sz:Size, alt:String = null):void
Add a button as child of the pan component and add it on the buttons list.
Zoom
  
click(evt:Event):void
Handle click event.
Zoom
  
destroy():void
[override]
Zoom
  
doubleClick(evt:Event):Boolean
Handle double-click event.
Zoom
  
draw():void
[override]
Zoom
 Inherited
to be overrided in sub classes
Control
 Inherited
resize(event:MapEvent):void
Control
 Inherited
toggleDisplay(event:Event = null):void
Control
Property Detail
buttonsproperty
buttons:Vector.<Button>


Implementation
    public function get buttons():Vector.<Button>
    public function set buttons(value:Vector.<Button>):void
slideFactorproperty 
slideFactor:int

The list of buttons of this pan component


Implementation
    public function get slideFactor():int
    public function set slideFactor(value:int):void
sliderImgproperty 
protected var sliderImg:Class

zoombarImgproperty 
protected var zoombarImg:Class

zoomMinusMiniImgproperty 
protected var zoomMinusMiniImg:Class

zoomPlusMiniImgproperty 
protected var zoomPlusMiniImg:Class

zoomWorldMiniImgproperty 
protected var zoomWorldMiniImg:Class

Constructor Detail
Zoom()Constructor
public function Zoom(position:Pixel = null)



Parameters
position:Pixel (default = null)
Method Detail
addButton()method
public function addButton(name:String, image:Bitmap, xy:Pixel, sz:Size, alt:String = null):void

Add a button as child of the pan component and add it on the buttons list. The button is also linked to MouseEvent.CLICK and MouseEvent.DOUBLE_CLICK

Parameters

name:String — The name of the component on the flash scene (mandatory)
 
image:Bitmap — The bitmap linked to the button display (mandatory)
 
xy:Pixel — The position of the button on the scene (mandatory)
 
sz:Size — The size for the button on the scene (mandatory)
 
alt:String (default = null) — The html alt parameter

click()method 
public function click(evt:Event):void

Handle click event. Switch on the button click and do the linked action (pan in the good orientation)

Parameters

evt:Event — The event received (return if not MouseEvent)

destroy()method 
override public function destroy():void

doubleClick()method 
public function doubleClick(evt:Event):Boolean

Handle double-click event. No action to do for this component so stop the propagation of the event.

Parameters

evt:Event — The event received

Returns
Boolean — false
draw()method 
override public function draw():void

Examples
The following code describe how to add a Zoom on a map :
       var theMap = Map();
       theMap.addControl(new Zoom());