Reference Source
public class | source

MapButton

地图按钮类

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');

Constructor Summary

Public Constructor
public

constructor(icon: String, onClick: function(): null, title: String, id: String)

构造函数

Method Summary

Public Methods
public

addToMapView(mapview: Object, position: String): Null

添加按钮到mapview

public

按钮启用的状态

public

隐藏按钮

public

remove(): Null

移除按钮

public

setEnabled(flag: Boolean): Null

设置按钮启用状态

public

setPosition(position: String): Null

设置按钮的位置

public

setTitle(title: String): Null

设置按钮标题

public

显示按钮

Public Constructors

public constructor(icon: String, onClick: function(): null, title: String, id: String) source

构造函数

Params:

NameTypeAttributeDescription
icon String

按钮的图标class定义

onClick function(): null

点击事件的响应函数

title String

按钮的文字

id String

按钮id

Public Methods

public addToMapView(mapview: Object, position: String): Null source

添加按钮到mapview

Params:

NameTypeAttributeDescription
mapview Object

mapview对象

position String

按钮的位置,例如“topleft”

Return:

Null

public enabled(): Boolean source

按钮启用的状态

Return:

Boolean

public hide(): MapButton source

隐藏按钮

Return:

MapButton

public remove(): Null source

移除按钮

Return:

Null

public setEnabled(flag: Boolean): Null source

设置按钮启用状态

Params:

NameTypeAttributeDescription
flag Boolean

按钮是否启用

Return:

Null

public setPosition(position: String): Null source

设置按钮的位置

Params:

NameTypeAttributeDescription
position String

按钮的位置,例如“topleft”

Return:

Null

public setTitle(title: String): Null source

设置按钮标题

Params:

NameTypeAttributeDescription
title String

标题内容

Return:

Null

public show(): MapButton source

显示按钮

Return:

MapButton