Class: Kamelopard::Polygon
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to the KML Polygon class
Instance Attribute Summary collapse
-
#altitudeMode ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems.
-
#extrude ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems.
-
#inner ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems.
-
#outer ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems.
Attributes inherited from Object
#comment, #kml_id, #master_only
Instance Method Summary collapse
- #<<(a) ⇒ Object
-
#initialize(outer, options = {}) ⇒ Polygon
constructor
A new instance of Polygon.
- #to_kml(elem = nil) ⇒ Object
Methods inherited from Object
#_alternate_to_kml, #change, #master_only?, parse
Constructor Details
#initialize(outer, options = {}) ⇒ Polygon
Returns a new instance of Polygon.
2487 2488 2489 2490 2491 2492 2493 2494 |
# File 'lib/kamelopard/classes.rb', line 2487 def initialize(outer, = {}) #extrude = 0, altitudeMode = :clampToGround) @extrude = 0 @altitudeMode = :clampToGround @inner = [] @outer = outer super end |
Instance Attribute Details
#altitudeMode ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems
2485 2486 2487 |
# File 'lib/kamelopard/classes.rb', line 2485 def altitudeMode @altitudeMode end |
#extrude ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems
2485 2486 2487 |
# File 'lib/kamelopard/classes.rb', line 2485 def extrude @extrude end |
#inner ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems
2485 2486 2487 |
# File 'lib/kamelopard/classes.rb', line 2485 def inner @inner end |
#outer ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems
2485 2486 2487 |
# File 'lib/kamelopard/classes.rb', line 2485 def outer @outer end |
Instance Method Details
#<<(a) ⇒ Object
2504 2505 2506 |
# File 'lib/kamelopard/classes.rb', line 2504 def <<(a) @inner << a end |
#to_kml(elem = nil) ⇒ Object
2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 |
# File 'lib/kamelopard/classes.rb', line 2508 def to_kml(elem = nil) k = XML::Node.new 'Polygon' super k e = XML::Node.new 'extrude' e << @extrude.to_s k << e Kamelopard.add_altitudeMode @altitudeMode, k e = XML::Node.new('outerBoundaryIs') e << @outer.to_kml k << e @inner.each do |i| e = XML::Node.new('innerBoundaryIs') e << i.to_kml k << e end elem << k unless elem.nil? k end |