com.supermap.web.mapping
public class InfoWindow
继承 InfoWindow Inheritance com.supermap.web.mapping.supportClasses.InfoContainer

信息窗类.

初始化地图控件,就会自带一个 InfoWindow 对象,它不能创建,只能通过地图控件获取这个对象,或定义该对象的属性。一个地图控件对应一个 InfoWindow,可以显示、隐藏等。infowindow父类的父类是Container,所以可以使用方法setStyle来设置infowindow的风格,如:map.infoWindow.setStyle('borderColor',0x0000ff);设置边角颜色,可以设置的风格见后面的常用Style。,如果想要更多的style,请查看mx.core.Container



公共属性
  属性 定义方
    closeButton : Button
获取或设置 InfoWindow 的关闭按钮。
InfoWindow
    closeButtonVisible : Boolean
获取或设置 InfoWindow 的关闭按钮是否可见。要使用该方法必须首先通过地图控件获取到 InfoWindow:
map.infoWindow.closeButtonVisible
InfoWindow
    content : UIComponent
获取或设置信息窗显示内容。要使用该方法必须首先通过地图控件获取到 InfoWindow:
map.infoWindow.content.
InfoWindow
    customCloseRect : Rectangle
用户自定义关闭区域,默认为 null。
InfoWindow
    infoWindowLabel : Label
获取或设置 InfoWindow 的标签。
InfoWindow
    infoWindowLabelVisible : Boolean
获取或设置 InfoWindow 的标签是否可见。要使用该方法必须首先通过地图控件获取到 InfoWindow:
map.infoWindow.labelVisible
InfoWindow
    isDisplayedOnCluster : Boolean
获取或设置 InfoWindow 是否可以应用于聚散点 Cluster。要使用该方法必须首先通过地图控件获取到 InfoWindow:
map.infoWindow.isDisplayedOnCluster。
InfoWindow
    showShadow : Boolean
获取或设置是否开启倾斜阴影。如果设置为true,那么InfoWindow的位置始终只能在右上角,不再自适应。
InfoWindow
公共方法
  方法 定义方
   
hide():void
隐藏 InfoWindow。
InfoWindow
   
show(point2D:Point2D, offset:Point = null):void
在指定的点显示 InfoWindow。
InfoWindow
Styles
  Style 描述 定义方
   
backgroundColor
Type: uint Format: Color CSS Inheritance: no
组件的背景色,默认为黑色。
InfoWindow
   
borderAlpha
Type: Number CSS Inheritance: no
边界透明度。默认为 1.0,表示不透明。取值范围为 0~1。
InfoWindow
   
borderColor
Type: uint Format: Color CSS Inheritance: no
边界颜色。默认为黑色。
InfoWindow
   
borderThickness
Type: Number CSS Inheritance: no
边界宽度。默认为 0,单位为像素。
InfoWindow
   
infoOffsetW
Type: Number Format: Length CSS Inheritance: no
InfoWindow 的指示箭头与显示面板的相交长度,默认为 10,单位:像素。当显示方位infoPlacement为中心时,不显示指示箭头。
InfoWindow
   
infoOffsetX
Type: Number Format: Length CSS Inheritance: no
横轴偏移量,默认值为 12,单位为像素。其与显示方位infoPlacement相关,当显示方位为上、下、中心时,其值无效。
InfoWindow
   
infoOffsetY
Type: Number Format: Length CSS Inheritance: no
纵轴领衔量,默认值为 12,单位为像素。其与显示方位infoPlacement相关,当显示方位为左、右、中心时,其值无效。
InfoWindow
   
infoPlacement
Type: String CSS Inheritance: no
InfoWindow 显示方位,即方向位置,包括:右上、右下、左上、左下、上、下、左、右、中心。该样式由 InfoPlacement 枚举类定义。默认为右上位置:upperRight。

另请参见

InfoWindow
   
infoPlacementMode
Type: String CSS Inheritance: no
定义 InfoWindow 流动显示模式,包括 auto 和 none 两种值。auto 表示 InfoWindow 随地图的平移会流动显示,none 表示不流动显示。
InfoWindow
   
