Class: Kamelopard::GroundOverlay

Inherits:
Overlay show all
Defined in:
lib/kamelopard/classes.rb

Overview

Corresponds to KML’s GroundOverlay object

Instance Attribute Summary collapse

Attributes inherited from Overlay

#color, #drawOrder

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

#maxLines, #snippet_text

Attributes inherited from Object

#comment, #kml_id, #master_only

Instance Method Summary collapse

Methods included from Icon

#icon_to_kml

Methods inherited from Feature

add_author, #extended_data_to_kml, #hide, #show, #styles_to_kml, #timespan, #timespan=, #timestamp, #timestamp=

Methods included from Snippet

#snippet_to_kml

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, options = {})
    @altitude = 0
    @altitudeMode = :clampToGround
    @href = icon
    super options
end

Instance Attribute Details

#altitudeObject

Returns the value of attribute altitude.



2241
2242
2243
# File 'lib/kamelopard/classes.rb', line 2241

def altitude
  @altitude
end

#altitudeModeObject

Returns the value of attribute altitudeMode.



2241
2242
2243
# File 'lib/kamelopard/classes.rb', line 2241

def altitudeMode
  @altitudeMode
end

#latlonboxObject

Returns the value of attribute latlonbox.



2241
2242
2243
# File 'lib/kamelopard/classes.rb', line 2241

def latlonbox
  @latlonbox
end

#latlonquadObject

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