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
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
Constructor Details
#initialize(coordinates = [], options = {}) ⇒ LinearRing
Returns a new instance of LinearRing.
325 326 327 328 329 330 331 332 333 |
# File 'lib/kamelopard/classes.rb', line 325 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.
322 323 324 |
# File 'lib/kamelopard/classes.rb', line 322 def altitudeMode @altitudeMode end |
#altitudeOffset ⇒ Object
Returns the value of attribute altitudeOffset.
322 323 324 |
# File 'lib/kamelopard/classes.rb', line 322 def altitudeOffset @altitudeOffset end |
#extrude ⇒ Object
Returns the value of attribute extrude.
322 323 324 |
# File 'lib/kamelopard/classes.rb', line 322 def extrude @extrude end |
#tessellate ⇒ Object
Returns the value of attribute tessellate.
322 323 324 |
# File 'lib/kamelopard/classes.rb', line 322 def tessellate @tessellate end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
335 336 337 338 339 340 341 342 343 344 345 346 347 |
# File 'lib/kamelopard/classes.rb', line 335 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 |