Reference Source
public class | source

CommonTools

通用工具类

Static Method Summary

Static Public Methods
public static

appendTokenToData(data: *): *

public static

appendTokenToUrl(url: *): *

public static

downloadFromUrl(url: String, output_file_name: String): Null

下载文件

public static

exportBase64UrlToImage(urlData: *, output_file_name: *)

public static

exportData(data: String, output_file_name: String, output_mime_type: String): Null

导出数据

public static

extractParameterFromSearch(search: *, param: *): *

public static

geoJsonFCToGC(featureCollection: Object): Object

GeoJSON文件的featureCollection类型转到geometryCollection类型,如果失败则返回空

public static

geoJsonToGC(geojson: *): *

public static

getCoords(shape: Object): LatLng[]

获取图形的坐标

public static

getGeomFromFeatureCollection(featureCollection: *): *

public static

getMapIntegerZoom(map: *, is_google: *): *

public static

获取形状类型

public static

getTimeString(s: *): *

public static

getUrlname(url: *): *

获取url的名称

public static

hexToRGB(hex: *, alpha: *): *

Hex转RGB

public static

pickObject(obj: *, arr: *): *

public static

runTurfCallback(callback: *)

public static

setMapStandardScale(map: *, standard_scale: *)

public static

stopDomEvent(e: DomEvent): null

停止继续传递事件

public static

删除字符串左边的空白字符

public static

删除字符串右边的空白字符

public static

删除字符串的空白字符

public static

删除字符串左边和右边的空白字符

Static Public Methods

public static appendTokenToData(data: *): * source

Params:

NameTypeAttributeDescription
data *

Return:

*

public static appendTokenToUrl(url: *): * source

Params:

NameTypeAttributeDescription
url *

Return:

*

public static downloadFromUrl(url: String, output_file_name: String): Null source

下载文件

Params:

NameTypeAttributeDescription
url String

文件的路径

output_file_name String

输出文件的名字

Return:

Null

public static exportBase64UrlToImage(urlData: *, output_file_name: *) source

Params:

NameTypeAttributeDescription
urlData *
output_file_name *

public static exportData(data: String, output_file_name: String, output_mime_type: String): Null source

导出数据

Params:

NameTypeAttributeDescription
data String

输出的数据

output_file_name String

输出文件名

output_mime_type String

输出文件的mime类型

Return:

Null

public static extractParameterFromSearch(search: *, param: *): * source

Params:

NameTypeAttributeDescription
search *
param *

Return:

*

public static geoJsonFCToGC(featureCollection: Object): Object source

GeoJSON文件的featureCollection类型转到geometryCollection类型,如果失败则返回空

Params:

NameTypeAttributeDescription
featureCollection Object

featureCollection格式的GeoJSON数据

Return:

Object

geometryCollection格式的GeoJSON数据

public static geoJsonToGC(geojson: *): * source

Params:

NameTypeAttributeDescription
geojson *

Return:

*

public static getCoords(shape: Object): LatLng[] source

获取图形的坐标

Params:

NameTypeAttributeDescription
shape Object

图形对象

Return:

LatLng[]

public static getGeomFromFeatureCollection(featureCollection: *): * source

Params:

NameTypeAttributeDescription
featureCollection *

Return:

*

public static getMapIntegerZoom(map: *, is_google: *): * source

Params:

NameTypeAttributeDescription
map *
is_google *

Return:

*

public static getShapeType(shape: Object): Number source

获取形状类型

Params:

NameTypeAttributeDescription
shape Object

图形对象

Return:

Number

point: 0, line: 1, fill: 2,

public static getTimeString(s: *): * source

Params:

NameTypeAttributeDescription
s *

Return:

*

public static getUrlname(url: *): * source

获取url的名称

Params:

NameTypeAttributeDescription
url *

Return:

*

public static hexToRGB(hex: *, alpha: *): * source

Hex转RGB

Params:

NameTypeAttributeDescription
hex *
alpha *

Return:

*

public static pickObject(obj: *, arr: *): * source

Params:

NameTypeAttributeDescription
obj *
arr *

Return:

*

public static runTurfCallback(callback: *) source

Params:

NameTypeAttributeDescription
callback *

public static setMapStandardScale(map: *, standard_scale: *) source

Params:

NameTypeAttributeDescription
map *
standard_scale *

public static stopDomEvent(e: DomEvent): null source

停止继续传递事件

Params:

NameTypeAttributeDescription
e DomEvent

地图Dom事件

Return:

null

public static stringLTrim(str: String): String source

删除字符串左边的空白字符

Params:

NameTypeAttributeDescription
str String

目标字符串

Return:

String

public static stringRTrim(str: String): String source

删除字符串右边的空白字符

Params:

NameTypeAttributeDescription
str String

目标字符串

Return:

String

public static stringRemoveBlank(str: String): String source

删除字符串的空白字符

Params:

NameTypeAttributeDescription
str String

目标字符串

Return:

String

public static stringTrim(str: String): String source

删除字符串左边和右边的空白字符

Params:

NameTypeAttributeDescription
str String

目标字符串

Return:

String