Timemap.js v.2.0.1

Namespace TimeMap.util

Defined in:
timemap.js

Namespace for TimeMap utility functions.

Static Fields

Field
TimeMap.util.nsMap
Empty container for mapping XML namespaces to URLs

Static Methods

Method
TimeMap.util.formatDate(d, precision)
Format a date as an ISO 8601 string
TimeMap.util.getNodeList(n, tag, ns)
Cross-browser implementation of getElementsByTagNameNS.
TimeMap.util.getPlacemarkType(pm)
Identify the placemark type of a Mapstraction placemark
TimeMap.util.getTagValue(n, tag, ns)
Get XML tag value as a string
TimeMap.util.lookup(key, map)
Attempt look up a key in an object, returning either the value, undefined if the key is a string but not found, or the key if not a string
TimeMap.util.makePoint(coords, reversed)
Make TimeMap.init()-style points from a GLatLng, LatLonPoint, array, or string
TimeMap.util.makePoly(coords, reversed)
Make TimeMap.init()-style polyline/polygons from a whitespace-delimited string of coordinates (such as those in GeoRSS and KML).
TimeMap.util.TimelineVersion()
Determine the SIMILE Timeline version.
Namespace Detail
TimeMap.util
Static Field Details
TimeMap.util.nsMap
Empty container for mapping XML namespaces to URLs
 TimeMap.util.nsMap['georss'] = 'http://www.georss.org/georss';
 // find georss:point
 TimeMap.util.getNodeList(node, 'point', 'georss')
Static Method Details
TimeMap.util.formatDate(d, precision) :{String}
Format a date as an ISO 8601 string
Parameters (optional)
d {Date} Date to format
precision {Number} Precision indicator:
     3 (default): Show full date and time
     2: Show full date and time, omitting seconds
     1: Show date only
Returns:
{String} Formatted string
TimeMap.util.getNodeList(n, tag, ns) :{jQuery}
Cross-browser implementation of getElementsByTagNameNS. Note: Expects any applicable namespaces to be mapped in TimeMap.util.nsMap.
Parameters (optional)
n {jQuery|XML Node} jQuery object with context, or XML node
tag {String} Name of tag to look for
ns {String} XML namespace to look in
Returns:
{jQuery} jQuery object with the list of nodes found
TimeMap.util.getPlacemarkType(pm) :{String}
Identify the placemark type of a Mapstraction placemark
Parameters (optional)
pm {Object} Placemark to identify
Returns:
{String} Type of placemark, or false if none found
TimeMap.util.getTagValue(n, tag, ns) :{String}
Get XML tag value as a string
Parameters (optional)
n {jQuery} jQuery object with context
tag {String} Name of tag to look for
ns {String} XML namespace to look in
Returns:
{String} Tag value as string
TimeMap.util.lookup(key, map) :{Object}
Attempt look up a key in an object, returning either the value, undefined if the key is a string but not found, or the key if not a string
Parameters (optional)
key {String|Object} Key to look up
map {Object} Object in which to look
Returns:
{Object} Value, undefined, or key
TimeMap.util.makePoint(coords, reversed) :{Object}
Make TimeMap.init()-style points from a GLatLng, LatLonPoint, array, or string
Parameters (optional)
coords {Object} GLatLng, LatLonPoint, array, or string to convert
reversed {Boolean} Whether the points are KML-style lon/lat, rather than lat/lon
Returns:
{Object} TimeMap.init()-style point object
TimeMap.util.makePoly(coords, reversed) :{Object}
Make TimeMap.init()-style polyline/polygons from a whitespace-delimited string of coordinates (such as those in GeoRSS and KML).
Parameters (optional)
coords {Object} String to convert
reversed {Boolean} Whether the points are KML-style lon/lat, rather than lat/lon
Returns:
{Object} Formated coordinate array
TimeMap.util.TimelineVersion() :{String}
Determine the SIMILE Timeline version.
Returns:
{String} At the moment, only "1.2", "2.2.0", or what Timeline provides
©2010 Nick Rabinowitz
Documentation generated by JsDoc Toolkit 2.3.2 on Sat Aug 06 2011 13:40:08 GMT-0700 (PDT)