Class: KML::ScreenOverlay

Inherits:
Overlay show all
Defined in:
lib/kml/screen_overlay.rb

Instance Attribute Summary collapse

Attributes inherited from Overlay

#color, #draw_order, #icon

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

#id

Instance Method Summary collapse

Methods inherited from Feature

#open, #open=, #open?, #parse, #visibility, #visibility=, #visibility?

Methods inherited from Object

#initialize, #parse

Constructor Details

This class inherits a constructor from KML::Object

Instance Attribute Details

#rotationObject

Returns the value of attribute rotation.



49
50
51
# File 'lib/kml/screen_overlay.rb', line 49

def rotation
  @rotation
end

#sizeObject

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_xyObject

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
  @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 overlay_xy= 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.overlayXY(@overlay_xy) if @overlay_xy
    xm.screenXY(@screen_xy) if @screen_xy
    xm.size{ @size } if @size
    xm.rotation{ @rotation } if @rotation
  }
end

#screen_xyObject

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