Reference Source
public class | source

MapButton

Map button class

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)

Constructor

Method Summary

Public Methods
public

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

Add button to mapview

public

Button enabled state

public

Hide button

public

remove(): Null

Remove button

public

setEnabled(flag: Boolean): Null

Set the button enabled state

public

setPosition(position: String): Null

Set position of button

public

setTitle(title: String): Null

Set button title

public

Show button

Public Constructors

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

Constructor

Params:

NameTypeAttributeDescription
icon String

button icon string

onClick function(): null

function will run on click event

title String

button title

id String

button id

Public Methods

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

Add button to mapview

Params:

NameTypeAttributeDescription
mapview Object

mapview object

position String

postion of button, such as 'topleft'...

Return:

Null

public enabled(): Boolean source

Button enabled state

Return:

Boolean

public hide(): MapButton source

Hide button

Return:

MapButton

public remove(): Null source

Remove button

Return:

Null

public setEnabled(flag: Boolean): Null source

Set the button enabled state

Params:

NameTypeAttributeDescription
flag Boolean

is button enabled

Return:

Null

public setPosition(position: String): Null source

Set position of button

Params:

NameTypeAttributeDescription
position String

postion of button, such as 'topleft'...

Return:

Null

public setTitle(title: String): Null source

Set button title

Params:

NameTypeAttributeDescription
title String

title content

Return:

Null

public show(): MapButton source

Show button

Return:

MapButton