Packagecom.afcomponents.umap.display
Classpublic class InfoWindow
InheritanceInfoWindow Inheritance Overlay Inheritance MapObject Inheritance flash.display.Sprite
ImplementsIInfoWindow

InfoWindow is a special overlay that is used to display user-defined information. Unlike other overlays InfoWindow is attached to GuiManager and so it always stays above all other graphical overlays, but below other controls.

To control Info Window appearence use InfoWindowStyle class, set by passing to the constructor or using setStyle() method. You can also specify the title & content text which will be displayed in the window.


Example
Here is how you can open new info window with your own text & style:
 import com.afcomponents.umap.core.UMap;
 import com.afcomponents.umap.styles.*;
 import com.afcomponents.umap.display.InfoWindow;
 import com.afcomponents.umap.types.Size;
  
 // create new map
 var map:UMap = new UMap();
 map.setSize(300,300);
 addChild(map);
  
 // define info window style
 var style:InfoWindowStyle = new InfoWindowStyle();
 style.strokeAlpha = 0.8;
 style.size = new Size(200,100);
 style.autoSize = InfoWindowStyle.AUTO_SIZE_NONE;
 style.tailSize.height = 30;
 style.tailOffset = 0.10;
 style.contentStyle.html = true;
 style.contentStyle.styleSheet = new StyleSheet();
 style.contentStyle.styleSheet.setStyle("html", {fontFamily:"arial", fontSize:12, color:"#555555"});
  
 // define info window parameters
 var param:Object = new Object();
 param.title = "Info window title";
 param.content = "Info window content...<br/>can be multiline<br/>and contain <b><u>HTML</u></b> tags.";
  
 // open new info window
 map.openInfoWindow(param, style);

After executing the code you should see something like this:

InfoWindow example

See also

com.afcomponents.umap.styles.InfoWindowStyle


Public Properties
 PropertyDefined by
 InheritedasDisplayObject : DisplayObject
Returns reference to the object as a DisplayObject instance.
MapObject
  asInteractiveObject : InteractiveObject
[read-only] Casts InfoWindow as an InteractiveObject.
InfoWindow
 InheritedautoCloseInfo : Boolean
Gets or sets the autCloseInfo flag, which indicates whether to close info window automatically when user clicks somewhere on the map.
Overlay
 InheritedautoInfo : Boolean
Gets or sets the autInfo flag, which indicates whether to open info window automatically upon mouse click.
Overlay
  autoPan : Boolean
Gets or sets autoPan property
InfoWindow
  closeButton : Sprite
[read-only] Returns a reference to the close button Sprite.
InfoWindow
  contentPanel : IPanel
[read-only] Returns a reference to the content panel.
InfoWindow
 Inheritedcore : UMap
Returns reference to the core UMap object.
MapObject
 Inheriteddata : *
Gets or sets the data parameter of the Overlay.
Overlay
 Inheriteddescription : String
Gets or sets the description text of the Overlay.
Overlay
 Inheriteddraggable : Boolean
Gets or sets Overlay's draggable property.
Overlay
 Inheriteddragging : Boolean
Indicates whether Overlay is being dragged at the moment.
Overlay
 Inheritedid : uint
Gets or sets the ID of the object.
MapObject
 Inheritedinfo : IInfoWindow
Return referens to opened InfoWindow
Overlay
 InheritedinfoParam : Object
Gets or sets the info window param object.
Overlay
 InheritedinfoStyle : Object
Gets or sets the info window style object associated with the Overlay.
Overlay
  main : Sprite
[read-only] Returns a reference to the main Sprite.
InfoWindow
 Inheritedname : String
Gets or sets the name of the object.
Overlay
 Inheritedowner : IMapObjectContainer
Returns reference to the owner container object.
MapObject
 Inheritedpoint : Point
Returns the position of the Overlay in bitmap coordinates.
Overlay
 Inheritedposition : LatLng
Gets or set the geographical position of the Overlay.
Overlay
  scrollBar : *
[read-only] Returns a reference to the attached scroll bar or null of no scroll bar class has been defined.
InfoWindow
 InheritedsmartPosition : Boolean
Gets or sets the smartPosition flag, which indicates whether to use smart positioning with the Overlay.
Overlay
  titlePanel : IPanel
[read-only] Returns a reference to the title panel.
InfoWindow
 Inheritedvisible : Boolean
