Class: Kamelopard::Model
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to the KML Model class
Instance Attribute Summary collapse
-
#link ⇒ Object
Returns the value of attribute link.
-
#location ⇒ Object
Returns the value of attribute location.
-
#orientation ⇒ Object
Returns the value of attribute orientation.
-
#resourceMap ⇒ Object
Returns the value of attribute resourceMap.
-
#scale ⇒ Object
Returns the value of attribute scale.
Attributes inherited from Object
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Model
constructor
location should be a Point, or some object that can behave like one, including a Placemark.
- #to_kml(elem = nil) ⇒ Object
Methods inherited from Object
Constructor Details
#initialize(options = {}) ⇒ Model
location should be a Point, or some object that can behave like one, including a Placemark. Model will get its Location and altitudeMode data from this attribute
1896 1897 1898 1899 |
# File 'lib/kamelopard/classes.rb', line 1896 def initialize( = {}) #link, location, orientation, scale, resourceMap) super end |
Instance Attribute Details
#link ⇒ Object
Returns the value of attribute link.
1891 1892 1893 |
# File 'lib/kamelopard/classes.rb', line 1891 def link @link end |
#location ⇒ Object
Returns the value of attribute location.
1891 1892 1893 |
# File 'lib/kamelopard/classes.rb', line 1891 def location @location end |
#orientation ⇒ Object
Returns the value of attribute orientation.
1891 1892 1893 |
# File 'lib/kamelopard/classes.rb', line 1891 def orientation @orientation end |
#resourceMap ⇒ Object
Returns the value of attribute resourceMap.
1891 1892 1893 |
# File 'lib/kamelopard/classes.rb', line 1891 def resourceMap @resourceMap end |
#scale ⇒ Object
Returns the value of attribute scale.
1891 1892 1893 |
# File 'lib/kamelopard/classes.rb', line 1891 def scale @scale end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 |
# File 'lib/kamelopard/classes.rb', line 1901 def to_kml(elem = nil) x = XML::Node.new 'Model' super x loc = XML::Node.new 'Location' { :longitude => @location.longitude, :latitude => @location.latitude, :altitude => @location.altitude, }.each do |k, v| d = XML::Node.new k.to_s d << v.to_s loc << d end x << loc Kamelopard.add_altitudeMode(@location.altitudeMode, x) @link.to_kml x @orientation.to_kml x @scale.to_kml x @resourceMap.to_kml x elem << x unless elem.nil? x end |