包 | com.supermap.web.mapping |
类 | public class InfoWindow |
继承 | InfoWindow ![]() |
初始化地图控件,就会自带一个 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 | ||
在指定的点显示 InfoWindow。
|
InfoWindow |
closeButton | 属性 |
closeButton:Button
获取或设置 InfoWindow 的关闭按钮。
public function get closeButton():Button
public function set closeButton(value:Button):void
closeButtonVisible | 属性 |
closeButtonVisible:Boolean
获取或设置 InfoWindow 的关闭按钮是否可见。要使用该方法必须首先通过地图控件获取到 InfoWindow:
map.infoWindow.closeButtonVisible
。
默认值为: true
.
public function get closeButtonVisible():Boolean
public function set closeButtonVisible(value:Boolean):void
content | 属性 |
content:UIComponent
获取或设置信息窗显示内容。要使用该方法必须首先通过地图控件获取到 InfoWindow:
map.infoWindow.content
. 注意:该属性类型不是 string,而是 UTComponent,即可以任何可视化组件来定义 InfoWindow 的显示内容。InfoWindow 的大小可根据 content 的大小而自适应的放大、缩小。
public function get content():UIComponent
public function set content(value:UIComponent):void
customCloseRect | 属性 |
customCloseRect:Rectangle
用户自定义关闭区域,默认为 null。
public function get customCloseRect():Rectangle
public function set customCloseRect(value:Rectangle):void
infoWindowLabel | 属性 |
infoWindowLabel:Label
获取或设置 InfoWindow 的标签。
public function get infoWindowLabel():Label
public function set infoWindowLabel(value:Label):void
infoWindowLabelVisible | 属性 |
infoWindowLabelVisible:Boolean
获取或设置 InfoWindow 的标签是否可见。要使用该方法必须首先通过地图控件获取到 InfoWindow:
map.infoWindow.labelVisible
。
默认值为: true
.
public function get infoWindowLabelVisible():Boolean
public function set infoWindowLabelVisible(value:Boolean):void
isDisplayedOnCluster | 属性 |
isDisplayedOnCluster:Boolean
获取或设置 InfoWindow 是否可以应用于聚散点 Cluster。要使用该方法必须首先通过地图控件获取到 InfoWindow:
map.infoWindow.isDisplayedOnCluster。
默认值为: false
.
public function get isDisplayedOnCluster():Boolean
public function set isDisplayedOnCluster(value:Boolean):void
showShadow | 属性 |
showShadow:Boolean
获取或设置是否开启倾斜阴影。如果设置为true,那么InfoWindow的位置始终只能在右上角,不再自适应。
默认值为: false
.
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相对于所指定的点对象的偏移量(像素)。 |