Packagecom.google.maps.controls
Classpublic final class ControlPosition

ControlPosition describes the position of a control in the map view. It specifies which corner of the map view is to be treated as a reference point and the X and Y padding offsets from this corner.



Public Methods
 MethodDefined by
  
ControlPosition(anchor:Number, opt_paddingX:Number = 0, opt_paddingY:Number)
Constructs a ControlPosition from offsets relative to a specified map corner.
ControlPosition
  
getAnchor():Number
Retrieves the anchor identifier.
ControlPosition
  
getOffsetX():Number
Retrieves the horizontal offset.
ControlPosition
  
getOffsetY():Number
Retrieves the vertical offset.
ControlPosition
  
toString():String
String representation of position object.
ControlPosition
Public Constants
 ConstantDefined by
  ANCHOR_BOTTOM_LEFT : Number = 0x20
[static] The control will be anchored in the bottom left corner of the map.
ControlPosition
  ANCHOR_BOTTOM_RIGHT : Number = 0x21
[static] The control will be anchored in the bottom right corner of the map.
ControlPosition
  ANCHOR_TOP_LEFT : Number = 0
[static] The control will be anchored in the top left corner of the map.
ControlPosition
  ANCHOR_TOP_RIGHT : Number = 1
[static] The control will be anchored in the top right corner of the map.
ControlPosition
Constructor detail
ControlPosition()constructor
public function ControlPosition(anchor:Number, opt_paddingX:Number = 0, opt_paddingY:Number)

Constructs a ControlPosition from offsets relative to a specified map corner.

Parameters
anchor:Number — Anchor type.
 
opt_paddingX:Number (default = 0) — Horizontal padding (defaults to 0).
 
opt_paddingY:Number — Vertical padding (if different from horizontal padding).

Example
Create a ControlPosition instance to anchor a control 16 pixels left of and 10 pixels below the top-right corner of the map.
   var position:ControlPosition = new ControlPosition(
     ControlPosition.ANCHOR_TOP_RIGHT, 16, 10);

Method detail
getAnchor()method
public function getAnchor():Number

Retrieves the anchor identifier.

Returns
Number — Anchor identifier.

Example
Test whether a position is anchored to the map's bottom-left corner.
   if (position.getAnchor()==ControlPosition.ANCHOR_BOTTOM_LEFT)
     trace("Positioned relative to the map's bottom-left corner.");

getOffsetX()method 
public function getOffsetX():Number

Retrieves the horizontal offset.

Returns
Number — The horizontal offset.
getOffsetY()method 
public function getOffsetY():Number

Retrieves the vertical offset.

Returns
Number — the vertical offset.
toString()method 
public function toString():String

String representation of position object.

Returns
String
Constant detail
ANCHOR_BOTTOM_LEFTconstant
public static const ANCHOR_BOTTOM_LEFT:Number = 0x20

The control will be anchored in the bottom left corner of the map.

ANCHOR_BOTTOM_RIGHTconstant 
public static const ANCHOR_BOTTOM_RIGHT:Number = 0x21

The control will be anchored in the bottom right corner of the map.

ANCHOR_TOP_LEFTconstant 
public static const ANCHOR_TOP_LEFT:Number = 0

The control will be anchored in the top left corner of the map.

ANCHOR_TOP_RIGHTconstant 
public static const ANCHOR_TOP_RIGHT:Number = 1

The control will be anchored in the top right corner of the map.