/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
- /*
- * Copyright 2008 Google Inc.
- * Licensed under the Apache License, Version 2.0:
- * http://www.apache.org/licenses/LICENSE-2.0
- */
- package com.google.maps.extras.xmlparsers.kml
- {
- import com.google.maps.extras.xmlparsers.Namespaces;
- import com.google.maps.extras.xmlparsers.ParsingTools;
- import com.google.maps.extras.xmlparsers.XmlElement;
-
- /**
- * Class that represents a <LineString> element.
- *
- * @see http://code.google.com/apis/kml/documentation/kmlreference.html#linestring
- */
- public class LineString extends Geometry
- {
- //todo: add constants for the enum values?
-
- // Can contain: <extrude>, <tessellate>, <altitudeMode>, <coordinates>
- // We support coordinates only
- private var _coordinates:Coordinates;
-
- /**
- * Constructor for class.
- *
- * @param x
- */
- public function LineString(x:XMLList)
- {
- super(x);
- if (ParsingTools.nullCheck(this.x.kml::coordinates) != null) {
- this._coordinates = new Coordinates(ParsingTools.nullCheck(this.x.kml::coordinates));
- }
- }
-
- /**
- * Represents the <coordinates> child element.
- */
- public function get coordinates():Coordinates
- {
- return this._coordinates;
- }
-
- public override function toString():String {
- return "LineString: " + super.toString() + " coordinates " + this._coordinates;
- }
- }
- }