/src/com/google/maps/extras/xmlparsers/kml/Document.as
ActionScript | 55 lines | 30 code | 7 blank | 18 comment | 3 complexity | 03563cf69368c97a9883e80c2cdad0ff MD5 | raw file
- /*
- * Copyright 2008 Google Inc.
- * Licensed under the Apache License, Version 2.0:
- * http://www.apache.org/licenses/LICENSE-2.0
- */
- // todo: Support Schema, StyleSelector elements
- package com.google.maps.extras.xmlparsers.kml
- {
- import com.google.maps.extras.xmlparsers.ParsingTools;
-
- /**
- * Class that represents a <Document> element within a KML file.
- *
- * @see http://code.google.com/apis/kml/documentation/kmlreference.html#document
- */
- public class Document extends Container
- {
-
- /**
- * Constructor for class.
- *
- * @param x
- */
-
- private var _styleMap:StyleMap;
- private var _styles:Array;
-
- public function Document(x:XMLList)
- {
- super(x);
-
- this._styles = new Array();
- var i:XML;
- for each (i in this.x.kml::Style) {
- this._styles.push(new com.google.maps.extras.xmlparsers.kml.Style(XMLList(i)));
- }
- if (ParsingTools.nullCheck(this.x.kml::StyleMap) != null) {
- this._styleMap = new com.google.maps.extras.xmlparsers.kml.StyleMap(this.x.kml::StyleMap);
- }
- }
-
- ///(cmR)
- public function get styles():Array{
- return this._styles;
- }
-
- public function get styleMap():StyleMap{
- return this._styleMap;
- }
- ///////////
- public override function toString():String {
- return "Document: " + super.toString();
- }
- }
- }