lowerLeftRadius
Type: Number Format: Length CSS Inheritance: no
左下角弧度,默认为 5 度。
InfoWindow
   
lowerRightRadius
Type: Number Format: Length CSS Inheritance: no
右下角弧度,默认为 5 度。
InfoWindow
   
shadowAlpha
Type: Number CSS Inheritance: no
阴影透明度,默认为 1.0,表示不透明。
InfoWindow
   
shadowAngle
Type: Number CSS Inheritance: no
阴影角度,默认为 45 度,顺时针表示正方向,逆时针表示负方向。
InfoWindow
   
shadowColor
Type: uint Format: Color CSS Inheritance: yes
阴影颜色,默认为黑色。
InfoWindow
   
shadowDistance
Type: Number Format: Length CSS Inheritance: no Theme: halo, spark
阴影深度,默认为 0.0。
InfoWindow
   
upperLeftRadius
Type: Number Format: Length CSS Inheritance: no
左上角弧度,默认为 5 度。
InfoWindow
   
upperRightRadius
Type: Number Format: Length CSS Inheritance: no
右上角弧度,默认为 5 度。
InfoWindow
属性详细信息
closeButton 属性
closeButton:Button

获取或设置 InfoWindow 的关闭按钮。


Implementation
    public function get closeButton():Button
    public function set closeButton(value:Button):void
closeButtonVisible 属性  
closeButtonVisible:Boolean

获取或设置 InfoWindow 的关闭按钮是否可见。要使用该方法必须首先通过地图控件获取到 InfoWindow:
map.infoWindow.closeButtonVisible

默认值为: true.


Implementation
    public function get closeButtonVisible():Boolean
    public function set closeButtonVisible(value:Boolean):void
content 属性  
content:UIComponent

获取或设置信息窗显示内容。要使用该方法必须首先通过地图控件获取到 InfoWindow:
map.infoWindow.content. 注意:该属性类型不是 string,而是 UTComponent,即可以任何可视化组件来定义 InfoWindow 的显示内容。InfoWindow 的大小可根据 content 的大小而自适应的放大、缩小。


Implementation
    public function get content():UIComponent
    public function set content(value:UIComponent):void
customCloseRect 属性  
customCloseRect:Rectangle

用户自定义关闭区域,默认为 null。


Implementation
    public function get customCloseRect():Rectangle
    public function set customCloseRect(value:Rectangle):void
infoWindowLabel 属性  
infoWindowLabel:Label

获取或设置 InfoWindow 的标签。


Implementation
    public function get infoWindowLabel():Label
    public function set infoWindowLabel(value:Label):void
infoWindowLabelVisible 属性  
infoWindowLabelVisible:Boolean

获取或设置 InfoWindow 的标签是否可见。要使用该方法必须首先通过地图控件获取到 InfoWindow:
map.infoWindow.labelVisible

默认值为: true.


Implementation
    public function get infoWindowLabelVisible():Boolean
    public function set infoWindowLabelVisible(value:Boolean):void
isDisplayedOnCluster 属性  
isDisplayedOnCluster:Boolean

获取或设置 InfoWindow 是否可以应用于聚散点 Cluster。要使用该方法必须首先通过地图控件获取到 InfoWindow:
map.infoWindow.isDisplayedOnCluster。

默认值为: false.


Implementation
    public function get isDisplayedOnCluster():Boolean
    public function set isDisplayedOnCluster(value:Boolean):void
showShadow 属性  
showShadow:Boolean

获取或设置是否开启倾斜阴影。如果设置为true,那么InfoWindow的位置始终只能在右上角,不再自适应。

默认值为: false.


Implementation
    public function get showShadow():Boolean
    public function set showShadow(value:Boolean):void
方法详细描述
hide () 方法
public function hide():void

隐藏 InfoWindow。

show () 方法  
public function show(point2D:Point2D, offset:Point = null):void

在指定的点显示 InfoWindow。

参数

point2D:Point2D — 指定的点对象。
 
offset:Point (default = null) — InfoWindow相对于所指定的点对象的偏移量(像素)。