Class: 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 KMLObject

#comment, #id

Instance Method Summary collapse

Methods inherited from Feature

#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.



1316
1317
1318
1319
1320
1321
1322
1323
# File 'lib/kamelopard/classes.rb', line 1316

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.



1315
1316
1317
# File 'lib/kamelopard/classes.rb', line 1315

def overlayXY
  @overlayXY
end

#rotationObject

Returns the value of attribute rotation.



1315
1316
1317
# File 'lib/kamelopard/classes.rb', line 1315

def rotation
  @rotation
end

#rotationXYObject

Returns the value of attribute rotationXY.



1315
1316
1317
# File 'lib/kamelopard/classes.rb', line 1315

def rotationXY
  @rotationXY
end

#screenXYObject

Returns the value of attribute screenXY.



1315
1316
1317
# File 'lib/kamelopard/classes.rb', line 1315

def screenXY
  @screenXY
end

#sizeObject

Returns the value of attribute size.



1315
1316
1317
# File 'lib/kamelopard/classes.rb', line 1315

def size
  @size
end

Instance Method Details

#to_kml(indent = 0) ⇒ Object



1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
# File 'lib/kamelopard/classes.rb', line 1325

def to_kml(indent = 0)
    k = "#{ ' ' * indent }<ScreenOverlay id=\"#{ @id }\">\n"
    k << super(indent + 4)
    k << @overlayXY.to_kml('overlayXY', indent + 4)   unless @overlayXY.nil?
    k << @screenXY.to_kml('screenXY', indent + 4)     unless @screenXY.nil?
    k << @rotationXY.to_kml('rotationXY', indent + 4) unless @rotationXY.nil?
    k << @size.to_kml('size', indent + 4)             unless @size.nil?
    k << "#{ ' ' * indent }    <rotation>#{ @rotation }</rotation>\n" unless @rotation.nil?
    k << "#{ ' ' * indent }</ScreenOverlay>\n"
end