PageRenderTime 15ms CodeModel.GetById 0ms RepoModel.GetById 1ms app.codeStats 0ms

/src/com/google/maps/extras/xmlparsers/kml/Document.as

http://gmaps-utility-library-flash.googlecode.com/
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
  7. package com.google.maps.extras.xmlparsers.kml
  8. {
  9. import com.google.maps.extras.xmlparsers.ParsingTools;
  10. /**
  11. * Class that represents a <Document> element within a KML file.
  12. *
  13. * @see http://code.google.com/apis/kml/documentation/kmlreference.html#document
  14. */
  15. public class Document extends Container
  16. {
  17. /**
  18. * Constructor for class.
  19. *
  20. * @param x
  21. */
  22. private var _styleMap:StyleMap;
  23. private var _styles:Array;
  24. public function Document(x:XMLList)
  25. {
  26. super(x);
  27. this._styles = new Array();
  28. var i:XML;
  29. for each (i in this.x.kml::Style) {
  30. this._styles.push(new com.google.maps.extras.xmlparsers.kml.Style(XMLList(i)));
  31. }
  32. if (ParsingTools.nullCheck(this.x.kml::StyleMap) != null) {
  33. this._styleMap = new com.google.maps.extras.xmlparsers.kml.StyleMap(this.x.kml::StyleMap);
  34. }
  35. }
  36. ///(cmR)
  37. public function get styles():Array{
  38. return this._styles;
  39. }
  40. public function get styleMap():StyleMap{
  41. return this._styleMap;
  42. }
  43. ///////////
  44. public override function toString():String {
  45. return "Document: " + super.toString();
  46. }
  47. }
  48. }