Reference Source
public class | source

MapButtonBar

按钮条类

See:

Example:

var button0 = new KQ.Control.MapButton('fa fa-globe fa-lg', function (btn, map) {
  console.log('button 0 clicked!');
}, 'Press Button 0');

var button1 = new KQ.Control.MapButton('fa fa-bug fa-lg', function (btn, map) {
  console.log('button 1 clicked!');
}, 'Press Button 1');

let bar = new KQ.Control.MapButtonBar([ button0, button1 ], { position: 'topright' });
bar.addTo(map);

Constructor Summary

Public Constructor
public

constructor(buttons: Array, options: Object)

构造函数

Method Summary

Public Methods
public

addToMapView(mapview: Object): Null

添加按钮条到mapview

public

隐藏按钮条

public

remove(): Null

移除按钮条

public

setAttribute(key: *, value: *)

public

setPosition(position: String): Null

设置按钮条的位置

public

显示按钮条

Public Constructors

public constructor(buttons: Array, options: Object) source

构造函数

Params:

NameTypeAttributeDescription
buttons Array

按钮数组

options Object

初始化选项

options.postion String
  • optional

按钮条的位置,例如“topleft”

Public Methods

public addToMapView(mapview: Object): Null source

添加按钮条到mapview

Params:

NameTypeAttributeDescription
mapview Object

mapview对象

Return:

Null

public hide(): MapButtonBar source

隐藏按钮条

Return:

MapButtonBar

public remove(): Null source

移除按钮条

Return:

Null

public setAttribute(key: *, value: *) source

Params:

NameTypeAttributeDescription
key *
value *

public setPosition(position: String): Null source

设置按钮条的位置

Params:

NameTypeAttributeDescription
position String

按钮条的位置,例如“topleft”

Return:

Null

public show(): MapButtonBar source

显示按钮条

Return:

MapButtonBar