Class: LineString
Overview
Corresponds to the KML LineString object
Instance Attribute Summary (collapse)
-
- (Object) altitude
Returns the value of attribute altitude.
-
- (Object) altitudeMode
Returns the value of attribute altitudeMode.
-
- (Object) altitudeOffset
Returns the value of attribute altitudeOffset.
-
- (Object) coordinates
readonly
Returns the value of attribute coordinates.
-
- (Object) drawOrder
Returns the value of attribute drawOrder.
-
- (Object) extrude
Returns the value of attribute extrude.
-
- (Object) latitude
Returns the value of attribute latitude.
-
- (Object) longitude
Returns the value of attribute longitude.
-
- (Object) tessellate
Returns the value of attribute tessellate.
Attributes inherited from KMLObject
Instance Method Summary (collapse)
-
- (Object) <<(a)
Appends an element to this LineString's CoordinateList.
-
- (LineString) initialize(coords, altMode = :clampToGround)
constructor
A new instance of LineString.
-
- (Object) set_coords(a)
Sets @coordinates element.
- - (Object) to_kml(indent = 0)
Constructor Details
- (LineString) initialize(coords, altMode = :clampToGround)
A new instance of LineString
234 235 236 237 238 |
# File 'lib/kamelopard/classes.rb', line 234 def initialize(coords, altMode = :clampToGround) super() @altitudeMode = altMode set_coords coords end |
Instance Attribute Details
- (Object) altitude
Returns the value of attribute altitude
231 232 233 |
# File 'lib/kamelopard/classes.rb', line 231 def altitude @altitude end |
- (Object) altitudeMode
Returns the value of attribute altitudeMode
231 232 233 |
# File 'lib/kamelopard/classes.rb', line 231 def altitudeMode @altitudeMode end |
- (Object) altitudeOffset
Returns the value of attribute altitudeOffset
231 232 233 |
# File 'lib/kamelopard/classes.rb', line 231 def altitudeOffset @altitudeOffset end |
- (Object) coordinates (readonly)
Returns the value of attribute coordinates
232 233 234 |
# File 'lib/kamelopard/classes.rb', line 232 def coordinates @coordinates end |
- (Object) drawOrder
Returns the value of attribute drawOrder
231 232 233 |
# File 'lib/kamelopard/classes.rb', line 231 def drawOrder @drawOrder end |
- (Object) extrude
Returns the value of attribute extrude
231 232 233 |
# File 'lib/kamelopard/classes.rb', line 231 def extrude @extrude end |
- (Object) latitude
Returns the value of attribute latitude
231 232 233 |
# File 'lib/kamelopard/classes.rb', line 231 def latitude @latitude end |
- (Object) longitude
Returns the value of attribute longitude
231 232 233 |
# File 'lib/kamelopard/classes.rb', line 231 def longitude @longitude end |
- (Object) tessellate
Returns the value of attribute tessellate
231 232 233 |
# File 'lib/kamelopard/classes.rb', line 231 def tessellate @tessellate end |
Instance Method Details
- (Object) <<(a)
Appends an element to this LineString's CoordinateList. See CoordinateList#add_element
250 251 252 |
# File 'lib/kamelopard/classes.rb', line 250 def <<(a) @coordinates << a end |
- (Object) set_coords(a)
Sets @coordinates element
241 242 243 244 245 246 247 |
# File 'lib/kamelopard/classes.rb', line 241 def set_coords(a) if a.kind_of? CoordinateList then @coordinates = a else @coordinates = CoordinateList.new(a) end end |
- (Object) to_kml(indent = 0)
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
# File 'lib/kamelopard/classes.rb', line 254 def to_kml(indent = 0) k = "#{ ' ' * indent }<LineString id =\"#{ @id }\">\n" k << kml_array([ [@altitudeOffset, 'gx:altitudeOffset', true], [@extrude, 'extrude', true], [@tessellate, 'tessellate', true], [@drawOrder, 'gx:drawOrder', true] ], indent + 4) k << @coordinates.to_kml(indent + 4) unless @coordinates.nil? if @altitudeMode == :clampToGround or @altitudeMode == :absolute then k << "#{ ' ' * indent } <altitudeMode>#{ @altitudeMode }</altitudeMode>\n" else k << "#{ ' ' * indent } <gx:altitudeMode>#{ @altitudeMode }</gx:altitudeMode>\n" end k << "#{ ' ' * indent }</LineString>\n" k end |