Class: LatLonQuad

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

Overview

Corresponds to KML’s gx:LatLonQuad object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lowerLeft, lowerRight, upperRight, upperLeft) ⇒ LatLonQuad

Returns a new instance of LatLonQuad.



1475
1476
1477
1478
1479
1480
# File 'lib/kamelopard/classes.rb', line 1475

def initialize(lowerLeft, lowerRight, upperRight, upperLeft)
    @lowerLeft = lowerLeft
    @lowerRight = lowerRight
    @upperRight = upperRight
    @upperLeft = upperLeft
end

Instance Attribute Details

#lowerLeftObject

Returns the value of attribute lowerLeft.



1474
1475
1476
# File 'lib/kamelopard/classes.rb', line 1474

def lowerLeft
  @lowerLeft
end

#lowerRightObject

Returns the value of attribute lowerRight.



1474
1475
1476
# File 'lib/kamelopard/classes.rb', line 1474

def lowerRight
  @lowerRight
end

#upperLeftObject

Returns the value of attribute upperLeft.



1474
1475
1476
# File 'lib/kamelopard/classes.rb', line 1474

def upperLeft
  @upperLeft
end

#upperRightObject

Returns the value of attribute upperRight.



1474
1475
1476
# File 'lib/kamelopard/classes.rb', line 1474

def upperRight
  @upperRight
end

Instance Method Details

#to_kml(indent = 0) ⇒ Object



1482
1483
1484
1485
1486
1487
1488
1489
# File 'lib/kamelopard/classes.rb', line 1482

def to_kml(indent = 0)

    <<-latlonquad
#{ ' ' * indent }<gx:LatLonQuad>
#{ ' ' * indent }    <coordinates>#{ @lowerLeft.longitude },#{ @lowerLeft.latitude } #{ @lowerRight.longitude },#{ @lowerRight.latitude } #{ @upperRight.longitude },#{ @upperRight.latitude } #{ @upperLeft.longitude },#{ @upperLeft.latitude }</coordinates>
#{ ' ' * indent }</gx:LatLonQuad>
    latlonquad
end