Reference Source
public class | source

CommonTools

CommonTools class

Static Method Summary

Static Public Methods
public static

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

Download file

public static

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

Export data

public static

geoJsonFCToGC(featureCollection: Object): Object

GeoJson featureCollection to geometryCollection, if failed return null

public static

geoJsonToGC(geojson: *): *

public static

getCoords(shape: Object): LatLng[]

Gets the coordinates of the shape

public static

Get shape type

public static

stopDomEvent(e: DomEvent): null

Stop the passing of events

public static

Trim string left

public static

Trim string right

public static

Remove blanks of string

public static

Trim string left and right

Static Public Methods

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

Download file

Params:

NameTypeAttributeDescription
url String

url of the file

output_file_name String

he name of output file

Return:

Null

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

Export data

Params:

NameTypeAttributeDescription
data String

data of output file

output_file_name String

name of output file

output_mime_type String

mime type of output file

Return:

Null

public static geoJsonFCToGC(featureCollection: Object): Object source

GeoJson featureCollection to geometryCollection, if failed return null

Params:

NameTypeAttributeDescription
featureCollection Object

geojson featureCollection format

Return:

Object

geojson geometryCollection format

public static geoJsonToGC(geojson: *): * source

Params:

NameTypeAttributeDescription
geojson *

Return:

*

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

Gets the coordinates of the shape

Params:

NameTypeAttributeDescription
shape Object

shape object

Return:

LatLng[]

public static getShapeType(shape: Object): Number source

Get shape type

Params:

NameTypeAttributeDescription
shape Object

shape object

Return:

Number

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

public static stopDomEvent(e: DomEvent): null source

Stop the passing of events

Params:

NameTypeAttributeDescription
e DomEvent

Map Dom event

Return:

null

public static stringLTrim(str: String): String source

Trim string left

Params:

NameTypeAttributeDescription
str String

string

Return:

String

public static stringRTrim(str: String): String source

Trim string right

Params:

NameTypeAttributeDescription
str String

string

Return:

String

public static stringRemoveBlank(str: String): String source

Remove blanks of string

Params:

NameTypeAttributeDescription
str String

string

Return:

String

public static stringTrim(str: String): String source

Trim string left and right

Params:

NameTypeAttributeDescription
str String

string

Return:

String