Packagecom.google.maps.overlays
Classpublic class OverlayBase
InheritanceOverlayBase Inheritance flash.display.Sprite
Implementsflash.events.IEventDispatcher, IOverlay

Base class for custom overlays. Developers may extend this class to create their own overlay implementations.
OverlayBase represents a visual object that should be used for rendering the overlay's foreground.
The default implementation of OverlayBase defines an overlay that does not have a shadow. If a shadow is needed, a developer will need to create a separate display object and override the "get shadow" property accessor to enable it.
In addition to rendering the overlay's foreground and shadow (if needed), any custom overlay should define the positionOverlay() method that would change the placement of the overlay upon its pane when the map is panned or zoomed by the user. Use the fromLatLngToPaneCoords() and fromProjectionPointToPaneCoords() of the pane to determine the position of the overlay's on the pane.
Ideally, a custom overlay should avoid extensive rendering operations in its implementation of the positionOverlay() method. This method will be called frequently by the map and re-rendering the overlay upon each call may negatively affect performance of the application when a large number of overlays are placed on the map.
An implementation of custom overlay may also need to define listeners for MapEvent.OVERLAY_ADDED and MapEvent.OVERLAY_REMOVED events to handle addition and removal of the overlay to/from the map.



Public Properties
 PropertyDefined by
  foreground : DisplayObject
[read-only] Display object that represents the overlay's foreground content.
OverlayBase
  pane : IPane
The pane this overlay resides on.
OverlayBase
  shadow : DisplayObject
[read-only] Display object that represents the overlay's shadow.
OverlayBase
  visible : Boolean
Visibility of the overlay.
OverlayBase
Public Methods
 MethodDefined by
  
Constructor.
OverlayBase
  
Determines the pane that the overlay is placed on when it is added to the map through the Map.addOverlay() call.
This method must be overloaded for the Map.addOverlay() call to function correctly.
OverlayBase
  
positionOverlay(zoomChanged:Boolean):void
Reposition the overlay on the screen.
OverlayBase
Protected Methods
 MethodDefined by
  
clearWrapper():void
Remove all event listeners and clear the wrapper.
OverlayBase
Property detail
foregroundproperty
foreground:DisplayObject  [read-only]

Display object that represents the overlay's foreground content.

Implementation
    public function get foreground():DisplayObject
paneproperty 
pane:IPane  [read-write]

The pane this overlay resides on. The pane is set when the overlay is added to the map. Developers may override the "set pane" method to handle addition/removal of the overlay to/from the map. Alternatively, developers map add listeners for MapEvent.OVERLAY_ADDED and MapEvent.OVERLAY_REMOVED events on the overlay to handle addition and removal of the overlay to/from the map.

Implementation
    public function get pane():IPane
    public function set pane(value:IPane):void
shadowproperty 
shadow:DisplayObject  [read-only]

Display object that represents the overlay's shadow. By default returns null (no shadow). If the overlay needs to have a shadow, this method property should be redefined and the value of shadow set before the overlay is added to the map. The display object returned by this property should remain unchanged while the overlay is added to a map.

Implementation
    public function get shadow():DisplayObject
visibleproperty 
visible:Boolean  [read-write]

Visibility of the overlay.

Implementation
    public function get visible():Boolean
    public function set visible(value:Boolean):void
Constructor detail
OverlayBase()constructor
public function OverlayBase()

Constructor.

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

Remove all event listeners and clear the wrapper.

getDefaultPane()method 
public function getDefaultPane(map:IMap):IPane

Determines the pane that the overlay is placed on when it is added to the map through the Map.addOverlay() call.
This method must be overloaded for the Map.addOverlay() call to function correctly. It is not required if the overlay is always added directly to its pane using IPane.addOverlay() call.

Parameters
map:IMap — Instance of map that this overlay is added to.

Returns
IPane — Instance of IPane to which the overlay will be added by default.
positionOverlay()method 
public function positionOverlay(zoomChanged:Boolean):void

Reposition the overlay on the screen. This method is called in response to changes in the position (centre) of the map and/or the map's zoom level. Developers should not call the method themselves. The implementation of this method should either change the position of the overlay on the screen in response to the change of the map's centre or redraw the overlay completely if it needs to be reconfigured for a different map centre/zoom level. Repositioning of the overlay should be done by changing the placement of the overlay's display object on its pane using the mappings provided by the IPane interface (fromLatLngToPaneCoords or fromProjectionPointToPaneCoords). This method is not implemented in the default implementation and must be overloaded in the derived classes to function properly.

Parameters
zoomChanged:Boolean — Whether the zoom level of the map has changed or the call was invoked just as a result of a map pan.