Class: Kamelopard::LineString

Inherits:
Geometry show all
Includes:
CoordinateList
Defined in:
lib/kamelopard/classes.rb

Overview

Corresponds to the KML LineString object

Instance Attribute Summary collapse

Attributes included from CoordinateList

#coordinates

Attributes inherited from Object

#comment, #kml_id, #master_only

Instance Method Summary collapse

Methods included from CoordinateList

#<<, #add_element, #coordinates_to_kml

Methods inherited from Object

#_alternate_to_kml, #change, #master_only?, parse

Constructor Details

#initialize(coordinates = [], options = {}) ⇒ LineString

Returns a new instance of LineString.



521
522
523
524
525
# File 'lib/kamelopard/classes.rb', line 521

def initialize(coordinates = [], options = {})
    @coordinates = []
    super options
    self.coordinates=(coordinates) unless coordinates.nil?
end

Instance Attribute Details

#altitudeObject

Returns the value of attribute altitude.



519
520
521
# File 'lib/kamelopard/classes.rb', line 519

def altitude
  @altitude
end

#altitudeModeObject

Returns the value of attribute altitudeMode.



519
520
521
# File 'lib/kamelopard/classes.rb', line 519

def altitudeMode
  @altitudeMode
end

#altitudeOffsetObject

Returns the value of attribute altitudeOffset.



519
520
521
# File 'lib/kamelopard/classes.rb', line 519

def altitudeOffset
  @altitudeOffset
end

#drawOrderObject

Returns the value of attribute drawOrder.



519
520
521
# File 'lib/kamelopard/classes.rb', line 519

def drawOrder
  @drawOrder
end

#extrudeObject

Returns the value of attribute extrude.



519
520
521
# File 'lib/kamelopard/classes.rb', line 519

def extrude
  @extrude
end

#latitudeObject

Returns the value of attribute latitude.



519
520
521
# File 'lib/kamelopard/classes.rb', line 519

def latitude
  @latitude
end

#longitudeObject

Returns the value of attribute longitude.



519
520
521
# File 'lib/kamelopard/classes.rb', line 519

def longitude
  @longitude
end

#tessellateObject

Returns the value of attribute tessellate.



519
520
521
# File 'lib/kamelopard/classes.rb', line 519

def tessellate
  @tessellate
end

Instance Method Details

#to_kml(elem = nil) ⇒ Object



527
528
529
530
531
532
533
534
535
536
537
538
539
540
# File 'lib/kamelopard/classes.rb', line 527

def to_kml(elem = nil)
    k = XML::Node.new 'LineString'
    super(k)
    Kamelopard.kml_array(k, [
        [@altitudeOffset, 'gx:altitudeOffset'],
        [@extrude, 'extrude'],
        [@tessellate, 'tessellate'],
        [@drawOrder, 'gx:drawOrder']
    ])
    coordinates_to_kml(k) unless @coordinates.nil?
    Kamelopard.add_altitudeMode @altitudeMode, k
    elem << k unless elem.nil?
    k
end