Packagecom.google.maps.controls
Classpublic final class MapTypeControl
InheritanceMapTypeControl Inheritance flash.display.Sprite
ImplementsIControl

A MapTypeControl provides a control for selecting and switching between supported map types via buttons. Controls will be made available for all map types currently attached to the map at the time the control is constructed. By default, maps support the set of MapType.DEFAULT_MAP_TYPES; additional map types can be added explicitly via Map.addMapType().



Public Methods
 MethodDefined by
  
Constructs a MapTypeControl object.
MapTypeControl
  
Retrieves the control position.
MapTypeControl
  
getDisplayObject():DisplayObject
Retrieves the control's display object (often this would be the control object itself, but potentially be a different object if the control contains a sprite rather than extending it).
MapTypeControl
  
getSize():Point
Retrieves the control's size.
MapTypeControl
  
Sets the instance of the map that this control operates on.
MapTypeControl
  
Sets the control's position and updates its position on the map.
MapTypeControl
Protected Methods
 MethodDefined by
  
clearWrapper():void
Remove all event listeners and clear the wrapper.
MapTypeControl
Constructor detail
MapTypeControl()constructor
public function MapTypeControl(options:MapTypeControlOptions = null)

Constructs a MapTypeControl object.

Parameters
options:MapTypeControlOptions (default = null) — Map type control options.

See also

Method detail
clearWrapper()method
protected function clearWrapper():void

Remove all event listeners and clear the wrapper.

getControlPosition()method 
public function getControlPosition():ControlPosition

Retrieves the control position.

Returns
ControlPosition — Position of the control.
getDisplayObject()method 
public function getDisplayObject():DisplayObject

Retrieves the control's display object (often this would be the control object itself, but potentially be a different object if the control contains a sprite rather than extending it).

Returns
DisplayObject — Control's display object.
getSize()method 
public function getSize():Point

Retrieves the control's size.

Returns
Point — Control's size in pixels.
initControlWithMap()method 
public function initControlWithMap(map:IMap):void

Sets the instance of the map that this control operates on. Normally invoked from the call to Map.addControl().

Parameters
map:IMap — The map to which this control should be attached. If this control had previously been attached to another map, the control will be removed from that map and attached to this map. If the map parameter is null, the control will be removed from any previous map but not attached to a new map.
setControlPosition()method 
public function setControlPosition(position:ControlPosition):void

Sets the control's position and updates its position on the map.

Parameters
position:ControlPosition — New position for the control.

Example
   navigatorControl.setControlPosition(
       new ControlPosition(ControlPosition.ANCHOR_TOP_RIGHT, 2, 2));