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.
2425 2426 2427 2428 2429 2430 2431 2432 |
# File 'lib/kamelopard/classes.rb', line 2425 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
2423 2424 2425 |
# File 'lib/kamelopard/classes.rb', line 2423 def altitudeMode @altitudeMode end |
#extrude ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems
2423 2424 2425 |
# File 'lib/kamelopard/classes.rb', line 2423 def extrude @extrude end |
#inner ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems
2423 2424 2425 |
# File 'lib/kamelopard/classes.rb', line 2423 def inner @inner end |
#outer ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems
2423 2424 2425 |
# File 'lib/kamelopard/classes.rb', line 2423 def outer @outer end |
Instance Method Details
#<<(a) ⇒ Object
2442 2443 2444 |
# File 'lib/kamelopard/classes.rb', line 2442 def <<(a) @inner << a end |
#to_kml(elem = nil) ⇒ Object
2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 |
# File 'lib/kamelopard/classes.rb', line 2446 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 |