/src/com/google/maps/extras/xmlparsers/kml/Document.as
ActionScript | 55 lines | 30 code | 7 blank | 18 comment | 3 complexity | 03563cf69368c97a9883e80c2cdad0ff MD5 | raw file
1/* 2* Copyright 2008 Google Inc. 3* Licensed under the Apache License, Version 2.0: 4* http://www.apache.org/licenses/LICENSE-2.0 5*/ 6// todo: Support Schema, StyleSelector elements 7package com.google.maps.extras.xmlparsers.kml 8{ 9 import com.google.maps.extras.xmlparsers.ParsingTools; 10 11 /** 12 * Class that represents a <Document> element within a KML file. 13 * 14 * @see http://code.google.com/apis/kml/documentation/kmlreference.html#document 15 */ 16 public class Document extends Container 17 { 18 19 /** 20 * Constructor for class. 21 * 22 * @param x 23 */ 24 25 private var _styleMap:StyleMap; 26 private var _styles:Array; 27 28 public function Document(x:XMLList) 29 { 30 super(x); 31 32 this._styles = new Array(); 33 var i:XML; 34 for each (i in this.x.kml::Style) { 35 this._styles.push(new com.google.maps.extras.xmlparsers.kml.Style(XMLList(i))); 36 } 37 if (ParsingTools.nullCheck(this.x.kml::StyleMap) != null) { 38 this._styleMap = new com.google.maps.extras.xmlparsers.kml.StyleMap(this.x.kml::StyleMap); 39 } 40 } 41 42 ///(cmR) 43 public function get styles():Array{ 44 return this._styles; 45 } 46 47 public function get styleMap():StyleMap{ 48 return this._styleMap; 49 } 50 /////////// 51 public override function toString():String { 52 return "Document: " + super.toString(); 53 } 54 } 55}