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?
Constructor Details
#initialize(icon, options = {}) ⇒ GroundOverlay
Returns a new instance of GroundOverlay.
2023 2024 2025 2026 2027 2028 |
# File 'lib/kamelopard/classes.rb', line 2023 def initialize(icon, = {}) @altitude = 0 @altitudeMode = :clampToGround @href = icon super end |
Instance Attribute Details
#altitude ⇒ Object
Returns the value of attribute altitude.
2022 2023 2024 |
# File 'lib/kamelopard/classes.rb', line 2022 def altitude @altitude end |
#altitudeMode ⇒ Object
Returns the value of attribute altitudeMode.
2022 2023 2024 |
# File 'lib/kamelopard/classes.rb', line 2022 def altitudeMode @altitudeMode end |
#latlonbox ⇒ Object
Returns the value of attribute latlonbox.
2022 2023 2024 |
# File 'lib/kamelopard/classes.rb', line 2022 def latlonbox @latlonbox end |
#latlonquad ⇒ Object
Returns the value of attribute latlonquad.
2022 2023 2024 |
# File 'lib/kamelopard/classes.rb', line 2022 def latlonquad @latlonquad end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 |
# File 'lib/kamelopard/classes.rb', line 2030 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 |