Module: WWUtil

Provides math constants and functions.
Source:

Methods

(static) clone(original) → {Object}

It clones original object into the new one. It is necessary to retain the options information valid for all nodes.
Parameters:
Name Type Description
original Object to clone
Source:
Returns:
Cloned object
Type
Object

(static) currentUrlSansFilePart() → {String}

Returns the current location URL as obtained from window.location with the last path component removed.
Source:
Returns:
The current location URL with the last path component removed.
Type
String

(static) date(item) → {Date}

Transforms item to date. It accepts ISO-8601 format.
Parameters:
Name Type Description
item String To transform.
Source:
Returns:
Date extracted from the current information.
Type
Date

(static) endsWith(subjectString, searchString, length) → {Boolean}

Determines whether subjectString ends with the characters of searchString.
Parameters:
Name Type Description
subjectString String The string to analyse.
searchString String The characters to be searched for at the end of subjectString.
length Number Optional. If provided overwrites the considered length of the string to search in. If omitted, the default value is the length of the string.
Source:
Returns:
true if the given characters are found at the end of the string; otherwise, false.
Type
Boolean

(static) fillArray(array, value)

Sets each element of an array to a specified value. This function is intentionally generic, and works with any data structure with a length property whose elements may be referenced using array index syntax.
Parameters:
Name Type Description
array The array to fill.
value * The value to assign to each array element.
Source:

(static) guid() → {string}

It returns unique GUID.
Source:
Returns:
String representing unique identifier in the application.
Type
string

(static) jsonp(url, parameterName, callback)

Request a resource using JSONP.
Parameters:
Name Type Description
url String The url to receive the request.
parameterName String The JSONP callback function key required by the server. Typically "jsonp" or "callback".
callback function The function to invoke when the request succeeds. The function receives one argument, the JSON payload of the JSONP request.
Source:

(static) multiplyArray(array, value)

Multiplies each element of an array by a specified value and assigns each element to the result. This function is intentionally generic, and works with any data structure with a length property whose elements may be referenced using array index syntax.
Parameters:
Name Type Description
array The array to fill.
value * The value to multiply by each array element.
Source:

(static) startsWith(subjectString, searchString, position) → {Boolean}

Determines whether subjectString begins with the characters of searchString.
Parameters:
Name Type Description
subjectString String The string to analyse.
searchString String The characters to be searched for at the start of subjectString.
position Number The position in subjectString at which to begin searching for searchString; defaults to 0.
Source:
Returns:
true if the given characters are found at the beginning of the string; otherwise, false.
Type
Boolean

(static) suffixForMimeType(mimeType) → {String}

Returns the suffix for a specified mime type.
Parameters:
Name Type Description
mimeType String The mime type to determine a suffix for.
Source:
Returns:
The suffix for the specified mime type, or null if the mime type is not recognized.
Type
String

(static) transformToBoolean(item) → {boolean}

It transforms given item to the boolean. It respects that 0, "0" and "false" are percieved as false on top of the standard Boolean function.
Parameters:
Name Type Description
item String Item to transform
Source:
Returns:
Value transformed to the boolean.
Type
boolean

(static) urlPath(url) → {String}

Returns the path component of a specified URL.
Parameters:
Name Type Description
url String The URL from which to determine the path component.
Source:
Returns:
The path component, or the empty string if the specified URL is null, undefined or empty.
Type
String

(static) worldwindlibLocation() → {String}

Returns the URL of the directory containing the WorldWind library.
Source:
Returns:
The URL of the directory containing the WorldWind library, or null if that directory cannot be determined.
Type
String