Gets or sets the Overlay's visibility.
Overlay
 InheritedzIndexAuto : Boolean
Gets or sets zIndexAuto property which indicates wheter Overlay should be brought to front on mouse over event.
Overlay
Public Methods
 MethodDefined by
  
InfoWindow(param:Object = null, style:Object = null)
InfoWindow's constructor.
InfoWindow
 Inherited
addEventListeners(target:InteractiveObject = null):void
Adds a built-in listener for MouseEvents fired by an InteractiveObject contained in the Overlay.
Overlay
 Inherited
bringToFront():void
Brings target Overlay to the top of the parent's display list.
Overlay
 Inherited
Creates an exact copy of this Overlay and returns it to the user.
Overlay
  
close():void
Closes the info window.
InfoWindow
 Inherited
Closes info window that is currently opened.
Overlay
  
dispose():void
Releases all the resources accuired by the object.
InfoWindow
 Inherited
dragStart():void
Starts Overlay dragging.
Overlay
 Inherited
dragStop():void
Stops Overlay dragging.
Overlay
 Inherited
fromXML(overlay:IOverlay, xml:XML):void
[static] Fetches Overlay's common properties from XML object in KML 2.1 format.
Overlay
  
Retruns Overlay bounds in geographical coordinates.
InfoWindow
  
getBoundsXY(zoom:Number = 0):Bounds
Retruns Overlay bounds in bitmap coordinates.
InfoWindow
  
Returns TextStyle that is applied to the content Text Field.
InfoWindow
  
[static] Returns the default InfoWindowStyle object that will be assigned to the newely created info window.
InfoWindow
  
[static] Returns the class that is used as a scroll bar for the info window.
InfoWindow
  
getStyle():Object
Returns the InfoWindowStyle object associated with the info window.
InfoWindow
  
Returns TextStyle that is applied to the title Text Field.
InfoWindow
  
hide():void
Hides overlay.
InfoWindow
 Inherited
invalidate():void
Schedules the Overlay for invalidation in 1 frame after this call.
Overlay
  
isOpen():Boolean
Returns a Boolean value which indicates whether info window is opened.
InfoWindow
  
move(x:Number, y:Number):void
InfoWindow
  
open(param:Object = null, style:Object = null):void
Opens the info window.
InfoWindow
 Inherited
openInfoWindow(param:Object = null, style:Object = null):IInfoWindow
Opens new info window with the specified parameters & style.
Overlay
  
redraw():void
Redraws the overlay.
InfoWindow
  
refresh(full:Boolean = false):void
Refreshes overlay position on the map.
InfoWindow
 Inherited
remove():void
Removes the object from the owner container object.
MapObject
 Inherited
removeEventListeners(target:InteractiveObject = null):void
Removes a built-in listener for MouseEvents fired by an InteractiveObject contained in the Overlay.
Overlay
  
reset():void
Resets the style & data for panels.
InfoWindow
  
setContentStyle(param:Object):void
Sets new style for the content Text Field.
InfoWindow
  
setDefaultStyle(style:Object):void
[static] Sets the default InfoWindowStyle object that will be assigned to the newely created info window.
InfoWindow
 Inherited
Adds the object to the specified IMapObjectContainer.
MapObject
  
setScrollBarClass(scrollBarClass:Class):void
[static] Sets the class that will be instantiated and used as a scroll bar for the info window.
InfoWindow
  
setStyle(param:Object):void
Sets a new style for the Info Window.
InfoWindow
  
setTitleStyle(param:Object):void
Sets new style for the title Text Field.
InfoWindow
  
show():void
Shows overlay.
InfoWindow
 Inherited
toString():String
Returns a textual representation of the object.
MapObject
 Inherited
toXML(full:Boolean = true, afcTags:Boolean = false):XML
Builds an XML object in KML 2.1 format that describes the Overlay & it's style.
Overlay
 Inherited
updatePosition(latlng:LatLng):void
Invoked when map center has been updated.
Overlay
 Inherited
