Class: Warpaint::Renderer
- Inherits:
-
Object
- Object
- Warpaint::Renderer
- Defined in:
- lib/warpaint/renderer.rb
Instance Method Summary collapse
-
#initialize(networks, track_points) ⇒ Renderer
constructor
A new instance of Renderer.
- #render_to(f) ⇒ Object
Constructor Details
#initialize(networks, track_points) ⇒ Renderer
Returns a new instance of Renderer.
5 6 7 8 |
# File 'lib/warpaint/renderer.rb', line 5 def initialize(networks, track_points) @networks = networks @track_points = track_points end |
Instance Method Details
#render_to(f) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/warpaint/renderer.rb', line 10 def render_to(f) = Kamel::Overlay.new .name = "Wireless Networks" @networks.each do |time, access_point| time_point_pair = @track_points.closest_to(time) trackpoint = time_point_pair[1] .placemark!( :name => access_point[:essid], :description => "This is an access point", :location => { :lng => trackpoint[:lon], :lat => trackpoint[:lat] }, :icon => "http://a.yfrog.com/img861/7242/hjvc.png" ) end f.write(.to_kml) end |