Summary
Methods:
| activate |
激活鹰眼地图控件 |
| deactivate |
禁用鹰眼地图控件 |
| destroy |
销毁控件,释放占用的内存。 |
| getControlType |
返回控件的类型 |
| setClassName |
设置控件面板样式类名 |
| setPosition |
设置控件面板在地图右下角的边界距离 |
| setStyle |
设置控件面板样式 |
Constructor
new MiniMap(layer, options)
Parameters:
| Name | Type | Default | Description | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
layer |
module:layer~Layer | null | 在鹰眼地图控件中展示的图层 |
|||||||||||||||||||||||||||||||||||||||
options |
Object | 可选项
|
Example
const tmsLayer = new hmap.layer.TMS("TMS", tmsURL, tmsOptions);
const miniMap = new hmap.control.MiniMap(tmsLayer);
map.addControl(miniMap);
Methods
-
activate()
-
激活鹰眼地图控件
-
deactivate()
-
禁用鹰眼地图控件
-
destroy()
-
销毁控件,释放占用的内存。
Example
miniMap.destroy(); -
getControlType() → {String}
-
返回控件的类型
Returns:
String -控件类型的名称。
-
setClassName(className)
-
设置控件面板样式类名
Parameters:
Name Type Description classNameString 要设置的样式类名
-
setPosition(position)
-
设置控件面板在地图右下角的边界距离
Parameters:
Name Type Description positionmodule:basetype~Pixel 像素坐标
Throws:
当参数position类型不对时,抛出异常
Example
MiniMap.setPosition(new hmap.basetype.Pixel(50,50)) -
setStyle(style)
-
设置控件面板样式
Parameters:
Name Type Description styleString 要设置的css样式字符串