包 | com.supermap.web.components |
类 | public class Compass |
继承 | Compass ![]() |
罗盘控件可以向东南西北四个方向任意平移地图,并可全幅显示地图。
若需要修改罗盘任一方向的平移量,需复写相应按钮的点击响应事件;若点击罗盘中心的按钮,不希望全幅显示地图,则需复写showEntire()方法。
方法 | 定义方 | ||
---|---|---|---|
Compass()
初始化 Compass 新实例。
|
Compass |
方法 | 定义方 | ||
---|---|---|---|
panDownHandler(event:MouseEvent):void
向下平移地图。该方法可被扩展,用法如:this.map.pan(0,-30),表示一次向下平移量为30个地图单位。
|
Compass | ||
panLeftHandler(event:MouseEvent):void
向左平移地图。该方法可被扩展,用法如:this.map.pan(-30,0),表示一次向左平移量为30个地图单位。
|
Compass | ||
panRightHandler(event:MouseEvent):void
向右平移地图。该方法可被扩展,用法如:this.map.pan(30,0),表示一次向右平移量为30个地图单位。
|
Compass | ||
panUpHandler(event:MouseEvent):void
向上平移地图。该方法可被扩展,用法如:this.map.pan(0,30),表示一次向上平移量为30个地图单位。
|
Compass | ||
showEntire(event:MouseEvent):void
全幅显示当前地图。该方法可被扩展,用法如:this.map.viewBounds = new Rectangle2D(0,0,180,90),若地图单位为经纬度,点击罗盘中心按钮后,不再全幅显示地图,而是显示东经0-180度、北纬0-90度的地理范围。
|
Compass |
map | 属性 |
map:Map
获取或设置与罗盘控件绑定的地图。
public function get map():Map
public function set map(value:Map):void
Compass | () | 构造函数 |
public function Compass()
初始化 Compass 新实例。
panDownHandler | () | 方法 |
protected function panDownHandler(event:MouseEvent):void
向下平移地图。该方法可被扩展,用法如:this.map.pan(0,-30),表示一次向下平移量为30个地图单位。
参数
event:MouseEvent |
panLeftHandler | () | 方法 |
protected function panLeftHandler(event:MouseEvent):void
向左平移地图。该方法可被扩展,用法如:this.map.pan(-30,0),表示一次向左平移量为30个地图单位。
参数
event:MouseEvent |
panRightHandler | () | 方法 |
protected function panRightHandler(event:MouseEvent):void
向右平移地图。该方法可被扩展,用法如:this.map.pan(30,0),表示一次向右平移量为30个地图单位。
参数
event:MouseEvent |
panUpHandler | () | 方法 |
protected function panUpHandler(event:MouseEvent):void
向上平移地图。该方法可被扩展,用法如:this.map.pan(0,30),表示一次向上平移量为30个地图单位。
参数
event:MouseEvent |
showEntire | () | 方法 |
protected function showEntire(event:MouseEvent):void
全幅显示当前地图。该方法可被扩展,用法如:this.map.viewBounds = new Rectangle2D(0,0,180,90),若地图单位为经纬度,点击罗盘中心按钮后,不再全幅显示地图,而是显示东经0-180度、北纬0-90度的地理范围。
参数
event:MouseEvent |