Module: NodeTransformers

Provides ways for transforming xml nodes to KML objects.
Source:

Methods

(static) attribute(name) → {function}

This transforming function works with attributes.
Parameters:
Name Type Description
name String Name of the attribute to retrieve.
Source:
Returns:
Transformer function.
Type
function

(static) boolean(node) → {Boolean}

Transforms node to its boolean value.
Parameters:
Name Type Description
node Node Node to transform
Source:
Returns:
Boolean representation of node value.
Type
Boolean

(static) date(node) → {Date}

Transform node to the date
Parameters:
Name Type Description
node Node Node to transform
Source:
Returns:
Date representing current node.
Type
Date

(static) kmlObject(node, parent, controls) → {KmlObject|null}

This function retrieves relevant KmlObject to the Node. If there is such element it returns created element, otherwise it returns null
Parameters:
Name Type Description
node Node Node to transform
parent KmlObject Parent to current node.
controls Array Array of controls.
Source:
Returns:
KmlObject representation for the node.
Type
KmlObject | null

(static) linearRing(node, parent, controls) → {KmlLinearRing}

It takes the node and transforms it to the LinearRing this was created to solve the mismatch between name of the element and type of the element.
Parameters:
Name Type Description
node Node Node to transform
parent KmlObject Parent to current node.
controls Array Array of controls.
Source:
Returns:
Transformed Linear Ring.
Type
KmlLinearRing

(static) number(node) → {Number}

Transforms node to its Numeric value.
Parameters:
Name Type Description
node Node Node to transform
Source:
Returns:
Numeric representation of node value.
Type
Number

(static) positions(node) → {Array.<Position>}

It takes the node and returns al positions included in it.
Parameters:
Name Type Description
node Node Node to transform
Source:
Returns:
All included positions. Positions are separated by space.
Type
Array.<Position>

(static) string(node) → {String}

Transforms node to its String value.
Parameters:
Name Type Description
node Node Node to transform
Source:
Returns:
Text representation of node value.
Type
String