Class: KML::Style
- Inherits:
-
StyleSelector
- Object
- Object
- StyleSelector
- KML::Style
- 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
-
#balloon_style ⇒ Object
Returns the value of attribute balloon_style.
-
#icon_style ⇒ Object
Returns the value of attribute icon_style.
-
#label_style ⇒ Object
Returns the value of attribute label_style.
-
#line_style ⇒ Object
Returns the value of attribute line_style.
-
#list_style ⇒ Object
Returns the value of attribute list_style.
-
#poly_style ⇒ Object
Returns the value of attribute poly_style.
Attributes inherited from Object
Instance Method Summary collapse
Methods inherited from Object
Constructor Details
This class inherits a constructor from KML::Object
Instance Attribute Details
#balloon_style ⇒ Object
Returns the value of attribute balloon_style.
11 12 13 |
# File 'lib/kml/style.rb', line 11 def balloon_style @balloon_style end |
#icon_style ⇒ Object
Returns the value of attribute icon_style.
7 8 9 |
# File 'lib/kml/style.rb', line 7 def icon_style @icon_style end |
#label_style ⇒ Object
Returns the value of attribute label_style.
8 9 10 |
# File 'lib/kml/style.rb', line 8 def label_style @label_style end |
#line_style ⇒ Object
Returns the value of attribute line_style.
9 10 11 |
# File 'lib/kml/style.rb', line 9 def line_style @line_style end |
#list_style ⇒ Object
Returns the value of attribute list_style.
12 13 14 |
# File 'lib/kml/style.rb', line 12 def list_style @list_style end |
#poly_style ⇒ Object
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 |