Class: Kamelopard::GroundOverlay
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to KML’s GroundOverlay object
Instance Attribute Summary collapse
-
#altitude ⇒ Object
Returns the value of attribute altitude.
-
#altitudeMode ⇒ Object
Returns the value of attribute altitudeMode.
-
#latlonbox ⇒ Object
Returns the value of attribute latlonbox.
-
#latlonquad ⇒ Object
Returns the value of attribute latlonquad.
Attributes inherited from Overlay
Attributes included from Icon
#h, #href, #httpQuery, #refreshInterval, #refreshMode, #viewBoundScale, #viewFormat, #viewRefreshMode, #viewRefreshTime, #w, #x, #y
Attributes inherited from Feature
#abstractView, #addressDetails, #atom_author, #atom_link, #description, #extendedData, #metadata, #name, #open, #phoneNumber, #region, #snippet, #styleSelector, #styleUrl, #styles, #timeprimitive, #visibility
Attributes included from Snippet
Attributes inherited from Object
#comment, #kml_id, #master_only
Instance Method Summary collapse
-
#initialize(icon, options = {}) ⇒ GroundOverlay
constructor
A new instance of GroundOverlay.
- #to_kml(elem = nil) ⇒ Object
Methods included from Icon
Methods inherited from Feature
add_author, #extended_data_to_kml, #hide, #show, #styles_to_kml, #timespan, #timespan=, #timestamp, #timestamp=
Methods included from Snippet
Methods inherited from Object
#_alternate_to_kml, #change, #master_only?, parse
Constructor Details
#initialize(icon, options = {}) ⇒ GroundOverlay
Returns a new instance of GroundOverlay.
2242 2243 2244 2245 2246 2247 |
# File 'lib/kamelopard/classes.rb', line 2242 def initialize(icon, = {}) @altitude = 0 @altitudeMode = :clampToGround @href = icon super end |
Instance Attribute Details
#altitude ⇒ Object
Returns the value of attribute altitude.
2241 2242 2243 |
# File 'lib/kamelopard/classes.rb', line 2241 def altitude @altitude end |
#altitudeMode ⇒ Object
Returns the value of attribute altitudeMode.
2241 2242 2243 |
# File 'lib/kamelopard/classes.rb', line 2241 def altitudeMode @altitudeMode end |
#latlonbox ⇒ Object
Returns the value of attribute latlonbox.
2241 2242 2243 |
# File 'lib/kamelopard/classes.rb', line 2241 def latlonbox @latlonbox end |
#latlonquad ⇒ Object
Returns the value of attribute latlonquad.
2241 2242 2243 |
# File 'lib/kamelopard/classes.rb', line 2241 def latlonquad @latlonquad end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 |
# File 'lib/kamelopard/classes.rb', line 2249 def to_kml(elem = nil) raise "Either latlonbox or latlonquad must be non-nil" if @latlonbox.nil? and @latlonquad.nil? k = XML::Node.new 'GroundOverlay' super k d = XML::Node.new 'altitude' d << @altitude.to_s k << d Kamelopard.add_altitudeMode(@altitudeMode, k) @latlonbox.to_kml(k) unless @latlonbox.nil? @latlonquad.to_kml(k) unless @latlonquad.nil? elem << k unless elem.nil? k end |