new Control()
自定义控件
Parameters:
| Name | Type | Description |
|---|---|---|
options.element |
string | 控件div |
options.className |
string | 控件class |
options.style |
string | 控件样式 |
Example
var options=new Array();
options.element=document.getElementById("controlDiv");
options.className="divClass";
options.style="width:100%";
var control=new szgeoinfo.Control(options);
map.addControl(control);
Methods
-
getDiv() → {element}
-
获取控件容器
Returns:
获取div对象
-
hide()
-
控件隐藏
-
show()
-
控件显示