Nokia Maps API Reference

Contents

Class nokia.maps.kml.DOM

Class Summary

This is a static class that provides helper methods for the KML-specific classes.

To instantiate this class, use the default constructor without arguments:

var myTypeSelector = new nokia.maps.kml.DOM();

Method Summary
static getAltitudeMode (node) : String This method parses the value of an XML DOM node into a string.
static getBoolean (node) : Boolean This method parses the value of an XML DOM node to a Boolean value.
static getColor (node) : String This method parses the value of an XML DOM node to a string that represents a color in RGBA format, reversing the order, because the KML specification uses the ABGR format.
static getFloat (node) : Float This method parses the value of an XML DOM node to a Floating point number.
static getInteger (node) : Integer This method parses the value of an XML DOM node to integer.
static getNodeAttribute (node, attributeName) : String This method parses the attribute attributeName from an XML DOM node and returns it as a string.
static getNodeId (node) : String This method parses the attribute id from an XML DOM node and returns it as a string.
static getString (node) : String This method parses the value of a DOM node into string.
static parseCoord (coordStr) : nokia.maps.geo.Coordinate This method parses a object containing geographical coordinates from a string.
static parseCoords (coordsString) : nokia.maps.geo.Coordinate[] This method parses a string containing coordinates to an array of objects, each containing the properties "lat", "lng" and "alt".
static parseFromString (node) : Document This method parses an XML string into browser-indepdendent XML Document object.
Constructor Detail
new nokia.maps.kml.DOM()
Method Detail
static getAltitudeMode (node) : String
This method parses the value of an XML DOM node into a string. The resulting string contains only predefined values as specified in KML documentation
Parameters:
{Node} node Any XML DOM node to parse
Returns:
{String} One of the predefined string values
static getBoolean (node) : Boolean
This method parses the value of an XML DOM node to a Boolean value.
Parameters:
{Node} node An XML DOM node to parse
Returns:
{Boolean} A Boolean representation of the node value
static getColor (node) : String
This method parses the value of an XML DOM node to a string that represents a color in RGBA format, reversing the order, because the KML specification uses the ABGR format. If parsing fails, the method returns the default hard-coded color.
Parameters:
{Node} node An XML DOM node to parse
Returns:
{String} A string representing a color in RGBA format
static getFloat (node) : Float
This method parses the value of an XML DOM node to a Floating point number.
Parameters:
{Node} node An XML DOM node to parse
Returns:
{Float} The value of the node as a float
static getInteger (node) : Integer
This method parses the value of an XML DOM node to integer.
Parameters:
{Node} node An XML DOM node to parse
Returns:
{Integer} The node value as an integer
static getNodeAttribute (node, attributeName) : String
This method parses the attribute attributeName from an XML DOM node and returns it as a string.
Parameters:
{Node} node An XML DOM node
{String} attributeName name of the attribute
Returns:
{String} A string containing the nod id
static getNodeId (node) : String
This method parses the attribute id from an XML DOM node and returns it as a string.
Parameters:
{Node} node An XML DOM node
Returns:
{String} A string containing the nod id
static getString (node) : String
This method parses the value of a DOM node into string.
Parameters:
{Node} node A DOM node to parse
Returns:
{String} The value of the DOM node as a stripped string value
static parseCoord (coordStr) : nokia.maps.geo.Coordinate
This method parses a object containing geographical coordinates from a string. If the input does not contain valid coordinates, the return value is undefined.
Parameters:
{String} coordStr A string containing the values of geographical coordinate as specified in KML specification, for example: "13,53.5,0" or "13,53.5"
Returns:
{nokia.maps.geo.Coordinate} An object containing an object containing geographical coordinates (the properties are "lat", "lng", and "alt"
static parseCoords (coordsString) : nokia.maps.geo.Coordinate[]
This method parses a string containing coordinates to an array of objects, each containing the properties "lat", "lng" and "alt". The return value contains only valid coordinates.
Parameters:
{String} coordsString A string containing a list of coordinates as specified in KML specification, for example: "13,53.5,0 14,53,0 13,52.5,0 14,52.5,0"
Returns:
{nokia.maps.geo.Coordinate[]} A list of objects containing parsed geographical coordinates
static parseFromString (node) : Document
This method parses an XML string into browser-indepdendent XML Document object.
Parameters:
{String} node An XML string to parse
Returns:
{Document} An XML DOM document
Documentation generated on Thu Dec 15 2011 15:14:31 GMT+0100 (CET).