Class: KML::MultiGeometry

Inherits:
Geometry show all
Defined in:
lib/kml/multi_geometry.rb

Instance Attribute Summary

Attributes inherited from Container

#features, #plain_children

Attributes inherited from Feature

#address, #address_details, #description, #look_at, #metadata, #name, #phone_number, #region, #snippet, #style_selector, #style_url, #time_primitive

Attributes inherited from Object

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Geometry

#altitude_mode, #altitude_mode=, #altitude_mode_set?, #extrude, #extrude=, #extrude?, #tessellate, #tessellate=, #tessellate?

Methods inherited from Feature

#open, #open=, #open?, #visibility, #visibility=, #visibility?

Methods inherited from Object

#initialize

Constructor Details

This class inherits a constructor from KML::Object

Class Method Details

.parse(node) ⇒ Object



7
8
9
# File 'lib/kml/multi_geometry.rb', line 7

def self.parse(node)
  self.new.parse(node)
end

Instance Method Details

#parse(node) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/kml/multi_geometry.rb', line 11

def parse(node)
  super(node) do |cld|
    case cld.name
    when 'Polygon'
      self.features << KML::Polygon.parse(cld)
    else
      puts "MultiGeometry"
      p cld
      puts
    end
  end
  self
end

#render(xm = Builder::XmlMarkup.new(:indent => 2)) ⇒ Object



3
4
5
# File 'lib/kml/multi_geometry.rb', line 3

def render(xm=Builder::XmlMarkup.new(:indent => 2))
  xm.MultiGeometry { features.each { |f| f.render(xm) } }
end