Class: Overlay

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

Overview

Abstract class corresponding to the KML Overlay object

Direct Known Subclasses

GroundOverlay, PhotoOverlay, ScreenOverlay

Instance Attribute Summary collapse

Attributes inherited from Feature

#abstractView, #addressDetails, #atom_author, #atom_link, #description, #extendedData, #metadata, #name, #open, #phoneNumber, #region, #snippet, #styleSelector, #styleUrl, #styles, #timeprimitive, #visibility

Attributes inherited from KMLObject

#comment, #id

Instance Method Summary collapse

Methods inherited from Feature

#styles_to_kml, #timespan, #timespan=, #timestamp, #timestamp=

Constructor Details

#initialize(icon, name = nil) ⇒ Overlay

Returns a new instance of Overlay.



1293
1294
1295
1296
1297
1298
1299
1300
1301
# File 'lib/kamelopard/classes.rb', line 1293

def initialize(icon, name = nil)
    super(name)
    if icon.respond_to?('to_kml') then
        @icon = icon
    elsif not icon.nil?
        @icon = Icon.new(icon.to_s)
    end
    Document.instance.folder << self
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



1291
1292
1293
# File 'lib/kamelopard/classes.rb', line 1291

def color
  @color
end

#drawOrderObject

Returns the value of attribute drawOrder.



1291
1292
1293
# File 'lib/kamelopard/classes.rb', line 1291

def drawOrder
  @drawOrder
end

#iconObject

Returns the value of attribute icon.



1291
1292
1293
# File 'lib/kamelopard/classes.rb', line 1291

def icon
  @icon
end

Instance Method Details

#to_kml(indent = 0) ⇒ Object



1303
1304
1305
1306
1307
1308
1309
1310
# File 'lib/kamelopard/classes.rb', line 1303

def to_kml(indent = 0)
    k = super(indent) + kml_array([
        [ @color, 'color', true ],
        [ @drawOrder, 'drawOrder', true ],
    ], indent + 4)
    k << @icon.to_kml(indent) unless @icon.nil?
    k
end