Class: Kamelopard::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 Object

#comment, #id

Instance Method Summary collapse

Methods inherited from Feature

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

Constructor Details

#initialize(icon, name = nil) ⇒ Overlay

Returns a new instance of Overlay.



1392
1393
1394
1395
1396
1397
1398
1399
1400
# File 'lib/kamelopard/classes.rb', line 1392

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

Instance Attribute Details

#colorObject

Returns the value of attribute color.



1390
1391
1392
# File 'lib/kamelopard/classes.rb', line 1390

def color
  @color
end

#drawOrderObject

Returns the value of attribute drawOrder.



1390
1391
1392
# File 'lib/kamelopard/classes.rb', line 1390

def drawOrder
  @drawOrder
end

#iconObject

Returns the value of attribute icon.



1390
1391
1392
# File 'lib/kamelopard/classes.rb', line 1390

def icon
  @icon
end

Instance Method Details

#to_kml(elem) ⇒ Object



1402
1403
1404
1405
1406
1407
1408
1409
1410
# File 'lib/kamelopard/classes.rb', line 1402

def to_kml(elem)
    super
    Kamelopard.kml_array(elem, [
        [ @color, 'color' ],
        [ @drawOrder, 'drawOrder' ],
    ])
    @icon.to_kml(elem) unless @icon.nil?
    elem
end