Class: KML::Style

Inherits:
StyleSelector show all
Defined in:
lib/kml/style.rb

Overview

A Style defines an addressable style group that can be referenced by StyleMaps and Features. Styles affect how Geometry is presented in the 3D viewer and how Features appear in the Places panel of the List view. Shared styles are collected in a Document and must have an id defined for them so that they can be referenced by the individual Features that use them.

Instance Attribute Summary collapse

Attributes inherited from Object

#id

Instance Method Summary collapse

Methods inherited from Object

#initialize, #parse

Constructor Details

This class inherits a constructor from KML::Object

Instance Attribute Details

#balloon_styleObject

Returns the value of attribute balloon_style.



11
12
13
# File 'lib/kml/style.rb', line 11

def balloon_style
  @balloon_style
end

#icon_styleObject

Returns the value of attribute icon_style.



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

def icon_style
  @icon_style
end

#label_styleObject

Returns the value of attribute label_style.



8
9
10
# File 'lib/kml/style.rb', line 8

def label_style
  @label_style
end

#line_styleObject

Returns the value of attribute line_style.



9
10
11
# File 'lib/kml/style.rb', line 9

def line_style
  @line_style
end

#list_styleObject

Returns the value of attribute list_style.



12
13
14
# File 'lib/kml/style.rb', line 12

def list_style
  @list_style
end

#poly_styleObject

Returns the value of attribute poly_style.



10
11
12
# File 'lib/kml/style.rb', line 10

def poly_style
  @poly_style
end

Instance Method Details

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



14
15
16
17
18
19
20
21
# File 'lib/kml/style.rb', line 14

def render(xm=Builder::XmlMarkup.new(:indent => 2))
  xm.Style(:id => id) {
    %w(Icon Label Line Poly Balloon List).each do |name| 
      field = "#{name.downcase}_style".to_sym
      self.__send__(field).render(xm) unless self.__send__(field).nil?
    end
  }
end