ShapeDrawerControl

矢量符号面板

new YS.ShapeDrawerControl(ys, options)

矢量图绘制面板组件
Name Type Description
ys Object YouScene对象
options Object 对象有下面这些属性:
Name Type Default Description
id String optional 矢量图绘制面板放在哪个盒子里
isDrag Boolean true optional 组件是否可以拖拽(默认值为true)
className String optional 矢量图绘制面板外层div的className,通过自定义className可以修改样式
Implements:
Example:
var youScene = new YS.YouScene({sdkServerUrl: 'http://ys.infoearth.com:9090/Server/'});
youScene.init("global");

var ShapeDrawerControl = new YS.ShapeDrawerControl(youScene,{});

ShapeDrawerControl.show();
Demo:

Members

readonlyshapeDrawers : DrawShape

面板管理的DrawShape对象

Methods

addPanelShape(shapeDrawer)

往面板中添加矢量对象
Name Type Description
shapeDrawer ShapeDrawer 要添加的矢量符号对象

addShape(shapeDrawerType)String

添加矢量符号
Name Type Description
shapeDrawerType ShapeDrawerType 要添加的矢量符号类型
Returns:
返回矢量符号对象的id

clean()

清理组件的临时数据、成果等
Implements:

destroy()Undefined

销毁组件 重载时请务必调用IControl.prototype.destroy.apply(this);
Returns:
Implements:

exportAllShapes()Array.<Object>

导出矢量符号信息
Returns:
返回矢量图对象序列化后的json数组

importAllShapes(allShapes)

导入矢量符号信息
Name Type Description
allShapes Array.<Object> 要导入的矢量符号列表
See:

isDestroyed()Boolean

该组件是否销毁 (true代表销毁了,false代表未销毁), 销毁后将不可以再使用
Returns:
Implements:

removeById(id)

通过Id移除矢量符号
Name Type Description
id String 矢量符号对象的id

removePanelShape(type)

移除面板中的矢量对象
Name Type Description
type String 面板中矢量符号对象的type

removeSelect()

移除当前选择的矢量符号

show()

显示组件
Implements:

showAll(visible)

显示(或隐藏)所有矢量符号
Name Type Description
visible Boolean 是否可见

showById(id)

通过Id显示(或隐藏)矢量符号
Name Type Description
id String 矢量符号对象的id