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
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
Constructor Details
#initialize(outer, options = {}) ⇒ Polygon
Returns a new instance of Polygon.
1930 1931 1932 1933 1934 1935 1936 |
# File 'lib/kamelopard/classes.rb', line 1930 def initialize(outer, = {}) #extrude = 0, altitudeMode = :clampToGround) @extrude = 0 @altitudeMode = :clampToGround @inner = [] super end |
Instance Attribute Details
#altitudeMode ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems
1928 1929 1930 |
# File 'lib/kamelopard/classes.rb', line 1928 def altitudeMode @altitudeMode end |
#extrude ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems
1928 1929 1930 |
# File 'lib/kamelopard/classes.rb', line 1928 def extrude @extrude end |
#inner ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems
1928 1929 1930 |
# File 'lib/kamelopard/classes.rb', line 1928 def inner @inner end |
#outer ⇒ Object
NB! No support for tessellate, because Google Earth doesn’t support it, it seems
1928 1929 1930 |
# File 'lib/kamelopard/classes.rb', line 1928 def outer @outer end |
Instance Method Details
#<<(a) ⇒ Object
1946 1947 1948 |
# File 'lib/kamelopard/classes.rb', line 1946 def <<(a) @inner << a end |
#to_kml(elem = nil) ⇒ Object
1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 |
# File 'lib/kamelopard/classes.rb', line 1950 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 |