Class: Kamelopard::LatLonQuad
- Inherits:
-
Object
- Object
- Kamelopard::LatLonQuad
- Defined in:
- lib/kamelopard/classes.rb
Overview
Corresponds to KML’s gx:LatLonQuad object
Instance Attribute Summary collapse
-
#lowerLeft ⇒ Object
Returns the value of attribute lowerLeft.
-
#lowerRight ⇒ Object
Returns the value of attribute lowerRight.
-
#upperLeft ⇒ Object
Returns the value of attribute upperLeft.
-
#upperRight ⇒ Object
Returns the value of attribute upperRight.
Instance Method Summary collapse
-
#initialize(lowerLeft, lowerRight, upperRight, upperLeft) ⇒ LatLonQuad
constructor
A new instance of LatLonQuad.
- #to_kml(elem = nil) ⇒ Object
Constructor Details
#initialize(lowerLeft, lowerRight, upperRight, upperLeft) ⇒ LatLonQuad
Returns a new instance of LatLonQuad.
2040 2041 2042 2043 2044 2045 |
# File 'lib/kamelopard/classes.rb', line 2040 def initialize(lowerLeft, lowerRight, upperRight, upperLeft) @lowerLeft = lowerLeft @lowerRight = lowerRight @upperRight = upperRight @upperLeft = upperLeft end |
Instance Attribute Details
#lowerLeft ⇒ Object
Returns the value of attribute lowerLeft.
2039 2040 2041 |
# File 'lib/kamelopard/classes.rb', line 2039 def lowerLeft @lowerLeft end |
#lowerRight ⇒ Object
Returns the value of attribute lowerRight.
2039 2040 2041 |
# File 'lib/kamelopard/classes.rb', line 2039 def lowerRight @lowerRight end |
#upperLeft ⇒ Object
Returns the value of attribute upperLeft.
2039 2040 2041 |
# File 'lib/kamelopard/classes.rb', line 2039 def upperLeft @upperLeft end |
#upperRight ⇒ Object
Returns the value of attribute upperRight.
2039 2040 2041 |
# File 'lib/kamelopard/classes.rb', line 2039 def upperRight @upperRight end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
2047 2048 2049 2050 2051 2052 2053 2054 |
# File 'lib/kamelopard/classes.rb', line 2047 def to_kml(elem = nil) k = XML::Node.new 'gx:LatLonQuad' d = XML::Node.new 'coordinates' d << "#{ @lowerLeft.longitude },#{ @lowerLeft.latitude } #{ @lowerRight.longitude },#{ @lowerRight.latitude } #{ @upperRight.longitude },#{ @upperRight.latitude } #{ @upperLeft.longitude },#{ @upperLeft.latitude }" k << d elem << k unless elem.nil? k end |