Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions lib/kml/label_style.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Source file contains the code for creating the LabelStyle element:
#
# <Style id="ID">
# <!-- specific to LabelStyle -->
# <scale>1</scale> <!-- float -->
# </LabelStyle>

module KML #:nodoc:
# Specifies how icons for point Placemarks are drawn, both in the Places panel and in the 3D viewer of
# Google Earth. The Icon object specifies the icon image. The +scale+ specifies the x, y scaling of the
# icon.
class LabelStyle < KML::Object

# Resizes the label (default=1).
attr_accessor :scale


def render(xm=Builder::XmlMarkup.new(:indent => 2))
xm.LabelStyle {
xm.scale(scale) unless scale.nil?
}
end
end
end

1 change: 1 addition & 0 deletions lib/kml/object.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def initialize(attributes=nil)
require 'kml/feature'
require 'kml/geometry'
require 'kml/color_style'
require 'kml/label_style'
require 'kml/style_selector'
require 'kml/link'
require 'kml/icon'
Expand Down
4 changes: 2 additions & 2 deletions ruby_kml.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.version = "0.1.7"
s.date = "2012-05-07"
s.version = "0.1.8"
s.date = "2015-09-01"
s.name = "ruby_kml"
s.summary = "Generate KML files with ruby"
s.email = ""
Expand Down