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.
2222 2223 2224 2225 2226 2227 |
# File 'lib/kamelopard/classes.rb', line 2222 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.
2221 2222 2223 |
# File 'lib/kamelopard/classes.rb', line 2221 def lowerLeft @lowerLeft end |
#lowerRight ⇒ Object
Returns the value of attribute lowerRight.
2221 2222 2223 |
# File 'lib/kamelopard/classes.rb', line 2221 def lowerRight @lowerRight end |
#upperLeft ⇒ Object
Returns the value of attribute upperLeft.
2221 2222 2223 |
# File 'lib/kamelopard/classes.rb', line 2221 def upperLeft @upperLeft end |
#upperRight ⇒ Object
Returns the value of attribute upperRight.
2221 2222 2223 |
# File 'lib/kamelopard/classes.rb', line 2221 def upperRight @upperRight end |
Instance Method Details
#to_kml(elem = nil) ⇒ Object
2229 2230 2231 2232 2233 2234 2235 2236 |
# File 'lib/kamelopard/classes.rb', line 2229 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 |