Class: Kamelopard::LinearRing
- Includes:
- CoordinateList
- 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.
-
#extrude ⇒ Object
Returns the value of attribute extrude.
-
#tessellate ⇒ Object
Returns the value of attribute tessellate.
Attributes included from CoordinateList
Attributes inherited from Object
#comment, #kml_id, #master_only
Instance Method Summary collapse
-
#initialize(coordinates = [], options = {}) ⇒ LinearRing
constructor
A new instance of LinearRing.
- #to_kml(elem = nil) ⇒ Object
Methods included from CoordinateList
#<<, #add_element, #coordinates_to_kml
Methods inherited from Object
#_alternate_to_kml, #change, #master_only?
Constructor Details
#initialize(coordinates = [], options = {}) ⇒ LinearRing
Returns a new instance of LinearRing.
444 445 446 447 448 449 450 451 452 |
# File 'lib/kamelopard/classes.rb', line 444 def initialize(coordinates = [], = {}) @tessellate = 0 @extrude = 0 @altitudeMode = :clampToGround @coordinates = [] super self.coordinates=(coordinates) unless coordinates.nil? end |
Instance Attribute Details
#altitudeMode ⇒ Object
Returns the value of attribute altitudeMode.
441 442 443 |
# File 'lib/kamelopard/classes.rb', line 441 def altitudeMode @altitudeMode end |
#altitudeOffset ⇒ Object
Returns the value of attribute altitudeOffset.
441 442 443 |
# File 'lib/kamelopard/classes.rb', line 441 def altitudeOffset @altitudeOffset end |
#extrude ⇒ Object
Returns the value of attribute extrude.
441 442 443 |
# File 'lib/kamelopard/classes.rb', line 441 def extrude @extrude end |
#tessellate ⇒ Object
Returns the value of attribute tessellate.
441 442 443 |
# File 'lib/kamelopard/classes.rb', line 441 def tessellate @tessellate end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
454 455 456 457 458 459 460 461 462 463 464 465 466 |
# File 'lib/kamelopard/classes.rb', line 454 def to_kml(elem = nil) k = XML::Node.new 'LinearRing' super(k) Kamelopard.kml_array(k, [ [ @altitudeOffset, 'gx:altitudeOffset' ], [ @tessellate, 'tessellate' ], [ @extrude, 'extrude' ] ]) Kamelopard.add_altitudeMode(@altitudeMode, k) coordinates_to_kml(k) unless @coordinates.nil? elem << k unless elem.nil? k end |