Class: PhotoOverlay

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

Overview

Corresponds to KML’s PhotoOverlay class

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, point, rotation = 0, viewvolume = nil, imagepyramid = nil, shape = :rectangle) ⇒ PhotoOverlay

Returns a new instance of PhotoOverlay.



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

def initialize(icon, point, rotation = 0, viewvolume = nil, imagepyramid = nil, shape = :rectangle)
    super(icon)
    if point.respond_to?('point')
        @point = point.point
    else
        @point = point
    end
    @rotation = rotation
    @viewVolume = viewvolume
    @imagePyramid = imagepyramid
    @shape = shape
end

Instance Attribute Details

#imagepyramidObject

Returns the value of attribute imagepyramid.



1388
1389
1390
# File 'lib/kamelopard/classes.rb', line 1388

def imagepyramid
  @imagepyramid
end

#pointObject

Returns the value of attribute point.



1388
1389
1390
# File 'lib/kamelopard/classes.rb', line 1388

def point
  @point
end

#rotationObject

Returns the value of attribute rotation.



1388
1389
1390
# File 'lib/kamelopard/classes.rb', line 1388

def rotation
  @rotation
end

#shapeObject

Returns the value of attribute shape.



1388
1389
1390
# File 'lib/kamelopard/classes.rb', line 1388

def shape
  @shape
end

#viewvolumeObject

Returns the value of attribute viewvolume.



1388
1389
1390
# File 'lib/kamelopard/classes.rb', line 1388

def viewvolume
  @viewvolume
end

Instance Method Details

#to_kml(indent = 0) ⇒ Object



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

def to_kml(indent = 0)
    k = "#{ ' ' * indent }<PhotoOverlay>\n"
    k << super(indent + 4)
    k << @viewVolume.to_kml(indent + 4) unless @viewVolume.nil?
    k << @imagePyramid.to_kml(indent + 4) unless @imagePyramid.nil?
    k << @point.to_kml(indent + 4, true)
    k << "#{ ' ' * indent }    <rotation>#{ @rotation }</rotation>\n"
    k << "#{ ' ' * indent }    <shape>#{ @shape }</shape>\n"
    k << "#{ ' ' * indent }</PhotoOverlay>\n"
end