Class: KML::ScreenOverlay
- Defined in:
- lib/kml/screen_overlay.rb
Instance Attribute Summary collapse
-
#rotation ⇒ Object
Returns the value of attribute rotation.
-
#size ⇒ Object
Returns the value of attribute size.
Attributes inherited from Overlay
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
Instance Method Summary collapse
-
#overlay_xy ⇒ Object
A hash of options in the form of :y, :xunits, :yunits that specify the point on the overlay image that is mapped to the screen.
-
#overlay_xy=(coords) ⇒ Object
Set the overlay_xy coordinates.
- #render(xm = Builder::XmlMarkup.new(:indent => 2)) ⇒ Object
-
#screen_xy ⇒ Object
A hash of options in the form of :y, :xunits, :yunits that specify the position on the screen where the image is mapped.
-
#screen_xy=(coords) ⇒ Object
Set the screen_xy coordinates.
Methods inherited from Feature
#open, #open=, #open?, #parse, #visibility, #visibility=, #visibility?
Methods inherited from Object
Constructor Details
This class inherits a constructor from KML::Object
Instance Attribute Details
#rotation ⇒ Object
Returns the value of attribute rotation.
49 50 51 |
# File 'lib/kml/screen_overlay.rb', line 49 def rotation @rotation end |
#size ⇒ Object
Returns the value of attribute size.
49 50 51 |
# File 'lib/kml/screen_overlay.rb', line 49 def size @size end |
Instance Method Details
#overlay_xy ⇒ Object
A hash of options in the form of :y, :xunits, :yunits that specify the point on the overlay image that is mapped to the screen
25 26 27 |
# File 'lib/kml/screen_overlay.rb', line 25 def @overlay_xy end |
#overlay_xy=(coords) ⇒ Object
Set the overlay_xy coordinates
xunits and yunits are :pixels or :fraction
32 33 34 |
# File 'lib/kml/screen_overlay.rb', line 32 def coords @overlay_xy = {:xunits => :fraction, :yunits => :fraction}.merge(coords) end |
#render(xm = Builder::XmlMarkup.new(:indent => 2)) ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'lib/kml/screen_overlay.rb', line 51 def render(xm=Builder::XmlMarkup.new(:indent => 2)) xm.ScreenOverlay { super xm.(@overlay_xy) if @overlay_xy xm.screenXY(@screen_xy) if @screen_xy xm.size{ @size } if @size xm.rotation{ @rotation } if @rotation } end |
#screen_xy ⇒ Object
A hash of options in the form of :y, :xunits, :yunits that specify the position on the screen where the image is mapped
38 39 40 |
# File 'lib/kml/screen_overlay.rb', line 38 def screen_xy @screen_xy end |
#screen_xy=(coords) ⇒ Object
Set the screen_xy coordinates
xunits and yunits are :pixels or :fraction
45 46 47 |
# File 'lib/kml/screen_overlay.rb', line 45 def screen_xy= coords @screen_xy = {:xunits => :fraction, :yunits => :fraction}.merge(coords) end |