Class Index | File Index

Classes


Class khtml.maplib.parser.Kml


Defined in: Kml.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
class understands KML and manages the layers related to the KML passed is like a layer in the view of the map but manages multiple layers of different types can be added to map as overlay
Method Summary
Method Attributes Method Name and Description
 
Creates a Vector Feature.
 
Generate a marker for the feature of a placemark.
<inner>  
hex2rgba(hex)
 
This url is used for the imagemarker in placemarks.
 
This path is prepended to groundoverlay image url's.
 
parse(force)
Parse KML!
 
Expects a DOMElement and extracts all "coordinates" tags Returns a two dimensional array of points or an array where array[0][0] is set to null
 
Parse a "Document" tag.
 
Parse "Folder" tags in the first level of the supplied node.
 
Parse a "GroundOverlay" tag.
 
parseIcon(node)
Parse an "Icon" tag.
 
Parse a "LineString" tag.
 
parseNode(node)
Parse a single node.
 
Parse a "Placemark" tag.
 
parsePoint(node)
Input should look like this: 9.205455021203617,47.46315014149831,0
 
Parse a "Polygon" tag.
 
parseStyle(node)
Parse a "Style" tag.
 
setDom(xml)
Parse XML.
Class Detail
khtml.maplib.parser.Kml(KML)
class understands KML and manages the layers related to the KML passed is like a layer in the view of the map but manages multiple layers of different types can be added to map as overlay
Parameters:
KML
See:
Example: kml from google tutorial
Method Detail
{khtml.maplib.overlay.Feature} generateFeature(data)
Creates a Vector Feature.
{tite:"MyTitle", desription: "MyDescription", point: new khtml.maplib.LatLng()} 
	  instead of attribute line (type: {khtml.maplib.geometry.LineString})
Parameters:
{Object} data
Returns:
{khtml.maplib.overlay.Feature}

getMarkerForFeature(data)
Generate a marker for the feature of a placemark. To switch the image, use
this.imageMarkerUrl('http://new url')
Hint: if you wan't to generate different markers, overwrite this method in your code.
var parser = khtml.maplib.parser.Kml();
parser.getMarkerForFeature = function(data) { return new ... }
Parameters:
{String} data
feature data

<inner> hex2rgba(hex)
Parameters:
hex

imageMarkerUrl(p)
This url is used for the imagemarker in placemarks.
Parameters:
{String} p
url

imgBasePath(p)
This path is prepended to groundoverlay image url's.
Parameters:
{String} p
base path

{khtml.maplib.overlay.Layer} parse(force)
Parse KML!
Parameters:
{boolean} force
parse dom again - even if it has been parsed before.
Returns:
{khtml.maplib.overlay.Layer}

parseCoordinates(node)
Expects a DOMElement and extracts all "coordinates" tags Returns a two dimensional array of points or an array where array[0][0] is set to null
Parameters:
{DOMElement} node
Returns:
Array
See:
http://code.google.com/intl/de/apis/kml/documentation/kmlreference.html#coordinates

parseDocument(node)
Parse a "Document" tag.
A Document is a container for features and styles.
This element is required if your KML file uses shared styles. 
Do not put shared styles within a Folder.
Parameters:
{DOMElement} node
See:
http://code.google.com/intl/de/apis/kml/documentation/kmlreference.html#document

parseFolder(node)
Parse "Folder" tags in the first level of the supplied node. This function dosen't support to parse all tags because folder structure is allways hierarchical.
A Folder is used to arrange other Features hierarchically (Folders, Placemarks, NetworkLinks, or Overlays).
A Feature is visible only if it and all its ancestors are visible.
Parameters:
{DOMElement} node
See:
http://code.google.com/intl/de/apis/kml/documentation/kmlreference.html#folder

parseGroundOverlay(node)
Parse a "GroundOverlay" tag.
	 
	
	   GroundOverlay.kml
	   7fffffff
	   1
	   
	      http://www.google.com/intl/en/images/logo.gif
	      onInterval
	      86400
	      0.75
	   
	   
	      37.83234
	      37.832122
	      -122.373033
	      -122.373724
	      45
	   
	
	
Note: rotation is in degree (+-180) around object center.
Parameters:
{DOMElement} node
XML Node of type "GroundOverlay"
Returns:
false if node is not a groundoverlay. Otherwise a new {khtml.maplib.overlay.Image} layer.
See:
http://code.google.com/intl/de/apis/kml/documentation/kmlreference.html#groundoverlay

parseIcon(node)
Parse an "Icon" tag. Parse tags: href,gx:x,gx:y,gx:w,gx:h. Ignore tags: refreshMode, refreshInterval, viewRefreshMode, viewRefreshTime, viewBoundScale, viewFormat, httpQuery.
Parameters:
{DOMElement} node
See:
http://code.google.com/intl/de/apis/kml/documentation/kmlreference.html#icon

{khtml.maplib.geometry.LineString} parseLineString(node)
Parse a "LineString" tag.
Parameters:
{DOMElement} node
Returns:
{khtml.maplib.geometry.LineString}
See:
http://code.google.com/intl/de/apis/kml/documentation/kmlreference.html#linestring

{khtml.maplib.overlays.Layer} parseNode(node)
Parse a single node. Entry point for parsing.
Parameters:
{DOMElement} node
Returns:
{khtml.maplib.overlays.Layer} or null

parsePlacemark(node)
Parse a "Placemark" tag.
Parameters:
{DOMElement} node

parsePoint(node)
Input should look like this: 9.205455021203617,47.46315014149831,0
Parameters:
node
See:
http://code.google.com/intl/de/apis/kml/documentation/kmlreference.html#coordinates

{khtml.maplib.geometry.Polygon} parsePolygon(node)
Parse a "Polygon" tag.
Parameters:
{DOMElement} node
Returns:
{khtml.maplib.geometry.Polygon}
See:
http://code.google.com/intl/de/apis/kml/documentation/kmlreference.html#polygon

parseStyle(node)
Parse a "Style" tag.
Parameters:
{DOMElement} node
XML Node
See:
http://code.google.com/intl/de/apis/kml/documentation/kmlreference.html#style

setDom(xml)
Parse XML.
Parameters:
{String} xml
xml as string or as parsed object

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Oct 09 2011 20:46:56 GMT+0200 (MESZ)