Reference Source
public class | source

MapConfig

Extends:

L~L.Evented → MapConfig

Map config manager, singleton

Static Method Summary

Static Public Methods
public static

Get instance object(Singleton mode)

Constructor Summary

Public Constructor
public

Constructor

Method Summary

Public Methods
public

Get control array

public

findLayer(origin_src_name: String, id: String): Object

Find layer object from

public

Get projection(esri) in config file.

public

Get projection(proj4) in config file.

public

getControl(controlType: String): Object

Get control

public

Get control height

public

Get control position

public

getControlProperty(control: String, property: String): String

Get control property

public

Get control type

public

Get control width

public

Get control permission

public

Get the option of draw control

public

Get map whole range

public

Get map initialize range

public

Get map language

public

Get layer ID

public

Get icon path of layer

public

Get layer key

public

Get display name of layer

public

Get opacity of layer

public

Get data source name of layer

public

Get sub layer array of the layer

public

Get Tooltip of layer

public

Get the layer type

public

Get layer permissions

public

Get map min scale index

public

Get data source old name

public

Get projection information(esri).

public

Get projection information(proj4).

public

Get projection bound.

public

Get projection origin.

public

Gets the option of the rubber box control

public

Get scale from scale index.

public

Get scale ID, in google mode, ID is the level of google scale.

public

getSourceByName(sourceName: String, isOrigin: Boolean): Object

Get data source object from data source name

public

Get layer type of data source.

public

Get layers of data source.

public

Get data source name

public

Get data source type

public

Get data source url

public

Get data source geometry service url

public

Get data source ip and port url

public

getSubControl(parent_control: Object, subcontrol_type: String): Object

Get ths sub control of parent control

public

getSubControls(parent_control: Object): Object

Get ths sub controls of parent control

public

Returns the maximum number of selected tree controls

public

Get unit

public

async initAsync(xmlstring: String, isZip: Boolean, callback: Function): Promise

Initialize

public

Does control have permissions

public

Is using google scale

public

isHasControl(controlType: String): Boolean

If has control

public

Is layer dynamic

public

If the layer is a composite layer

public

Does layer have permissions

public

Is layer the history layer

public

Is layer the mask layer

public

If the layer is for mini map

public

Is layer used in the layer tree

public

Is layer selected by default

public

the language of using

public

layers(isIncludeUnuse: Boolean): Array

Get layer list

public

Get the mask layer list

public

Get mini layer list

public

permission(value: String[]): String[]

Set or obtain permissions if not passed parameters are obtained

public

Get resolutions, meter / pixel

public

Convert scale ID to scale index.

public

Convert scale index to scale ID.

public

Get scale list

public

setDrawOption(option: Object): Null

Set the option of draw control

public

setLayerOpacity(layer: Object, opacity: Number): Null

Get opacity of layer

public

setRubberBandOption(option: Object): Null

Set the options for a rubber box control

public

setSources(sources: Array): Array

Set data source array

public

Get data source list

public

Get theme name

public

Get layer tree label

Static Public Methods

public static getInstance(): MapConfig source

Get instance object(Singleton mode)

Return:

MapConfig

Public Constructors

public constructor() source

Constructor

Public Methods

public controls(): Array source

Get control array

Return:

Array

public findLayer(origin_src_name: String, id: String): Object source

Find layer object from

Params:

NameTypeAttributeDescription
origin_src_name String

origin source name

id String

layer id

Return:

Object

public getConfigPrj(): String source

Get projection(esri) in config file.

Return:

String

public getConfigProj4(): String source

Get projection(proj4) in config file.

Return:

String

public getControl(controlType: String): Object source

Get control

Params:

NameTypeAttributeDescription
controlType String

control type, "zoom","tree" and so on.

Return:

Object

or null

public getControlHeight(control: String): String source

Get control height

Params:

NameTypeAttributeDescription
control String

control object.

Return:

String

number string with unit

public getControlPosition(control: String): String source

Get control position

Params:

NameTypeAttributeDescription
control String

control object.

Return:

String

'topleft', 'topright', 'bottomleft' or 'bottomright'

public getControlProperty(control: String, property: String): String source

Get control property

Params:

NameTypeAttributeDescription
control String

control object.

property String

property "url","type"等

Return:

String

value of property

public getControlType(control: Object): String source

Get control type

Params:

NameTypeAttributeDescription
control Object

