Skip to content

m-gis核心库 v0.4.4


m-gis核心库 / DomUtil

类: DomUtil ​

定义于: utils/DomUtil.ts:3

构造函数 ​

构造函数 ​

new DomUtil(): DomUtil

返回 ​

DomUtil

方法 ​

addClass() ​

static addClass(el, name): void

定义于: utils/DomUtil.ts:93

参数 ​

el ​

HTMLElement

name ​

string

Adds name to the element's class attribute.

返回 ​

void


create() ​

static create(tagName, className?, container?): HTMLElement

定义于: utils/DomUtil.ts:38

参数 ​

tagName ​

string

className? ​

string

container? ​

HTMLElement

Creates an HTML element with tagName, sets its class to className, and optionally appends it to container element.

返回 ​

HTMLElement


createSvg() ​

static createSvg(width, height, path, container): SVGElement

定义于: utils/DomUtil.ts:163

参数 ​

width ​

string

height ​

string

path ​

string

container ​

HTMLElement

返回 ​

SVGElement


empty() ​

static empty(el): void

定义于: utils/DomUtil.ts:64

参数 ​

el ​

HTMLElement

Removes all of el's children elements from el

返回 ​

void


get() ​

static get(id): HTMLElement | null

定义于: utils/DomUtil.ts:10

Function

get(id: String|HTMLElement): HTMLElement Returns an element given its DOM id, or returns the element itself if it was passed directly.

参数 ​

id ​

string | HTMLElement

返回 ​

HTMLElement | null


getClass() ​

static getClass(el): any

定义于: utils/DomUtil.ts:146

参数 ​

el ​

any

Returns the element's class.

返回 ​

any


getStyle() ​

static getStyle(el, style): string

定义于: utils/DomUtil.ts:21

Function

getStyle(el: HTMLElement, styleAttrib: String): String Returns the value for a certain style attribute on an element, including computed values or values set through CSS.

参数 ​

el ​

any

style ​

any

返回 ​

string


hasClass() ​

static hasClass(el, name): boolean

定义于: utils/DomUtil.ts:76

Function

hasClass(el: HTMLElement, name: String): Boolean Returns true if the element's class attribute contains name.

参数 ​

el ​

HTMLElement

name ​

string

返回 ​

boolean


remove() ​

static remove(el): void

定义于: utils/DomUtil.ts:52

t

参数 ​

el ​

HTMLElement

Removes el from its parent element

返回 ​

void


removeClass() ​

static removeClass(el, name): void

定义于: utils/DomUtil.ts:112

参数 ​

el ​

HTMLElement

name ​

string

Removes name from the element's class attribute.

返回 ​

void


setClass() ​

static setClass(el, name): void

定义于: utils/DomUtil.ts:132

参数 ​

el ​

any

name ​

string

Sets the element's class.

返回 ​

void

MGis 地理三维库