updateZoom(zoom:Number):void
Invoked when map zoom has been updated.
Overlay
Events
 EventSummaryDefined by
 Inherited Dispatched when the InfoWindow has been closed with the Overlay Overlay
 Inherited Dispatched when the InfoWindow has been opened with the Overlay Overlay
 Inherited Dispatched when an Overlay position is about to be refreshed.Overlay
 Inherited Dispatched when overlay has been added to a MapObjectContainer, e.g.Overlay
 Inherited Dispatched when an Overlay is about to be invalidated.Overlay
 Inherited Dispatched when an Overlay has been changed.Overlay
 Inherited Dispatched when user drags an Overlay.Overlay
 Inherited Dispatched when user starts dragging an Overlay.Overlay
 Inherited Dispatched when user stops dragging an Overlay.Overlay
 Inherited Dispatched when an Overlay has become invisible.Overlay
 Inherited Dispatched when user presses a mouse button over an Overlay.Overlay
 Inherited Dispatched when user moves the mouse over an Overlay.Overlay
 Inherited Dispatched when user releases a mouse button over an Overlay.Overlay
 Inherited Dispatched when an Overlay enters ready state.Overlay
 Inherited Dispatched when an Overlay has been invalidated.Overlay
 Inherited Dispatched when an Overlay position has been refreshed.Overlay
 Inherited Dispatched when user rolls out an Overlay.Overlay
 Inherited Dispatched when user rolls over an Overlay.Overlay
 Inherited Dispatched when an Overlay has become visible.Overlay
Property detail
asInteractiveObjectproperty
asInteractiveObject:InteractiveObject  [read-only]

Casts InfoWindow as an InteractiveObject.

Implementation
    public function get asInteractiveObject():InteractiveObject
autoPanproperty 
autoPan:Boolean  [read-write]

Gets or sets autoPan property

Implementation
    public function get autoPan():Boolean
    public function set autoPan(value:Boolean):void
closeButtonproperty 
closeButton:Sprite  [read-only]

Returns a reference to the close button Sprite.

Implementation
    public function get closeButton():Sprite
contentPanelproperty 
contentPanel:IPanel  [read-only]

Returns a reference to the content panel.

Implementation
    public function get contentPanel():IPanel
mainproperty 
main:Sprite  [read-only]

Returns a reference to the main Sprite.

Implementation
    public function get main():Sprite
scrollBarproperty 
scrollBar:*  [read-only]

Returns a reference to the attached scroll bar or null of no scroll bar class has been defined.

Implementation
    public function get scrollBar():*
titlePanelproperty 
titlePanel:IPanel  [read-only]

Returns a reference to the title panel.

Implementation
    public function get titlePanel():IPanel
Constructor detail
InfoWindow()constructor
public function InfoWindow(param:Object = null, style:Object = null)

InfoWindow's constructor.

Creates new info window with the specified properties & style. After window is created it should be attached to a MapObjectContainer container by a setOwner() call.

Parameters
param:Object (default = null) — Object that holds all the properites of an info window you wish to override upon its creation.
 
style:Object (default = null) — Object that defines window's style.
Method detail
close()method
public function close():void

Closes the info window.

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

Releases all the resources accuired by the object.

getBoundsLatLng()method 
public override function getBoundsLatLng():LatLngBounds

Retruns Overlay bounds in geographical coordinates.

Returns
LatLngBounds — Overlay bounding rectangle in geographical coordinates.
getBoundsXY()method 
public override function getBoundsXY(zoom:Number = 0):Bounds

Retruns Overlay bounds in bitmap coordinates. Use zoom parameter to specify zoom level for bounds conversion.

Parameters
zoom:Number (default = 0) — Defines the zoom level at which to perform bounds conversion; if omitted, current zoom level will be used.

Returns
Bounds — Overlay bounding rectangle in bitmap coordinates.
getContentStyle()method 
public function getContentStyle():TextStyle

Returns TextStyle that is applied to the content Text Field.

Returns
TextStyle

See also

getDefaultStyle()method 
public static function getDefaultStyle():InfoWindowStyle

Returns the default InfoWindowStyle object that will be assigned to the newely created info window.

Returns
InfoWindowStyle — The default style.
getScrollBarClass()method 
public static function getScrollBarClass():Class

Returns the class that is used as a scroll bar for the info window.

Returns
Class
getStyle()method 
public override function getStyle():Object

Returns the InfoWindowStyle object associated with the info window.

Returns
Object

See also

getTitleStyle()method 
public function getTitleStyle():TextStyle

Returns TextStyle that is applied to the title Text Field.

Returns
TextStyle

See also

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

