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