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

http://gmaps-utility-library-flash.googlecode.com/ · ActionScript · 50 lines · 24 code · 5 blank · 21 comment · 2 complexity · 40901c834548b728905879f5fa5b7939 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. * Class that represents a <LineString> element.
  13. *
  14. * @see http://code.google.com/apis/kml/documentation/kmlreference.html#linestring
  15. */
  16. public class LineString extends Geometry
  17. {
  18. //todo: add constants for the enum values?
  19. // Can contain: <extrude>, <tessellate>, <altitudeMode>, <coordinates>
  20. // We support coordinates only
  21. private var _coordinates:Coordinates;
  22. /**
  23. * Constructor for class.
  24. *
  25. * @param x
  26. */
  27. public function LineString(x:XMLList)
  28. {
  29. super(x);
  30. if (ParsingTools.nullCheck(this.x.kml::coordinates) != null) {
  31. this._coordinates = new Coordinates(ParsingTools.nullCheck(this.x.kml::coordinates));
  32. }
  33. }
  34. /**
  35. * Represents the &lt;coordinates&gt; child element.
  36. */
  37. public function get coordinates():Coordinates
  38. {
  39. return this._coordinates;
  40. }
  41. public override function toString():String {
  42. return "LineString: " + super.toString() + " coordinates " + this._coordinates;
  43. }
  44. }
  45. }