Class: Kamelopard::ScreenOverlay

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

Overview

Corresponds to KML’s ScreenOverlay object

Instance Attribute Summary collapse

Attributes inherited from Overlay

#color, #drawOrder, #icon

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, size = nil, rotation = nil, overlayXY = nil, screenXY = nil, rotationXY = nil) ⇒ ScreenOverlay

Returns a new instance of ScreenOverlay.



1416
1417
1418
1419
1420
1421
1422
1423
# File 'lib/kamelopard/classes.rb', line 1416

def initialize(icon, name  = nil, size = nil, rotation = nil, overlayXY = nil, screenXY = nil, rotationXY = nil)
    super(icon, name)
    @overlayXY = overlayXY
    @screenXY = screenXY
    @rotationXY = rotationXY
    @size = size
    @rotation = rotation
end

Instance Attribute Details

#overlayXYObject

Returns the value of attribute overlayXY.



1415
1416
1417
# File 'lib/kamelopard/classes.rb', line 1415

def overlayXY
  @overlayXY
end

#rotationObject

Returns the value of attribute rotation.



1415
1416
1417
# File 'lib/kamelopard/classes.rb', line 1415

def rotation
  @rotation
end

#rotationXYObject

Returns the value of attribute rotationXY.



1415
1416
1417
# File 'lib/kamelopard/classes.rb', line 1415

def rotationXY
  @rotationXY
end

#screenXYObject

Returns the value of attribute screenXY.



1415
1416
1417
# File 'lib/kamelopard/classes.rb', line 1415

def screenXY
  @screenXY
end

#sizeObject

Returns the value of attribute size.



1415
1416
1417
# File 'lib/kamelopard/classes.rb', line 1415

def size
  @size
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
# File 'lib/kamelopard/classes.rb', line 1425

def to_kml(elem = nil)
    k = REXML::Element.new 'ScreenOverlay'
    super k
    @overlayXY.to_kml('overlayXY', k)   unless @overlayXY.nil?
    @screenXY.to_kml('screenXY', k)     unless @screenXY.nil?
    @rotationXY.to_kml('rotationXY', k) unless @rotationXY.nil?
    @size.to_kml('size', k)             unless @size.nil?
    if ! @rotation.nil? then
        d = REXML::Element.new 'rotation'
        d.text = @rotation
        k << d
    end
    elem << k unless elem.nil?
    k
end