Appearance
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
Methods
checkPosition()
staticcheckPosition(position):any
Defined in: src/utils/Util.ts:120
Parameters
position
any
Returns
any
Function
checkPosition(position: Object): Boolean Check position for validity
dataURLtoBlob()
staticdataURLtoBlob(dataUrl):Blob
Defined in: src/utils/Util.ts:168
Parameters
dataUrl
any
Returns
Blob
debounce()
staticdebounce(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()
staticemptyImageUrl():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()
staticexitFullScreen():void
Defined in: src/utils/Util.ts:215
退出全屏
Returns
void
formatNum()
staticformatNum(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()
staticgetRandomNum(Min,Max):number
Defined in: src/utils/Util.ts:15
生成范围随机数
Parameters
Min
any
Max
any
Returns
number
Min
最小值
Max
最大值(包括)
isPromise()
staticisPromise(obj):boolean
Defined in: src/utils/Util.ts:185
Parameters
obj
any
Returns
boolean
merge()
staticmerge(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()
staticrequestFullScreen(el):void
Defined in: src/utils/Util.ts:193
进入全屏
Parameters
el
any = window.document.documentElement
Returns
void
setOptions()
staticsetOptions(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()
staticsplitWords(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()
staticthrottle(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()
statictrim(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()
staticuuid(prefix):string
Defined in: src/utils/Util.ts:25
Generates uuid
Parameters
prefix
string = 'D'
Returns
string