Skip to content

xgis-cesium v0.1.9


xgis-cesium / Util

Class: Util

Defined in: src/utils/Util.ts:9

Some of the code borrows from leaflet https://github.com/Leaflet/Leaflet/tree/master/src/core

Constructors

new Util()

new Util(): Util

Returns

Util

Methods

checkPosition()

static checkPosition(position): any

Defined in: src/utils/Util.ts:120

Parameters

position

any

Returns

any

Function

checkPosition(position: Object): Boolean Check position for validity


dataURLtoBlob()

static dataURLtoBlob(dataUrl): Blob

Defined in: src/utils/Util.ts:168

Parameters

dataUrl

any

Returns

Blob


debounce()

static debounce(fn, delay): () => void

Defined in: src/utils/Util.ts:135

Creates a debounced function that delays invoking fn until after delay

Parameters

fn

any

delay

any

Returns

Function

Returns

void


emptyImageUrl()

static emptyImageUrl(): string

Defined in: src/utils/Util.ts:109

Data URI string containing a base64-encoded empty GIF image. Used as a hack to free memory from unused images on WebKit-powered mobile devices (by setting image src to this string).

Returns

string


exitFullScreen()

static exitFullScreen(): void

Defined in: src/utils/Util.ts:215

退出全屏

Returns

void


formatNum()

static formatNum(num, digits): number

Defined in: src/utils/Util.ts:89

Parameters

num

any

digits

any

Returns

number

Function

formatNum(num: Number, digits?: Number): Number Returns the number num rounded to digits decimals, or to 6 decimals by default.


getRandomNum()

static getRandomNum(Min, Max): number

Defined in: src/utils/Util.ts:15

生成范围随机数

Parameters

Min

any

Max

any

Returns

number

Min

最小值

Max

最大值(包括)


isPromise()

static isPromise(obj): boolean

Defined in: src/utils/Util.ts:185

Parameters

obj

any

Returns

boolean


merge()

static merge(dest, ...sources): any

Defined in: src/utils/Util.ts:46

Merges the properties of the src object (or multiple objects) into dest object and returns the latter.

Parameters

dest

any

sources

...any[]

Returns

any


requestFullScreen()

static requestFullScreen(el): void

Defined in: src/utils/Util.ts:193

进入全屏

Parameters

el

any = window.document.documentElement

Returns

void


setOptions()

static setOptions(obj, options): any

Defined in: src/utils/Util.ts:72

Parameters

obj

any

options

any

Returns

any

Function

setOptions(obj: Object, options: Object): Object Merges the given properties to the options of the obj object, returning the resulting options. See Class options.


splitWords()

static splitWords(str): any

Defined in: src/utils/Util.ts:62

Parameters

str

any

Returns

any

Function

splitWords(str: String): String[] Trims and splits the string on whitespace and returns the array of parts.


throttle()

static throttle(fn, delay): () => boolean

Defined in: src/utils/Util.ts:149

Creates a throttled function that only invokes fn at most once per

Parameters

fn

any

delay

any

Returns

Function

Returns

boolean


trim()

static trim(str): any

Defined in: src/utils/Util.ts:99

Parameters

str

any

Returns

any

Function

trim(str: String): String Compatibility polyfill for String.prototype.trim


uuid()

static uuid(prefix): string

Defined in: src/utils/Util.ts:25

Generates uuid

Parameters

prefix

string = 'D'

Returns

string