control

Return:

String

public getControlWidth(control: String): String source

Get control width

Params:

NameTypeAttributeDescription
control String

control object.

Return:

String

number string with unit

public getControlpermission(control: Object): String[] source

Get control permission

Params:

NameTypeAttributeDescription
control Object

control object

Return:

String[]

public getDrawOption(): Object source

Get the option of draw control

Return:

Object

public getFullExtent(): Array source

Get map whole range

Return:

Array

left, bottom, right, up

public getInitExtent(): Array source

Get map initialize range

Return:

Array

left, bottom, right, up

public getLanguage(): String source

Get map language

Return:

String

'cn','en'

public getLayerID(layer: Object): Number source

Get layer ID

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

Number

public getLayerIcon(layer: Object): String source

Get icon path of layer

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

String

public getLayerKey(layer: Object): String source

Get layer key

Params:

NameTypeAttributeDescription
layer Object

object

Return:

String

layer key

public getLayerLabel(layer: Object): String source

Get display name of layer

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

String

public getLayerOpacity(layer: Object): Number source

Get opacity of layer

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

Number

public getLayerSourceName(layer: Object): String source

Get data source name of layer

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

String

public getLayerSubLayer(layer: Object): Array source

Get sub layer array of the layer

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

Array

public getLayerTooltip(layer: Object): String source

Get Tooltip of layer

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

String

public getLayerType(layer: Object): String source

Get the layer type

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

String

'sl' vector; 'yx' image

public getLayerpermission(layer: Object): String[] source

Get layer permissions

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

String[]

public getMinScaleID(): Number source

Get map min scale index

Return:

Number

public getOriginSourceName(source: Object): String source

Get data source old name

Params:

NameTypeAttributeDescription
source Object

data source object

Return:

String

public getPrj(): String source

Get projection information(esri). If no projection, it will guess unit and set default projection.

Return:

String

public getProj4(): String source

Get projection information(proj4). If no projection, it will guess unit and set default projection.

Return:

String

public getProjectionBounds(): Array source

Get projection bound.

Return:

Array

[left, top, right, bottom]

public getProjectionOrigin(): Array source

Get projection origin.

Return:

Array

[x, y]

public getRubberBandOption(): Object source

Gets the option of the rubber box control

Return:

Object

public getScaleByIndex(index: Number): Number source

Get scale from scale index.

Params:

NameTypeAttributeDescription
index Number

scale index

Return:

Number

public getScaleID(scale: Object): Number source

Get scale ID, in google mode, ID is the level of google scale.

Params:

NameTypeAttributeDescription
scale Object

scale object

Return:

Number

public getSourceByName(sourceName: String, isOrigin: Boolean): Object source

Get data source object from data source name

Params:

NameTypeAttributeDescription
sourceName String

data source name

isOrigin Boolean

is find in origin data sources.(or in preprocessed data sources)

Return:

Object

public getSourceLayerType(source: Object): String source

Get layer type of data source. Final data source only have one layer type.(After preprocessing)

Params:

NameTypeAttributeDescription
source Object

data source object

Return:

String

"sl" "yx" ""...

public getSourceLayers(source: Object): Array source

Get layers of data source.

Params:

NameTypeAttributeDescription
source Object

data source object

Return:

Array

public getSourceName(source: Object): String source

Get data source name

Params:

NameTypeAttributeDescription
source Object

data source object

Return:

String

public getSourceType(source: Object): String source

Get data source type

Params:

NameTypeAttributeDescription
source Object

data source object

Return:

String

"kqmapping" "wms" ...

public getSourceUrl(source: Object): String source

Get data source url

Params:

NameTypeAttributeDescription
source Object

data source object

Return:

String

public getSourceUrl_GeometryService(source: Object): String source

Get data source geometry service url

Params:

NameTypeAttributeDescription
source Object

data source object

Return:

String

public getSourceUrl_IPPort(source: Object): String source

Get data source ip and port url

Params:

NameTypeAttributeDescription
source Object

data source object

Return:

String

public getSubControl(parent_control: Object, subcontrol_type: String): Object source

Get ths sub control of parent control

Params:

NameTypeAttributeDescription
parent_control Object

parent control

subcontrol_type String

sub control type

Return:

Object

or {null}

public getSubControls(parent_control: Object): Object source

Get ths sub controls of parent control

Params:

