Reference Source
public class | source

MapInput

Extends:

leaflet~L.Control.MapInput → MapInput

Used to create input control of the map.

Example:

var options = {
position: 'topleft',

onClick: function () {
console.log('onclick!!!');
console.log(this.value());
},
}
var input = new KQ.Control.MapInput(options);
input.setDropdownData([ 'A', 'B', 'C' ]);
input.setOnClick(function () {
console.log('new onclick!!!');
console.log(input.value());
console.log(input.dropdownValue());
});

Constructor Summary

Public Constructor
public

constructor(options: Object)

Constructor

Method Summary

Public Methods
public

addToMapView(mapview: MapView): Null

Add popup to mapview

public

Return the value of dropdown list

public

remove(): Null

Removes the layer from the map it is currently active on.

public

setOnClick(callback: function(e: Object): null): Null

Set on click event handle function

public

Return the value of input

Public Constructors

public constructor(options: Object) source

Constructor

Params:

NameTypeAttributeDescription
options Object

config params

options.position String

position of the mapinput

options.iconType String

icon type, default is 'search'.('check', 'custom', 'play', 'heart')

options.inputWidth Number

width of input control

options.isHasDropdown Boolean

if value is false, dropdown control will disappear

options.dropdownWidth Number

width of dropdown control

options.dropdownMargin Number

margin of input control and dropdown control

options.onClick Object

callback function rans when button is clicked

Public Methods

public addToMapView(mapview: MapView): Null source

Add popup to mapview

Params:

NameTypeAttributeDescription
mapview MapView

mapview object

Return:

Null

public dropdownValue(): String source

Return the value of dropdown list

Return:

String

public remove(): Null source

Removes the layer from the map it is currently active on.

Return:

Null

public setOnClick(callback: function(e: Object): null): Null source

Set on click event handle function

Params:

NameTypeAttributeDescription
callback function(e: Object): null

event handle function

Return:

Null

public value(): String source

Return the value of input

Return:

String