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

http://gmaps-utility-library-flash.googlecode.com/ · ActionScript · 73 lines · 40 code · 8 blank · 25 comment · 0 complexity · 8b8568ccfa3de867b3127de43128296a 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. package com.google.maps.extras.xmlparsers.kml
  7. {
  8. import com.google.maps.extras.xmlparsers.Namespaces;
  9. import com.google.maps.extras.xmlparsers.ParsingTools;
  10. import com.google.maps.extras.xmlparsers.XmlElement;
  11. /**
  12. * Base class for LatLonBox and LatLonAltBox (not implemented).
  13. */
  14. public class AbstractLatLonBox extends KmlObject
  15. {
  16. private var _north:Number;
  17. private var _south:Number;
  18. private var _east:Number;
  19. private var _west:Number;
  20. /**
  21. * Constructor for class.
  22. *
  23. * @param x
  24. */
  25. public function AbstractLatLonBox(x:XMLList)
  26. {
  27. super(x);
  28. this._north = ParsingTools.nanCheck(this.x.kml::north);
  29. this._south = ParsingTools.nanCheck(this.x.kml::south);
  30. this._east = ParsingTools.nanCheck(this.x.kml::east);
  31. this._west = ParsingTools.nanCheck(this.x.kml::west);
  32. }
  33. /**
  34. * Represents the <north> child element.
  35. */
  36. public function get north():Number
  37. {
  38. return this._north;
  39. }
  40. /**
  41. * Represents the <south> child element.
  42. */
  43. public function get south():Number
  44. {
  45. return this._south;
  46. }
  47. /**
  48. * Represents the <east> child element.
  49. */
  50. public function get east():Number
  51. {
  52. return this._east;
  53. }
  54. /**
  55. * Represents the <west> child element.
  56. */
  57. public function get west():Number
  58. {
  59. return this._west;
  60. }
  61. public override function toString():String {
  62. return "AbstractLatLonBox: " + " north: " + this._north + "south: " + this._south + "east: " + this._east + " west: " + this._west;
  63. }
  64. }
  65. }