Show on the map the displacement of the detected APs
[wifihood] / wifiscanner / wifimap / view.py
index 5ae2c1e..a7f688c 100755 (executable)
@@ -231,6 +231,18 @@ class simpleMapWidget ( AbstractmapWidget , gtk.Image ) :
         dest_x , dest_y = self.gps2pix( coords , ( center_x , center_y ) )
         pixmap.draw_rectangle(gc, True , dest_x , dest_y , radius , radius )
 
+    def line( self , pixmap , start , coords , colorname ) :
+
+        center_x , center_y = self.center()
+
+        gc = pixmap.new_gc()
+        gc.foreground = pixmap.get_colormap().alloc_color( colorname )
+
+        src_x , src_y = self.gps2pix( start , ( center_x , center_y ) )
+        dest_x , dest_y = self.gps2pix( coords , ( center_x , center_y ) )
+        dist = math.sqrt( (dest_x-src_x)**2 + (dest_y-src_y)**2 )
+        pixmap.draw_line(gc , src_x , src_y , dest_x , dest_y )
+
     def plot_APs( self ) :
 
         pixmap,mask = self.get_pixbuf().render_pixmap_and_mask()