Class: KML::IconStyle
- Inherits:
-
ColorStyle
- Object
- Object
- ColorStyle
- KML::IconStyle
- Defined in:
- lib/kml/icon_style.rb
Overview
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.
Instance Attribute Summary collapse
-
#heading ⇒ Object
Compass direction, in degrees.
-
#hot_spot ⇒ Object
Specifies the position within the Icon that is “anchored” to the Point specified in the Placemark.
-
#icon ⇒ Object
A custom Icon.
-
#scale ⇒ Object
Resizes the icon (default=1).
Attributes inherited from ColorStyle
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
#heading ⇒ Object
Compass direction, in degrees. Default=0 (North). ( <a href=“earth.google.com/kml/kml_tags_21.html#heading”>See diagram.) Values range from 0 to ±180 degrees.
26 27 28 |
# File 'lib/kml/icon_style.rb', line 26 def heading @heading end |
#hot_spot ⇒ Object
Specifies the position within the Icon that is “anchored” to the Point specified in the Placemark. See KML::HotSpot
36 37 38 |
# File 'lib/kml/icon_style.rb', line 36 def hot_spot @hot_spot end |
#scale ⇒ Object
Resizes the icon (default=1).
29 30 31 |
# File 'lib/kml/icon_style.rb', line 29 def scale @scale end |
Instance Method Details
#render(xm = Builder::XmlMarkup.new(:indent => 2)) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/kml/icon_style.rb', line 38 def render(xm=Builder::XmlMarkup.new(:indent => 2)) xm.IconStyle { super xm.scale(scale) unless scale.nil? xm.heading(heading) unless heading.nil? icon.render(xm) unless icon.nil? unless hot_spot.nil? xm.hotSpot(:x => hot_spot.x, :y => hot_spot.y, :xunits => hot_spot.xunits, :yunits => hot_spot.yunits) end } end |