Hides overlay. Fires OverlayEvent.HIDE & OverlayEvent.CHAGNED events if visibility has been changed.

isOpen()method 
public function isOpen():Boolean

Returns a Boolean value which indicates whether info window is opened.

Returns
Boolean — A value of true if info widow is opened at the moment; false if it is not.
move()method 
public function move(x:Number, y:Number):void

Parameters
x:Number
 
y:Number
open()method 
public function open(param:Object = null, style:Object = null):void

Opens the info window. When opnening the info window, you can override info window paramters via param object. You can also specify new info window style via the style parameter.

Here is a list of properties you can specify in the param object:

PropertyTypeDefaultDescription
title String "" Specifies text that should be displayed in the title text field.
content String "" Specifies text that should be displayed in the content text field.
offset Point (0,0) Specifies offset distance of the info window's hot spot.
autoClose Boolean true A flag that defines whether info window should close automatically when user clicks the map.
autoPan Boolean true A flag that defines whether infoWindow should pan automatically to fit inside the map view.
position LatLng (0,0) Specifies info window's geographical position.

Parameters
param:Object (default = null) — Object that holds all the properites of an info window you wish to override.
 
style:Object (default = null) — Object that defines window's style.
redraw()method 
public override function redraw():void

Redraws the overlay.

Override this method in your subclass and call super.redraw() immediately before actual redraw so that OverlayEvent.BEFORE_REDRAW event will be automatically fired. At the end of your drawing don't forget to manually fire OverlayEvent.REDRAW event.

refresh()method 
public override function refresh(full:Boolean = false):void

Refreshes overlay position on the map. If the full paramter is set to true then bitmap coordinates for this overlay are recalculated. Otherwise overlay will be repositioned using previuosly calculated coordinates.

Parameters
full:Boolean (default = false) — Indicates whether to perform full refresh.
reset()method 
public function reset():void

Resets the style & data for panels. After that we wait for Event.CHANGE event from the panels and trigger resize() function.

setContentStyle()method 
public function setContentStyle(param:Object):void

Sets new style for the content Text Field.

Parameters
param:Object — that contains the properties of the TextStyle class you wish to overwrite.

See also

setDefaultStyle()method 
public static function setDefaultStyle(style:Object):void

Sets the default InfoWindowStyle object that will be assigned to the newely created info window.

Parameters
style:Object — Object that contains the properties of the InfoWindowStyle class you wish to overwrite.
setScrollBarClass()method 
public static function setScrollBarClass(scrollBarClass:Class):void

Sets the class that will be instantiated and used as a scroll bar for the info window. Typcially you should use UIScrollBar class, but you can design your own. The text field which should be scrolled is passed to the scroll bar class via scrollTarget property. To see the scroll bar you should also set InfoWindowStyle.scroll property to true.

Parameters
scrollBarClass:Class — UIScrollBar or it's subclass.

Example
Here is quick example:
  import com.afcomponents.umap.styles.InfoWindowStyle;
  import com.afcomponents.umap.display.InfoWindow;
  import com.afcomponents.umap.types.Size;
  import fl.controls.UIScrollBar;
   
  // create new map
  var map:UMap = new UMap();
  map.setSize(300,300);
  addChild(map);
   
  // define scroll bar class
  // don't forget to put UIScrollBar component into the library
  InfoWindow.setScrollBarClass(UIScrollBar);
   
  // define info window style
  var style:InfoWindowStyle = new InfoWindowStyle();
  style.scroll = true;
  style.maxSize = new Size(300, 100);
   
  // define parameters
  var param:Object = new Object();
  param.title = "My Info Window";
  param.content = "This is a very\nlong description\nto show you\nthe usage of scroll bar class\ndon't forget\nto have UIScrollBar in your library";
   
  // open new info window
  var info:InfoWindow = map.openInfoWindow(param, style) as InfoWindow;
  

setStyle()method 
public override function setStyle(param:Object):void

Sets a new style for the Info Window.

Parameters
param:Object — that contains the properties of the InfoWindowStyle class you wish to overwrite.

See also

setTitleStyle()method 
public function setTitleStyle(param:Object):void

Sets new style for the title Text Field.

Parameters
param:Object — that contains the properties of the TextStyle class you wish to overwrite.

See also

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

Shows overlay. Fires OverlayEvent.SHOW & OverlayEvent.CHAGNED events if visibility has been changed.