Class: Kamelopard::LinearRing
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to KML’s LinearRing object
Instance Attribute Summary collapse
-
#altitudeMode ⇒ Object
Returns the value of attribute altitudeMode.
-
#altitudeOffset ⇒ Object
Returns the value of attribute altitudeOffset.
-
#coordinates ⇒ Object
Returns the value of attribute coordinates.
-
#extrude ⇒ Object
Returns the value of attribute extrude.
-
#tessellate ⇒ Object
Returns the value of attribute tessellate.
Attributes inherited from Object
Instance Method Summary collapse
-
#<<(a) ⇒ Object
Appends an element to this LinearRing’s CoordinateList.
-
#initialize(coordinates = nil, tessellate = 0, extrude = 0, altitudeMode = :clampToGround, altitudeOffset = nil) ⇒ LinearRing
constructor
A new instance of LinearRing.
-
#set_coords(a) ⇒ Object
Sets @coordinates element.
- #to_kml(elem = nil) ⇒ Object
Constructor Details
#initialize(coordinates = nil, tessellate = 0, extrude = 0, altitudeMode = :clampToGround, altitudeOffset = nil) ⇒ LinearRing
Returns a new instance of LinearRing.
298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/kamelopard/classes.rb', line 298 def initialize(coordinates = nil, tessellate = 0, extrude = 0, altitudeMode = :clampToGround, altitudeOffset = nil) super() if coordinates.nil? then @coordinates = nil elsif coordinates.kind_of? CoordinateList then @coordinates = coordinates else @coordinates = CoordinateList.new(coordinates) end @tessellate = tessellate @extrude = extrude @altitudeMode = altitudeMode @altitudeOffset = altitudeOffset end |
Instance Attribute Details
#altitudeMode ⇒ Object
Returns the value of attribute altitudeMode.
296 297 298 |
# File 'lib/kamelopard/classes.rb', line 296 def altitudeMode @altitudeMode end |
#altitudeOffset ⇒ Object
Returns the value of attribute altitudeOffset.
296 297 298 |
# File 'lib/kamelopard/classes.rb', line 296 def altitudeOffset @altitudeOffset end |
#coordinates ⇒ Object
Returns the value of attribute coordinates.
296 297 298 |
# File 'lib/kamelopard/classes.rb', line 296 def coordinates @coordinates end |
#extrude ⇒ Object
Returns the value of attribute extrude.
296 297 298 |
# File 'lib/kamelopard/classes.rb', line 296 def extrude @extrude end |
#tessellate ⇒ Object
Returns the value of attribute tessellate.
296 297 298 |
# File 'lib/kamelopard/classes.rb', line 296 def tessellate @tessellate end |
Instance Method Details
#<<(a) ⇒ Object
Appends an element to this LinearRing’s CoordinateList. See CoordinateList#add_element
323 324 325 |
# File 'lib/kamelopard/classes.rb', line 323 def <<(a) @coordinates << a end |
#set_coords(a) ⇒ Object
Sets @coordinates element
314 315 316 317 318 319 320 |
# File 'lib/kamelopard/classes.rb', line 314 def set_coords(a) if a.kind_of? CoordinateList then @coordinates = a else @coordinates = CoordinateList.new(a) end end |
#to_kml(elem = nil) ⇒ Object
327 328 329 330 331 332 333 334 335 336 337 338 339 |
# File 'lib/kamelopard/classes.rb', line 327 def to_kml(elem = nil) k = REXML::Element.new 'LinearRing' super(k) Kamelopard.kml_array(k, [ [ @altitudeOffset, 'gx:altitudeOffset' ], [ @tessellate, 'tessellate' ], [ @extrude, 'extrude' ] ]) Kamelopard.add_altitudeMode(@altitudeMode, k) @coordinates.to_kml(k) elem.elements << k unless elem.nil? k end |