NameTypeAttributeDescription
parent_control Object

parent control

Return:

Object

public getTreeSelectMaxCount(): Number source

Returns the maximum number of selected tree controls

Return:

Number

public getUnit(): String source

Get unit

Return:

String

'meter', 'degree', 'us-ft', 'other'

public async initAsync(xmlstring: String, isZip: Boolean, callback: Function): Promise source

Initialize

Params:

NameTypeAttributeDescription
xmlstring String

map config information, xml format

isZip Boolean

is use zip format

callback Function

callback function rans after initialization

Return:

Promise

public isControlHasPermission(control: Object): Boolean source

Does control have permissions

Params:

NameTypeAttributeDescription
control Object

control object

Return:

Boolean

public isGoogleScale(): Boolean source

Is using google scale

Return:

Boolean

public isHasControl(controlType: String): Boolean source

If has control

Params:

NameTypeAttributeDescription
controlType String

control type, "zoom","tree" and so on.

Return:

Boolean

public isLayerDynamic(layer: Object): Boolean source

Is layer dynamic

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

Boolean

public isLayerGroup(layer: Object): Boolean source

If the layer is a composite layer

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

Boolean

public isLayerHasPermission(layer: Object): Boolean source

Does layer have permissions

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

Boolean

public isLayerHistory(layer: Object): Boolean source

Is layer the history layer

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

Boolean

public isLayerMask(layer: Object): Boolean source

Is layer the mask layer

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

Boolean

public isLayerMini(layer: Object): Boolean source

If the layer is for mini map

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

Boolean

public isLayerUse(layer: Object): Boolean source

Is layer used in the layer tree

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

Boolean

public isLayerVisible(layer: Object): Boolean source

Is layer selected by default

Params:

NameTypeAttributeDescription
layer Object

layer object

Return:

Boolean

public language(): string source

the language of using

Return:

string

public layers(isIncludeUnuse: Boolean): Array source

Get layer list

Params:

NameTypeAttributeDescription
isIncludeUnuse Boolean

is include unused layer.

Return:

Array

public maskLayers(): Array source

Get the mask layer list

Return:

Array

public miniLayers(): Array source

Get mini layer list

Return:

Array

public permission(value: String[]): String[] source

Set or obtain permissions if not passed parameters are obtained

Params:

NameTypeAttributeDescription
value String[]

The permission values that you want to set

Return:

String[]

public resolutions(): Array source

Get resolutions, meter / pixel

Return:

Array

public scaleIDToIndex(id: Number): Number source

Convert scale ID to scale index.

Params:

NameTypeAttributeDescription
id Number

scale id

Return:

Number

public scaleIndexToID(index: Number): Number source

Convert scale index to scale ID.

Params:

NameTypeAttributeDescription
index Number

scale index

Return:

Number

public scales(): Array source

Get scale list

Return:

Array

public setDrawOption(option: Object): Null source

Set the option of draw control

Params:

NameTypeAttributeDescription
option Object

The option param

option.importMaxFeatureCount Number

The max importing feature count at a time

option.isUseTxt Boolean

If the value is true, it will enable 'txt' mode

option.importTxtFunction function(file: Object): null

When importing button is clicked in 'txt' mode, will run the function

option.exportTxtFunction function(): null

When exporting button is clicked in 'txt' mode, will run the function

option.isUseExcel Boolean

If the value is true, it will enable 'excel' mode

option.importExcelFunction function(file: Object): null

When importing button is clicked in 'excel' mode, will run the function

option.exportExcelFunction function(): null

When exporting button is clicked in 'excel' mode, will run the function

Return:

Null

public setLayerOpacity(layer: Object, opacity: Number): Null source

Get opacity of layer

Params:

NameTypeAttributeDescription
layer Object

layer object

opacity Number

layer opacity, 0~1

Return:

Null

public setRubberBandOption(option: Object): Null source

Set the options for a rubber box control

Params:

NameTypeAttributeDescription
option Object

setting option

option.rubberBandFunction function(): null

The function that is called after the rubber box control is selected

Return:

Null

public setSources(sources: Array): Array source

Set data source array

Params:

NameTypeAttributeDescription
sources Array

data source array

Return:

Array

public sources(): Array source

Get data source list

Return:

Array

public themeName(): String source

Get theme name

Return:

String

public treeLabel(): String source

Get layer tree label

Return:

String